@nowline/embed 0.0.0-dev.20261004035821.gd8a6927 → 0.0.0-dev.20261004042017.g9406f7f

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.20261004035821.gd8a6927 sha=d8a6927 built=2026-10-03T23:57:57-04:00 */
1
+ /*! @nowline/embed 0.0.0-dev.20261004042017.g9406f7f sha=9406f7f built=2026-10-04T00:19:51-04:00 */
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -40179,8 +40179,8 @@ function effectiveTheme(theme, systemTheme) {
40179
40179
  }
40180
40180
 
40181
40181
  // src/index.ts
40182
- var version = true ? "0.0.0-dev.20261004035821.gd8a6927" : "0.0.0";
40183
- var sha = true ? "d8a6927" : "unknown";
40182
+ var version = true ? "0.0.0-dev.20261004042017.g9406f7f" : "0.0.0";
40183
+ var sha = true ? "9406f7f" : "unknown";
40184
40184
  var DEFAULT_SELECTOR = "pre code.language-nowline, code.language-nowline";
40185
40185
  var initialConfig = {
40186
40186
  theme: "auto",
@@ -1,4 +1,4 @@
1
- /*! @nowline/embed 0.0.0-dev.20261004035821.gd8a6927 sha=d8a6927 built=2026-10-03T23:57:57-04:00 */
1
+ /*! @nowline/embed 0.0.0-dev.20261004042017.g9406f7f sha=9406f7f built=2026-10-04T00:19:51-04:00 */
2
2
  "use strict";var nowline=(()=>{var WC=Object.create;var cc=Object.defineProperty;var qC=Object.getOwnPropertyDescriptor;var VC=Object.getOwnPropertyNames;var YC=Object.getPrototypeOf,KC=Object.prototype.hasOwnProperty;var ZC=(t,e,r)=>e in t?cc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var FE=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var me=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},bu=(t,e)=>{for(var r in e)cc(t,r,{get:e[r],enumerable:!0})},UE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of VC(e))!KC.call(t,i)&&i!==r&&cc(t,i,{get:()=>e[i],enumerable:!(n=qC(e,i))||n.enumerable});return t};var Jh=(t,e,r)=>(r=t!=null?WC(YC(t)):{},UE(e||!t||!t.__esModule?cc(r,"default",{value:t,enumerable:!0}):r,t)),wu=t=>UE(cc({},"__esModule",{value:!0}),t);var S=(t,e,r)=>ZC(t,typeof e!="symbol"?e+"":e,r);var Ks=me(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.boolean=h2;On.string=RR;On.number=m2;On.error=g2;On.func=y2;On.array=AR;On.stringArray=x2;function h2(t){return t===!0||t===!1}function RR(t){return typeof t=="string"||t instanceof String}function m2(t){return typeof t=="number"||t instanceof Number}function g2(t){return t instanceof Error}function y2(t){return typeof t=="function"}function AR(t){return Array.isArray(t)}function x2(t){return AR(t)&&t.every(e=>RR(e))}});var vy=me(te=>{"use strict";var T2=te&&te.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_2=te&&te.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E2=te&&te.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&T2(r,e,n[i]);return _2(r,e),r}})();Object.defineProperty(te,"__esModule",{value:!0});te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;var Ao=E2(Ks()),Jg;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Jg||(te.ErrorCodes=Jg={}));var Qg=class t extends Error{constructor(r,n,i){super(n);S(this,"code");S(this,"data");this.code=Ao.number(r)?r:Jg.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,t.prototype)}toJson(){let r={code:this.code,message:this.message};return this.data!==void 0&&(r.data=this.data),r}};te.ResponseError=Qg;var Lr=class Lr{constructor(e){S(this,"kind");this.kind=e}static is(e){return e===Lr.auto||e===Lr.byName||e===Lr.byPosition}toString(){return this.kind}};S(Lr,"auto",new Lr("auto")),S(Lr,"byPosition",new Lr("byPosition")),S(Lr,"byName",new Lr("byName"));var wi=Lr;te.ParameterStructures=wi;var Qe=class{constructor(e,r){S(this,"method");S(this,"numberOfParams");this.method=e,this.numberOfParams=r}get parameterStructures(){return wi.auto}};te.AbstractMessageSignature=Qe;var ey=class extends Qe{constructor(r){super(r,0);S(this,"_")}};te.RequestType0=ey;var ty=class extends Qe{constructor(r,n=wi.auto){super(r,1);S(this,"_parameterStructures");S(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.RequestType=ty;var ry=class extends Qe{constructor(r,n=wi.auto){super(r,1);S(this,"_parameterStructures");S(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.RequestType1=ry;var ny=class extends Qe{constructor(r){super(r,2);S(this,"_")}};te.RequestType2=ny;var iy=class extends Qe{constructor(r){super(r,3);S(this,"_")}};te.RequestType3=iy;var oy=class extends Qe{constructor(r){super(r,4);S(this,"_")}};te.RequestType4=oy;var sy=class extends Qe{constructor(r){super(r,5);S(this,"_")}};te.RequestType5=sy;var ay=class extends Qe{constructor(r){super(r,6);S(this,"_")}};te.RequestType6=ay;var cy=class extends Qe{constructor(r){super(r,7);S(this,"_")}};te.RequestType7=cy;var ly=class extends Qe{constructor(r){super(r,8);S(this,"_")}};te.RequestType8=ly;var uy=class extends Qe{constructor(r){super(r,9);S(this,"_")}};te.RequestType9=uy;var fy=class extends Qe{constructor(r,n=wi.auto){super(r,1);S(this,"_parameterStructures");S(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.NotificationType=fy;var dy=class extends Qe{constructor(r){super(r,0);S(this,"_")}};te.NotificationType0=dy;var py=class extends Qe{constructor(r,n=wi.auto){super(r,1);S(this,"_parameterStructures");S(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=py;var hy=class extends Qe{constructor(r){super(r,2);S(this,"_")}};te.NotificationType2=hy;var my=class extends Qe{constructor(r){super(r,3);S(this,"_")}};te.NotificationType3=my;var gy=class extends Qe{constructor(r){super(r,4);S(this,"_")}};te.NotificationType4=gy;var yy=class extends Qe{constructor(r){super(r,5);S(this,"_")}};te.NotificationType5=yy;var xy=class extends Qe{constructor(r){super(r,6);S(this,"_")}};te.NotificationType6=xy;var Ty=class extends Qe{constructor(r){super(r,7);S(this,"_")}};te.NotificationType7=Ty;var _y=class extends Qe{constructor(r){super(r,8);S(this,"_")}};te.NotificationType8=_y;var Ey=class extends Qe{constructor(r){super(r,9);S(this,"_")}};te.NotificationType9=Ey;var SR;(function(t){function e(i){let o=i;return o&&Ao.string(o.method)&&(Ao.string(o.id)||Ao.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Ao.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Ao.string(o.id)||Ao.number(o.id)||o.id===null)}t.isResponse=n})(SR||(te.Message=SR={}))});var wy=me(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.LRUCache=Ri.LinkedMap=Ri.Touch=void 0;var Ct;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ct||(Ri.Touch=Ct={}));var IR,Id=class{constructor(){S(this,IR,"LinkedMap");S(this,"_map");S(this,"_head");S(this,"_tail");S(this,"_size");S(this,"_state");this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before(e){let r=this._map.get(e);return r?r.previous?.value:void 0}after(e){let r=this._map.get(e);return r?r.next?.value:void 0}has(e){return this._map.has(e)}get(e,r=Ct.None){let n=this._map.get(e);if(n)return r!==Ct.None&&this.touch(n,r),n.value}set(e,r,n=Ct.None){let i=this._map.get(e);if(i)i.value=r,n!==Ct.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Ct.None:this.addItemLast(i);break;case Ct.First:this.addItemFirst(i);break;case Ct.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(IR=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Ct.First&&r!==Ct.Last)){if(r===Ct.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Ct.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Ri.LinkedMap=Id;var by=class extends Id{constructor(r,n=1){super();S(this,"_limit");S(this,"_ratio");this._limit=r,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(r){this._limit=r,this.checkTrim()}get ratio(){return this._ratio}set ratio(r){this._ratio=Math.min(Math.max(0,r),1),this.checkTrim()}get(r,n=Ct.AsNew){return super.get(r,n)}peek(r){return super.get(r,Ct.None)}set(r,n){return super.set(r,n,Ct.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ri.LRUCache=by});var NR=me(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.Disposable=void 0;var kR;(function(t){function e(r){return{dispose:r}}t.create=e})(kR||(kd.Disposable=kR={}))});var Ai=me(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});var Ry;function Ay(){if(Ry===void 0)throw new Error("No runtime abstraction layer installed");return Ry}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Ry=r}t.install=e})(Ay||(Ay={}));Sy.default=Ay});var Zs=me(Si=>{"use strict";var v2=Si&&Si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Si,"__esModule",{value:!0});Si.Emitter=Si.Event=void 0;var b2=v2(Ai()),PR;(function(t){let e={dispose(){}};t.None=function(){return e}})(PR||(Si.Event=PR={}));var Iy=class{constructor(){S(this,"_callbacks");S(this,"_contexts")}add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,b2.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Nd=class Nd{constructor(e){S(this,"_options");S(this,"_event");S(this,"_callbacks");this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Iy),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=Nd._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};S(Nd,"_noop",function(){});var ky=Nd;Si.Emitter=ky});var Od=me(Vt=>{"use strict";var w2=Vt&&Vt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R2=Vt&&Vt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A2=Vt&&Vt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&w2(r,e,n[i]);return R2(r,e),r}})(),S2=Vt&&Vt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.CancellationTokenSource=Vt.CancellationToken=void 0;var I2=S2(Ai()),k2=A2(Ks()),Ny=Zs(),Pd;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ny.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ny.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||k2.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Pd||(Vt.CancellationToken=Pd={}));var N2=Object.freeze(function(t,e){let r=(0,I2.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Cd=class{constructor(){S(this,"_isCancelled",!1);S(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?N2:(this._emitter||(this._emitter=new Ny.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Py=class{constructor(){S(this,"_token")}get token(){return this._token||(this._token=new Cd),this._token}cancel(){this._token?this._token.cancel():this._token=Pd.Cancelled}dispose(){this._token?this._token instanceof Cd&&this._token.dispose():this._token=Pd.None}};Vt.CancellationTokenSource=Py});var CR=me(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.SharedArrayReceiverStrategy=Js.SharedArraySenderStrategy=void 0;var P2=Od(),_l;(function(t){t.Continue=0,t.Cancelled=1})(_l||(_l={}));var Cy=class{constructor(){S(this,"buffers");this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=_l.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,_l.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Js.SharedArraySenderStrategy=Cy;var Oy=class{constructor(e){S(this,"data");this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===_l.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Ly=class{constructor(e){S(this,"token");this.token=new Oy(e)}cancel(){}dispose(){}},Dy=class{constructor(){S(this,"kind","request")}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new P2.CancellationTokenSource:new Ly(r)}};Js.SharedArrayReceiverStrategy=Dy});var $y=me(Qs=>{"use strict";var C2=Qs&&Qs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.Semaphore=void 0;var O2=C2(Ai()),My=class{constructor(e=1){S(this,"_capacity");S(this,"_active");S(this,"_waiting");if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,O2.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("Too many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Qs.Semaphore=My});var LR=me(Ot=>{"use strict";var L2=Ot&&Ot.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D2=Ot&&Ot.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M2=Ot&&Ot.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&L2(r,e,n[i]);return D2(r,e),r}})(),$2=Ot&&Ot.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.ReadableStreamMessageReader=Ot.AbstractMessageReader=Ot.MessageReader=void 0;var Uy=$2(Ai()),ea=M2(Ks()),Fy=Zs(),F2=$y(),OR;(function(t){function e(r){let n=r;return n&&ea.func(n.listen)&&ea.func(n.dispose)&&ea.func(n.onError)&&ea.func(n.onClose)&&ea.func(n.onPartialMessage)}t.is=e})(OR||(Ot.MessageReader=OR={}));var Ld=class{constructor(){S(this,"errorEmitter");S(this,"closeEmitter");S(this,"partialMessageEmitter");this.errorEmitter=new Fy.Emitter,this.closeEmitter=new Fy.Emitter,this.partialMessageEmitter=new Fy.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${ea.string(e.message)?e.message:"unknown"}`)}};Ot.AbstractMessageReader=Ld;var By;(function(t){function e(r){let n,i,o,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,s.set(o.name,o)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)s.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Uy.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(By||(By={}));var Xy=class extends Ld{constructor(r,n){super();S(this,"readable");S(this,"options");S(this,"callback");S(this,"nextMessageLength");S(this,"messageToken");S(this,"buffer");S(this,"partialMessageTimer");S(this,"_partialMessageTimeout");S(this,"readSemaphore");this.readable=r,this.options=By.fromOptions(n),this.buffer=(0,Uy.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new F2.Semaphore(1)}set partialMessageTimeout(r){this._partialMessageTimeout=r}get partialMessageTimeout(){return this._partialMessageTimeout}listen(r){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=r;let n=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),n}onData(r){try{for(this.buffer.append(r);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders(!0);if(!i)return;let o=i.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property.
3
3
  ${JSON.stringify(Object.fromEntries(i))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,o=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(o)}).catch(i=>{this.fireError(i)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Uy.default)().timer.setTimeout((r,n)=>{this.partialMessageTimer=void 0,r===this.messageToken&&(this.firePartialMessage({messageToken:r,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ot.ReadableStreamMessageReader=Xy});var UR=me(Lt=>{"use strict";var U2=Lt&&Lt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B2=Lt&&Lt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X2=Lt&&Lt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&U2(r,e,n[i]);return B2(r,e),r}})(),G2=Lt&&Lt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.WriteableStreamMessageWriter=Lt.AbstractMessageWriter=Lt.MessageWriter=void 0;var DR=G2(Ai()),El=X2(Ks()),H2=$y(),MR=Zs(),j2="Content-Length: ",$R=`\r
4
4
  `,FR;(function(t){function e(r){let n=r;return n&&El.func(n.dispose)&&El.func(n.onClose)&&El.func(n.onError)&&El.func(n.write)}t.is=e})(FR||(Lt.MessageWriter=FR={}));var Dd=class{constructor(){S(this,"errorEmitter");S(this,"closeEmitter");this.errorEmitter=new MR.Emitter,this.closeEmitter=new MR.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${El.string(e.message)?e.message:"unknown"}`)}};Lt.AbstractMessageWriter=Dd;var Gy;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,DR.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,DR.default)().applicationJson.encoder}}t.fromOptions=e})(Gy||(Gy={}));var Hy=class extends Dd{constructor(r,n){super();S(this,"writable");S(this,"options");S(this,"errorCount");S(this,"writeSemaphore");this.writable=r,this.options=Gy.fromOptions(n),this.errorCount=0,this.writeSemaphore=new H2.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(r){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(r,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let o=[];return o.push(j2,i.byteLength.toString(),$R),o.push($R),this.doWrite(r,o,i)},i=>{throw this.fireError(i),i}))}async doWrite(r,n,i){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(i)}catch(o){return this.handleError(o,r),Promise.reject(o)}}handleError(r,n){this.errorCount++,this.fireError(r,n,this.errorCount)}end(){this.writable.end()}};Lt.WriteableStreamMessageWriter=Hy});var BR=me(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.AbstractMessageBuffer=void 0;var z2=13,W2=10,q2=`\r
@@ -2638,5 +2638,5 @@ ${r}`),this.inline?`{${i}}`:i}};function KU(t,e,r){if(t==="linkplain"||t==="link
2638
2638
  }`));var rB={languageId:"nowline",fileExtensions:[".nowline"],caseInsensitive:!1,mode:"development"},pk={AstReflection:()=>new Yl},hk={Grammar:()=>dk(),LanguageMetaData:()=>rB,parser:{}};var mk={"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":t=>`Line ${t.line}: mixed tabs and spaces in indentation. Use either tabs or spaces consistently.`,"NL.E0100":t=>`Invalid version format "${t.version}". Expected format: v1, v2, etc.`,"NL.E0101":t=>`This file requires Nowline ${t.version}, but the parser only supports up to ${t.supported}.`,"NL.E0102":t=>`Unknown directive property "${t.key}". Allowed: ${t.allowed}.`,"NL.E0103":t=>`Duplicate directive property "${t.key}".`,"NL.E0104":t=>`Invalid locale "${t.value}". Use a BCP-47 tag like "en-US", "fr", or "fr-CA".`,"NL.E0200":t=>`Invalid include mode "${t.value}". Must be merge, ignore, or isolate.`,"NL.E0201":t=>`Duplicate "${t.key}" option on include.`,"NL.E0300":t=>`Duplicate identifier "${t.name}". First declared at ${t.location}.`,"NL.E0301":t=>`${t.type} must have an identifier, a title, or both.`,"NL.E0400":t=>`Invalid duration "${t.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q. Use "size:NAME" to reference a declared size.`,"NL.E0401":t=>`Invalid size "${t.value}". Use the id of a declared size (e.g. xs, m, lg).`,"NL.E0402":t=>`Invalid effort "${t.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q.`,"NL.E0403":t=>`Invalid remaining value "${t.value}". Use a percentage like 30% or a duration literal like 1w, 0.5d.`,"NL.E0404":t=>`Remaining must be between 0% and 100%, got ${t.value}.`,"NL.E0405":t=>`Invalid ${t.key} "${t.value}". Use ISO 8601 format: YYYY-MM-DD.`,"NL.E0406":t=>`Invalid scale "${t.value}". Use a raw duration literal like 1w, 2w, 1q (no name lookup).`,"NL.E0407":t=>`Invalid calendar "${t.value}". Must be business, full, or custom.`,"NL.E0408":t=>`Property "${t.key}" requires at least one reference.`,"NL.E0410":t=>`"${t.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":t=>`Inline date in "${t.key}:" is not allowed on ${t.type}. Allowed only on item, parallel, and group; for a milestone use "date:" instead.`,"NL.E0412":t=>`Inline date "${t.date}" in "${t.key}:" requires the roadmap to declare "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0413":t=>`Inline date "${t.date}" in "${t.key}:" is before roadmap start ${t.start}.`,"NL.E0500":t=>`Anchor "${t.name}" requires a "date:" property.`,"NL.E0501":t=>`Anchor "${t.name}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0502":t=>`Anchor "${t.name}" date ${t.date} is before roadmap start ${t.start}.`,"NL.E0503":t=>`Milestone "${t.name}" requires at least one of "date:" or "after:".`,"NL.E0504":t=>`Milestone "${t.name}" date ${t.date} is before roadmap start ${t.start}.`,"NL.E0505":()=>'Footnote requires an "on:" property referencing one or more entities.',"NL.E0600":t=>`Item "${t.name}" requires a "size:" or "duration:" property.`,"NL.W0700":t=>`Unknown property "${t.key}" on ${t.entity}. The renderer ignores it.${t.suggested?` Did you mean "${t.suggested}"?`:""}`,"NL.W1000":t=>`Now-line date ${t.date} is outside the roadmap window (${t.start} \u2013 ${t.end}); it will not be drawn.`,"NL.I1000":t=>`Title on item "${t.name}" is wider than its bar at this scale; it rendered to the right of the bar.`,"NL.I1001":t=>`Label chips on item "${t.name}" did not fit inside the bar; they rendered in a spill column to the right.`,"NL.I1002":t=>`Item "${t.name}" is too narrow to show its marker at this scale; decorations spilled beside the bar.`,"NL.I1003":t=>t.anchor?`Item "${t.name}" extends past its "before:" anchor "${t.anchor}".`:`Item "${t.name}" extends past its "before:" anchor.`,"NL.I1004":t=>`Swimlane "${t.lane}" packed into ${t.rows} rows to avoid overlap.`,"NL.I1005":t=>`Swimlane "${t.lane}" is over capacity in one or more periods (red utilization band).`};var gk={"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":t=>`Ligne ${t.line}\xA0: tabulations et espaces m\xE9lang\xE9s dans l'indentation. Utilisez l'un ou l'autre, mais pas les deux.`,"NL.E0100":t=>`Format de version invalide \xAB\xA0${t.version}\xA0\xBB. Format attendu\xA0: v1, v2, etc.`,"NL.E0101":t=>`Ce fichier requiert Nowline ${t.version}, mais l'analyseur ne prend en charge que jusqu'\xE0 ${t.supported}.`,"NL.E0102":t=>`Propri\xE9t\xE9 de directive inconnue \xAB\xA0${t.key}\xA0\xBB. Valeurs admises\xA0: ${t.allowed}.`,"NL.E0103":t=>`Propri\xE9t\xE9 de directive \xAB\xA0${t.key}\xA0\xBB en double.`,"NL.E0104":t=>`Locale invalide \xAB\xA0${t.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":t=>`Mode d'include invalide \xAB\xA0${t.value}\xA0\xBB. Doit \xEAtre merge, ignore ou isolate.`,"NL.E0201":t=>`Option \xAB\xA0${t.key}\xA0\xBB en double sur include.`,"NL.E0300":t=>`Identifiant en double \xAB\xA0${t.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${t.location}.`,"NL.E0301":t=>`${t.type} doit comporter un identifiant, un titre, ou les deux.`,"NL.E0400":t=>`Dur\xE9e invalide \xAB\xA0${t.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":t=>`Taille invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez l'identifiant d'une taille d\xE9clar\xE9e (p.\xA0ex. xs, m, lg).`,"NL.E0402":t=>`Effort invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q.`,"NL.E0403":t=>`Valeur restante invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un pourcentage tel que 30% ou un litt\xE9ral de dur\xE9e comme 1w, 0.5d.`,"NL.E0404":t=>`La valeur restante doit \xEAtre comprise entre 0 % et 100 %, re\xE7u ${t.value}.`,"NL.E0405":t=>`${t.key} invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez le format ISO 8601\xA0: AAAA-MM-JJ.`,"NL.E0406":t=>`\xC9chelle invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 1w, 2w, 1q (pas de recherche par nom).`,"NL.E0407":t=>`Calendrier invalide \xAB\xA0${t.value}\xA0\xBB. Doit \xEAtre business, full ou custom.`,"NL.E0408":t=>`La propri\xE9t\xE9 \xAB\xA0${t.key}\xA0\xBB exige au moins une r\xE9f\xE9rence.`,"NL.E0410":t=>`\xAB\xA0${t.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":t=>`Une date inline dans \xAB\xA0${t.key}:\xA0\xBB n'est pas autoris\xE9e sur ${t.type}. Autoris\xE9e seulement sur item, parallel et group\xA0; pour un milestone utilisez \xAB\xA0date:\xA0\xBB \xE0 la place.`,"NL.E0412":t=>`La date inline \xAB\xA0${t.date}\xA0\xBB dans \xAB\xA0${t.key}:\xA0\xBB exige que la roadmap d\xE9clare \xAB\xA0start:\xA0\xBB. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0413":t=>`La date inline \xAB\xA0${t.date}\xA0\xBB dans \xAB\xA0${t.key}:\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.start}).`,"NL.E0500":t=>`L'ancre \xAB\xA0${t.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0date:\xA0\xBB.`,"NL.E0501":t=>`L'ancre \xAB\xA0${t.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":t=>`La date ${t.date} de l'ancre \xAB\xA0${t.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.start}).`,"NL.E0503":t=>`Le jalon \xAB\xA0${t.name}\xA0\xBB exige au moins l'une des propri\xE9t\xE9s \xAB\xA0date:\xA0\xBB ou \xAB\xA0after:\xA0\xBB.`,"NL.E0504":t=>`La date ${t.date} du jalon \xAB\xA0${t.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.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":t=>`L'\xE9l\xE9ment \xAB\xA0${t.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0size:\xA0\xBB ou \xAB\xA0duration:\xA0\xBB.`,"NL.W0700":t=>`Propri\xE9t\xE9 inconnue \xAB\xA0${t.key}\xA0\xBB sur ${t.entity}. Le moteur de rendu l'ignore.${t.suggested?` Vouliez-vous dire \xAB\xA0${t.suggested}\xA0\xBB\xA0?`:""}`};var yk={};var xk={};var nB=new Map([["en-US",mk],["fr",gk],["fr-CA",yk],["fr-FR",xk]]);function ru(t,e,...r){for(let n of iB(t)){let o=nB.get(n)?.[e];if(o)return o(...r)}return e}var Tk="en-US";function iB(t){let e=[],r=oB(t);for(;r.length>0;){e.includes(r)||e.push(r);let n=r.lastIndexOf("-");if(n<=0)break;r=r.slice(0,n)}return e.includes(Tk)||e.push(Tk),e}function oB(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}var sB=/[\\/]/;function vk(t){for(let e=t.length-1;e>=0;e--){let r=t.charCodeAt(e);if(r===47||r===92)return e}return-1}function _k(...t){for(let e of t)if(e){if(e.includes("\\")&&!e.includes("/"))return"\\";if(e.includes("/"))return"/"}return"/"}function aB(t){return t?t[0]==="/"||t[0]==="\\"?!0:t.length>=3&&/^[A-Za-z]:[\\/]/.test(t):!1}function bk(t){let e=vk(t);return e<0?".":e===0?t[0]:e===2&&/^[A-Za-z]:[\\/]/.test(t)?t.slice(0,3):t.slice(0,e)}function rh(t){let e=vk(t);return e<0?t:t.slice(e+1)}function n_(t,e){if(aB(e))return Ek(e,_k(e));let r=_k(t,e);return Ek(`${t}${r}${e}`,r)}function Ek(t,e){let r="",n=t,i=/^([A-Za-z]:)([\\/])?/.exec(n);i?(r=i[1]+(i[2]?e:""),n=n.slice(i[0].length)):(n[0]==="/"||n[0]==="\\")&&(r=e,n=n.replace(/^[\\/]+/,""));let o=[];for(let s of n.split(sB))if(!(s===""||s===".")){if(s===".."){o.length>0&&o[o.length-1]!==".."?o.pop():r||o.push("..");continue}o.push(s)}return r+o.join(e)}var lB=/^\d{4}-\d{2}-\d{2}$/;function Ak(t){let e=t?.properties.find(r=>r.key==="start");if(e?.value&&lB.test(e.value)&&!Number.isNaN(new Date(e.value).getTime()))return e.value}function uB(t,e,r){return e&&r?`Included "${t}" declares start:${r}, which doesn't match this file's start:${e}. Both files must declare the same start date, or neither should.`:e?`Included "${t}" has no start:, but this file declares start:${e}. Both files must declare the same start date, or neither should.`:`Included "${t}" declares start:${r}, but this file has no start:. Both files must declare the same start date, or neither should.`}function Sk(){return{styles:new Map,defaults:new Map,symbols:new Map}}function Ik(){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 o_(t,e,r){let n=r.readFile??(async c=>{let{nodeReadFile:l}=await Promise.resolve().then(()=>(Rk(),wk));return l(c)}),i={services:r.services,diagnostics:[],resolving:[],processed:new Map,readFile:n},o=n_("",e),{config:s,content:a}=await Nk(t,o,i);return{config:s,content:a,diagnostics:i.diagnostics,processedFiles:new Set(i.processed.keys())}}async function Nk(t,e,r){if(r.processed.has(e))return r.processed.get(e);if(r.resolving.includes(e)){r.diagnostics.push({severity:"error",message:`Circular include detected: ${[...r.resolving,e].join(" \u2192 ")}`,sourcePath:e});let a={config:Sk(),content:Ik()};return r.processed.set(e,a),a}r.resolving.push(e);let n=Sk(),i=Ik();hB(n,t),yB(i,t);let o=new Set;for(let a of t.includes){let c=a.path,l=n_(bk(e),c);if(o.has(l)){r.diagnostics.push({severity:"error",message:`Duplicate include "${c}" in ${rh(e)}.`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}o.add(l);let u=kk(a,"config")??"merge",f=kk(a,"roadmap")??"merge",d;try{let y=await r.readFile(l);d=await fB(r.services,y,l)}catch(y){r.diagnostics.push({severity:"error",message:`Could not read include "${c}": ${y.message}`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}let{config:p,content:m}=await Nk(d,l,r);if(dB(n,p,u,l,r.diagnostics),pB(i,m,p,f,l,c,r.diagnostics),f==="isolate"&&!m.roadmap&&r.diagnostics.push({severity:"error",message:`Cannot isolate "${c}": it has no roadmap declaration.`,sourcePath:e,line:a.$cstNode?.range.start.line}),f!=="ignore"&&d.roadmapDecl){let y=Ak(t.roadmapDecl),v=Ak(d.roadmapDecl);y!==v&&r.diagnostics.push({severity:"error",message:uB(c,y,v),sourcePath:e,line:a.$cstNode?.range.start.line})}}r.resolving.pop();let s={config:n,content:i};return r.processed.set(e,s),s}function kk(t,e){let r=t.options.find(n=>n.key===e);if(r&&(r.value==="merge"||r.value==="ignore"||r.value==="isolate"))return r.value}async function fB(t,e,r){let n=lt.file(r),o=t.shared.workspace.LangiumDocumentFactory.fromString(e,n);return await t.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function dB(t,e,r,n,i){if(r==="ignore"||r==="isolate")return;let o=(s,a)=>i.push({severity:"warning",message:`${a} "${s}" from ${rh(n)} is shadowed by the parent's definition.`,sourcePath:n});i_(t.styles,e.styles,s=>o(s,"Style")),i_(t.defaults,e.defaults,s=>o(s,"Default")),i_(t.symbols,e.symbols,s=>o(s,"Symbol")),e.scale&&!t.scale&&(t.scale=e.scale),e.calendar&&!t.calendar&&(t.calendar=e.calendar)}function pB(t,e,r,n,i,o,s){if(n==="ignore")return;if(n==="isolate"){e.roadmap&&t.isolatedRegions.push({sourcePath:o,config:r,content:e});return}let a=(c,l)=>s.push({severity:"warning",message:`${l} "${c}" from ${rh(i)} is shadowed by the parent's definition.`,sourcePath:i});Un(t.persons,e.persons,c=>a(c,"Person")),Un(t.teams,e.teams,c=>a(c,"Team")),Un(t.anchors,e.anchors,c=>a(c,"Anchor")),Un(t.labels,e.labels,c=>a(c,"Label")),Un(t.sizes,e.sizes,c=>a(c,"Size")),Un(t.statuses,e.statuses,c=>a(c,"Status")),Un(t.swimlanes,e.swimlanes,c=>a(c,"Swimlane")),Un(t.milestones,e.milestones,c=>a(c,"Milestone")),Un(t.footnotes,e.footnotes,c=>a(c,"Footnote")),e.roadmap&&!t.roadmap&&(t.roadmap=e.roadmap)}function i_(t,e,r){for(let[n,i]of e){if(t.has(n)){r(n);continue}t.set(n,i)}}function Un(t,e,r){for(let[n,i]of e){if(!i.name&&i.title){t.set(Ck(t,Pk(i.title)),i);continue}if(t.has(n)){r(n);continue}t.set(n,i)}}function hB(t,e){for(let r of e.configEntries)mB(t,r)}function mB(t,e){uk(e)?t.scale||(t.scale=e):th(e)?t.calendar||(t.calendar=e):eu(e)?e.name&&!t.styles.has(e.name)&&t.styles.set(e.name,e):tu(e)?e.name&&!t.symbols.has(e.name)&&t.symbols.set(e.name,e):$i(e)&&(t.defaults.has(e.entityType)||t.defaults.set(e.entityType,e))}function gB(t){let e={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 r of t){let n=r.name;n&&(_r(r)?e.swimlanes.add(n):Fn(r)?e.persons.add(n):Er(r)?e.teams.add(n):Kl(r)?e.anchors.add(n):Jl(r)?e.labels.add(n):Co(r)?e.sizes.add(n):Xa(r)?e.statuses.add(n):Ql(r)?e.milestones.add(n):Zl(r)&&e.footnotes.add(n))}return e}function yB(t,e){e.roadmapDecl&&!t.roadmap&&(t.roadmap=e.roadmapDecl);let r=gB(e.roadmapEntries);for(let n of e.roadmapEntries)xB(t,n,r)}function Pk(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"entity"}function Ck(t,e,r){let n=o=>t.has(o)||(r?.has(o)??!1);if(!n(e))return e;let i=2;for(;n(`${e}-${i}`);)i++;return`${e}-${i}`}function Bn(t,e,r){e.name?t.has(e.name)||t.set(e.name,e):e.title&&t.set(Ck(t,Pk(e.title),r),e)}function xB(t,e,r){_r(e)?Bn(t.swimlanes,e,r.swimlanes):Fn(e)?Bn(t.persons,e,r.persons):Er(e)?Bn(t.teams,e,r.teams):Kl(e)?Bn(t.anchors,e,r.anchors):Jl(e)?Bn(t.labels,e,r.labels):Co(e)?Bn(t.sizes,e,r.sizes):Xa(e)?Bn(t.statuses,e,r.statuses):Ql(e)?Bn(t.milestones,e,r.milestones):Zl(e)&&Bn(t.footnotes,e,r.footnotes)}function s_(t){return/[\r\n]/.test(t)?t.replace(/\s*[\r\n]+\s*/g," ").trim():t}var Ok="v1",a_=new Set(["planned","in-progress","active","done","completed","at-risk","blocked"]),nh=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"]),d_=new Set(["none","multiplier","person","people","points","time"]),ih=new Set([...d_,"shield","warning","lock","calendar"]),Hk="none",oh={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"])},TB=new Set(["red","blue","yellow","green","orange","purple","violet","gray","grey","navy","white","none"]),_B=new Set(["business","full","custom"]),c_=new Set(["days-per-week","days-per-month","days-per-quarter","days-per-year"]),Lk=new Set(["name","label-every","label"]),Dk=new Set(["item","label","swimlane","roadmap","milestone","footnote","anchor","parallel","group"]),EB={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},Mk=new Set(["labels","link","style","description"]),vB={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};function bB(t,e,r){if(t===e)return 0;let n=t.length,i=e.length;if(Math.abs(n-i)>r)return r+1;if(n===0)return i;if(i===0)return n;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<=n;a++){s[0]=a;let c=a;for(let u=1;u<=i;u++){let f=t.charCodeAt(a-1)===e.charCodeAt(u-1)?0:1;s[u]=Math.min(o[u]+1,s[u-1]+1,o[u-1]+f),s[u]<c&&(c=s[u])}if(c>r)return r+1;let l=o;o=s,s=l}return o[i]}function wB(t,e,r=2){let n,i=r+1;for(let o of e){let s=bB(t,o,r);if(s<i&&(n=o,i=s,s===0))break}return n}var RB=[{keys:new Set(["progress","percent","percentage","pct","complete","completion"]),requires:"remaining",suggest:"status: + remaining:"}];function AB(t,e){let r=t.toLowerCase();for(let n of RB)if(n.keys.has(r)&&e.has(n.requires))return n.suggest}function Ne(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}var nu=/^\d+(?:\.\d+)?[dwmqy]$/,SB=/^\d+%$/,Fi=/^\d{4}-\d{2}-\d{2}$/,IB=/^#[0-9a-fA-F]{3,8}$/,kB=/^v\d+$/,$k=/^\d+$/,NB=/^[dwmqy]$/,Fk=/^\d+(\.\d+)?$/,p_=/^\d+(\.\d+)?%$/,jk=/^\d+\.\d+$/,PB=/^\d+$/,CB=/^[\x20-\x7E]{1,3}$/,OB=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\d{3})?$/,LB=new Set(["merge","ignore","isolate"]),Uk=new Set(["locale"]);function l_(t){let e=t?.roadmapDecl?.properties.find(i=>Ne(i)==="start");if(!e)return{kind:"missing"};let r=e.value;if(!r||!Fi.test(r))return{kind:"invalid"};let n=new Date(r);return Number.isNaN(n.getTime())?{kind:"invalid"}:{kind:"valid",iso:r,date:n}}function Gr(t){return t.name??(t.title===void 0?"<unnamed>":s_(t.title))}function DB(t){return t.$type.replace(/Declaration$|Block$/,"").toLowerCase()}function Ie(t,e,r,n,...i){t(e,ru("en-US",n,...i),{...r,data:{code:n,args:i}})}function zk(t){let e=t.validation.ValidationRegistry,r=t.validation.NowlineValidator,n={NowlineFile:[r.checkFileStructure,r.checkUniqueIdentifiers,r.checkSwimlaneRequired,r.checkIndentationConsistency,r.checkRoadmapOnlyKeywordsPosition,r.checkForwardReferences,r.checkReferenceResolution,r.checkInlineDatePins,r.checkCircularDependencies,r.checkDuplicateSizeIds,r.checkCalendarBlockConsistency,r.checkPersonDeclarations,r.checkDuplicateSymbolIds,r.checkSymbolReferences],NowlineDirective:[r.checkDirectiveVersion,r.checkDirectiveProperties],IncludeOption:[r.checkIncludeMode],IncludeDeclaration:[r.checkIncludeDuplicateOptions],EntityProperty:[r.checkPropertyValues],RoadmapDeclaration:[r.checkEntityIdOrTitle,r.checkRoadmapProperties,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],AnchorDeclaration:[r.checkEntityIdOrTitle,r.checkAnchorRequiredDate,r.checkAnchorAgainstStart,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],SwimlaneDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkUtilizationOrdering,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],ItemDeclaration:[r.checkEntityIdOrTitle,r.checkItemRequiredDuration,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],ParallelBlock:[r.checkParallelMinChildren,r.checkNoComputedProperties,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],GroupBlock:[r.checkGroupMinChildren,r.checkNoComputedProperties,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],MilestoneDeclaration:[r.checkEntityIdOrTitle,r.checkMilestoneRequirement,r.checkMilestoneAgainstStart,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],FootnoteDeclaration:[r.checkEntityIdOrTitle,r.checkFootnoteOn,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],PersonDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],TeamDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],StyleDeclaration:[r.checkEntityIdOrTitle],StyleProperty:[r.checkStylePropertyEnum],SymbolDeclaration:[r.checkEntityIdOrTitle,r.checkSymbolDeclaration],LabelDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],SizeDeclaration:[r.checkEntityIdOrTitle,r.checkSizeDeclaration,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],StatusDeclaration:[r.checkEntityIdOrTitle,r.checkStatusDeclaration,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],DefaultDeclaration:[r.checkDefaultDeclaration,r.checkUtilizationOrdering],CalendarBlock:[r.checkCalendarBlock],ScaleBlock:[r.checkScaleBlock]};e.register(n,r)}var ah=class{checkFileStructure(e,r){let n=e.hasConfig?pf.findNodeForKeyword(e.$cstNode,"config")?.offset:void 0,i=e.roadmapDecl?.$cstNode?.offset;n!==void 0&&i!==void 0&&n>i&&Ie(r,"error",{node:e,property:"hasConfig"},"NL.E0001");for(let o of e.includes){let s=o.$cstNode?.offset??0;n!==void 0&&s>n&&Ie(r,"error",{node:o},"NL.E0002"),i!==void 0&&s>i&&Ie(r,"error",{node:o},"NL.E0003")}}checkRoadmapOnlyKeywordsPosition(e,r){}checkDirectiveVersion(e,r){if(!kB.test(e.version)){Ie(r,"error",{node:e,property:"version"},"NL.E0100",{version:e.version});return}let n=parseInt(e.version.slice(1),10),i=parseInt(Ok.slice(1),10);n>i&&Ie(r,"error",{node:e,property:"version"},"NL.E0101",{version:e.version,supported:Ok})}checkDirectiveProperties(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!Uk.has(o)){Ie(r,"error",{node:i,property:"key"},"NL.E0102",{key:o,allowed:[...Uk].join(", ")});continue}if(n.has(o)&&Ie(r,"error",{node:i,property:"key"},"NL.E0103",{key:o}),n.add(o),o==="locale"){let s=i.value;OB.test(s)||Ie(r,"error",{node:i,property:"value"},"NL.E0104",{value:s})}}}checkEntityIdOrTitle(e,r){!e.name&&!e.title&&Ie(r,"error",{node:e},"NL.E0301",{type:e.$type})}checkUniqueIdentifiers(e,r){let n=new Map,i=(o,s)=>{if(!o)return;let a=n.get(o);a?Ie(r,"error",{node:s},"NL.E0300",{name:o,location:sh(a)}):n.set(o,s)};e.roadmapDecl?.name&&i(e.roadmapDecl.name,e.roadmapDecl);for(let o of e.roadmapEntries)FB(o,i);for(let o of e.configEntries)eu(o)&&o.name&&i(o.name,o)}checkIndentationConsistency(e,r){let n=e.$document?.textDocument.getText()??e.$cstNode?.text;if(!n)return;let i=n.split(/\r?\n/);for(let o=0;o<i.length;o++){let s=i[o];if(s.length===0)continue;let a=s.match(/^([\t ]+)/);if(!a)continue;let c=a[1];if(c.includes(" ")&&c.includes(" ")){Ie(r,"error",{node:e},"NL.E0005",{line:o+1});return}}}checkSwimlaneRequired(e,r){let n=e.roadmapEntries.some(_r);e.roadmapDecl&&!n&&Ie(r,"error",{node:e.roadmapDecl},"NL.E0004")}checkIncludeMode(e,r){LB.has(e.value)||Ie(r,"error",{node:e,property:"value"},"NL.E0200",{value:e.value})}checkIncludeDuplicateOptions(e,r){let n=new Set;for(let i of e.options){let o=i.key.replace(/:$/,"");n.has(o)&&Ie(r,"error",{node:i},"NL.E0201",{key:o}),n.add(o)}}checkPropertyValues(e,r){let n=Ne(e),i=e.value,o=e.values,s=i?[i]:o;switch(n){case"status":break;case"duration":i&&!nu.test(i)&&Ie(r,"error",{node:e,property:"value"},"NL.E0400",{value:i});break;case"size":i&&!Bk(i)&&Ie(r,"error",{node:e,property:"value"},"NL.E0401",{value:i});break;case"effort":i&&!nu.test(i)&&Ie(r,"error",{node:e,property:"value"},"NL.E0402",{value:i});break;case"remaining":{if(i)if(SB.test(i)){let a=parseFloat(i);(a<0||a>100)&&Ie(r,"error",{node:e,property:"value"},"NL.E0404",{value:i})}else nu.test(i)||Ie(r,"error",{node:e,property:"value"},"NL.E0403",{value:i});break}case"date":case"start":i&&(!Fi.test(i)||Number.isNaN(new Date(i).getTime()))&&Ie(r,"error",{node:e,property:"value"},"NL.E0405",{key:n,value:i});break;case"scale":i&&!nu.test(i)&&Ie(r,"error",{node:e,property:"value"},"NL.E0406",{value:i});break;case"calendar":i&&!_B.has(i)&&Ie(r,"error",{node:e,property:"value"},"NL.E0407",{value:i});break;case"on":case"after":case"before":s.length===0&&Ie(r,"error",{node:e},"NL.E0408",{key:n});break;case"capacity":{if(!i)break;let a=e.$container,c=MB(a);if(c==="invalid")break;c==="lane"?(!Fk.test(i)||parseFloat(i)<=0)&&r("error",`Invalid swimlane capacity "${i}". 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"}):p_.test(i)?parseFloat(i)<=0&&r("error",`Item capacity "${i}" must be positive.`,{node:e,property:"value"}):Fk.test(i)?parseFloat(i)<=0&&r("error",`Item capacity "${i}" must be positive.`,{node:e,property:"value"}):r("error",`Invalid item capacity "${i}". Use a positive integer (capacity:2), decimal (capacity:0.5), or percent literal (capacity:50%).`,{node:e,property:"value"});break}case"overcapacity":{r("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(!i)break;if(!$B(e.$container)){r("error",`"${n}:" is only valid on "swimlane" or "default swimlane".`,{node:e});break}if(i===Hk)break;if(p_.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(jk.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(PB.test(i)){r("error",`Ambiguous ${n} value "${i}". Use the percent form ("${i}%") or the decimal-fraction form ("0.${i}") to make the intent explicit.`,{node:e,property:"value"});break}r("error",`Invalid ${n} value "${i}". 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;default:if(nh.has(n)){if(n==="bg"||n==="fg"||n==="text")i&&!u_(i)&&r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in oh){let a=oh[n];i&&!a.has(i)&&!u_(i)&&r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...a].join(", ")}.`,{node:e,property:"value"})}}break}}checkAnchorRequiredDate(e,r){e.properties.find(i=>Ne(i)==="date")||Ie(r,"error",{node:e},"NL.E0500",{name:Gr(e)})}checkAnchorAgainstStart(e,r){let n=e.properties.find(a=>Ne(a)==="date");if(!n?.value)return;let i=n.value;if(!Fi.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=l_(e.$container);switch(s.kind){case"invalid":return;case"missing":Ie(r,"error",{node:n,property:"value"},"NL.E0501",{name:Gr(e)});return;case"valid":o<s.date&&Ie(r,"error",{node:n,property:"value"},"NL.E0502",{name:Gr(e),date:i,start:s.iso});return}}checkMilestoneRequirement(e,r){let n=e.properties.some(o=>Ne(o)==="date"),i=e.properties.some(o=>Ne(o)==="after");!n&&!i&&Ie(r,"error",{node:e},"NL.E0503",{name:Gr(e)})}checkMilestoneAgainstStart(e,r){let n=e.properties.find(a=>Ne(a)==="date");if(!n?.value)return;let i=n.value;if(!Fi.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=l_(e.$container);switch(s.kind){case"invalid":return;case"missing":r("error",`Milestone "${Gr(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":o<s.date&&Ie(r,"error",{node:n,property:"value"},"NL.E0504",{name:Gr(e),date:i,start:s.iso});return}}checkFootnoteOn(e,r){e.properties.some(i=>Ne(i)==="on")||Ie(r,"error",{node:e},"NL.E0505")}checkNoFootnoteProperty(e,r){for(let n of e.properties)Ne(n)==="footnote"&&r("error",`Property "footnote:" is not valid on ${f_(e)}. Footnotes attach via "on:" on the footnote declaration \u2014 declare \`footnote <id> on:<target-id>\` instead.`,{node:n})}checkItemRequiredDuration(e,r){let n=e.properties.some(o=>Ne(o)==="duration"),i=e.properties.some(o=>Ne(o)==="size");!n&&!i&&Ie(r,"error",{node:e},"NL.E0600",{name:Gr(e)})}checkNoComputedProperties(e,r){for(let n of e.properties){let i=Ne(n);(i==="size"||i==="duration"||i==="remaining"||i==="capacity")&&r("error",`"${i}" is not valid on ${e.$type==="ParallelBlock"?"parallel":"group"} (computed from children).`,{node:n})}}checkParallelMinChildren(e,r){let n=e.content.filter(i=>!r_(i));n.length===0?r("error","Parallel block must contain at least 2 children.",{node:e}):n.length===1&&r("warning","Parallel block has only 1 child. Use at least 2 for parallel execution.",{node:e})}checkGroupMinChildren(e,r){e.content.filter(i=>!r_(i)).length===0&&r("error","Group must contain at least 1 child.",{node:e})}checkNoRawStyleProperties(e,r){for(let n of e.properties){let i=Ne(n);nh.has(i)&&r("error",`Raw style property "${i}" is not allowed on ${f_(e)}. Declare a named style in config and reference it via "style:id".`,{node:n})}}checkUnknownEntityProperties(e,r){let n=vB[e.$type];if(!n)return;let i=e.$type==="ParallelBlock"||e.$type==="GroupBlock"?new Set(["size","duration","remaining","capacity"]):null;for(let o of e.properties){let s=Ne(o);if(n.has(s)||Mk.has(s)||nh.has(s)||s==="footnote"||i?.has(s))continue;let a=[...n,...Mk],c=AB(s,n)??wB(s,a)??"";Ie(r,"warning",{node:o,property:"key"},"NL.W0700",{key:s,entity:f_(e),suggested:c})}}checkRoadmapProperties(e,r){}checkStylePropertyEnum(e,r){let n=Ne(e),i=e.value;if(n==="bg"||n==="fg"||n==="text")u_(i)||r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in oh){let o=oh[n];o.has(i)||r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...o].join(", ")}.`,{node:e,property:"value"})}else nh.has(n)||r("error",`Unknown style property "${n}".`,{node:e,property:"key"})}checkSizeDeclaration(e,r){e.properties.find(i=>Ne(i)==="effort")||r("error",`Size "${Gr(e)}" requires an "effort:" property.`,{node:e}),e.name&&(nu.test(e.name)||NB.test(e.name))&&r("error",`Size id "${e.name}" collides with the raw duration pattern. Choose a different name (e.g. "xs", "small", "quarter").`,{node:e,property:"name"})}checkStatusDeclaration(e,r){e.name&&a_.has(e.name)&&r("error",`Status id "${e.name}" collides with the built-in status value. Built-ins: ${[...a_].join(", ")}.`,{node:e,property:"name"})}checkDuplicateSizeIds(e,r){let n=new Map;for(let i of e.roadmapEntries)if(Co(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate size id "${i.name}". First declared at ${sh(o)}.`,{node:i,property:"name"}):n.set(i.name,i)}}checkUtilizationOrdering(e,r){if($i(e)&&e.entityType!=="swimlane")return;let n=e.properties.find(a=>Ne(a)==="utilization-warn-at"),i=e.properties.find(a=>Ne(a)==="utilization-over-at");if(!n||!i)return;let o=Xk(n.value),s=Xk(i.value);o===null||s===null||o>s&&r("error",`utilization-warn-at (${n.value}) must be \u2264 utilization-over-at (${i.value}). Warn fires below over; if both fire at the same point, the warn band collapses to zero.`,{node:n,property:"value"})}checkDefaultDeclaration(e,r){if(!Dk.has(e.entityType)){r("error",`"${e.entityType}" is not a supported entity type for default. Allowed: ${[...Dk].join(", ")}.`,{node:e,property:"entityType"});return}let n=e.$container,i=-1;for(let s=0;s<n.configEntries.length;s++){let a=n.configEntries[s];if($i(a)&&a.entityType===e.entityType){if(i<0)i=s;else if(a===e){r("error",`Duplicate "default ${e.entityType}" declaration. Only one is allowed per entity type per file.`,{node:e});break}}}let o=EB[e.entityType];if(o)for(let s of e.properties){let a=Ne(s);o.has(a)&&r("error",`"${a}" cannot be set on "default ${e.entityType}". Identity-defining, sizing, sequencing, reference, and prose properties must be explicit on each entity.`,{node:s})}}checkCalendarBlockConsistency(e,r){let n=e.configEntries.filter(th),o=e.roadmapDecl?.properties.find(s=>Ne(s)==="calendar")?.value;if(n.length>0&&o!=="custom")for(let s of n)r("error",'A "calendar" config block is only valid when the roadmap declares calendar:custom.',{node:s});if(o==="custom"&&n.length===0&&r("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"}),o==="custom"&&n.length>0)for(let s of n){let a=new Set(s.properties.map(c=>Ne(c)));for(let c of c_)a.has(c)||r("error",`calendar:custom requires "${c}" in the calendar config block.`,{node:s})}}checkCalendarBlock(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!c_.has(o)){r("error",`Unknown calendar property "${o}". Allowed: ${[...c_].join(", ")}.`,{node:i,property:"key"});continue}n.has(o)&&r("error",`Duplicate calendar property "${o}".`,{node:i,property:"key"}),n.add(o),(!$k.test(i.value)||parseInt(i.value,10)<=0)&&r("error",`"${o}" must be a positive integer, got "${i.value}".`,{node:i,property:"value"})}}checkScaleBlock(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!Lk.has(o)){r("error",`Unknown scale property "${o}". Allowed: ${[...Lk].join(", ")}.`,{node:i,property:"key"});continue}n.has(o)&&r("error",`Duplicate scale property "${o}".`,{node:i,property:"key"}),n.add(o),o==="label-every"&&(!$k.test(i.value)||parseInt(i.value,10)<=0)&&r("error",`"label-every" must be a positive integer, got "${i.value}".`,{node:i,property:"value"})}}checkForwardReferences(e,r){let n=new Map,i=new Map;for(let o=0;o<e.roadmapEntries.length;o++){let s=e.roadmapEntries[o];Co(s)&&s.name?n.has(s.name)||n.set(s.name,o):Xa(s)&&s.name&&(i.has(s.name)||i.set(s.name,o))}for(let o=0;o<e.roadmapEntries.length;o++){let s=e.roadmapEntries[o];Gk(s,a=>{let c=Ne(a);if(c==="size"&&a.value){let l=a.value,u=n.get(l);u===void 0?r("error",`Size "${l}" is not declared. Add "size ${l} effort:<literal>" earlier in the roadmap section.`,{node:a,property:"value"}):u>=o&&r("error",`Size "${l}" is referenced before its declaration. Move "size ${l}" above this entity.`,{node:a,property:"value"})}else if(c==="status"&&a.value){let l=a.value;if(a_.has(l))return;let u=i.get(l);u===void 0?r("error",`Status "${l}" is not a built-in and has no declaration. Add "status ${l}" earlier in the roadmap section.`,{node:a,property:"value"}):u>=o&&r("error",`Status "${l}" is referenced before its declaration. Move "status ${l}" above this entity.`,{node:a,property:"value"})}})}}checkReferenceResolution(e,r){let n=UB(e),i=o=>{Gk(o,s=>{let a=Ne(s);if(a!=="after"&&a!=="before"&&a!=="on")return;let c=s.value?[s.value]:s.values;for(let l of c)l&&((a==="after"||a==="before")&&Fi.test(l)||n.has(l)||r("error",`${a}: reference "${l}" does not resolve to any declared entity in this file.`,{node:s}))})};for(let o of e.roadmapEntries)i(o)}checkInlineDatePins(e,r){let n=l_(e),i=o=>{let s=o.properties??[],a=cr(o)||Xr(o)||Br(o);for(let c of s){let l=Ne(c);if(l!=="after"&&l!=="before")continue;let f=(c.value?[c.value]:c.values).filter(d=>!!d&&Fi.test(d));if(f.length!==0){if(!a){Ie(r,"error",{node:c},"NL.E0411",{key:l,type:DB(o)});continue}f.length>1&&Ie(r,"error",{node:c},"NL.E0410",{key:l});for(let d of f)switch(n.kind){case"invalid":continue;case"missing":Ie(r,"error",{node:c},"NL.E0412",{key:l,date:d});continue;case"valid":{let p=new Date(d);if(Number.isNaN(p.getTime()))continue;p<n.date&&Ie(r,"error",{node:c},"NL.E0413",{key:l,date:d,start:n.iso})}}}}if(_r(o))for(let c of o.content)i(c);else if(Xr(o)||Br(o))for(let c of o.content)i(c)};for(let o of e.roadmapEntries)i(o)}checkCircularDependencies(e,r){let n=new Map,i=(p,m)=>{n.has(p)||n.set(p,new Set),n.get(p).add(m)},o=(p,m,y)=>{if(p)for(let v of m){let _=Ne(v);if(_==="after"){let x=v.value?[v.value]:v.values;for(let E of x)E&&(Fi.test(E)||i(p,E))}else if(_==="before"){let x=v.value?[v.value]:v.values;for(let E of x)E&&(Fi.test(E)||i(E,p))}}},s=p=>{let m=p.name,y=p.properties??[];if(o(m,y,e),_r(p))for(let v of p.content)s(v);else if(Xr(p)||Br(p))for(let v of p.content)s(v)};for(let p of e.roadmapEntries)s(p);let a=0,c=1,l=2,u=new Map;for(let p of n.keys())u.set(p,a);let f=new Set,d=(p,m)=>{u.set(p,c),m.push(p);for(let y of n.get(p)??[]){let v=u.get(y)??a;if(v===c){let _=m.indexOf(y),x=m.slice(_).concat(y),E=[...x].sort().join("\u2192");f.has(E)||(f.add(E),r("error",`Circular dependency detected: ${x.join(" \u2192 ")}.`,{node:e.roadmapDecl??e}))}else v===a&&d(y,m)}m.pop(),u.set(p,l)};for(let p of n.keys())(u.get(p)??a)===a&&d(p,[])}checkPersonDeclarations(e,r){let n=new Map,i=a=>!!a.title||a.properties.length>0||a.description!==void 0,o=a=>{if(!a.name)return;let c=i(a);n.has(a.name)||n.set(a.name,[]),n.get(a.name).push({node:a,isDeclaration:c}),!c&&a.$container.$type==="NowlineFile"&&r("warning",`Bare "person ${a.name}" at roadmap top level has no declaration. Either add properties (title, link, etc.) or remove the line.`,{node:a})},s=a=>{for(let c of a.content)Fn(c)?o(c):Er(c)&&s(c)};for(let a of e.roadmapEntries)Fn(a)?o(a):Er(a)&&s(a);for(let[a,c]of n){let l=c.filter(u=>u.isDeclaration);if(l.length>1)for(let u=1;u<l.length;u++)r("error",`Person "${a}" is declared more than once. First declaration at ${sh(l[0].node)}.`,{node:l[u].node})}}checkSymbolDeclaration(e,r){e.name&&ih.has(e.name)&&r("error",`Symbol id "${e.name}" collides with a built-in icon name. Reserved built-ins: ${[...ih].sort().join(", ")}.`,{node:e,property:"name"});let n=e.properties.find(o=>Ne(o)==="unicode");n?(!n.value||n.value.length===0)&&r("error",`Symbol "${Gr(e)}" unicode: must be a non-empty value.`,{node:n,property:"value"}):r("error",`Symbol "${Gr(e)}" requires a "unicode:" property (e.g. unicode:"\u{1F4B0}" or unicode:"\\u{1F464}").`,{node:e});let i=e.properties.find(o=>Ne(o)==="ascii");if(i){let o=i.value??"";CB.test(o)||r("error",`Symbol "${Gr(e)}" ascii: must be 1-3 ASCII characters (got ${o.length} character${o.length===1?"":"s"}).`,{node:i,property:"value"})}for(let o of e.properties){let s=Ne(o);s!=="unicode"&&s!=="ascii"&&s!=="link"&&s!=="description"&&r("error",`Unknown symbol property "${s}". Allowed: unicode, ascii, link, description.`,{node:o,property:"key"})}}checkDuplicateSymbolIds(e,r){let n=new Map;for(let i of e.configEntries)if(tu(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate symbol id "${i.name}". First declared at ${sh(o)}.`,{node:i,property:"name"}):n.set(i.name,i)}}checkSymbolReferences(e,r){let n=new Map;for(let o=0;o<e.configEntries.length;o++){let s=e.configEntries[o];tu(s)&&s.name&&(n.has(s.name)||n.set(s.name,o))}let i=(o,s,a,c)=>{if(s!=="icon"&&s!=="capacity-icon"||!a||!Bk(a)||s==="capacity-icon"&&d_.has(a)||s==="icon"&&ih.has(a))return;let l=n.get(a);if(l===void 0){let u=s==="capacity-icon"?[...d_].sort().join(", "):[...ih].sort().join(", ");r("error",`${s}: "${a}" is neither a built-in (${u}) nor a declared symbol. Add "symbol ${a} unicode:..." earlier in config or use a quoted Unicode literal.`,{node:c,property:"value"})}else l>=o&&r("error",`${s}: symbol "${a}" is referenced before its declaration. Move "symbol ${a}" above this entry.`,{node:c,property:"value"})};for(let o=0;o<e.configEntries.length;o++){let s=e.configEntries[o];if(eu(s))for(let a of s.properties)i(o,Ne(a),a.value,a);else if($i(s))for(let a of s.properties)i(o,Ne(a),a.value,a)}}};function u_(t){return TB.has(t)||IB.test(t)}function Bk(t){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t)}function MB(t){return t?_r(t)?"lane":cr(t)?"item":$i(t)?t.entityType==="swimlane"?"lane":"item":"invalid":"invalid"}function $B(t){return t?!!(_r(t)||$i(t)&&t.entityType==="swimlane"):!1}function Xk(t){if(!t||t===Hk)return null;if(p_.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e/100:null}if(jk.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}return null}function sh(t){let e=t.$cstNode;return e?`line ${e.range.start.line+1}`:"unknown location"}function f_(t){let e=t.$type.replace(/Declaration$|Block$/,"").toLowerCase(),r=t.name??(t.title===void 0?void 0:s_(t.title));return r?`${e} "${r}"`:e}function FB(t,e){if(_r(t)){e(t.name,t);for(let r of t.content)h_(r,e)}else Fn(t)?e(t.name,t):Er(t)?Wk(t,e):(Kl(t)||Ql(t)||Zl(t)||Jl(t)||Co(t)||Xa(t))&&e(t.name,t)}function Wk(t,e){e(t.name,t);for(let r of t.content)Er(r)&&Wk(r,e)}function h_(t,e){if(cr(t))e(t.name,t);else if(Xr(t)){e(t.name,t);for(let r of t.content)h_(r,e)}else if(Br(t)){e(t.name,t);for(let r of t.content)h_(r,e)}}function Gk(t,e){let r=n=>{let i=n.properties;if(Array.isArray(i))for(let o of i)e(o);if(_r(n))for(let o of n.content)r(o);else if(Xr(n)||Br(n))for(let o of n.content)r(o);else if(Er(n))for(let o of n.content)(Er(o)||Fn(o))&&r(o)};r(t)}function UB(t){let e=new Set;t.roadmapDecl?.name&&e.add(t.roadmapDecl.name);let r=n=>{let i=n.name;if(i&&e.add(i),_r(n))for(let o of n.content)r(o);else if(Xr(n)||Br(n))for(let o of n.content)r(o);else if(Er(n))for(let o of n.content)Er(o)||Fn(o)?r(o):lk(o)};for(let n of t.roadmapEntries)r(n);return e}var m_=class extends Ys{runConverter(e,r,n){return e.name==="PROPERTY_KEY_WITH_COLON"||e.name==="INCLUDE_OPTION_KEY"?r.endsWith(":")?r.slice(0,-1):r:super.runConverter(e,r,n)}},g_=class extends zl{isStartOfLine(e,r){if(!super.isStartOfLine(e,r))return!1;let n=r-1;for(;n>=0&&(e[n]===" "||e[n]===" ");)n--;for(;n>=0&&(e[n]==="\r"||e[n]===`
2639
2639
  `);)n--;for(;n>=0&&(e[n]===" "||e[n]===" ");)n--;return n<0||e[n]!=="\\"}},qk={parser:{TokenBuilder:()=>new g_({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:t=>new Vp(t),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new m_},validation:{NowlineValidator:()=>new ah}};function y_(t={}){let e=t.shared??Ra(qp(Yp),pk),r=Ra(Wp({shared:e}),hk,qk);return e.ServiceRegistry.register(r),zk(r),{shared:e,Nowline:r}}function Vk(t){return t.endsWith(":")?t.slice(0,-1):t}function le(t,e){return t.find(r=>Vk(r.key)===e)?.value}function tt(t,e){let r=t.find(n=>Vk(n.key)===e);return r?r.value!==void 0?[r.value]:[...r.values]:[]}function dt(t){if(!t)return null;let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(!e)return null;let r=new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10)));return Number.isNaN(r.getTime())?null:r}var Ga={mode:"business",daysPerWeek:5,daysPerMonth:22,daysPerQuarter:65,daysPerYear:260},BB={mode:"full",daysPerWeek:7,daysPerMonth:30,daysPerQuarter:91,daysPerYear:365};function Yk(t,e){let n=t.roadmapDecl?.properties.find(i=>x_(i.key)==="calendar")?.value??"business";if(n==="business")return{...Ga};if(n==="full")return{...BB};if(e){let i=(o,s)=>{let a=e.properties.find(l=>x_(l.key)===o),c=a?parseInt(a.value,10):NaN;return Number.isFinite(c)&&c>0?c:s};return{mode:"custom",daysPerWeek:i("days-per-week",Ga.daysPerWeek),daysPerMonth:i("days-per-month",Ga.daysPerMonth),daysPerQuarter:i("days-per-quarter",Ga.daysPerQuarter),daysPerYear:i("days-per-year",Ga.daysPerYear)}}return{...Ga}}var ch=/^(\d+(?:\.\d+)?)([dwmqy])$/;function lh(t,e){let r=ch.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case"d":return n;case"w":return n*e.daysPerWeek;case"m":return n*e.daysPerMonth;case"q":return n*e.daysPerQuarter;case"y":return n*e.daysPerYear;default:return 0}}function Kk(t,e,r){return t?ch.test(t)?lh(t,r):e.get(t)?.effortDays??0:0}function Ui(t,e,r){let n=le(t,"duration");if(n&&ch.test(n))return lh(n,r);let i=le(t,"size"),o=i?e.get(i):void 0;if(!o)return 0;let s=Yn(le(t,"capacity"))??1;return o.effortDays/s}function Zk(t,e,r){let n=le(t,"size"),i=n?e.get(n):void 0;if(i)return i.effortDays;let o=le(t,"duration");if(o&&ch.test(o)){let s=Yn(le(t,"capacity"))??1;return lh(o,r)*s}return 0}function uh(t,e){let r=new Map;for(let[n,i]of t){let s=i.properties.find(c=>x_(c.key)==="effort")?.value;if(!s)continue;let a=lh(s,e);a<=0||r.set(n,{name:n,title:i.title||void 0,effortDays:a,effortLiteral:s})}return r}function x_(t){return t.endsWith(":")?t.slice(0,-1):t}function vr(t,e){return Math.round((e.getTime()-t.getTime())/864e5)}function Bi(t,e){let r=new Date(t.getTime());return r.setUTCDate(r.getUTCDate()+e),r}var fh=class{constructor(e){S(this,"items");S(this,"brackets");this.items=e.itemBars,this.brackets=e.brackets}hasObstacle(e,r,n){let i=Math.min(r,n),o=Math.max(r,n);for(let s of this.items)if(!(e<=s.x||e>=s.x+s.width)&&!(s.y+s.height<=i||s.y>=o))return!0;return!1}bracketsNear(e,r,n,i){let o=Math.min(r,n),s=Math.max(r,n),a=[];for(let c of this.brackets)Math.abs(c.x-e)>i||c.yBottom<=o||c.yTop>=s||a.push(c);return a}};function Jk(t,e){let r=[],n=[],i=s=>{if(s.kind==="item"){r.push(s.box);return}if(s.kind==="parallel"){if(s.style.bracket==="solid"||s.style.bracket==="dashed"){let l=s.box.y-12,u=s.box.y+s.box.height+12,f=s.box.x,d=s.box.x+s.box.width;n.push({x:f,yTop:l,yBottom:u}),n.push({x:d,yTop:l,yBottom:u}),n.push({x:f+4,yTop:l-1,yBottom:l+1}),n.push({x:f+4,yTop:u-1,yBottom:u+1}),n.push({x:d-4,yTop:l-1,yBottom:l+1}),n.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"&&n.push({x:s.box.x,yTop:s.box.y,yBottom:s.box.y+s.box.height});for(let c of s.children)i(c);return}},o=s=>{for(let a of s.children)i(a);for(let a of s.nested)o(a)};for(let s of t)o(s);for(let s of e)for(let a of s.nestedSwimlanes)o(a);return{itemBars:r,brackets:n}}function XB(t,e){let{from:r,to:n}=t;if(Math.abs(r.y-n.y)<.5)return{x:(r.x+n.x)/2,underBar:!1,range:null};let i=Math.min(r.y,n.y),o=Math.max(r.y,n.y);if(r.x<=n.x){let a=r.x+6,c=n.x-6;if(a>c)return{x:n.x-6,underBar:!0,range:null};let l={minX:a,maxX:c},u=(r.x+n.x)/2,f=Math.max(a,Math.min(c,u));if(!e.hasObstacle(f,i,o))return{x:f,underBar:!1,range:l};let d=c-a;for(let p=1;p<=d;p++){let m=f-p;if(m>=a&&!e.hasObstacle(m,i,o))return{x:m,underBar:!1,range:l};let y=f+p;if(y<=c&&!e.hasObstacle(y,i,o))return{x:y,underBar:!1,range:l}}return{x:f,underBar:!0,range:l}}let s=[r.x+10,n.x-10];for(let a of s)if(a>0&&!e.hasObstacle(a,i,o))return{x:a,underBar:!1,range:null};return{x:r.x+10,underBar:!0,range:null}}function GB(t,e,r,n){let i=Math.min(r.from.y,r.to.y),o=Math.max(r.from.y,r.to.y),s=n.bracketsNear(t,i,o,4);if(s.length===0)return{x:t,forceUnderBar:!1};let a=s[0],c=Math.abs(s[0].x-t);for(let d=1;d<s.length;d++){let p=Math.abs(s[d].x-t);p<c&&(a=s[d],c=p)}let l=[a.x+4,a.x-4],u=4-.01;for(let d of l){if(e&&(d<e.minX||d>e.maxX))continue;let p=e?d:Math.max(Math.min(r.from.x,r.to.x)+1,Math.min(Math.max(r.from.x,r.to.x)-1,d));if(n.bracketsNear(p,i,o,u).length===0)return{x:p,forceUnderBar:!1}}return{x:e?Math.min(Math.max(t,e.minX),e.maxX):t,forceUnderBar:!0}}function HB(t){let e=[...t].sort((i,o)=>Math.abs(i.channelX-o.channelX)>=1?i.channelX-o.channelX:i.orderIndex-o.orderIndex),r=new Map,n=0;for(;n<e.length;){let i=n+1;for(;i<e.length&&Math.abs(e[i].channelX-e[n].channelX)<1;)i++;let s=[...e.slice(n,i)].sort((c,l)=>{let u=Math.min(c.req.from.y,c.req.to.y),f=Math.min(l.req.from.y,l.req.to.y);return Math.abs(u-f)>.5?u-f:c.orderIndex-l.orderIndex}),a=[];for(let c of s){let l=Math.min(c.req.from.y,c.req.to.y),u=Math.max(c.req.from.y,c.req.to.y),f=-1;for(let d=0;d<a.length;d++)if(a[d]<=l){f=d,a[d]=u;break}f===-1&&(f=a.length,a.push(u)),r.set(c.orderIndex,f)}n=i}return r}function jB(t){if(t===0||t>4)return 0;let e=Math.ceil(t/2);return(t%2===1?1:-1)*e*3}function zB(t){let e=t.from.x>=t.to.x?{x:t.to.x-1,y:t.from.y}:t.from;return{fromId:t.fromId,toId:t.toId,waypoints:[e,t.to],underBar:!1}}function Qk(t,e){let r=new Array(t.length),n=[];for(let o=0;o<t.length;o++){let s=t[o];if(s.isMarkerSource){r[o]=zB(s);continue}if(Math.abs(s.from.y-s.to.y)<.5&&s.to.x-s.from.x<20){r[o]={fromId:s.fromId,toId:s.toId,waypoints:[s.from,s.to],underBar:!1};continue}let{x:a,underBar:c,range:l}=XB(s,e),{x:u,forceUnderBar:f}=GB(a,l,s,e),d=c||f;n.push({req:s,channelX:u,underBar:d,orderIndex:o})}let i=HB(n);for(let o of n){let s=jB(i.get(o.orderIndex)??0),a=o.channelX+s;r[o.orderIndex]={fromId:o.req.fromId,toId:o.req.toId,waypoints:WB(o.req.from,o.req.to,a),underBar:o.underBar}}return r}function WB(t,e,r){return Math.abs(t.y-e.y)<.5?[t,e]:[t,{x:r,y:t.y},{x:r,y:e.y},e]}var iu="en-US",qB={"en-US":{nowLabel:"now",quarterPrefix:"Q"},fr:{nowLabel:"maint.",quarterPrefix:"T"}};function eN(t,e){return e??t??iu}function dh(t){let e={};for(let r of VB(t)){let n=qB[r];if(n)for(let i of Object.keys(n))e[i]===void 0&&n[i]!==void 0&&(e[i]=n[i])}return e}function VB(t){let e=[],r=YB(t);for(;r.length>0;){e.includes(r)||e.push(r);let n=r.lastIndexOf("-");if(n<=0)break;r=r.slice(0,n)}return e.includes(iu)||e.push(iu),e}function YB(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}function tN(t){let{box:e,afterDate:r,beforeDate:n,hasLinkIcon:i,footnoteCount:o}=t;if(!r&&!n)return[];let s=[],a=hn,c=e.y+VE,l=Em(e.width);if(r){let u=vm(e.x,i),f=l?{x:e.x-gn-a,y:c}:{x:u,y:c};s.push({side:"after",isoDate:r,glyphTopLeft:f,glyphSize:a,spilled:l})}if(n){let u=e.x+e.width,f=bm(u,o),d=l?{x:u+gn,y:c}:{x:f,y:c};s.push({side:"before",isoDate:n,glyphTopLeft:d,glyphSize:a,spilled:l})}return s}function ph(t){let{box:e,afterDate:r,beforeDate:n,row:i}=t;if(!r&&!n)return[];let o=[],s=hn,a,c,l;if(i.kind==="title-tab-row"){a=e.y+(qi-s)/2;let u=i.titleTabWidth!==void 0?e.x+i.titleTabWidth:void 0;c=u!==void 0?u+mn:e.x+Ji,l=u??e.x}else a=e.y-es+(es-s)/2,c=e.x+Ji,l=i.title?eo(e.x,i.titleInsetX,!!r)+Am(i.title):e.x;if(r&&(l=Math.max(l,c+s),o.push({side:"after",isoDate:r,glyphTopLeft:{x:c,y:a},glyphSize:s,spilled:!1})),n){let u=e.x+e.width-_m-s;o.push({side:"before",isoDate:n,glyphTopLeft:{x:Math.max(u,l+mn),y:a},glyphSize:s,spilled:!1})}return o}function br(t){for(let e of t)if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e}function hh(t,e){return{x:t,y:e,height:0,maxX:t}}var Ha=class{constructor(e){S(this,"rows");S(this,"opts");this.opts=e,this.rows=[{y:e.originY,height:e.minRowHeight,rightEdge:e.laneLeftX,spillX:e.laneLeftX,placedChildren:[]}]}placeItem(e){for(let n=0;n<this.rows.length;n+=1){let i=this.rows[n];if(!(e.desiredStart<i.rightEdge)&&!(e.desiredStart<i.spillX)&&!this.rowIntersectsCorridor(i,e))return{rowIndex:n,y:i.y}}let r=this.appendRow(Math.max(this.opts.minRowHeight,e.predictedHeight));return{rowIndex:this.rows.length-1,y:r.y}}placeBlock(){let e=this.rows[this.rows.length-1];if(e.rightEdge>this.opts.laneLeftX){let r=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:r.y}}return{rowIndex:this.rows.length-1,y:e.y}}commitItem(e){let r=this.rows[e.rowIndex],n=Math.max(e.placed.box.height,e.rowHeight??0);this.growRowHeight(e.rowIndex,n),r.rightEdge=e.logicalEnd,r.spillX=e.spillReservation??this.opts.laneLeftX,r.placedChildren.push(e.placed)}commitBlock(e){let r=this.rows[e.rowIndex];this.growRowHeight(e.rowIndex,e.blockHeight),r.rightEdge=e.blockEnd,r.spillX=e.spillReservation??this.opts.laneLeftX,r.placedChildren.push(e.placed)}usedHeight(){let e=this.rows[this.rows.length-1];return e.y+e.height-this.opts.originY}usedRightX(){let e=this.opts.laneLeftX;for(let r of this.rows)r.rightEdge>e&&(e=r.rightEdge),r.spillX>e&&(e=r.spillX);return e}rowIntersectsCorridor(e,r){return this.opts.slackCorridors.some(n=>n.y>=e.y&&n.y<e.y+e.height&&r.desiredStart<n.xEnd&&r.desiredEnd>n.xStart&&n.slackPredId!==r.childId)}appendRow(e){let r=this.rows[this.rows.length-1],n={y:r.y+r.height,height:e,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX,placedChildren:[]};return this.rows.push(n),n}growRowHeight(e,r){let n=this.rows[e],i=r-n.height;if(!(i<=0)){n.height=r;for(let o=e+1;o<this.rows.length;o+=1){let s=this.rows[o];s.y+=i;for(let a of s.placedChildren)rN(a,i)}}}};function rN(t,e){if(t.box.y+=e,t.kind==="item"){for(let r of t.labelChips)r.box.y+=e;t.overflowBox&&(t.overflowBox.y+=e);return}for(let r of t.children)rN(r,e)}var nN={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},Xn={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"},T_={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...Xn,headerHeight:"md",padding:"md"},swimlane:{...Xn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...Xn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...Xn,bracket:"none",padding:"xs"},group:{...Xn,bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...Xn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...Xn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...Xn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...Xn,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",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"},arrowhead:{neutral:"#94a3b8",light:"#64748b",dark:"#e2e8f0"},status:{done:"#34d399",inProgress:"#60a5fa",atRisk:"#facc15",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},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 iN={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Gn={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"},__={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Gn,headerHeight:"md",padding:"md"},swimlane:{...Gn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Gn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Gn,bracket:"none",padding:"xs"},group:{...Gn,bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Gn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Gn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Gn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Gn,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",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"},arrowhead:{neutral:"#595959",light:"#9e9e9e",dark:"#1a1a1a"},status:{done:"#8a8a8a",inProgress:"#595959",atRisk:"#737373",blocked:"#3a3a3a",planned:"#bdbdbd",neutral:"#bdbdbd"},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 oN={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Hn={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"},E_={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Hn,headerHeight:"md",padding:"md"},swimlane:{...Hn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Hn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Hn,bracket:"none",padding:"xs"},group:{...Hn,bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Hn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Hn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Hn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Hn,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",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"},arrowhead:{neutral:"#475569",light:"#94a3b8",dark:"#0f172a"},status:{done:"#10b981",inProgress:"#3b82f6",atRisk:"#f59e0b",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},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 v_={light:E_,dark:T_,grayscale:__};var KB={greyscale:"grayscale"};function b_(t){let e=t.toLowerCase(),r=KB[e]??e;if(r==="light"||r==="dark"||r==="grayscale")return r}var ZB={grey:"gray",violet:"purple"};function Oo(t,e){if(t==="none")return"none";if(t.startsWith("#"))return t;let r=e.name==="dark"?nN:e.name==="grayscale"?iN:oN,n=ZB[t]??t,i=r[n];return typeof i=="string"?i:t}function ja(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function JB(t,e){return{bg:Oo(t.bg,e),fg:Oo(t.fg,e),text:Oo(t.text,e),border:t.border,icon:t.icon,shadow:t.shadow,font:t.font,weight:t.weight,italic:t.italic,textSize:t.textSize,padding:t.padding,spacing:t.spacing,headerHeight:t.headerHeight,cornerRadius:t.cornerRadius,bracket:t.bracket,headerPosition:"beside",capacityIcon:t.capacityIcon,timelinePosition:"top",minorGrid:!1}}function w_(t,e,r,n){switch(e){case"bg":t.bg=Oo(r,n);break;case"fg":t.fg=Oo(r,n);break;case"text":t.text=Oo(r,n);break;case"border":(r==="solid"||r==="dashed"||r==="dotted")&&(t.border=r);break;case"icon":t.icon=r;break;case"shadow":(r==="none"||r==="subtle"||r==="soft"||r==="hard")&&(t.shadow=r);break;case"font":(r==="sans"||r==="serif"||r==="mono")&&(t.font=r);break;case"weight":(r==="thin"||r==="light"||r==="normal"||r==="bold")&&(t.weight=r);break;case"italic":t.italic=r==="true";break;case"text-size":t.textSize=ou(r,"xl");break;case"padding":t.padding=ou(r,"xl");break;case"spacing":t.spacing=ou(r,"xl");break;case"header-height":t.headerHeight=ou(r,"xl");break;case"corner-radius":t.cornerRadius=ou(r,"full");break;case"bracket":(r==="none"||r==="solid"||r==="dashed")&&(t.bracket=r);break;case"header-position":(r==="beside"||r==="above")&&(t.headerPosition=r);break;case"capacity-icon":t.capacityIcon=r;break;case"timeline-position":(r==="top"||r==="bottom"||r==="both")&&(t.timelinePosition=r);break;case"minor-grid":t.minorGrid=r==="true";break;default:break}}function ou(t,e){let r=["none","xs","sm","md","lg","xl","full"],n=r.indexOf(e),i=r.indexOf(t);return i<0?"md":i>n?r[n]:r[i]}function sN(t,e,r){if(e)for(let n of e.properties)w_(t,ja(n),n.value,r)}function QB(t,e,r){for(let n of e){let i=ja(n);n.value!==void 0&&w_(t,i,n.value,r)}}function e3(t,e,r){let n=e.find(o=>ja(o)==="labels");if(!n)return;let i=n.value?[n.value]:n.values;for(let o of i){let s=r.labels.get(o);if(!s)continue;let a=s.properties.find(c=>ja(c)==="style");a?.value&&sN(t,r.styles.get(a.value),r.theme)}}function t3(t,e,r){let n=e.find(i=>ja(i)==="style");n?.value&&sN(t,r.styles.get(n.value),r.theme)}function st(t,e,r){let n=r.theme.entities[t],i=JB(n,r.theme),o=r.defaults.get(t);if(o)for(let s of o.properties)s.value!==void 0&&w_(i,ja(s),s.value,r.theme);return e3(i,e,r),t3(i,e,r),QB(i,e,r.theme),i}function aN(t,e){return st("label",t.properties,e)}var mh=class{constructor(e,r){S(this,"node");S(this,"deps");this.node=e,this.deps=r}get id(){return this.node.name??""}place(e,r){let{node:n}=this,{deps:i}=this,o=st("group",n.properties,r.styleCtx),s=e.x,a=n.title??n.name,c=r.currentFlowKey;r.nextGroupId+=1,r.currentFlowKey=`${c}/group:${n.name??`group-${r.nextGroupId}`}`;let l=br(tt(n.properties,"after")),u=br(tt(n.properties,"before")),f=!!(l||u),d=Vi(o.bg),m=d&&!!a||d&&f,y=m?qi+Qh:0,v=m?nm:0,_=Ac(d,!!a,f),x=e.y+_,E=r.bandScale.step(),b=s,D=new Ha({laneLeftX:b,originY:x+y,minRowHeight:E,slackCorridors:r.slackCorridors}),I=b,M=[];for(let F of n.content){if(F.$type==="DescriptionDirective")continue;if(!cr(F)){let G=F.properties??[],oe=i.resolveChildStart(G,I,b,r),{rowIndex:U,y:pe}=D.placeBlock(),he=i.newCursor(oe,pe),ge=i.sequenceOne(F,he,r);M.push(ge);let De=ge.box.x+ge.box.width,q=Math.max(E,he.height);D.commitBlock({rowIndex:U,placed:ge,blockHeight:q,blockEnd:De,spillReservation:Xu(ge)}),I=Math.max(I,De);continue}let A=F.properties,k=i.resolveChildStart(A,I,b,r),N=Ui(A,r.sizes,r.cal),B=Math.max(hr,N*r.timeline.pixelsPerDay),j=k+B,W=F.name??"",Q=i.predictItemBarExtraHeight(F,r),J=E+Q,{rowIndex:ce,y:K}=D.placeItem({childId:W,desiredStart:k,desiredEnd:j,predictedHeight:J}),ie=i.newCursor(k,K),ue=i.sequenceItem(F,ie,r);M.push(ue);let Ee=ue.box.x+ue.box.width+rr;I=Math.max(I,Ee);let we=null;(ue.textSpills||ue.chipsOutside||ue.dotSpills||ue.iconSpills||ue.footnoteSpills)&&(we=Math.max(ue.decorationsRightX,ue.chipsOutside?ue.chipsRightX:0)+6),D.commitItem({rowIndex:ce,placed:ue,logicalEnd:Ee,spillReservation:we,rowHeight:Math.max(J,E+(ue.box.height-r.bandScale.bandwidth()))})}let H=Math.max(E,D.usedHeight()),Y=Math.max(I,D.usedRightX()),re={x:s,y:x,width:Y-s,height:y+H+v};e.x=I+dc,e.maxX=Math.max(e.maxX,e.x);let $=r.bandScale.step()-r.bandScale.bandwidth();e.height=Math.max(e.height,_+re.height+$);let R=n.name;R&&(r.entityLeftEdges.set(R,re.x),r.entityRightEdges.set(R,re.x+re.width)),r.currentFlowKey=c;let O=ph({box:re,afterDate:l,beforeDate:u,row:d?{kind:"title-tab-row",titleTabWidth:a?Yi(a):void 0}:{kind:"header-band",title:a,titleInsetX:ts}});return{kind:"group",id:R,title:a,box:re,children:M,style:o,inlineDatePins:O.length>0?O:void 0}}};var r3=12,n3=4,gh=13,i3=11;function R_(t,e){return(t?St(t,i3):0)+e}function cN(t){if(!/[\r\n]/.test(t))return;let e=t.replace(/\r\n?/g,`
2640
2640
  `).split(`
2641
- `).map(i=>i.trim()),r=0,n=e.length;for(;r<n&&e[r]==="";)r+=1;for(;n>r&&e[n-1]==="";)n-=1;return e.slice(r,n)}function A_(t,e,r,n=e){let i=t,o=cN(t);if(o){if(o.length>=2)return{textSpills:!(r<=e&&o.every((l,u)=>St(l,gh)<=(u===0?n:e))),titleLines:o};i=o[0]??""}let s=i.length>0&&St(i,gh)>n,a=r>e;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let c=Tc(i,e,gh,n);if(c.length>=2&&c.length<=ym&&c.every((l,u)=>St(l,gh)<=(u===0?n:e)))return{textSpills:!1,titleLines:c}}return{textSpills:!0,titleLines:[i]}}function S_(t,e,r){let n=cN(t);return n&&n.length>=2?n:!e.textSpills&&!r&&e.titleLines.length>=2?e.titleLines:[n?n[0]??"":t]}var yh=class{constructor(e){S(this,"input");this.input=e}get id(){return this.input.id}measure(e){return{width:Math.max(hr,this.input.logicalRightX-this.input.logicalLeftX),height:e.bands.bandwidth()}}place(e,r){let n=this.measure(r),i=Math.max(hr,n.width-2*rr),o=e.x+rr,s={x:o,y:e.y,width:i,height:n.height},a=Qn(!!this.input.hasLinkIcon,this.input.hasAfterGlyph?{barWidth:i}:void 0),c=Math.max(0,i-a-r3),l=this.input.title,u=R_(this.input.metaText,this.input.metaTrailingWidth??0),f=Math.max(0,i-a-(this.input.titleFirstLineRightReservePx??wc({barWidth:i,footnoteLabels:[],hasBeforeGlyph:!1}))),{textSpills:d,titleLines:p}=A_(l,c,u,f),m=d?o+i+n3:o+a;return{id:this.input.id,box:s,textX:m,textSpills:d,titleLines:p}}};var xh=class{constructor(e,r){S(this,"node");S(this,"deps");this.node=e,this.deps=r}get id(){return this.node.name??""}place(e,r){let{node:n}=this,{deps:i}=this,o=st("parallel",n.properties,r.styleCtx),s=e.x,a=br(tt(n.properties,"after")),c=br(tt(n.properties,"before")),l=n.title??n.name,u=KE(!!(a||c)),f=e.y+u,d=[],p=s,m=0,y=r.currentFlowKey;r.nextParallelId+=1;let v=n.name??`parallel-${r.nextParallelId}`,_=0;for(let D of n.content){if(D.$type==="DescriptionDirective")continue;r.currentFlowKey=`${y}/par:${v}#${_}`;let I=i.newCursor(s,f+m),M=i.sequenceOne(D,I,r);d.push(M),m+=Math.max(r.bandScale.step(),I.height),p=Math.max(p,I.maxX),_++}r.currentFlowKey=y;let x={x:s,y:f,width:p-s,height:m};e.x=p+dc,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,u+m);let E=n.name;E&&(r.entityLeftEdges.set(E,x.x),r.entityRightEdges.set(E,x.x+x.width));let b=ph({box:x,afterDate:a,beforeDate:c,row:{kind:"header-band",title:l,titleInsetX:rs}});return{kind:"parallel",id:E,title:l,box:x,children:d,style:o,inlineDatePins:b.length>0?b:void 0}}};function Lo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function I_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Do(t){let e,r,n;t.length!==2?(e=Lo,r=(a,c)=>Lo(t(a),c),n=(a,c)=>t(a)-c):(e=t===Lo||t===I_?t:o3,r=t,n=t);function i(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&n(a[f-1],c)>-n(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function o3(){return 0}function k_(t){return t===null?NaN:+t}var lN=Do(Lo),uN=lN.right,s3=lN.left,a3=Do(k_).center,N_=uN;var za=class extends Map{constructor(e,r=u3){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[n,i]of e)this.set(n,i)}get(e){return super.get(fN(this,e))}has(e){return super.has(fN(this,e))}set(e,r){return super.set(c3(this,e),r)}delete(e){return super.delete(l3(this,e))}};function fN({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function c3({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function l3({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function u3(t){return t!==null&&typeof t=="object"?t.valueOf():t}var f3=Math.sqrt(50),d3=Math.sqrt(10),p3=Math.sqrt(2);function dN(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=f3?10:o>=d3?5:o>=p3?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(t*l),c=Math.round(e*l),a/l<t&&++a,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(t/l),c=Math.round(e/l),a*l<t&&++a,c*l>e&&--c),c<a&&.5<=r&&r<2?dN(t,e,r*2):[a,c,l]}function P_(t,e,r){return e=+e,t=+t,r=+r,dN(t,e,r)[2]}function Th(t,e,r){e=+e,t=+t,r=+r;let n=e<t,i=n?P_(e,t,r):P_(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function _h(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,o=new Array(i);++n<i;)o[n]=t+n*r;return o}function Wa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var pN=Symbol("implicit");function Eh(){var t=new za,e=[],r=[],n=pN;function i(o){let s=t.get(o);if(s===void 0){if(n!==pN)return n;t.set(o,s=e.push(o)-1)}return r[s%r.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new za;for(let s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Eh(e,r).unknown(n)},Wa.apply(i,arguments),i}function su(){var t=Eh().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete t.unknown;function f(){var d=e().length,p=i<n,m=p?i:n,y=p?n:i;o=(y-m)/Math.max(1,d-c+l*2),a&&(o=Math.floor(o)),m+=(y-m-o*(d-c))*u,s=o*(1-c),a&&(m=Math.round(m),s=Math.round(s));var v=_h(d).map(function(_){return m+o*_});return r(p?v.reverse():v)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,a=!0,f()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(d){return arguments.length?(a=!!d,f()):a},t.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),f()):c},t.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},t.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},t.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},t.copy=function(){return su(e(),[n,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Wa.apply(f(),arguments)}function vh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function C_(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function lu(){}var au=.7,Rh=1/au,qa="\\s*([+-]?\\d+)\\s*",cu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ln="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",h3=/^#([0-9a-f]{3,8})$/,m3=new RegExp(`^rgb\\(${qa},${qa},${qa}\\)$`),g3=new RegExp(`^rgb\\(${ln},${ln},${ln}\\)$`),y3=new RegExp(`^rgba\\(${qa},${qa},${qa},${cu}\\)$`),x3=new RegExp(`^rgba\\(${ln},${ln},${ln},${cu}\\)$`),T3=new RegExp(`^hsl\\(${cu},${ln},${ln}\\)$`),_3=new RegExp(`^hsla\\(${cu},${ln},${ln},${cu}\\)$`),hN={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vh(lu,Xi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:mN,formatHex:mN,formatHex8:E3,formatHsl:v3,formatRgb:gN,toString:gN});function mN(){return this.rgb().formatHex()}function E3(){return this.rgb().formatHex8()}function v3(){return vN(this).formatHsl()}function gN(){return this.rgb().formatRgb()}function Xi(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=h3.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?yN(e):r===3?new Zt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?bh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?bh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=m3.exec(t))?new Zt(e[1],e[2],e[3],1):(e=g3.exec(t))?new Zt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=y3.exec(t))?bh(e[1],e[2],e[3],e[4]):(e=x3.exec(t))?bh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=T3.exec(t))?_N(e[1],e[2]/100,e[3]/100,1):(e=_3.exec(t))?_N(e[1],e[2]/100,e[3]/100,e[4]):hN.hasOwnProperty(t)?yN(hN[t]):t==="transparent"?new Zt(NaN,NaN,NaN,0):null}function yN(t){return new Zt(t>>16&255,t>>8&255,t&255,1)}function bh(t,e,r,n){return n<=0&&(t=e=r=NaN),new Zt(t,e,r,n)}function b3(t){return t instanceof lu||(t=Xi(t)),t?(t=t.rgb(),new Zt(t.r,t.g,t.b,t.opacity)):new Zt}function Va(t,e,r,n){return arguments.length===1?b3(t):new Zt(t,e,r,n??1)}function Zt(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}vh(Zt,Va,C_(lu,{brighter(t){return t=t==null?Rh:Math.pow(Rh,t),new Zt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?au:Math.pow(au,t),new Zt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zt($o(this.r),$o(this.g),$o(this.b),Ah(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xN,formatHex:xN,formatHex8:w3,formatRgb:TN,toString:TN}));function xN(){return`#${Mo(this.r)}${Mo(this.g)}${Mo(this.b)}`}function w3(){return`#${Mo(this.r)}${Mo(this.g)}${Mo(this.b)}${Mo((isNaN(this.opacity)?1:this.opacity)*255)}`}function TN(){let t=Ah(this.opacity);return`${t===1?"rgb(":"rgba("}${$o(this.r)}, ${$o(this.g)}, ${$o(this.b)}${t===1?")":`, ${t})`}`}function Ah(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $o(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Mo(t){return t=$o(t),(t<16?"0":"")+t.toString(16)}function _N(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Hr(t,e,r,n)}function vN(t){if(t instanceof Hr)return new Hr(t.h,t.s,t.l,t.opacity);if(t instanceof lu||(t=Xi(t)),!t)return new Hr;if(t instanceof Hr)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(r-n)/a+(r<n)*6:r===o?s=(n-e)/a+2:s=(e-r)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new Hr(s,a,c,t.opacity)}function bN(t,e,r,n){return arguments.length===1?vN(t):new Hr(t,e,r,n??1)}function Hr(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}vh(Hr,bN,C_(lu,{brighter(t){return t=t==null?Rh:Math.pow(Rh,t),new Hr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?au:Math.pow(au,t),new Hr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Zt(O_(t>=240?t-240:t+120,i,n),O_(t,i,n),O_(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Hr(EN(this.h),wh(this.s),wh(this.l),Ah(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Ah(this.opacity);return`${t===1?"hsl(":"hsla("}${EN(this.h)}, ${wh(this.s)*100}%, ${wh(this.l)*100}%${t===1?")":`, ${t})`}`}}));function EN(t){return t=(t||0)%360,t<0?t+360:t}function wh(t){return Math.max(0,Math.min(1,t||0))}function O_(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function L_(t,e,r,n,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*r+(1+3*t+3*o-3*s)*n+s*i)/6}function wN(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],s=n>0?t[n-1]:2*i-o,a=n<e-1?t[n+2]:2*o-i;return L_((r-n/e)*e,s,i,o,a)}}function RN(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],o=t[n%e],s=t[(n+1)%e],a=t[(n+2)%e];return L_((r-n/e)*e,i,o,s,a)}}var uu=t=>()=>t;function R3(t,e){return function(r){return t+r*e}}function A3(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function AN(t){return(t=+t)==1?Sh:function(e,r){return r-e?A3(e,r,t):uu(isNaN(e)?r:e)}}function Sh(t,e){var r=e-t;return r?R3(t,r):uu(isNaN(t)?e:t)}var D_=(function t(e){var r=AN(e);function n(i,o){var s=r((i=Va(i)).r,(o=Va(o)).r),a=r(i.g,o.g),c=r(i.b,o.b),l=Sh(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return n.gamma=t,n})(1);function SN(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),o=new Array(r),s,a;for(s=0;s<r;++s)a=Va(e[s]),n[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return n=t(n),i=t(i),o=t(o),a.opacity=1,function(c){return a.r=n(c),a.g=i(c),a.b=o(c),a+""}}}var pne=SN(wN),hne=SN(RN);function IN(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=t[i]*(1-o)+e[i]*o;return n}}function kN(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function NN(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),o=new Array(r),s;for(s=0;s<n;++s)i[s]=Fo(t[s],e[s]);for(;s<r;++s)o[s]=e[s];return function(a){for(s=0;s<n;++s)o[s]=i[s](a);return o}}function PN(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Gi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function CN(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Fo(t[i],e[i]):n[i]=e[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var $_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,M_=new RegExp($_.source,"g");function S3(t){return function(){return t}}function I3(t){return function(e){return t(e)+""}}function ON(t,e){var r=$_.lastIndex=M_.lastIndex=0,n,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(n=$_.exec(t))&&(i=M_.exec(e));)(o=i.index)>r&&(o=e.slice(r,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:Gi(n,i)})),r=M_.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?I3(c[0].x):S3(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function Fo(t,e){var r=typeof e,n;return e==null||r==="boolean"?uu(e):(r==="number"?Gi:r==="string"?(n=Xi(e))?(e=n,D_):ON:e instanceof Xi?D_:e instanceof Date?PN:kN(e)?IN:Array.isArray(e)?NN:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?CN:Gi)(t,e)}function F_(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function U_(t){return function(){return t}}function B_(t){return+t}var LN=[0,1];function Ya(t){return t}function X_(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:U_(isNaN(e)?NaN:.5)}function k3(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function N3(t,e,r){var n=t[0],i=t[1],o=e[0],s=e[1];return i<n?(n=X_(i,n),o=r(s,o)):(n=X_(n,i),o=r(o,s)),function(a){return o(n(a))}}function P3(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),o=new Array(n),s=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<n;)i[s]=X_(t[s],t[s+1]),o[s]=r(e[s],e[s+1]);return function(a){var c=N_(t,a,1,n)-1;return o[c](i[c](a))}}function DN(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function C3(){var t=LN,e=LN,r=Fo,n,i,o,s=Ya,a,c,l;function u(){var d=Math.min(t.length,e.length);return s!==Ya&&(s=k3(t[0],t[d-1])),a=d>2?P3:N3,c=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(c||(c=a(t.map(n),e,r)))(n(s(d)))}return f.invert=function(d){return s(i((l||(l=a(e,t.map(n),Gi)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,B_),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),r=F_,u()},f.clamp=function(d){return arguments.length?(s=d?!0:Ya,u()):s!==Ya},f.interpolate=function(d){return arguments.length?(r=d,u()):r},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,p){return n=d,i=p,u()}}function G_(){return C3()(Ya,Ya)}function H_(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],o=t[n],s;return o<i&&(s=r,r=n,n=s,s=i,i=o,o=s),t[r]=e.floor(i),t[n]=e.ceil(o),t}var j_=new Date,z_=new Date;function qe(t,e,r,n){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),e(o,a),t(o);while(l<o&&o<s);return c},i.filter=o=>qe(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),r&&(i.count=(o,s)=>(j_.setTime(+o),z_.setTime(+s),t(j_),t(z_),Math.floor(r(j_,z_))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var fu=qe(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);fu.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?qe(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):fu);var Kne=fu.range;var un=qe(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),MN=un.range;var Ka=qe(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),O3=Ka.range,Ih=qe(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),L3=Ih.range;var Za=qe(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),D3=Za.range,kh=qe(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),M3=kh.range;var jn=qe(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),$3=jn.range,pu=qe(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),F3=pu.range,Nh=qe(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),U3=Nh.range;function Xo(t){return qe(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var zn=Xo(0),Ja=Xo(1),FN=Xo(2),UN=Xo(3),Hi=Xo(4),BN=Xo(5),XN=Xo(6),GN=zn.range,B3=Ja.range,X3=FN.range,G3=UN.range,H3=Hi.range,j3=BN.range,z3=XN.range;function Go(t){return qe(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var Ho=Go(0),Qa=Go(1),HN=Go(2),jN=Go(3),ji=Go(4),zN=Go(5),WN=Go(6),qN=Ho.range,W3=Qa.range,q3=HN.range,V3=jN.range,Y3=ji.range,K3=zN.range,Z3=WN.range;var ec=qe(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),J3=ec.range,Ph=qe(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),Q3=Ph.range;var lr=qe(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());lr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:qe(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});var e4=lr.range,jr=qe(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());jr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:qe(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});var t4=jr.range;function YN(t,e,r,n,i,o){let s=[[un,1,1e3],[un,5,5*1e3],[un,15,15*1e3],[un,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(l,u,f){let d=u<l;d&&([l,u]=[u,l]);let p=f&&typeof f.range=="function"?f:c(l,u,f),m=p?p.range(l,+u+1):[];return d?m.reverse():m}function c(l,u,f){let d=Math.abs(u-l)/f,p=Do(([,,v])=>v).right(s,d);if(p===s.length)return t.every(Th(l/31536e6,u/31536e6,f));if(p===0)return fu.every(Math.max(Th(l,u,f),1));let[m,y]=s[d/s[p-1][2]<s[p][2]/d?p-1:p];return m.every(y)}return[a,c]}var[n4,i4]=YN(jr,Ph,Ho,Nh,kh,Ih),[W_,q_]=YN(lr,ec,zn,jn,Za,Ka);function V_(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Y_(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function hu(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function K_(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,o=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,l=mu(i),u=gu(i),f=mu(o),d=gu(o),p=mu(s),m=gu(s),y=mu(a),v=gu(a),_=mu(c),x=gu(c),E={a:N,A:B,b:j,B:W,c:null,d:tP,e:tP,f:S4,g:$4,G:U4,H:w4,I:R4,j:A4,L:sP,m:I4,M:k4,p:Q,q:J,Q:iP,s:oP,S:N4,u:P4,U:C4,V:O4,w:L4,W:D4,x:null,X:null,y:M4,Y:F4,Z:B4,"%":nP},b={a:ce,A:K,b:ie,B:ue,c:null,d:rP,e:rP,f:j4,g:eX,G:rX,H:X4,I:G4,j:H4,L:cP,m:z4,M:W4,p:Ee,q:we,Q:iP,s:oP,S:q4,u:V4,U:Y4,V:K4,w:Z4,W:J4,x:null,X:null,y:Q4,Y:tX,Z:nX,"%":nP},D={a:re,A:$,b:R,B:O,c:F,d:QN,e:QN,f:_4,g:JN,G:ZN,H:eP,I:eP,j:g4,L:T4,m:m4,M:y4,p:Y,q:h4,Q:v4,s:b4,S:x4,u:l4,U:u4,V:f4,w:c4,W:d4,x:A,X:k,y:JN,Y:ZN,Z:p4,"%":E4};E.x=I(r,E),E.X=I(n,E),E.c=I(e,E),b.x=I(r,b),b.X=I(n,b),b.c=I(e,b);function I(V,G){return function(oe){var U=[],pe=-1,he=0,ge=V.length,De,q,It;for(oe instanceof Date||(oe=new Date(+oe));++pe<ge;)V.charCodeAt(pe)===37&&(U.push(V.slice(he,pe)),(q=KN[De=V.charAt(++pe)])!=null?De=V.charAt(++pe):q=De==="e"?" ":"0",(It=G[De])&&(De=It(oe,q)),U.push(De),he=pe+1);return U.push(V.slice(he,pe)),U.join("")}}function M(V,G){return function(oe){var U=hu(1900,void 0,1),pe=H(U,V,oe+="",0),he,ge;if(pe!=oe.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(G&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(he=Y_(hu(U.y,0,1)),ge=he.getUTCDay(),he=ge>4||ge===0?Qa.ceil(he):Qa(he),he=pu.offset(he,(U.V-1)*7),U.y=he.getUTCFullYear(),U.m=he.getUTCMonth(),U.d=he.getUTCDate()+(U.w+6)%7):(he=V_(hu(U.y,0,1)),ge=he.getDay(),he=ge>4||ge===0?Ja.ceil(he):Ja(he),he=jn.offset(he,(U.V-1)*7),U.y=he.getFullYear(),U.m=he.getMonth(),U.d=he.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),ge="Z"in U?Y_(hu(U.y,0,1)).getUTCDay():V_(hu(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(ge+5)%7:U.w+U.U*7-(ge+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,Y_(U)):V_(U)}}function H(V,G,oe,U){for(var pe=0,he=G.length,ge=oe.length,De,q;pe<he;){if(U>=ge)return-1;if(De=G.charCodeAt(pe++),De===37){if(De=G.charAt(pe++),q=D[De in KN?G.charAt(pe++):De],!q||(U=q(V,oe,U))<0)return-1}else if(De!=oe.charCodeAt(U++))return-1}return U}function Y(V,G,oe){var U=l.exec(G.slice(oe));return U?(V.p=u.get(U[0].toLowerCase()),oe+U[0].length):-1}function re(V,G,oe){var U=p.exec(G.slice(oe));return U?(V.w=m.get(U[0].toLowerCase()),oe+U[0].length):-1}function $(V,G,oe){var U=f.exec(G.slice(oe));return U?(V.w=d.get(U[0].toLowerCase()),oe+U[0].length):-1}function R(V,G,oe){var U=_.exec(G.slice(oe));return U?(V.m=x.get(U[0].toLowerCase()),oe+U[0].length):-1}function O(V,G,oe){var U=y.exec(G.slice(oe));return U?(V.m=v.get(U[0].toLowerCase()),oe+U[0].length):-1}function F(V,G,oe){return H(V,e,G,oe)}function A(V,G,oe){return H(V,r,G,oe)}function k(V,G,oe){return H(V,n,G,oe)}function N(V){return s[V.getDay()]}function B(V){return o[V.getDay()]}function j(V){return c[V.getMonth()]}function W(V){return a[V.getMonth()]}function Q(V){return i[+(V.getHours()>=12)]}function J(V){return 1+~~(V.getMonth()/3)}function ce(V){return s[V.getUTCDay()]}function K(V){return o[V.getUTCDay()]}function ie(V){return c[V.getUTCMonth()]}function ue(V){return a[V.getUTCMonth()]}function Ee(V){return i[+(V.getUTCHours()>=12)]}function we(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var G=I(V+="",E);return G.toString=function(){return V},G},parse:function(V){var G=M(V+="",!1);return G.toString=function(){return V},G},utcFormat:function(V){var G=I(V+="",b);return G.toString=function(){return V},G},utcParse:function(V){var G=M(V+="",!0);return G.toString=function(){return V},G}}}var KN={"-":"",_:" ",0:"0"},Rt=/^\s*\d+/,o4=/^%/,s4=/[\\^$*+?|[\]().{}]/g;function Pe(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(e)+i:i)}function a4(t){return t.replace(s4,"\\$&")}function mu(t){return new RegExp("^(?:"+t.map(a4).join("|")+")","i")}function gu(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function c4(t,e,r){var n=Rt.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function l4(t,e,r){var n=Rt.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function u4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function f4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function d4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function ZN(t,e,r){var n=Rt.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function JN(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function p4(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function h4(t,e,r){var n=Rt.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function m4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function QN(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function g4(t,e,r){var n=Rt.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function eP(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function y4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function x4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function T4(t,e,r){var n=Rt.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function _4(t,e,r){var n=Rt.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function E4(t,e,r){var n=o4.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function v4(t,e,r){var n=Rt.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function b4(t,e,r){var n=Rt.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function tP(t,e){return Pe(t.getDate(),e,2)}function w4(t,e){return Pe(t.getHours(),e,2)}function R4(t,e){return Pe(t.getHours()%12||12,e,2)}function A4(t,e){return Pe(1+jn.count(lr(t),t),e,3)}function sP(t,e){return Pe(t.getMilliseconds(),e,3)}function S4(t,e){return sP(t,e)+"000"}function I4(t,e){return Pe(t.getMonth()+1,e,2)}function k4(t,e){return Pe(t.getMinutes(),e,2)}function N4(t,e){return Pe(t.getSeconds(),e,2)}function P4(t){var e=t.getDay();return e===0?7:e}function C4(t,e){return Pe(zn.count(lr(t)-1,t),e,2)}function aP(t){var e=t.getDay();return e>=4||e===0?Hi(t):Hi.ceil(t)}function O4(t,e){return t=aP(t),Pe(Hi.count(lr(t),t)+(lr(t).getDay()===4),e,2)}function L4(t){return t.getDay()}function D4(t,e){return Pe(Ja.count(lr(t)-1,t),e,2)}function M4(t,e){return Pe(t.getFullYear()%100,e,2)}function $4(t,e){return t=aP(t),Pe(t.getFullYear()%100,e,2)}function F4(t,e){return Pe(t.getFullYear()%1e4,e,4)}function U4(t,e){var r=t.getDay();return t=r>=4||r===0?Hi(t):Hi.ceil(t),Pe(t.getFullYear()%1e4,e,4)}function B4(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Pe(e/60|0,"0",2)+Pe(e%60,"0",2)}function rP(t,e){return Pe(t.getUTCDate(),e,2)}function X4(t,e){return Pe(t.getUTCHours(),e,2)}function G4(t,e){return Pe(t.getUTCHours()%12||12,e,2)}function H4(t,e){return Pe(1+pu.count(jr(t),t),e,3)}function cP(t,e){return Pe(t.getUTCMilliseconds(),e,3)}function j4(t,e){return cP(t,e)+"000"}function z4(t,e){return Pe(t.getUTCMonth()+1,e,2)}function W4(t,e){return Pe(t.getUTCMinutes(),e,2)}function q4(t,e){return Pe(t.getUTCSeconds(),e,2)}function V4(t){var e=t.getUTCDay();return e===0?7:e}function Y4(t,e){return Pe(Ho.count(jr(t)-1,t),e,2)}function lP(t){var e=t.getUTCDay();return e>=4||e===0?ji(t):ji.ceil(t)}function K4(t,e){return t=lP(t),Pe(ji.count(jr(t),t)+(jr(t).getUTCDay()===4),e,2)}function Z4(t){return t.getUTCDay()}function J4(t,e){return Pe(Qa.count(jr(t)-1,t),e,2)}function Q4(t,e){return Pe(t.getUTCFullYear()%100,e,2)}function eX(t,e){return t=lP(t),Pe(t.getUTCFullYear()%100,e,2)}function tX(t,e){return Pe(t.getUTCFullYear()%1e4,e,4)}function rX(t,e){var r=t.getUTCDay();return t=r>=4||r===0?ji(t):ji.ceil(t),Pe(t.getUTCFullYear()%1e4,e,4)}function nX(){return"+0000"}function nP(){return"%"}function iP(t){return+t}function oP(t){return Math.floor(+t/1e3)}var tc,Ch,uP,fP,dP;Z_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Z_(t){return tc=K_(t),Ch=tc.format,uP=tc.parse,fP=tc.utcFormat,dP=tc.utcParse,tc}function iX(t){return new Date(t)}function oX(t){return t instanceof Date?+t:+new Date(+t)}function pP(t,e,r,n,i,o,s,a,c,l){var u=G_(),f=u.invert,d=u.domain,p=l(".%L"),m=l(":%S"),y=l("%I:%M"),v=l("%I %p"),_=l("%a %d"),x=l("%b %d"),E=l("%B"),b=l("%Y");function D(I){return(c(I)<I?p:a(I)<I?m:s(I)<I?y:o(I)<I?v:n(I)<I?i(I)<I?_:x:r(I)<I?E:b)(I)}return u.invert=function(I){return new Date(f(I))},u.domain=function(I){return arguments.length?d(Array.from(I,oX)):d().map(iX)},u.ticks=function(I){var M=d();return t(M[0],M[M.length-1],I??10)},u.tickFormat=function(I,M){return M==null?D:l(M)},u.nice=function(I){var M=d();return(!I||typeof I.range!="function")&&(I=e(M[0],M[M.length-1],I??10)),I?d(H_(M,I)):u},u.copy=function(){return DN(u,pP(t,e,r,n,i,o,s,a,c,l))},u}function Oh(){return Wa.apply(pP(W_,q_,lr,ec,zn,jn,Za,Ka,un,Ch).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var J_=class t{constructor(e,r,n){S(this,"bandwidthPx");S(this,"stepPx");S(this,"d3");this.bandwidthPx=e,this.stepPx=r,this.d3=n}static fixedRow(e){return new t(e.bandwidth,e.step)}static forRows(e){let r=Array.from({length:e.count},(i,o)=>String(o)),n=su().domain(r).range(e.range).paddingInner(e.paddingInner??0).paddingOuter(e.paddingOuter??0);return new t(n.bandwidth(),n.step(),n)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(e){if(!this.d3)throw new Error("BandScale.forward is only available on closed-domain bands (BandScale.forRows)");let r=this.d3(e);if(r===void 0)throw new Error(`BandScale: unknown band id "${e}"`);return r}},sX={bandwidth:56,step:64};function hP(){return J_.fixedRow(sX)}var yu=class{constructor(e){S(this,"domain");S(this,"range");S(this,"pixelsPerDay");S(this,"calendar");S(this,"d3");this.domain=e.domain,this.range=e.range,this.calendar=e.calendar;let r=Math.max(1,vr(e.domain[0],e.domain[1]));this.pixelsPerDay=(e.range[1]-e.range[0])/r,this.d3=Oh().domain(e.domain).range(e.range)}forward(e){let r=vr(this.domain[0],e);return this.range[0]+r*this.pixelsPerDay}forwardWithinDomain(e){return e<this.domain[0]||e>this.domain[1]?null:this.forward(e)}invert(e){return this.d3.invert(e)}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};function Lh(t){return t.endsWith(":")?t.slice(0,-1):t}function mP(t,e){let n=t.roadmapDecl?.properties.find(c=>Lh(c.key)==="scale")?.value,i="weeks",o,s;if(n)if(n==="days"||n==="weeks"||n==="months"||n==="quarters"||n==="years")i=n;else{let c=/^(\d+)([dwmqy])$/.exec(n);if(c){let l=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=Dh(i)*l,s=1}}let a=s??WE[i]??4;if(e){let l=e.properties.find(m=>Lh(m.key)==="unit")?.value??i,u=e.properties.find(m=>Lh(m.key)==="label-every"),f=e.properties.find(m=>Lh(m.key)==="pixels-per-unit"),d=u?Math.max(1,parseInt(u.value,10)||a):a,p=f?Math.max(1,parseInt(f.value,10)||Dh(l)):o??Dh(l);return{unit:l,labelEvery:d,pixelsPerUnit:p}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Dh(i)}}function Dh(t){switch(t){case"days":return GE;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}function Q_(t,e,r,n=iu){let i=r.daysPerUnit(e.unit),o=i*t.pixelsPerDay,s=Math.max(1,Math.round(t.widthPx/t.pixelsPerDay)),a=Math.floor(s/i)+1,c=[];for(let l=0;l<a;l++){let u=l*i,f=t.originX+u*t.pixelsPerDay,d=l%e.labelEvery===0,p=l===a-1;c.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?aX(e.unit,Bi(t.domain[0],u),l,n):void 0})}return c}function aX(t,e,r,n){switch(t){case"days":return`${e.getUTCMonth()+1}/${e.getUTCDate()}`;case"weeks":{let i=e.toLocaleString(n,{month:"short",timeZone:"UTC"}),o=e.getUTCDate().toString().padStart(2,"0");return`${i} ${o}`}case"months":return e.toLocaleString(n,{month:"short",timeZone:"UTC"});case"quarters":{let i=Math.floor(e.getUTCMonth()/3)+1;return`${dh(n).quarterPrefix}${i} ${e.getUTCFullYear()}`}case"years":return`${e.getUTCFullYear()}`}}function gP(t){return{daysPerUnit:e=>eE(e,t),addUnits:(e,r,n)=>Bi(e,r*eE(n,t)),isWorkingDay:()=>!0}}function yP(t,e){return eE(t,e)}function eE(t,e){switch(t){case"days":return 1;case"weeks":return e.daysPerWeek;case"months":return e.daysPerMonth;case"quarters":return e.daysPerQuarter;case"years":return e.daysPerYear}}var tE=class{constructor(e,r){S(this,"id");S(this,"anchor");this.id=e,this.anchor=r}place(e,r){let n=le(this.anchor.properties,"date"),i=dt(n);if(!i)return null;let o=e.scale.forwardWithinDomain(i);if(o===null)return null;let s=st("anchor",this.anchor.properties,e.styleCtx),a=e.markerRowPlacements.get(this.id),c=a?.centerY??e.timeline.markerRow.y,l={x:o,y:c},u=a?.labelBox??{x:o+6+6,y:c-4,width:0,height:12},f=a?.labelSide??"right";return e.entityLeftEdges.set(this.id,o),e.entityRightEdges.set(this.id,o),e.entityMidpoints.set(this.id,l),{id:this.id,title:this.anchor.title??this.id,center:l,radius:6,style:s,predecessorPoints:[],cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f}}};function TP(t,e,r){let n=[];for(let[i,o]of t){let s=new tE(i,o).place(e,r);s&&n.push(s)}return n}function rc(t){let e=0;for(let r of t)e=Math.max(e,_P(r.children)),r.nested.length>0&&(e=Math.max(e,rc(r.nested)));return e}function _P(t){let e=0;for(let r of t)r.kind==="item"?e=Math.max(e,r.box.x+r.box.width):e=Math.max(e,_P(r.children));return e}function rE(t,e,r){let n=[],i=new Map,o=new Map;return[...t.entries()].sort(([c],[l])=>c.localeCompare(l)).forEach(([c,l],u)=>{let f=u+1;i.set(c,f),o.set(c,tt(l.properties,"on")),n.push({number:f,title:l.title??c,description:l.description?.text,style:st("footnote",l.properties,e.styleCtx)})}),{area:{box:{x:Sr,y:r+Sr,width:e.chartRightX-2*Sr,height:n.length===0?0:mc+n.length*gc+Sr},entries:n},index:i,hosts:o}}var cX=.8,lX=1;function uX(t){let e=[];return vP(t,e),e}function vP(t,e){for(let r of t)if(r.kind==="item"){let n=fX(r);n>0&&r.box.width>0&&e.push({startX:r.box.x,endX:r.box.x+r.box.width,load:n})}else(r.kind==="parallel"||r.kind==="group")&&vP(r.children,e)}function fX(t){return t.capacity?t.capacity.value:t.size?1:0}function bP(t){if(t.capacityValue<=0||t.warnFraction===null&&t.overFraction===null)return null;let e=uX(t.children);if(e.length===0)return null;let r=new Set;for(let s of e)r.add(s.startX),r.add(s.endX);let n=Array.from(r).sort((s,a)=>s-a);if(n.length<2)return null;let i=[];for(let s=0;s<n.length-1;s++){let a=n[s],c=n[s+1],l=(a+c)/2,u=0;for(let f of e)f.startX<=l&&l<f.endX&&(u+=f.load);i.push({startX:a,endX:c,load:u,classification:dX(u,t.capacityValue,t.warnFraction,t.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:t.capacityValue,warnFraction:t.warnFraction,overFraction:t.overFraction}}function dX(t,e,r,n){let i=t/e;return n!==null&&i>=n?"red":r!==null&&i>=r?"yellow":"green"}function wP(t,e){let r=e.get("swimlane"),n=EP(le(t.properties,"utilization-warn-at"),r?le(r.properties,"utilization-warn-at"):void 0,cX),i=EP(le(t.properties,"utilization-over-at"),r?le(r.properties,"utilization-over-at"):void 0,lX);return{warn:n,over:i}}function EP(t,e,r){let i=mX(t??e);return i.kind==="unset"?r:i.kind==="none"?null:i.value}var pX=/^\d+(?:\.\d+)?%$/,hX=/^\d+\.\d+$/;function mX(t){if(t===void 0)return{kind:"unset"};if(t==="none")return{kind:"none"};if(pX.test(t)){let e=parseFloat(t)/100;return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}if(hX.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}return{kind:"unset"}}var RP=10;function gX(t,e,r){let n=le(t.properties,"capacity"),i=Yn(n);if(i===null)return{capacity:null,badgeWidthPx:0};let o=lc(i),s=uc(e.capacityIcon,r),a=Wi(o,s,RP);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var yX=10,xX=38,TX=8;function _X(t,e,r){let n=t.title??t.name??"";if(!n)return 0;let i=le(t.properties,"owner");return Sc(0,n,i??void 0,e,r).rightX}function EX(t,e){if(!t.name)return[];let r=[];for(let[n,i]of e.footnoteHosts.entries())if(i.includes(t.name)){let o=e.footnoteIndex.get(n);o!==void 0&&r.push(o)}return r.sort((n,i)=>n-i),r}function vX(t,e,r,n){for(let i of t.content){if(i.$type==="DescriptionDirective")continue;let o=cr(i)?i.properties:i.properties??[];return n.resolveChildStart(o,e,e,r)}}var nc=class{constructor(e,r){S(this,"input");S(this,"deps");this.input=e,this.deps=r}get id(){return this.input.lane.name??""}place(e,r){let{lane:n,bandIndex:i}=this.input,{deps:o}=this,s=st("swimlane",n.properties,r.styleCtx),a=e.x,c=r.bandScale.step(),l=r.currentFlowKey;r.currentFlowKey=`lane:${n.name??i}`;let{capacity:u,badgeWidthPx:f}=gX(n,s,r.symbols),d=EX(n,r),p=d.length>0?o.estimateTextWidth(d.join(","),RP):0,m=_X(n,f,p),y=vX(n,a,r,o),v=!n.title||y===void 0||y>=m+TX,_=e.y+(v?yX:xX),x=new Ha({laneLeftX:a,originY:_,minRowHeight:c,slackCorridors:r.slackCorridors}),E=a,b=[];for(let R of n.content){if(R.$type==="DescriptionDirective")continue;if(!cr(R)){let we=R.properties??[],V=o.resolveChildStart(we,E,a,r),{rowIndex:G,y:oe}=x.placeBlock(),U=o.newCursor(V,oe),pe=o.sequenceOne(R,U,r);b.push(pe);let he=pe.box.x+pe.box.width,ge=Math.max(c,U.height);x.commitBlock({rowIndex:G,placed:pe,blockHeight:ge,blockEnd:he,spillReservation:Xu(pe)}),E=Math.max(E,he);continue}let O=R.properties,F=o.resolveChildStart(O,E,a,r),A=Ui(O,r.sizes,r.cal),k=Math.max(hr,A*r.timeline.pixelsPerDay),N=F+k,B=R.name??"",j=o.predictItemBarExtraHeight(R,r),W=c+j,{rowIndex:Q,y:J}=x.placeItem({childId:B,desiredStart:F,desiredEnd:N,predictedHeight:W}),ce=o.newCursor(F,J),K=o.sequenceItem(R,ce,r);b.push(K);let ie=K.box.x+K.box.width+rr;E=Math.max(E,ie);let ue=null;(K.textSpills||K.chipsOutside||K.dotSpills||K.iconSpills||K.footnoteSpills)&&(ue=Math.max(K.decorationsRightX,K.chipsOutside?K.chipsRightX:0)+6),x.commitItem({rowIndex:Q,placed:K,logicalEnd:ie,spillReservation:ue,rowHeight:Math.max(W,c+(K.box.height-r.bandScale.bandwidth()))})}let D=_-e.y,I=Math.max(c+32,D+x.usedHeight()+16),M=Math.max(x.usedRightX(),m),H={x:0,y:e.y,width:r.chartRightX,height:I},Y=le(n.properties,"owner"),re;if(Y){let R=r.teams.get(Y),O=r.persons.get(Y);re=R?.title??O?.title??Y}let $=u?(()=>{let{warn:R,over:O}=wP(n,r.styleCtx.defaults);return bP({children:b,capacityValue:u.value,warnFraction:R,overFraction:O})})():null;return r.currentFlowKey=l,{positioned:{id:n.name,title:n.title??n.name??"",box:H,bandIndex:i,children:b,nested:[],style:s,owner:re,footnoteIndicators:d,capacity:u,utilization:$},usedHeight:I,usedRightX:M}}};var bX=18,wX=14,RX=14,AX=16,SX=32;function AP(t,e,r,n){let i=r+bX,o=[],s=!0;for(let a of t){s||(i+=AX),s=!1;let c=a.content.roadmap?.title??a.sourcePath,l=i+wX,u={cal:e.cal,styleCtx:{theme:e.styleCtx.theme,styles:a.config.styles,defaults:a.config.defaults,labels:a.content.labels},sizes:uh(a.content.sizes,e.cal),labels:a.content.labels,teams:a.content.teams,persons:a.content.persons,symbols:a.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:e.timeline,scale:e.scale,calendar:e.calendar,bandScale:e.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:"",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:new Map,chartTopY:l,chartBottomY:l,swimlaneBottomY:l,chartRightX:e.chartRightX,nextParallelId:0,nextGroupId:0},f=[],d=l,p=0;for(let I of a.content.swimlanes.values()){u.nextParallelId=0,u.nextGroupId=0;let{positioned:M,usedHeight:H}=new nc({lane:I,bandIndex:p},n).place({x:u.timeline.originX,y:d},u);f.push(M),d+=H,p++}let m=d,y=Math.max(e.bandScale.bandwidth(),m-i+RX),v=0,{chromeRightX:_}=Ic(v,c,a.sourcePath),x=rc(f),E=Math.max(_,x)+SX,b=Math.min(e.chartRightX-v,E-v),D={x:v,y:i,width:b,height:y};for(let I of f)I.box.width=b;o.push({sourcePath:a.sourcePath,label:c,box:D,nestedSwimlanes:f,style:st("swimlane",[],e.styleCtx)}),i+=y}return{regions:o,endY:i}}function Fh(t,e){let r=[];for(let n of t){let o=e.entityVisualRightX.get(n)??e.entityRightEdges.get(n);if(o===void 0)continue;let s=e.itemSlackAttachY.get(n)??e.entityMidpoints.get(n)?.y??0,a=e.itemFlowKey.get(n)??`marker:${n}`;r.push({ref:n,x:o,y:s,flowKey:a})}return r}function Uh(t){let e=new Map;for(let r of t){let n=e.get(r.flowKey);(!n||r.x>n.x)&&e.set(r.flowKey,r)}return Array.from(e.values())}function SP(t,e,r,n,i,o,s,a){let c=n.length*i*.58*(o?1.05:1),l=t+r+6,u=t-r-6-c,f=l+c<=a,d=u>=s,p=f?"right":d?"left":"right";return{box:{x:p==="right"?l:u,y:e-4,width:c,height:12},side:p}}var nE=class{constructor(e,r){S(this,"id");S(this,"milestone");this.id=e,this.milestone=r}place(e){let r=this.milestone,n=st("milestone",r.properties,e.styleCtx),i=le(r.properties,"date"),o=tt(r.properties,"after"),s=dt(i),a=e.timeline.markerRow.y,c=6,l=r.title??this.id,u=null,f=a,d=null,p="right",m=!1,y,v=!1;if(s){let x=e.scale.forwardWithinDomain(s);if(x===null)return null;u=x,m=!0;let E=e.markerRowPlacements.get(this.id);E&&(f=E.centerY,d=E.labelBox,p=E.labelSide);let b=Fh(o,e),D=Uh(b),I=null;for(let M of D)(!I||M.x>I.x)&&(I=M);I&&I.x>x&&(v=!0,y=[{x:I.x,y:I.y>0?I.y:f}])}else if(o.length>0){let x=Fh(o,e),E=Uh(x);E.sort((M,H)=>H.x-M.x);let b=E[0]?.x??e.timeline.originX;u=b,m=!1;let D=SP(u,a,c,l,10,!0,e.timeline.box.x,e.chartRightX);f=a,d=D.box,p=D.side,e.markerRowPlacements.set(this.id,{rowIndex:0,centerY:f,labelBox:d,labelSide:p});let I=[];for(let M=1;M<E.length;M++){let H=E[M];H.x<b&&H.y>0&&I.push({x:H.x,y:H.y})}I.length>0&&(y=I)}if(u===null)return null;if(!d){let x=SP(u,f,c,l,10,!0,e.timeline.box.x,e.chartRightX);d=x.box,p=x.side}let _={x:u,y:f};return e.entityLeftEdges.set(this.id,_.x),e.entityRightEdges.set(this.id,_.x),e.entityMidpoints.set(this.id,_),{id:this.id,title:l,center:_,radius:c,fixed:m,slackArrows:y,isOverrun:v,style:n,cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,labelBox:d,labelSide:p}}};function IP(t,e){let r=[];for(let[n,i]of t){let o=new nE(n,i).place(e);o&&r.push(o)}return r}var kX=4;function NP(t,e){e>t.chartRightX&&(t.chartRightX=e)}var Xh=class{place(e,r,n,i){let o=n.theme??"light",s=v_[o],a=n.width??1280,c=eN(n.locale,CX(e)),l=Yk(e,r.config.calendar),u=mP(e,r.config.scale),f=uh(r.content.sizes,l),d={theme:s,styles:r.config.styles,defaults:r.config.defaults,labels:r.content.labels},{startDate:p,endDate:m}=i.computeDateWindow(e,{cal:l,sizes:f},r,n.today,u),y=st("roadmap",e.roadmapDecl?.properties??[],d),v=y.headerPosition==="beside",_=y.timelinePosition!=="bottom",x=y.timelinePosition==="bottom"||y.timelinePosition==="both",E=e.roadmapDecl?.title??e.roadmapDecl?.name??"",b=le(e.roadmapDecl?.properties??[],"author"),D=i.sizeBesideHeader(E,b),I=v?{x:0,y:0,width:D.boxWidth,height:0}:{x:0,y:0,width:0,height:Pu},M=v?D.boxWidth:0,H=v?8:Pu+8,Y=gP(l),re=u.pixelsPerUnit/Y.daysPerUnit(u.unit),$=Math.max(1,vr(p,m)),R=$*re,O=M+mr,F=R,A=M+mr+F+mr,k=Math.min(a,A),N=n.today!==void 0&&n.today>=p&&n.today<=m,B=r.content.anchors.size+r.content.milestones.size>0,j=N?Kn:0,W=_?fc:0,Q=new yu({domain:[p,m],range:[O,O+R],calendar:Y}),J=Math.max(k,O+F+mr),ce=[];for(let[X,ne]of r.content.anchors){let xe=dt(le(ne.properties,"date"));if(!xe)continue;let pr=Q.forwardWithinDomain(xe);pr!==null&&ce.push({id:X,centerX:pr,radius:6,title:ne.title??X,fontSize:10,bold:!1,date:xe,isMilestone:!1})}for(let[X,ne]of r.content.milestones){let xe=dt(le(ne.properties,"date"));if(!xe)continue;let pr=Q.forwardWithinDomain(xe);pr!==null&&ce.push({id:X,centerX:pr,radius:6,title:ne.title??X,fontSize:10,bold:!0,date:xe,isMilestone:!0})}let K=PP(ce,M,J,i.estimateTextWidth),ie=B?Math.max(1,K.rowCount):0,ue=ie*26,Ee=j+W+ue,we=Ee+8,V=v?D.cardHeight+kX:0,G=Math.max(H,V-Ee),oe=G+j,U=oe+W,pe=U+ue,he=Q_(Q,u,Y,c),ge={box:{x:O,y:G,width:R,height:0},ticks:he,pixelsPerDay:re,originX:O,startDate:p,endDate:m,labelStyle:st("roadmap",[],d),pillRowHeight:j,tickPanelY:oe,tickPanelHeight:W,markerRow:{y:U+13,height:ue,collisionY:U-8},minorGrid:y.minorGrid},De=new Map;for(let[X,ne]of K.placements){let xe=U+13+ne.rowIndex*26;De.set(X,{rowIndex:ne.rowIndex,centerY:xe,labelBox:{...ne.labelBox,y:xe-4},labelSide:ne.labelSide})}let q={cal:l,styleCtx:d,sizes:f,labels:r.content.labels,teams:r.content.teams,persons:r.content.persons,symbols:r.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:ge,scale:Q,calendar:Y,bandScale:hP(),entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:"",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:De,chartTopY:G+we,chartBottomY:0,swimlaneBottomY:0,chartRightX:J,nextParallelId:0,nextGroupId:0};for(let X of ce){let ne=De.get(X.id);ne&&(q.entityLeftEdges.set(X.id,X.centerX),q.entityRightEdges.set(X.id,X.centerX),q.entityMidpoints.set(X.id,{x:X.centerX,y:ne.centerY}))}let It=rE(r.content.footnotes,q,0);q.footnoteIndex=It.index,q.footnoteHosts=It.hosts;let oc=new Map(q.entityLeftEdges),wr=new Map(q.entityRightEdges),Rr=new Map(q.entityMidpoints),qo=[...r.content.swimlanes.values()],sc=st("swimlane",[],d),Ar=BE[sc.spacing]??0,dn=()=>{q.nextParallelId=0,q.nextGroupId=0;let X=[],ne=q.chartTopY,xe=0,pr=q.timeline.originX;for(let HC of qo){xe>0&&(ne+=Ar);let{positioned:jC,usedHeight:zC,usedRightX:$E}=new nc({lane:HC,bandIndex:xe},i).place({x:q.timeline.originX,y:ne},q);X.push(jC),ne+=zC,$E>pr&&(pr=$E),xe++}return{swimlanes:X,nextY:ne,maxRightX:pr}},fr=dn(),dr=fr.swimlanes,pn=fr.nextY,Qt=NX(r.content.milestones,q);Qt.length>0&&(q.entityLeftEdges=new Map(oc),q.entityRightEdges=new Map(wr),q.entityMidpoints=new Map(Rr),q.itemSlackAttachY=new Map,q.entityVisualLeftX=new Map,q.entityVisualRightX=new Map,q.itemArrowSource=new Map,q.itemFlowKey=new Map,q.currentFlowKey="",q.slackCorridors=Qt,fr=dn(),dr=fr.swimlanes,pn=fr.nextY),NP(q,fr.maxRightX+mr);for(let X of dr)X.box.width=q.chartRightX;let T=r.content.isolatedRegions,C=[];if(T.length>0){let X=AP(T,q,pn+8,i);C=X.regions,pn=X.endY}q.chartBottomY=pn,q.swimlaneBottomY=pn,ge.box.height=q.chartBottomY-ge.box.y;let z=IP(r.content.milestones,q),Z=rc(dr);for(let X of C)Z=Math.max(Z,rc(X.nestedSwimlanes));for(let X of ce)Z=Math.max(Z,X.centerX+X.radius);for(let X of z)Z=Math.max(Z,X.center.x+X.radius);let ye=Y.daysPerUnit(u.unit),He=(Z-O)/re,fe=He>0?Math.ceil(He/ye)*ye:0;if(fe>$){let X=Bi(p,fe),ne=fe*re,xe=new yu({domain:[p,X],range:[O,O+ne],calendar:Y});q.scale=xe,ge.endDate=X,ge.box.width=ne,ge.ticks=Q_(xe,u,Y,c),NP(q,O+ne+mr)}let Me=ce.map(X=>({id:X.id,centerX:X.centerX,radius:X.radius,title:X.title,fontSize:X.fontSize,bold:X.bold}));for(let X of z)X.fixed||Me.push({id:X.id??"",centerX:X.center.x,radius:X.radius,title:X.title,fontSize:10,bold:!0});let at=PP(Me,M,q.chartRightX,i.estimateTextWidth);q.markerRowPlacements.clear();for(let[X,ne]of at.placements){let xe=U+13+ne.rowIndex*26;q.markerRowPlacements.set(X,{rowIndex:ne.rowIndex,centerY:xe,labelBox:{...ne.labelBox,y:xe-4},labelSide:ne.labelSide})}for(let X of z){let ne=q.markerRowPlacements.get(X.id??"");ne&&(X.center={x:X.center.x,y:ne.centerY},X.labelBox=ne.labelBox,X.labelSide=ne.labelSide)}for(let X of ce){let ne=q.markerRowPlacements.get(X.id);ne&&q.entityMidpoints.set(X.id,{x:X.centerX,y:ne.centerY})}for(let X of z)X.fixed||q.entityMidpoints.set(X.id??"",{x:X.center.x,y:X.center.y});let Be=B?Math.max(1,at.rowCount):0;if(Be>ie){let X=(Be-ie)*26;q.timeline.markerRow.height=Be*26,q.timeline.box.height+=X,q.chartTopY+=X,q.chartBottomY+=X,q.swimlaneBottomY+=X;for(let ne of dr)iE(ne,X);for(let ne of C)PX(ne,X);for(let[ne,xe]of q.entityMidpoints)q.markerRowPlacements.has(ne)||q.entityMidpoints.set(ne,{x:xe.x,y:xe.y+X});for(let[ne,xe]of q.itemSlackAttachY)q.itemSlackAttachY.set(ne,xe+X);for(let[ne,xe]of q.itemArrowSource)q.itemArrowSource.set(ne,{x:xe.x,y:xe.y+X});for(let ne of z)if(ne.cutTopY=q.chartTopY,ne.cutBottomY=q.swimlaneBottomY,ne.slackArrows)for(let xe of ne.slackArrows)xe.y+=X}x&&(q.timeline.bottomTickPanelY=q.chartBottomY+8,q.timeline.bottomTickPanelHeight=fc,q.chartBottomY+=8+fc);let je=new Set(z.map(X=>X.center.x)),At=TP(r.content.anchors,q,je),er=i.collectItems(qo),tr=i.buildDependencies(er,dr,C,q),kt=i.buildNowline(n.today,q,c),mt=rE(r.content.footnotes,q,q.chartBottomY);q.footnoteIndex=mt.index,q.footnoteHosts=mt.hosts,I.height=I.height||q.chartBottomY,v||(I.width=q.chartRightX);let ac=v?{x:6,y:pe-D.cardHeight,width:D.cardWidth,height:D.cardHeight}:{x:0,y:0,width:q.chartRightX,height:Pu},Zh=mt.area.entries.length>0?mt.area.box.y+mt.area.box.height:q.chartBottomY,Vo={x:q.chartRightX-mr-pm,y:Zh+mr,width:pm,height:zE},ME=Vo.y+Vo.height+mr,Re={box:I,position:y.headerPosition,title:E,author:b,titleLines:D.titleLines,authorLines:D.authorLines,cardBox:ac,logo:void 0,style:y,attributionBox:Vo};return{width:q.chartRightX,height:ME,theme:o,palette:s,backgroundColor:s.surface.page,header:Re,timeline:ge,nowline:kt,swimlanes:dr,anchors:At,milestones:z,edges:tr,footnotes:mt.area,includes:C,chartBox:{x:M,y:q.chartTopY,width:q.chartRightX-M,height:q.chartBottomY-q.chartTopY}}}};function NX(t,e){let r=[];for(let[n,i]of t){let o=le(i.properties,"date"),s=tt(i.properties,"after"),a=dt(o),c=Fh(s,e),l=Uh(c);if(a){let f=e.scale.forwardWithinDomain(a);if(f===null)continue;let d=null;for(let p of l)(!d||p.x>d.x)&&(d=p);d&&d.x>f&&d.y>0&&r.push({xStart:Math.min(d.x,f),xEnd:Math.max(d.x,f),y:d.y,slackPredId:d.ref,milestoneId:n});continue}if(l.length===0)continue;l.sort((f,d)=>d.x-f.x);let u=l[0].x;for(let f=1;f<l.length;f++){let d=l[f];d.x<u&&d.y>0&&r.push({xStart:d.x,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:n})}}return r}function iE(t,e){t.box.y+=e;for(let r of t.children)CP(r,e);for(let r of t.nested)iE(r,e)}function CP(t,e){if(t.box.y+=e,t.kind==="item"){t.overflowBox&&(t.overflowBox.y+=e);for(let r of t.labelChips)r.box.y+=e;return}for(let r of t.children)CP(r,e)}function PX(t,e){t.box.y+=e;for(let r of t.nestedSwimlanes)iE(r,e)}function PP(t,e,r,n){let i=[...t].sort((a,c)=>a.centerX-c.centerX),o=new Map,s=[];for(let a of i){let c=n(a.title,a.fontSize)*(a.bold?1.05:1),l=a.centerX+a.radius+6,u=a.centerX-a.radius-6-c,f=l+c<=r,d=u>=e,p=a.centerX-a.radius,m=a.centerX+a.radius,y=M=>M==="right"?l:u,v=M=>M==="right"?f:d,_=(M,H)=>{let Y=Math.min(p,M),re=Math.max(m,M+c);return s[H].some($=>$.left<re&&$.right>Y)},x=-1,E="right",b=l;e:for(let M=s.length-1;M>=0;M--)for(let H of["right","left"]){if(!v(H))continue;let Y=y(H);if(!_(Y,M)){x=M,E=H,b=Y;break e}}if(x===-1){for(let[M,H]of o)o.set(M,{...H,rowIndex:H.rowIndex+1});s=[[],...s],x=0,E=f?"right":"left",b=y(E)}let D=Math.min(p,b),I=Math.max(m,b+c);s[x].push({left:D,right:I}),o.set(a.id,{rowIndex:x,labelBox:{x:b,y:0,width:c,height:12},labelSide:E})}return{placements:o,rowCount:s.length}}function CX(t){return t.directive?.properties.find(r=>OX(r.key)==="locale")?.value}function OX(t){return t.endsWith(":")?t.slice(0,-1):t}function LX(t){switch(t){case"done":case"completed":return"done";case"in-progress":case"active":return"in-progress";case"at-risk":case"blocked":case"planned":return t;case void 0:return"planned";default:return"neutral"}}function DX(t){if(!t)return 0;let e=/^(\d{1,3})%$/.exec(t);return e?Math.max(0,Math.min(100,parseInt(e[1],10)))/100:0}function MX(t,e){if(t)return/^\d+(?:\.\d+)?[dwmqy]$/.test(t)||/^\d+%$/.test(t)?t:e.sizes.get(t)?.effortLiteral??t}function $X(t,e){if(t)return e.teams.get(t)?.title??e.persons.get(t)?.title??t}function FX(t){if(!t)return{icon:"none"};let e=t.toLowerCase();return e.includes("linear.app")?{icon:"linear",href:t}:e.includes("github.com")?{icon:"github",href:t}:e.includes("atlassian.net")||e.includes("jira.")?{icon:"jira",href:t}:{icon:"generic",href:t}}function Gh(t,e,r,n,i){let o=aN(t,e),s=t.name??t.title??"",a=o.padding==="none"?"xs":o.padding,c=XE[a],l=Math.max(20,Math.round(s.length*5.5+c*2));return i!==void 0&&(l=Math.min(l,i)),{text:s,style:o,box:{x:r,y:n,width:l,height:Qi}}}function DP(t,e){let r=Zk(t,e.sizes,e.cal),n=Kk(le(t,"remaining"),e.sizes,e.cal),i=le(t,"status"),o=LX(i),s=DX(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(le(t,"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"&&n>0&&r>0&&(s=Math.max(0,Math.min(1,1-n/r))),{status:o,progress:s}}function MP(t,e,r,n,i,o,s){let a=le(t,"duration"),c=!!a&&/^\d+(?:\.\d+)?[dwmqy]$/.test(a),l=n?n.title??n.name:"",u=c?a:l||void 0,f=le(t,"remaining"),d=MX(f,e),p=$X(r??le(t,"owner"),e),m=()=>[u,p].filter(Boolean).join(" "),y;if(i==="in-progress"&&d){let b=m();y=b?`${b} \u2014 ${d} remaining`:`${d} remaining`}else if(i==="in-progress"&&o>0&&o<1){let b=Math.round((1-o)*100),D=m();y=D?`${D} \u2014 ${b}% remaining`:`${b}% remaining`}else(p||u)&&(y=m()||void 0);let v=le(t,"capacity"),_=Yn(v),x=null,E=0;if(_!==null){let b=lc(_),D=uc(s,e.symbols);x={value:_,text:b,icon:D};let I=11;E=(y?St(" ",I):0)+Wi(b,D,I)}return{metaText:y,ownerDisplay:p,capacity:x,capacityTrailingWidth:E}}function $P(t,e){let r=new Set;if(t){for(let[n,i]of e.footnoteHosts.entries())if(i.includes(t)){let o=e.footnoteIndex.get(n);o!==void 0&&r.add(o)}}return[...r].sort((n,i)=>n-i)}function FP(t,e,r){return wc({barWidth:t,footnoteLabels:e.map(String),hasBeforeGlyph:br(r)!==void 0})}function uE(t,e,r,n){let i=t.properties,o=st("item",i,r.styleCtx),s=le(i,"size"),a=s?r.sizes.get(s)??null:null,c=Ui(i,r.sizes,r.cal),l=tt(i,"after"),u=tt(i,"before"),f=le(i,"date"),d=e.x,p=dt(f);if(p){let Re=r.scale.forwardWithinDomain(p);Re!==null&&(d=Re)}else if(l.length>0){let Re=e.x;for(let Nt of l){let X=dt(Nt);if(X){let xe=r.scale.forwardWithinDomain(X);xe!==null&&(Re=Math.max(Re,xe));continue}let ne=r.entityRightEdges.get(Nt);ne!==void 0&&(Re=Math.max(Re,ne))}d=Math.max(e.x,Re)}let m=Math.max(hr,c*r.timeline.pixelsPerDay),y=d,v=d+m,_=le(i,"link"),x=FX(_),E=x.icon!=="none",b=Math.max(hr,m-2*rr),D=tt(i,"labels"),I=[];for(let Re of D){let Nt=r.labels.get(Re);if(!Nt)continue;let X=Gh(Nt,r.styleCtx,0,0);I.push({id:Nt,width:X.box.width})}let M=0;for(let Re=0;Re<I.length;Re+=1)Re>0&&(M+=xn),M+=I[Re].width;let H=Math.max(0,b-2*qr),Y=I.length>0&&M>H,re=!1,$,R;if(u.length>0){let Re,Nt;for(let X of u){let ne=dt(X),xe=ne?r.scale.forwardWithinDomain(ne)??void 0:r.entityLeftEdges.get(X);xe!==void 0&&(Re===void 0||xe<Re)&&(Re=xe,Nt=X)}Re!==void 0&&v>Re&&(re=!0,$={x:Re,y:e.y,width:v-Re,height:r.bandScale.bandwidth()},R=Nt)}let{status:O,progress:F}=DP(i,r),A={done:"#ecfdf5","in-progress":"#eff6ff","at-risk":"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},k={done:"#052e16","in-progress":"#172554","at-risk":"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},N={done:"#ebebeb","in-progress":"#e4e4e4","at-risk":"#eeeeee",blocked:"#dcdcdc",planned:"#f5f5f5",neutral:"#f5f5f5"},B={done:r.styleCtx.theme.status.done,"in-progress":r.styleCtx.theme.status.inProgress,"at-risk":r.styleCtx.theme.status.atRisk,blocked:r.styleCtx.theme.status.blocked,planned:r.styleCtx.theme.status.planned,neutral:r.styleCtx.theme.status.neutral},j=r.styleCtx.theme.name,W=j==="dark",Q=W?"#0f172a":"#ffffff",J=j==="grayscale"?"#9e9e9e":"#94a3b8";o.bg===Q&&(o.bg=j==="grayscale"?N[O]:W?k[O]:A[O]),o.fg===J&&(o.fg=B[O]);let{metaText:ce,ownerDisplay:K,capacity:ie,capacityTrailingWidth:ue}=MP(i,r,n,a,O,F,o.capacityIcon),Ee=t.title??t.name??"",we=$P(t.name,r),V=new yh({id:t.name??"",title:Ee,logicalLeftX:y,logicalRightX:v,metaText:ce,metaTrailingWidth:ue,hasLinkIcon:E,hasAfterGlyph:br(l)!==void 0,titleFirstLineRightReservePx:FP(b,we,u)}).place({x:y,y:e.y},{time:r.scale,bands:r.bandScale,style:o}),G=V.box,oe=r.bandScale.bandwidth(),U=G.width<Qo,pe=E&&G.width<Fu,he=G.width<Uu,ge=V.textSpills||pe,De=S_(Ee,V,pe),q=De.length,It=null;Y&&(It=Rm(I,G.width));let oc=It?It.rows.length:I.length>0?1:0,wr=ce!==void 0||ie!==null,Rr=vc(q,wr),qo=$u(q,wr),sc=BP(Y,ge,oc,oe,Rr),Ar=Math.max(qo,sc);Ar>0&&(G.height=oe+Ar);let dn=[],fr=G.y+oe-Wr-Qi-ei,dr=G.y+(Y&&ge?Math.max(Zo,Rr):Rr)+ei,Qt=Y&&ge||!Y&&I.length>0?Math.max(fr,dr):fr,T=Y?G.x+G.width+gn:G.x+qr,C=T;if(It)for(let Re=0;Re<It.rows.length;Re+=1){let Nt=Qt+Re*wm,X=T;for(let xe of It.rows[Re]){let pr=Gh(xe.id,r.styleCtx,X,Nt);dn.push(pr),X+=pr.box.width+xn}let ne=X-xn;ne>C&&(C=ne)}else{let Re=T;for(let Nt of I){let X=Gh(Nt.id,r.styleCtx,Re,Qt);dn.push(X),Re+=X.box.width+xn}C=I.length>0?Re-xn:T}let z=K??n??le(i,"owner"),Z=t.description?.text,ye=we.length>0&&he,fe=G.x+G.width+gn,Me=!1,at=null;pe&&(Me&&(fe+=gr),at=fe,fe=at+yn,Me=!0);let Be=0;if(ge){Me&&(fe+=gr);let Re=Math.max(...De.map(X=>St(X,_c))),Nt=(ce?St(ce,11):0)+ue;Be=Math.max(Re,Nt),fe+=Be,Me=!0}let je=null;ye&&(Me&&(fe+=gr),je=fe,fe+=we.length*Jn,Me=!0);let At=null;U&&(Me&&(fe+=gr),At=fe+Vr,fe=At+Vr,Me=!0);let er=Math.max(G.x+G.width,fe),tr=t.name;tr&&(r.entityLeftEdges.set(tr,y),r.entityRightEdges.set(tr,v));let kt=tr??UP(t),mt=G.y+oe/2;r.entityMidpoints.set(kt,{x:(y+v)/2,y:ge?G.y+G.height/2:mt}),r.entityVisualLeftX.set(kt,G.x),r.entityVisualRightX.set(kt,G.x+G.width);let ac=ge?{x:G.x+G.width,y:G.y+G.height-Wr/2}:{x:G.x+G.width,y:mt};r.itemArrowSource.set(kt,ac),r.itemFlowKey.set(kt,r.currentFlowKey);let Zh=ge?G.y+G.height-Wr/2:G.y+G.height/2;r.itemSlackAttachY.set(kt,Zh),e.x=v,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,r.bandScale.step()+Ar);let Vo=tN({box:G,afterDate:br(l),beforeDate:br(u),hasLinkIcon:E,footnoteCount:we.length});return{kind:"item",id:tr,title:Ee,...De.length>=2||De[0]!==Ee?{titleLines:De}:{},box:G,status:O,progressFraction:F,footnoteIndicators:we,labelChips:dn,chipsOutside:Y,chipsRightX:C,linkIcon:x.icon,linkHref:x.href,hasOverflow:re,overflowBox:$,overflowAnchorId:R,owner:z,description:Z,metaText:ce,textSpills:ge,dotSpills:U,iconSpills:pe,footnoteSpills:ye,dotSpillCx:At,iconSpillX:at,footnoteSpillStartX:je,decorationsRightX:er,capacity:ie,size:a,style:o,inlineDatePins:Vo.length>0?Vo:void 0}}function UX(t,e,r){return new xh(t,{sequenceOne:fE,newCursor:hh}).place(e,r)}function BX(t,e,r){return new mh(t,{sequenceItem:uE,sequenceOne:fE,resolveChildStart:GP,newCursor:hh,estimateTextWidth:St,predictItemBarExtraHeight:XP}).place(e,r)}function fE(t,e,r){if(cr(t))return uE(t,e,r);if(Xr(t))return UX(t,e,r);if(Br(t))return BX(t,e,r);throw new Error(`Unknown swimlane child type: ${t.$type??"unknown"}`)}function UP(t){let e=t.$cstNode?.range.start;return`#item@${e?e.line+1:0}:${e?e.character+1:0}`}function BP(t,e,r,n,i){if(r===0)return 0;let o=n-Wr-Qi-ei,s;t&&e?s=Math.max(Zo,i)+ei:t?s=o:s=Math.max(o,i+ei);let c=s+(r-1)*wm+Qi+ei+Wr;return Math.max(0,c-n)}function XP(t,e){let r=t.properties,n=e.bandScale.bandwidth(),i=Ui(r,e.sizes,e.cal),o=Math.max(hr,i*e.timeline.pixelsPerDay),s=Math.max(hr,o-2*rr),a=le(r,"size"),c=a?e.sizes.get(a)??null:null,{status:l,progress:u}=DP(r,e),{metaText:f,capacity:d,capacityTrailingWidth:p}=MP(r,e,void 0,c,l,u,st("item",r,e.styleCtx).capacityIcon),m=f!==void 0||d!==null,y=!!le(r,"link"),v=t.title??t.name??"",_=br(tt(r,"after"))!==void 0,x=Qn(y,_?{barWidth:s}:void 0),E=Math.max(0,s-x-qr),b=Math.max(0,s-x-FP(s,$P(t.name,e),tt(r,"before"))),D=A_(v,E,R_(f,p),b),I=y&&s<Fu,M=D.textSpills||I,H=S_(v,D,I).length,Y=$u(H,m),re=tt(r,"labels"),$=[];for(let B of re){let j=e.labels.get(B);if(!j)continue;let W=Gh(j,e.styleCtx,0,0);$.push({id:j,width:W.box.width})}if($.length===0)return Y;let R=0;for(let B=0;B<$.length;B+=1)B>0&&(R+=xn),R+=$[B].width;let O=Math.max(0,s-2*qr),F=R>O,A=F?Rm($,s):null,k=A?A.rows.length:1,N=BP(F,M,k,n,vc(H,m));return Math.max(Y,N)}function GP(t,e,r,n){let i=dt(le(t,"date"))??dt(le(t,"start"));if(i){let s=n.scale.forwardWithinDomain(i);if(s!==null)return s}let o=tt(t,"after");if(o.length>0){let s=r;for(let a of o){let c=dt(a);if(c){let u=n.scale.forwardWithinDomain(c);u!==null&&(s=Math.max(s,u));continue}let l=n.entityRightEdges.get(a);l!==void 0&&(s=Math.max(s,l))}return Math.max(r,s)}return e}var oE=6;function XX(t,e){let r=cm-32,n=Tc(t,r,16),i=Tc(e??"",r,11),o=0;for(let d of n)o=Math.max(o,St(d,16));for(let d of i)o=Math.max(o,St(d,11));let s=o+32,a=Math.max(HE-oE,Math.min(cm-oE,s)),c=n.length>0?(n.length-1)*20:0,l=i.length>0?18+(i.length-1)*14:0,u=26+c+l+14,f=a+oE;return{titleLines:n,authorLines:i,cardWidth:a,cardHeight:u,boxWidth:f}}function GX(t,e,r,n,i){let s=t.roadmapDecl?.properties??[],a=le(s,"start"),c=dt(a)??HX(n),l=le(s,"length"),u=0;if(l){let y=jX(l,e.cal);y>0&&(u=y)}let f=HP(r,e,c,u>0?void 0:n),d=yP(i.unit,e.cal),p=f>0?Math.ceil(f/d)*d:4*e.cal.daysPerWeek,m=Math.max(u,p);return{startDate:c,endDate:Bi(c,Math.max(1,m))}}function HX(t){let e=t??new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function jX(t,e){let r=/^(\d+(?:\.\d+)?)([dwmqy])$/.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case"d":return n;case"w":return n*e.daysPerWeek;case"m":return n*e.daysPerMonth;case"q":return n*e.daysPerQuarter;case"y":return n*e.daysPerYear;default:return 0}}function HP(t,e,r,n){let i=new Map,o=new Map,s=new Map,a=0,c=f=>{let d=dt(f);return d?vr(r,d):i.has(f)?i.get(f):o.has(f)?o.get(f):s.has(f)?s.get(f):0};for(let f of t.content.anchors.values()){let d=dt(le(f.properties,"date"));if(d&&f.name){let p=vr(r,d);o.set(f.name,p),a=Math.max(a,p)}}let l=(f,d)=>{let p=d;for(let m of f)m.$type!=="DescriptionDirective"&&(p=u(m,p),a=Math.max(a,p));return p},u=(f,d)=>{if(cr(f)){let p=Ui(f.properties,e.sizes,e.cal),m=dt(le(f.properties,"date")),y=dt(le(f.properties,"start")),v=tt(f.properties,"after"),_=d;m?_=vr(r,m):y?_=vr(r,y):v.length>0&&(_=Math.max(d,...v.map(c)));let x=_+p;return f.name&&i.set(f.name,x),x}if(Xr(f)){let p=tt(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d,y=m;for(let v of f.content){if(v.$type==="DescriptionDirective")continue;let _=u(v,m);y=Math.max(y,_)}return y}if(Br(f)){let p=tt(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d;return l(f.content,m)}return d};for(let f of t.content.swimlanes.values())l(f.content,0);for(let f of t.content.milestones.values()){let d=dt(le(f.properties,"date"));if(d){let m=vr(r,d);f.name&&s.set(f.name,m),a=Math.max(a,m);continue}let p=tt(f.properties,"after");if(p.length>0){let m=Math.max(0,...p.map(c));f.name&&s.set(f.name,m),a=Math.max(a,m)}}for(let f of t.content.isolatedRegions){let d=HP({config:f.config,content:f.content,diagnostics:[],processedFiles:new Set},e,r,void 0);a=Math.max(a,d)}if(n){let f=vr(r,n);f>0&&(a=Math.max(a,f))}return a}function zX(t,e,r,n){let i=new fh(Jk(e,r)),o=[],s=[];for(let[l,u]of t){let f=tt(u.properties,"after"),d=n.entityMidpoints.get(l),p=n.entityVisualLeftX.get(l);if(!d||p===void 0)continue;let m={x:p,y:d.y};for(let y of f){let v=n.itemArrowSource.get(y),_,x=v===void 0;if(v)_=v;else{let E=n.entityMidpoints.get(y);if(!E)continue;_={x:E.x,y:d.y}}!x&&Math.abs(_.y-m.y)<.5&&m.x-_.x<20||(o.push({fromId:y,toId:l,from:_,to:m,isMarkerSource:x}),s.push({fromId:y,toId:l}))}}let a=Qk(o,i),c=[];for(let l=0;l<a.length;l++){let u=a[l];c.push({fromId:s[l].fromId,toId:s[l].toId,waypoints:u.waypoints,kind:u.underBar?"underBar":"normal",style:st("item",[],n.styleCtx)})}return c}function WX(t,e,r){if(!t)return null;let n=e.scale.forwardWithinDomain(t);if(n===null)return null;let i=e.timeline.box.y,o=e.timeline.tickPanelY,s=dh(r).nowLabel,a=St(s,hc),c=Math.max(om,Math.ceil(a+2*Ko)),l=e.timeline.originX-mr,u=c/2,f;n-u<l?f="flag-right":n+u>e.chartRightX?f="flag-left":f="center";let d=e.timeline.bottomTickPanelY,p=e.timeline.bottomTickPanelHeight??0,m=d!==void 0&&p>0?d+p:e.swimlaneBottomY;return{x:n,topY:o,bottomY:m,pillTopY:i,pillMode:f,label:s,pillWidth:c,style:st("item",[],e.styleCtx)}}function qX(t){let e=new Map,r=n=>{if(cr(n)){e.set(n.name??UP(n),n);return}if(Xr(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}if(Br(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}};for(let n of t)for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return e}function dE(t,e,r={}){return new Xh().place(t,e,r,{sequenceItem:uE,sequenceOne:fE,resolveChildStart:GP,newCursor:hh,estimateTextWidth:St,predictItemBarExtraHeight:XP,computeDateWindow:GX,sizeBesideHeader:XX,collectItems:qX,buildDependencies:zX,buildNowline:WX})}function pE(t){return t.toISOString().slice(0,10)}function VX(t){return t.id!==void 0?t.id:/[\r\n]/.test(t.title)?t.title.replace(/\s*[\r\n]+\s*/g," ").trim():t.title}function jP(t,e){for(let r of t)r.kind==="item"?e(r):jP(r.children,e)}function YX(t,e,r){let n=VX(t);t.textSpills&&r.push(jo(e,"NL.I1000","info",{name:n},n)),t.chipsOutside&&r.push(jo(e,"NL.I1001","info",{name:n},n)),(t.box.width<Qo||t.dotSpills||t.iconSpills||t.footnoteSpills)&&r.push(jo(e,"NL.I1002","info",{name:n},n)),t.hasOverflow&&r.push(jo(e,"NL.I1003","info",{name:n,anchor:t.overflowAnchorId},n))}function jo(t,e,r,n,i){return{message:ru(t,e,n),severity:r,code:e,entityId:i,lspSeverity:r==="warning"?2:3,data:{code:e,args:n}}}function zP(t,e,r){let n=t.id??t.title,i=[];jP(t.children,a=>i.push(a));for(let a of i)YX(a,e,r);let o=new Set(i.map(a=>a.box.y));o.size>1&&r.push(jo(e,"NL.I1004","info",{lane:n,rows:o.size},n)),(t.utilization?.segments.some(a=>a.classification==="red")??!1)&&r.push(jo(e,"NL.I1005","info",{lane:n},n));for(let a of t.nested)zP(a,e,r)}function hE(t,e={}){let r=e.locale??"en-US",n=[];for(let i of t.swimlanes)zP(i,r,n);if(e.today){let i=e.today,o=t.timeline.startDate,s=t.timeline.endDate;(i<o||i>s)&&n.push(jo(r,"NL.W1000","warning",{date:pE(i),start:pE(o),end:pE(s)}))}return n}var zo=class extends Error{constructor(e){super(e),this.name="TimezoneError"}};function mE(t){if(!t||t.toLowerCase()==="local")return{kind:"local"};if(t.toUpperCase()==="UTC")return{kind:"utc"};if(t==="Z")return{kind:"offset",ms:0};let e=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(t);if(e){let r=e[1]==="+"?1:-1,n=parseInt(e[2],10),i=e[3]!==void 0?parseInt(e[3],10):0;if(n>23||i>59)throw new zo(`nowline: invalid timezone offset "${t}". Hours must be 0\u201323 and minutes 0\u201359.`);return{kind:"offset",ms:r*(n*60+i)*6e4}}try{return{kind:"iana",name:Intl.DateTimeFormat(void 0,{timeZone:t}).resolvedOptions().timeZone}}catch{throw new zo(`nowline: unrecognised timezone "${t}". 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 jh(t,e){switch(e.kind){case"local":return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));case"utc":return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));case"offset":{let r=new Date(t.getTime()+e.ms);return new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()))}case"iana":{let r=new Intl.DateTimeFormat("en-CA",{timeZone:e.name,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),n=0,i=0,o=0;for(let s of r)s.type==="year"?n=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(n,i,o))}}}var KX=/^(\d{4})-(\d{2})-(\d{2})$/,ZX=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,JX=/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function gE(t={}){let e=t.zone??{kind:"local"},r=t.clock??(()=>new Date),n=t.now;if(!(n==="-"||n===null)){if(n instanceof Date)return n;if(n!==void 0){let i=KX.exec(n);if(i)return new Date(Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10)));let o=ZX.exec(n);if(o){let a=new Date(n);if(!Number.isNaN(a.getTime())){if(o[2]==="Z")return jh(a,{kind:"utc"});let l=o[3]==="+"?1:-1,u=parseInt(o[4],10),f=o[5]!==void 0?parseInt(o[5],10):0,d=l*(u*60+f)*6e4;return jh(a,{kind:"offset",ms:d})}}let s=JX.exec(n);return s?new Date(Date.UTC(parseInt(s[1],10),parseInt(s[2],10)-1,parseInt(s[3],10))):void 0}return jh(r(),e)}}function QX(t){return t===2?"warning":t===3?"info":"error"}function WP(t,e){return{severity:QX(t.severity),code:km(t),message:t.message,suggestion:Im(t.message),file:e,line:(t.range?.start.line??0)+1,column:(t.range?.start.character??0)+1}}function qP(t,e){return{severity:"error",code:"parse-error",message:t.message,file:e,line:t.token?.startLine??1,column:t.token?.startColumn??1}}function VP(t,e){return{severity:"error",code:"lex-error",message:t.message,file:e,line:t.line??1,column:t.column??1}}function YP(t){return{severity:t.severity,code:"include",message:t.message,file:t.sourcePath,line:t.line!==void 0?t.line+1:1,column:1}}function KP(t,e,r="warning"){return{severity:r,code:"render.warning",message:t,file:e,line:1,column:1}}function ZP(t,e){return{severity:t.severity,code:t.code,message:t.message,file:e,line:1,column:1}}var JP="__nowline_browser_noop_include__";async function QP(t){throw new Error(`${JP}: include "${t}" was skipped \u2014 running in single-file mode.`)}function eC(t){return t.includes(JP)}var zi={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"}},eG={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"}},tC={...zi,...eG};var iae={none:"",multiplier:"x",person:zi.person.ascii,people:zi.people.ascii,points:zi.points.ascii,time:zi.time.ascii};var zh=class{constructor(e="nl"){S(this,"prefix");S(this,"counter",0);this.prefix=e}next(e){let r=`${this.prefix}-${this.counter++}`;return e?`${r}-${e}`:r}};var tG=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"]),rG=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","class","clip-path","mask","filter","font-family","font-size","font-weight","font-style","text-anchor","dx","dy","rotate","letter-spacing","word-spacing","style","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"]);function nG(t){let e=[],r=0,n=t.length;for(;r<n;){if(t[r]!=="<"){let u=r;for(;r<n&&t[r]!=="<";)r++;let f=t.slice(u,r);f.trim().length>0?e.push({kind:"text",text:f}):f.length>0&&e.push({kind:"text",text:f});continue}if(t.startsWith("<!--",r)){let u=t.indexOf("-->",r+4);if(u<0)break;e.push({kind:"comment",text:t.slice(r+4,u)}),r=u+3;continue}if(t.startsWith("<![CDATA[",r)){let u=t.indexOf("]]>",r+9);if(u<0)break;e.push({kind:"cdata",text:t.slice(r+9,u)}),r=u+3;continue}if(t.startsWith("<?",r)){let u=t.indexOf("?>",r+2);if(u<0)break;e.push({kind:"decl",text:t.slice(r+2,u)}),r=u+2;continue}if(t.startsWith("<!",r)){let u=t.indexOf(">",r+2);if(u<0)break;e.push({kind:"decl",text:t.slice(r+2,u)}),r=u+1;continue}if(t[r+1]==="/"){let u=t.indexOf(">",r+2);if(u<0)break;let f=t.slice(r+2,u).trim();e.push({kind:"close",name:f}),r=u+1;continue}let i=iG(t,r);if(i<0)break;let o=t.slice(r+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:c,attrs:l}=oG(a);e.push({kind:s?"self":"open",name:c,attrs:l}),r=i+1}return e}function iG(t,e){let r=e+1,n=null;for(;r<t.length;){let i=t[r];if(n)i===n&&(n=null);else if(i==='"'||i==="'")n=i;else if(i===">")return r;r++}return-1}function oG(t){let e=0;for(;e<t.length&&/\s/.test(t[e]);)e++;let r=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;let n=t.slice(r,e),i={};for(;e<t.length;){for(;e<t.length&&/\s/.test(t[e]);)e++;if(e>=t.length)break;let o=e;for(;e<t.length&&t[e]!=="="&&!/\s/.test(t[e]);)e++;let s=t.slice(o,e);if(e>=t.length||t[e]!=="="){s&&(i[s]="");continue}if(e++,e>=t.length)break;let a=t[e];if(a!=='"'&&a!=="'"){let l=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;i[s]=t.slice(l,e);continue}e++;let c=e;for(;e<t.length&&t[e]!==a;)e++;i[s]=t.slice(c,e),e<t.length&&e++}return{name:n,attrs:i}}function xu(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function sG(t,e){if(t.startsWith("#")){let r=e.get(t.slice(1));return r?`#${r}`:null}if(/^url\(#[^)]+\)$/.test(t)){let r=t.slice(5,-1),n=e.get(r);return n?`url(#${n})`:null}return null}function rC(t,e={}){let r=e.idPrefix??"nl-logo",n=e.onWarn??(()=>{}),i=nG(t),o=new Map,s=0;for(let l of i)if((l.kind==="open"||l.kind==="self")&&l.attrs&&"id"in l.attrs){let u=l.attrs.id;u&&!o.has(u)&&o.set(u,`${r}-${s++}`)}let a=[],c=[];for(let l of i)if(l.kind!=="comment"&&l.kind!=="decl"){if(l.kind==="cdata"){c[c.length-1]&&a.push(xu(l.text??""));continue}if(l.kind==="text"){if(c.length===0||c[c.length-1]){let u=(l.text??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a.push(u)}continue}if(l.kind==="open"||l.kind==="self"){let u=l.name??"";if(u==="script"||u==="foreignObject"||u==="animate"||u==="animateTransform"||u==="animateMotion"||u==="set"){n(`sanitizer: dropping <${u}>`),l.kind==="open"&&c.push(!1);continue}if(!tG.has(u)){n(`sanitizer: dropping unknown element <${u}>`),l.kind==="open"&&c.push(!1);continue}let f=[`<${u}`],d=Object.keys(l.attrs??{}).sort();for(let p of d){let m=l.attrs[p];if(/^on/i.test(p)){n(`sanitizer: dropping event handler ${p}`);continue}if(!rG.has(p)){n(`sanitizer: dropping attribute ${p}`);continue}if(p==="href"||p==="xlink:href"){let y=sG(m,o);if(y===null){n(`sanitizer: dropping external href ${m}`);continue}f.push(` ${p}="${xu(y)}"`);continue}if(p==="style"){n("sanitizer: dropping inline style");continue}if(p==="id"){let y=o.get(m);y&&f.push(` id="${xu(y)}"`);continue}if(/\burl\(#/i.test(m)){let y=m.replace(/url\(#([^)]+)\)/gi,(v,_)=>{let x=o.get(_);return x?`url(#${x})`:"none"});f.push(` ${p}="${xu(y)}"`);continue}if(/data:|javascript:|vbscript:/i.test(m)){n(`sanitizer: dropping suspicious value at ${p}`);continue}f.push(` ${p}="${xu(m)}"`)}f.push(l.kind==="self"?"/>":">"),a.push(f.join("")),l.kind==="open"&&c.push(!0);continue}l.kind==="close"&&c.pop()&&a.push(`</${l.name}>`)}return a.join("")}var nC=/&/g,iC=/</g,oC=/>/g,aG=/"/g,cG=/'/g;function Jt(t){return t.replace(nC,"&amp;").replace(iC,"&lt;").replace(oC,"&gt;")}function Wn(t){return t.replace(nC,"&amp;").replace(iC,"&lt;").replace(oC,"&gt;").replace(aG,"&quot;").replace(cG,"&#39;")}function ic(t){let e=Object.keys(t).sort(),r=[];for(let n of e){let i=t[n];i==null||i===!1||(i===!0?r.push(n):r.push(`${n}="${Wn(String(i))}"`))}return r.length?` ${r.join(" ")}`:""}function ee(t,e,r){return r===void 0||r===""?`<${t}${ic(e)}/>`:`<${t}${ic(e)}>${r}</${t}>`}function Ce(t,e){return`<text${ic(t)}>${Jt(e)}</text>`}function h(t){return Number.isFinite(t)?Number.isInteger(t)?t.toString():(Math.round(t*100)/100).toString():"0"}var lG={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 uG(t,e){let r=`${t}-shadow-${e}`,n=lG[e],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${n.stdDeviation}"/><feOffset dx="${n.dx}" dy="${n.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${n.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return ee("filter",{id:r,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function sC(t,e){return e==="none"?null:`url(#${t}-shadow-${e})`}function aC(t){return["subtle","soft","hard"].map(e=>uG(t,e)).join("")}var fG={thin:100,light:300,normal:400,bold:700};function dG(t){return Yo[t]??14}function xE(t,e,r){return{"font-family":e[t.font],"font-size":r??dG(t.textSize),"font-weight":fG[t.weight]??400,"font-style":t.italic?"italic":"normal",fill:t.text}}function pG(t){if(t.border==="dashed")return"4 3";if(t.border==="dotted")return"1 3"}function hG(t){if(!t||t==="none"||t==="transparent")return 1;let e=t.startsWith("#")?t.slice(1):t;if(e.length===3&&(e=e.split("").map(s=>s+s).join("")),e.length!==6)return 1;let r=parseInt(e.slice(0,2),16)/255,n=parseInt(e.slice(2,4),16)/255,i=parseInt(e.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(r)+.7152*o(n)+.0722*o(i)}function mG(t,e){return hG(t)>=.24?e.statusDot.onLight:e.statusDot.onDark}function yE(t,e){return t.length*e*.58}function fC(t,e,r,n,i,o,s){let a=i*.58,c=e?yE(e,i):0,l=e?a:0,u=r+c+l,{text:f,icon:d}=t,p=yE(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return Ce({x:h(u),y:h(n),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return Ce({x:h(u),y:h(n),...m},`${f}\xD7`);if(d.kind==="builtin"){let v=zi[d.name],_=Ce({x:h(u),y:h(n),...m},f),x=i*.1,E=i,b=u+p+x,D=n-i*.85,I=`<svg x="${h(b)}" y="${h(D)}" width="${h(E)}" height="${h(E)}" viewBox="${v.viewBox}" style="color:${Wn(s)}" aria-hidden="true">${v.body}</svg>`;return _+I}let y=h(i*.1);return`<text x="${h(u)}" y="${h(n)}" font-family="${Wn(o)}" font-size="${i}" fill="${Wn(s)}">${Jt(f)}<tspan dx="${y}">${Jt(d.text)}</tspan></text>`}var cC=.6,gG=.5;function yG(t){let{metaText:e,capacity:r,x:n,baselineY:i,fontSize:o,fontFamily:s,color:a}=t;if(!e&&!r)return"";let c={"font-family":s,"font-size":o,fill:a};if(!r)return Ce({x:h(n),y:h(i),...c},e);if(!e)return fC(r,void 0,n,i,o,s,a);let l=h(o*cC),u=`<text x="${h(n)}" y="${h(i)}" font-family="${Wn(s)}" font-size="${o}" fill="${Wn(a)}">`,{text:f,icon:d}=r;if(!d)return u+Jt(e)+`<tspan dx="${l}">${Jt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+Jt(e)+`<tspan dx="${l}">${Jt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let I=h(o*.1);return u+Jt(e)+`<tspan dx="${l}">${Jt(f)}</tspan><tspan dx="${I}">${Jt(d.text)}</tspan></text>`}let p=zi[d.name],m=I=>I.length*o*gG,y=n+m(e)+o*cC,v=o*.1,_=o,x=y+m(f)+v,E=i-o*.85,b=u+Jt(e)+`<tspan dx="${l}">${Jt(f)}</tspan></text>`,D=`<svg x="${h(x)}" y="${h(E)}" width="${h(_)}" height="${h(_)}" viewBox="${p.viewBox}" style="color:${Wn(a)}" aria-hidden="true">${p.body}</svg>`;return b+D}function xG(t,e){let r=tC.calendar,n=`<svg x="${h(t.glyphTopLeft.x)}" y="${h(t.glyphTopLeft.y)}" width="${h(t.glyphSize)}" height="${h(t.glyphSize)}" viewBox="${r.viewBox}" style="color:${Wn(e)}" aria-hidden="true">${r.body}</svg>`,i=`<title>${Jt(t.isoDate)}</title>`;return ee("g",{"data-layer":"inline-date-pin","data-side":t.side,"data-date":t.isoDate,"data-spilled":t.spilled?"true":null},i+n)}function TE(t,e){return!t||t.length===0?"":t.map(r=>xG(r,e)).join("")}function TG(t){return(t?.length??0)>0}function dC(t){return t?.some(e=>e.side==="after")??!1}function _G(t,e,r,n,i,o={}){let s=Math.min(Ru[i.cornerRadius]??4,n/2);return ee("rect",{x:h(t),y:h(e),width:h(r),height:h(n),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":pG(i)??null,...o})}function EG(t,e,r,n){let i=t.box.x+t.cardBox.x,o=t.box.y+t.cardBox.y,s=t.cardBox.width,a=t.cardBox.height,c=t.style.bg==="none"?r.surface.headerBox:t.style.bg,l=r.header.cardBorder,u=ee("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:c,stroke:l,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`}),f=[];t.titleLines.forEach((_,x)=>{f.push(Ce({x:h(i+16),y:h(o+26+x*20),"font-family":n[t.style.font],"font-size":16,"font-weight":600,fill:t.style.text},_))});let d=f.join(""),p=o+26+Math.max(0,t.titleLines.length-1)*20,m=r.header.author,y=[];t.authorLines.forEach((_,x)=>{y.push(Ce({x:h(i+16),y:h(p+18+x*14),"font-family":n[t.style.font],"font-size":11,fill:m},_))});let v=y.join("");return ee("g",{"data-layer":"header","data-id":`${e}-header`},u+d+v)}function vG(t,e,r){let n=r.timeline.gridLine,i=r.timeline.minorGridLine,o=t.bottomTickPanelHeight??0,s=t.bottomTickPanelY!==void 0&&o>0,a=t.tickPanelY,c=s?t.bottomTickPanelY+o:t.box.y+t.box.height,l=e,u=t.box.y+t.box.height,f=[];for(let d of t.ticks)if(d.major)f.push(ee("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(c),stroke:n,"stroke-width":1}));else if(t.minorGrid){if(d.labelX===void 0)continue;f.push(ee("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}return ee("g",{"data-layer":"grid"},f.join(""))}function bG(t,e,r){let n=e.timeline.panelFill,i=e.timeline.border,o=e.timeline.labelText,s=[],a=t.tickPanelY,c=t.tickPanelHeight,l=c>0,u=t.markerRow.height>0,f=a+c,d=t.markerRow.height,p=t.bottomTickPanelY,m=t.bottomTickPanelHeight??0,y=p!==void 0&&m>0;l&&s.push(ee("rect",{x:h(t.box.x),y:h(a),width:h(t.box.width),height:h(c),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1})),u&&s.push(ee("rect",{x:h(t.box.x),y:h(f),width:h(t.box.width),height:h(d),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1})),y&&s.push(ee("rect",{x:h(t.box.x),y:h(p),width:h(t.box.width),height:h(m),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1}));for(let v of t.ticks)v.major&&(!v.label||v.labelX===void 0||(l&&s.push(Ce({x:h(v.labelX),y:h(a+Au),"font-family":r.sans,"font-size":10,fill:o,"text-anchor":"middle"},v.label)),y&&s.push(Ce({x:h(v.labelX),y:h(p+Au),"font-family":r.sans,"font-size":10,fill:o,"text-anchor":"middle"},v.label))));return ee("g",{"data-layer":"timeline"},s.join(""))}function wG(t,e,r){if(!t)return"";let n=e.nowline.stroke,i=e.nowline.labelText,o=ee("line",{x1:h(t.x),y1:h(t.topY),x2:h(t.x),y2:h(t.bottomY),stroke:n,"stroke-width":Nu}),s=RG(t,n),a=AG(t,i,r);return ee("g",{"data-layer":"nowline"},o+s+a)}function pC(t){let e=Nu/2;return t.pillMode==="flag-right"?t.x-e:t.pillMode==="flag-left"?t.x+e:t.x}function RG(t,e){let r=t.pillTopY,n=t.pillTopY+Kn,i=sm,o=t.pillWidth;if(t.pillMode==="center")return ee("rect",{x:h(t.x-o/2),y:h(r),width:h(o),height:h(Kn),rx:i,ry:i,fill:e});let s=pC(t);if(t.pillMode==="flag-right"){let l=s+o,u=[`M ${h(s)} ${h(r)}`,`L ${h(l-i)} ${h(r)}`,`A ${i} ${i} 0 0 1 ${h(l)} ${h(r+i)}`,`L ${h(l)} ${h(n-i)}`,`A ${i} ${i} 0 0 1 ${h(l-i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,"Z"].join(" ");return ee("path",{d:u,fill:e})}let a=s-o,c=[`M ${h(s)} ${h(r)}`,`L ${h(a+i)} ${h(r)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(r+i)}`,`L ${h(a)} ${h(n-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,"Z"].join(" ");return ee("path",{d:c,fill:e})}function AG(t,e,r){let n=t.pillTopY+am,i=pC(t),o,s;return t.pillMode==="center"?(o=t.x,s="middle"):t.pillMode==="flag-right"?(o=i+Ko,s="start"):(o=i-Ko,s="end"),Ce({x:h(o),y:h(n),"font-family":r.sans,"font-size":hc,"font-weight":700,fill:e,"text-anchor":s},t.label)}function SG(t,e,r,n,i){let o=[],s=sC(r,t.style.shadow);o.push(_G(t.box.x,t.box.y,t.box.width,t.box.height,t.style,{filter:s??null}));let a=mG(t.style.bg,n),c={done:a.done,"in-progress":a.inProgress,"at-risk":a.atRisk,blocked:a.blocked,planned:a.planned,neutral:a.neutral},l=c[t.status]??c.neutral;if(t.progressFraction>0){let _=Math.max(0,Math.min(t.box.width,t.box.width*t.progressFraction));o.push(ee("rect",{x:h(t.box.x),y:h(t.box.y+t.box.height-Wr),width:h(_),height:Wr,fill:t.style.fg,opacity:.55}))}let u=t.dotSpills&&t.dotSpillCx!==null?t.dotSpillCx:t.box.x+t.box.width-Ki;o.push(ee("circle",{cx:h(u),cy:h(t.box.y+xm),r:Vr,fill:l})),o.push(TE(t.inlineDatePins,t.style.fg));let f;if(t.textSpills)f=t.box.x+t.box.width+gn,t.iconSpills&&(f+=yn+gr);else{let _=!!t.linkIcon&&t.linkIcon!=="none",E=t.inlineDatePins?.find(b=>b.side==="after"&&!b.spilled)?Qn(_,{barWidth:t.box.width}):Qn(!e.noLinks&&_&&!t.iconSpills);f=t.box.x+E}let d=t.style.text,p=n.entities.item.text,m=t.textSpills?p:d,y=t.textSpills?p:t.style.fg,v=t.titleLines??(t.title?[t.title]:[]);if(v.forEach((_,x)=>{_!==""&&o.push(Ce({x:h(f),y:h(t.box.y+Du+x*Ec),"font-family":i[t.style.font],"font-size":_c,"font-weight":600,fill:m},_))}),(t.metaText||t.capacity)&&o.push(yG({metaText:t.metaText,capacity:t.capacity,x:f,baselineY:t.box.y+Mu(v.length),fontSize:gm,fontFamily:i[t.style.font],color:y})),t.footnoteIndicators.length>0){let _=t.box.y+Tm;if(t.footnoteSpills&&t.footnoteSpillStartX!==null){let x=t.footnoteSpillStartX;for(let E=0;E<t.footnoteIndicators.length;E++){let b=t.footnoteIndicators[E];o.push(Ce({x:h(x),y:h(_),"font-family":i.sans,"font-size":bc,"font-weight":700,fill:p},String(b))),x+=Jn}}else{let x=t.box.x+t.box.width-Jo;for(let E=t.footnoteIndicators.length-1;E>=0;E--){let b=t.footnoteIndicators[E];o.push(Ce({x:h(x),y:h(_),"font-family":i.sans,"font-size":bc,"font-weight":700,fill:t.style.text,"text-anchor":"end"},String(b))),x-=Jn}}}if(!e.noLinks&&t.linkIcon&&t.linkIcon!=="none"){let _={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},x=_[t.linkIcon]??_.generic,E=yn,b=t.iconSpills&&t.iconSpillX!==null?t.iconSpillX:t.box.x+Zi,D=t.box.y+Zi,I=ee("rect",{x:h(b),y:h(D),width:E,height:E,rx:2,ry:2,fill:x}),M=b,H=D,Y=ee("path",{d:`M${h(M+4)} ${h(H+10)} L${h(M+10)} ${h(H+4)} M${h(M+6)} ${h(H+4)} H${h(M+10)} V${h(H+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),re=I+Y,$=t.linkHref?ee("a",{href:t.linkHref,target:"_blank",rel:"noopener"},re):re;o.push($)}if(t.hasOverflow&&t.overflowBox){let _=n.item.overflowTailFill,x=n.item.overflowTailStroke,E=n.item.overflowCaption;o.push(ee("rect",{x:h(t.overflowBox.x),y:h(t.overflowBox.y),width:h(t.overflowBox.width),height:h(t.overflowBox.height),fill:_,stroke:x,"stroke-width":1})),t.overflowAnchorId&&t.overflowBox.width>60&&o.push(Ce({x:h(t.overflowBox.x+t.overflowBox.width/2),y:h(t.overflowBox.y+t.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:E,"text-anchor":"middle"},`past ${t.overflowAnchorId}`))}for(let _ of t.labelChips){let x=Math.min(Ru[_.style.cornerRadius]??8,_.box.height/2);o.push(ee("rect",{x:h(_.box.x),y:h(_.box.y),width:h(_.box.width),height:h(_.box.height),rx:h(x),ry:h(x),fill:_.style.bg==="none"?"transparent":_.style.bg,stroke:_.style.fg,"stroke-width":.5})),o.push(Ce({x:h(_.box.x+_.box.width/2),y:h(_.box.y+_.box.height/2+3),...xE(_.style,i,Yo.xs),"text-anchor":"middle"},_.text))}return ee("g",{"data-layer":"item","data-id":t.id??null},o.join(""))}function IG(t,e,r,n,i){let o=[],s=Vi(t.style.bg);if(s){if(o.push(ee("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:t.style.bg,stroke:t.style.fg,"stroke-width":1,"fill-opacity":.18,filter:`url(#${r}-shadow-subtle)`})),t.title){let a=Yi(t.title),c=t.box.x,l=t.box.y,u=qi,f=6,d=`M${h(c+f)} ${h(l)}H${h(c+a)}V${h(l+u-f)}A${f} ${f} 0 0 1 ${h(c+a-f)} ${h(l+u)}H${h(c)}V${h(l+f)}A${f} ${f} 0 0 1 ${h(c+f)} ${h(l)}Z`;o.push(ee("path",{d,fill:t.style.fg})),o.push(Ce({x:h(c+pc),y:h(l+em),"font-family":i[t.style.font],"font-size":tm,"font-weight":600,fill:"#ffffff"},t.title))}}else{let a=t.style.fg,c=Ac(s,!!t.title,TG(t.inlineDatePins));if(t.style.bracket!=="none"){let u=t.box.y+t.box.height,f=t.style.bracket==="dashed"?"3 2":null,d=c>0?`M${h(t.box.x+4)} ${h(t.box.y-c)} L${h(t.box.x)} ${h(t.box.y-c)} L${h(t.box.x)} ${h(u)} L${h(t.box.x+4)} ${h(u)}`:`M${h(t.box.x)} ${h(t.box.y)} L${h(t.box.x)} ${h(u)} L${h(t.box.x+4)} ${h(u)}`;o.push(ee("path",{d,fill:"none",stroke:a,"stroke-width":1,"stroke-dasharray":f}))}t.title&&o.push(Ce({x:h(eo(t.box.x,ts,dC(t.inlineDatePins))),y:h(t.box.y-Bu),...xE(t.style,i,Rc),"fill-opacity":.7},t.title))}o.push(TE(t.inlineDatePins,t.style.fg));for(let a of t.children)o.push(_E(a,e,r,n,i));return ee("g",{"data-layer":"group","data-id":t.id??null},o.join(""))}function kG(t,e,r,n,i){let o=[];if(t.style.bracket==="solid"||t.style.bracket==="dashed"){let c=t.box.y-12,l=t.box.y+t.box.height+12,u=t.box.x,f=t.box.x+t.box.width,d=n.parallel.bracketStroke;o.push(ee("path",{d:`M${h(u+4)} ${h(c)} H${h(u)} V${h(l)} H${h(u+4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),o.push(ee("path",{d:`M${h(f-4)} ${h(c)} H${h(f)} V${h(l)} H${h(f-4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}t.title&&o.push(Ce({x:h(eo(t.box.x,rs,dC(t.inlineDatePins))),y:h(t.box.y-Bu),...xE(t.style,i,Rc),"fill-opacity":.7},t.title)),o.push(TE(t.inlineDatePins,t.style.fg));for(let s of t.children)o.push(_E(s,e,r,n,i));return ee("g",{"data-layer":"parallel","data-id":t.id??null},o.join(""))}function _E(t,e,r,n,i){return t.kind==="item"?SG(t,e,r,n,i):t.kind==="group"?IG(t,e,r,n,i):kG(t,e,r,n,i)}var lC=2;function NG(t,e){switch(t){case"green":return e.swimlane.utilizationOk;case"yellow":return e.swimlane.utilizationWarn;case"red":return e.swimlane.utilizationOver}}function PG(t,e){if(!t.utilization||t.utilization.segments.length===0)return"";let r=t.box.y+t.box.height-lC,n=t.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":ee("rect",{x:h(i.startX),y:h(r),width:h(o),height:lC,fill:NG(i.classification,e),"data-utilization":i.classification,"data-load":h(i.load)})});return ee("g",{"data-layer":"lane-utilization","data-id":t.id??null},n.join(""))}function CG(t,e){let r=t.bandIndex%2===0?e.swimlane.rowTintEven:e.swimlane.rowTintOdd,n=e.swimlane.border;return ee("g",{"data-layer":"swimlane-bg","data-id":t.id??null},ee("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),fill:r,stroke:n,"stroke-width":1}))}function hC(t,e,r,n,i){let o=n.swimlane.tabFill,s=n.swimlane.tabStroke,a=n.swimlane.tabText,c=n.swimlane.ownerText,l=n.swimlane.footnoteIndicator,u=[];if(t.title){let d=t.capacity?Wi(t.capacity.text,t.capacity.icon,10):0,p=t.footnoteIndicators.length>0?t.footnoteIndicators.join(","):"",m=p?yE(p,10):0,y=Sc(t.box.x,t.title,t.owner,d,m),v=Su,_=t.box.y+10,x=_+Iu;u.push(ee("rect",{x:h(y.tabX),y:h(_),width:h(y.tabW),height:h(v),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(Ce({x:h(y.titleX),y:h(x),"font-family":i[t.style.font],"font-size":12,"font-weight":600,fill:a},t.title)),t.owner&&u.push(Ce({x:h(y.ownerX),y:h(x),"font-family":i[t.style.font],"font-size":10,fill:c},`owner: ${t.owner}`)),t.capacity&&u.push(fC(t.capacity,void 0,y.badgeX,x,10,i[t.style.font],c)),p&&u.push(Ce({x:h(y.footnoteRightX),y:h(_+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:l,"text-anchor":"end"},p))}for(let f of t.children)u.push(_E(f,e,r,n,i));return u.push(PG(t,n)),ee("g",{"data-layer":"swimlane","data-id":t.id??null},u.join(""))}function OG(t,e,r){let n=t.radius,i=t.center.x,o=t.center.y,s=e.anchorDiamond.fill,a=e.anchorDiamond.stroke,c=ee("path",{d:`M${h(i)} ${h(o-n)} L${h(i+n)} ${h(o)} L${h(i)} ${h(o+n)} L${h(i-n)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),l=e.anchorDiamond.label,u=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,f={x:h(u),y:h(o+4),"font-family":r.sans,"font-size":10,fill:l};t.labelSide==="left"&&(f["text-anchor"]="end");let d=t.title?Ce(f,t.title):"";return ee("g",{"data-layer":"anchor","data-id":t.id??null},c+d)}function LG(t,e){let r=e.anchorDiamond.cutLine;return ee("line",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,"stroke-width":1,"stroke-dasharray":"1 3"})}function DG(t,e,r){let n=t.center.x,i=t.center.y,o=t.radius,s=e.milestoneDiamond.fill,a=ee("path",{d:`M${h(n)} ${h(i-o)} L${h(n+o)} ${h(i)} L${h(n)} ${h(i+o)} L${h(n-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),c=e.milestoneDiamond.label,l=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,u={x:h(l),y:h(i+4),"font-family":r.sans,"font-size":10,"font-weight":600,fill:c};t.labelSide==="left"&&(u["text-anchor"]="end");let f=t.title?Ce(u,t.title):"";return ee("g",{"data-layer":"milestone","data-id":t.id??null},a+f)}function MG(t,e){let r=t.isOverrun?e.milestoneDiamond.cutLineOverrun:e.milestoneDiamond.cutLineNormal,n=[];if(n.push(ee("line",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":ku,"stroke-linecap":"round"})),t.slackArrows&&t.slackArrows.length>0){let i=e.milestoneDiamond.slack;for(let o of t.slackArrows)n.push(ee("path",{d:`M${h(o.x)} ${h(o.y)} H${h(t.center.x-6)}`,fill:"none",stroke:i,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":"url(#nl-arrow-dark)"}))}return n.join("")}function uC(t,e){let r=t.kind==="overflow"?e.dependency.overflowStroke:e.dependency.edgeStroke,n=t.waypoints;if(n.length<2)return"";let i=t.kind==="underBar"?.8:1.1;return ee("path",{d:$G(n,hm),fill:"none",stroke:r,"stroke-width":i,"stroke-dasharray":t.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":"url(#nl-arrow)"})}function $G(t,e){if(t.length<2)return"";let r=[`M${h(t[0].x)} ${h(t[0].y)}`];for(let n=1;n<t.length;n++){let i=t[n-1],o=t[n];if(n===t.length-1){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=t[n+1],a=Math.sign(o.x-i.x),c=Math.sign(o.y-i.y),l=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(e,f/2,d/2);if(p<=0||a!==0&&l!==0||c!==0&&u!==0){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},y={x:o.x+l*p,y:o.y+u*p};r.push(`L${h(m.x)} ${h(m.y)}`),r.push(`Q${h(o.x)} ${h(o.y)} ${h(y.x)} ${h(y.y)}`)}return r.join(" ")}function FG(t,e,r,n){if(t.entries.length===0)return"";let i=r.footnotePanel.fill,o=r.footnotePanel.border,s=r.footnotePanel.header,a=r.footnotePanel.title,c=r.footnotePanel.description,l=r.footnotePanel.number,u=[];u.push(ee("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`})),u.push(Ce({x:h(t.box.x+Sr),y:h(t.box.y+lm),"font-family":n.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=t.box.y+mc+Sr,d=t.box.x+Sr,p=d+Sr;return t.entries.forEach((m,y)=>{let v=f+y*gc;u.push(Ce({x:h(d),y:h(v),"font-family":n.sans,"font-size":10,"font-weight":700,fill:l},String(m.number))),u.push(Ce({x:h(p),y:h(v),"font-family":n.sans,"font-size":11,"font-weight":600,fill:a},m.title)),m.description&&u.push(Ce({x:h(p+Math.max(120,m.title.length*6)),y:h(v),"font-family":n.sans,"font-size":11,fill:c},`\u2014 ${m.description}`))}),ee("g",{"data-layer":"footnotes"},u.join(""))}function UG(t,e,r,n,i){let o=n.includeRegion.border,s=n.includeRegion.fill,a=n.includeRegion.tabFill,c=n.includeRegion.tabStroke,l=n.includeRegion.tabText,u=n.includeRegion.badgeFill,f=n.includeRegion.badgeStroke,d=n.includeRegion.badgeText,p=t.box.x+8,m=t.box.y,y=t.box.width-16,v=t.box.height,_=ee("rect",{x:h(p),y:h(m),width:h(y),height:h(v),rx:8,ry:8,fill:s,stroke:o,"stroke-width":1,"stroke-dasharray":ku}),x=Su,E=Ic(t.box.x,t.label,t.sourcePath),b=m-x/2,D=ee("rect",{x:h(E.tabX),y:h(b),width:h(E.tabWidth),height:x,rx:4,ry:4,fill:a,stroke:c,"stroke-width":1}),I=Ce({x:h(E.tabLabelX),y:h(b+Iu),"font-family":i.sans,"font-size":11,"font-weight":600,fill:l},t.label),M=E.badgeX,H=E.badgeSize,Y=m-H/2,re=ee("rect",{x:h(M),y:h(Y),width:H,height:H,rx:4,ry:4,fill:u,stroke:f,"stroke-width":1}),$=ee("path",{d:`M${h(M+7)} ${h(Y+4)} H${h(M+14)} V${h(Y+11)} M${h(M+4)} ${h(Y+7)} H${h(M+11)} V${h(Y+14)} H${h(M+4)} Z`,stroke:d,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),R=9,O=m+4,F=ee("rect",{x:h(E.sourceHaloX),y:h(O-R),width:h(E.sourceHaloWidth),height:R+6,fill:s}),A=Ce({x:h(E.sourceTextX),y:h(O),"font-family":i.mono,"font-size":R,fill:d},t.sourcePath),k=t.nestedSwimlanes.map(N=>hC(N,e,r,n,i)).join("");return ee("g",{"data-layer":"include"},_+k+D+I+re+$+F+A)}function BG(t,e){let r=t.palette.attribution.mark,n=t.palette.attribution.link;if(t.swimlanes.length===0)return"";let i=t.header.attributionBox.x,o=t.header.attributionBox.y,s=Zn,a=Ce({x:"0",y:s,"font-family":e.sans,"font-size":Ou,"font-weight":400,fill:r},Cu)+Ce({x:xc,y:s,"font-family":e.sans,"font-size":Zn,"font-weight":700,fill:r},"now")+ee("rect",{x:fm,y:12,width:dm,height:Zn,fill:n})+Ce({x:Lu,y:s,"font-family":e.sans,"font-size":Zn,"font-weight":400,fill:r},"ine"),c=ee("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(yc)})`},a);return ee("a",{href:um,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},ee("g",{"data-layer":"attribution"},c))}async function XG(t,e,r,n,i,o,s){if(!e)return"";let a;try{a=await e(t)}catch(u){let f=`logo: failed to load ${t}: ${u instanceof Error?u.message:String(u)}`;if(n.strict)throw u;return n.warn?.(f),""}let c=(a.mime??"").toLowerCase();if(c==="image/svg+xml"){let u=new TextDecoder().decode(a.bytes),f=rC(u,{idPrefix:`${r}-logo`,onWarn:n.warn});return ee("g",{transform:`translate(${h(i)} ${h(o)})`},f)}if(c==="image/png"||c==="image/jpeg"||c==="image/jpg"||c==="image/webp"){let u=GG(a.bytes);return ee("image",{href:`data:${c};base64,${u}`,x:h(i),y:h(o),width:h(s),height:h(s),preserveAspectRatio:"xMidYMid meet"})}let l=`logo: unsupported mime ${c} for ${t}`;if(n.strict)throw new Error(l);return n.warn?.(l),""}function GG(t){if(typeof btoa<"u"){let r="";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)}let e=globalThis;if(e.Buffer)return e.Buffer.from(t).toString("base64");throw new Error("renderer: no base64 encoder available")}async function EE(t,e={}){let n=new zh(e.idPrefix??"nl").next("root"),i=t.palette,o=e.fontFamilies??mm,s=[],a=i.arrowhead.neutral,c=i.arrowhead.light,l=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>${aC(n)}`+u("nl-arrow",a)+u("nl-arrow-light",c)+u("nl-arrow-dark",l)+"</defs>";s.push(f),s.push(ee("rect",{x:0,y:0,width:h(t.width),height:h(t.height),fill:t.backgroundColor})),s.push(bG(t.timeline,i,o));for(let p of t.swimlanes)s.push(CG(p,i));s.push(vG(t.timeline,t.chartBox.y,i));for(let p of t.edges)p.kind==="underBar"&&s.push(uC(p,i));for(let p of t.swimlanes)s.push(hC(p,e,n,i,o));for(let p of t.includes)s.push(UG(p,e,n,i,o));for(let p of t.edges)p.kind!=="underBar"&&s.push(uC(p,i));for(let p of t.anchors)s.push(LG(p,i));for(let p of t.milestones)s.push(MG(p,i));for(let p of t.anchors)s.push(OG(p,i,o));for(let p of t.milestones)s.push(DG(p,i,o));if(s.push(wG(t.nowline,i,o)),s.push(FG(t.footnotes,n,i,o)),s.push(EG(t.header,n,i,o)),s.push(BG(t,o)),t.header.logo&&e.assetResolver){let p=await XG(t.header.logo.assetRef??"",e.assetResolver,n,e,t.header.logo.box.x,t.header.logo.box.y,Math.max(t.header.logo.box.width,t.header.logo.box.height));p&&s.push(p)}return`<svg${ic({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(t.width)} ${h(t.height)}`,width:h(t.width),height:h(t.height),"data-theme":t.theme,"data-generator":"nowline"})}>${s.join("")}</svg>`}var vE="/browser-source.nowline",HG={error:3,warning:2,info:1},jG={error:3,warning:2,info:1};function mC(t,e){return HG[t]>=jG[e]}var Wh,gC=0;function yC(){return Wh||(Wh=y_()),Wh}function zG(){return lt.parse(`memory:///nowline-browser-${++gC}.nowline`)}async function qh(t,e={}){let r=e.filePath??vE,n=yC(),o=n.shared.workspace.LangiumDocumentFactory.fromString(t,zG());await n.shared.workspace.DocumentBuilder.build([o],{validation:!0});let s=[];for(let a of Sm(o))a.origin==="lexer"?s.push(VP(a.error,r)):a.origin==="parser"?s.push(qP(a.error,r)):s.push(WP(a.diagnostic,r));return{ast:o.parseResult.value,diagnostics:s}}async function bE(t,e={}){let r=e.filePath??vE,n=await qh(t,{filePath:r});if(n.diagnostics.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:n.diagnostics};let i=yC(),o=e.readFile??QP,s=await o_(n.ast,r,{services:i.Nowline,readFile:o}),a=[...n.diagnostics];for(let x of s.diagnostics){if(x.severity==="error"&&eC(x.message)){e.onSkippedInclude?.({sourcePath:x.sourcePath,message:x.message});continue}a.push(YP(x))}if(a.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:a};let c;if(e.timezone)try{c=mE(e.timezone)}catch(x){if(x instanceof zo)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:x.message,file:r,line:1,column:1}]};throw x}let l=gE({now:e.today,zone:c}),u=dE(n.ast,s,{theme:e.theme,today:l,locale:e.locale,width:e.width}),f=e.diagnosticLevel??"error",d=hE(u,{today:l??void 0,locale:e.locale??"en-US"}).map(x=>ZP(x,r)),p=e.showLinks!==!1,m=e.strict===!0,y=[],v=await EE(u,{idPrefix:e.idPrefix,assetResolver:e.assetResolver,noLinks:!p,strict:m,warn:x=>y.push(x),fontFamilies:e.fontFamilies}),_=[...d,...y.map(x=>KP(x,r,m?"error":"warning"))].filter(x=>mC(x.severity,f));return m&&_.length>0?{kind:"diagnostics",diagnostics:[...a,..._]}:{kind:"svg",svg:v,warnings:_}}function wE(){Wh=void 0,gC=0}var xC="/embed.nowline",RE=!1;async function TC(t){let{ast:e,diagnostics:r}=await qh(t,{filePath:xC});return{ast:e,errors:r.filter(n=>n.severity==="error").map(n=>n.message)}}async function Vh(t,e={}){let r={filePath:xC,theme:e.theme,today:e.today,timezone:e.timezone,locale:e.locale,width:e.width,idPrefix:e.idPrefix,onSkippedInclude:()=>{RE||(RE=!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."))}},n=await bE(t,r);if(n.kind==="svg")return n.svg;let i=n.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Tu(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Tu=class extends Error{constructor(r,n){super(r);S(this,"details",n);this.name="EmbedRenderError"}};function _C(){RE=!1,wE()}var zr=Uint8Array,ur=Uint16Array,NE=Int32Array,PE=new zr([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]),CE=new zr([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]),EC=new zr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),RC=function(t,e){for(var r=new ur(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new NE(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return{b:r,r:i}},AC=RC(PE,2),WG=AC.b,SE=AC.r;WG[28]=258,SE[258]=28;var SC=RC(CE,0),Oae=SC.b,vC=SC.r,IE=new ur(32768);for(Le=0;Le<32768;++Le)qn=(Le&43690)>>1|(Le&21845)<<1,qn=(qn&52428)>>2|(qn&13107)<<2,qn=(qn&61680)>>4|(qn&3855)<<4,IE[Le]=((qn&65280)>>8|(qn&255)<<8)>>1;var qn,Le,vu=(function(t,e,r){for(var n=t.length,i=0,o=new ur(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new ur(e);for(i=1;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new ur(1<<e);var c=15-e;for(i=0;i<n;++i)if(t[i])for(var l=i<<4|t[i],u=e-t[i],f=s[t[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[IE[f]>>c]=l}else for(a=new ur(n),i=0;i<n;++i)t[i]&&(a[i]=IE[s[t[i]-1]++]>>15-t[i]);return a}),Wo=new zr(288);for(Le=0;Le<144;++Le)Wo[Le]=8;var Le;for(Le=144;Le<256;++Le)Wo[Le]=9;var Le;for(Le=256;Le<280;++Le)Wo[Le]=7;var Le;for(Le=280;Le<288;++Le)Wo[Le]=8;var Le,Yh=new zr(32);for(Le=0;Le<32;++Le)Yh[Le]=5;var Le,qG=vu(Wo,9,0);var VG=vu(Yh,5,0);var IC=function(t){return(t+7)/8|0},YG=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new zr(t.subarray(e,r))};var Vn=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},_u=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},AE=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return{t:NC,l:0};if(i==1){var s=new zr(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(D,I){return D.f-I.f}),r.push({s:-1,f:25001});var a=r[0],c=r[1],l=0,u=1,f=2;for(r[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=r[r[l].f<r[f].f?l++:f++],c=r[l!=u&&r[l].f<r[f].f?l++:f++],r[u++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=o[0].s,n=1;n<i;++n)o[n].s>d&&(d=o[n].s);var p=new ur(d+1),m=kE(r[u-1],p,0);if(m>e){var n=0,y=0,v=m-e,_=1<<v;for(o.sort(function(I,M){return p[M.s]-p[I.s]||I.f-M.f});n<i;++n){var x=o[n].s;if(p[x]>e)y+=_-(1<<m-p[x]),p[x]=e;else break}for(y>>=v;y>0;){var E=o[n].s;p[E]<e?y-=1<<e-p[E]++-1:++n}for(;n>=0&&y;--n){var b=o[n].s;p[b]==e&&(--p[b],++y)}m=e}return{t:new zr(p),l:m}},kE=function(t,e,r){return t.s==-1?Math.max(kE(t.l,e,r+1),kE(t.r,e,r+1)):e[t.s]=r},bC=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new ur(++e),n=0,i=t[0],o=1,s=function(c){r[n++]=c},a=1;a<=e;++a)if(t[a]==i&&a!=e)++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=t[a]}return{c:r.subarray(0,n),n:e}},Eu=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},kC=function(t,e,r){var n=r.length,i=IC(e+2);t[i]=n&255,t[i+1]=n>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<n;++o)t[i+o+4]=r[o];return(i+4+n)*8},wC=function(t,e,r,n,i,o,s,a,c,l,u){Vn(e,u++,r),++i[256];for(var f=AE(i,15),d=f.t,p=f.l,m=AE(o,15),y=m.t,v=m.l,_=bC(d),x=_.c,E=_.n,b=bC(y),D=b.c,I=b.n,M=new ur(19),H=0;H<x.length;++H)++M[x[H]&31];for(var H=0;H<D.length;++H)++M[D[H]&31];for(var Y=AE(M,7),re=Y.t,$=Y.l,R=19;R>4&&!re[EC[R-1]];--R);var O=l+5<<3,F=Eu(i,Wo)+Eu(o,Yh)+s,A=Eu(i,d)+Eu(o,y)+s+14+3*R+Eu(M,re)+2*M[16]+3*M[17]+7*M[18];if(c>=0&&O<=F&&O<=A)return kC(e,u,t.subarray(c,c+l));var k,N,B,j;if(Vn(e,u,1+(A<F)),u+=2,A<F){k=vu(d,p,0),N=d,B=vu(y,v,0),j=y;var W=vu(re,$,0);Vn(e,u,E-257),Vn(e,u+5,I-1),Vn(e,u+10,R-4),u+=14;for(var H=0;H<R;++H)Vn(e,u+3*H,re[EC[H]]);u+=3*R;for(var Q=[x,D],J=0;J<2;++J)for(var ce=Q[J],H=0;H<ce.length;++H){var K=ce[H]&31;Vn(e,u,W[K]),u+=re[K],K>15&&(Vn(e,u,ce[H]>>5&127),u+=ce[H]>>12)}}else k=qG,N=Wo,B=VG,j=Yh;for(var H=0;H<a;++H){var ie=n[H];if(ie>255){var K=ie>>18&31;_u(e,u,k[K+257]),u+=N[K+257],K>7&&(Vn(e,u,ie>>23&31),u+=PE[K]);var ue=ie&31;_u(e,u,B[ue]),u+=j[ue],ue>3&&(_u(e,u,ie>>5&8191),u+=CE[ue])}else _u(e,u,k[ie]),u+=N[ie]}return _u(e,u,k[256]),u+N[256]},KG=new NE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),NC=new zr(0),ZG=function(t,e,r,n,i,o){var s=o.z||t.length,a=new zr(n+s+5*(1+Math.ceil(s/7e3))+i),c=a.subarray(n,a.length-i),l=o.l,u=(o.r||0)&7;if(e){u&&(c[0]=o.r>>3);for(var f=KG[e-1],d=f>>13,p=f&8191,m=(1<<r)-1,y=o.p||new ur(32768),v=o.h||new ur(m+1),_=Math.ceil(r/3),x=2*_,E=function(he){return(t[he]^t[he+1]<<_^t[he+2]<<x)&m},b=new NE(25e3),D=new ur(288),I=new ur(32),M=0,H=0,Y=o.i||0,re=0,$=o.w||0,R=0;Y+2<s;++Y){var O=E(Y),F=Y&32767,A=v[O];if(y[F]=A,v[O]=F,$<=Y){var k=s-Y;if((M>7e3||re>24576)&&(k>423||!l)){u=wC(t,c,0,b,D,I,H,re,R,Y-R,u),re=M=H=0,R=Y;for(var N=0;N<286;++N)D[N]=0;for(var N=0;N<30;++N)I[N]=0}var B=2,j=0,W=p,Q=F-A&32767;if(k>2&&O==E(Y-Q))for(var J=Math.min(d,k)-1,ce=Math.min(32767,Y),K=Math.min(258,k);Q<=ce&&--W&&F!=A;){if(t[Y+B]==t[Y+B-Q]){for(var ie=0;ie<K&&t[Y+ie]==t[Y+ie-Q];++ie);if(ie>B){if(B=ie,j=Q,ie>J)break;for(var ue=Math.min(Q,ie-2),Ee=0,N=0;N<ue;++N){var we=Y-Q+N&32767,V=y[we],G=we-V&32767;G>Ee&&(Ee=G,A=we)}}}F=A,A=y[F],Q+=F-A&32767}if(j){b[re++]=268435456|SE[B]<<18|vC[j];var oe=SE[B]&31,U=vC[j]&31;H+=PE[oe]+CE[U],++D[257+oe],++I[U],$=Y+B,++M}else b[re++]=t[Y],++D[t[Y]]}}for(Y=Math.max(Y,$);Y<s;++Y)b[re++]=t[Y],++D[t[Y]];u=wC(t,c,l,b,D,I,H,re,R,Y-R,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=v,o.p=y,o.i=Y,o.w=$)}else{for(var Y=o.w||0;Y<s+l;Y+=65535){var pe=Y+65535;pe>=s&&(c[u/8|0]=l,pe=s),u=kC(c,u+1,t.subarray(Y,pe))}o.i=s}return YG(a,0,n+IC(u)+i)};var PC=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,o=r.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=n+=r[s];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}t=n,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},JG=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new zr(o.length+t.length);s.set(o),s.set(t,o.length),t=s,i.w=o.length}return ZG(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,i)};var CC=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};var QG=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;if(t[0]=120,t[1]=n<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=PC();i.p(e.dictionary),CC(t,2,i.d())}};function OC(t,e){e||(e={});var r=PC();r.p(t);var n=JG(t,e,e.dictionary?6:2,4);return QG(n,e),CC(n,n.length-4,r.d()),n}var eH=typeof TextDecoder<"u"&&new TextDecoder,tH=0;try{eH.decode(NC,{stream:!0}),tH=1}catch{}var MC="https://free.nowline.io/open";function LC(t){let e=new TextEncoder().encode(t),r=OC(e),n=32768,i="";for(let o=0;o<r.length;o+=n)i+=String.fromCharCode(...r.subarray(o,o+n));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function OE({source:t,sourceUrl:e,share:r}){if(r===!1||r==="none")return null;if(typeof r=="object")return e!==void 0&&DC(e)?r.remoteUrl.replace("{url}",encodeURIComponent(e)):r.textUrl.replace("{text}",LC(t));let n=r===!0?MC:r,i=new URL(n);return e!==void 0&&DC(e)?i.hash=`url=${encodeURIComponent(e)}`:i.hash=`text=${LC(t)}`,i.toString()}function DC(t){try{return new URL(t).protocol==="https:"}catch{return!1}}var $C=0;async function FC(t){let e=t.document??globalThis.document;if(!e)return{rendered:0,failed:0};let r=e.querySelectorAll(t.selector),n=0,i=0,o=++$C,s=t.share??!0,a=[],c=0;for(let l of Array.from(r)){let u=rH(l);if(!u)continue;let f=nH(l),d=`nl-r${o}-${c++}`,p={theme:t.theme,locale:t.locale,width:t.width,today:t.today,timezone:t.timezone,idPrefix:d},m=u.parentElement,y=u.nextSibling,_=l.getAttribute("data-nowline-source-url")??void 0??t.sourceUrl;a.push(Vh(f,p).then(x=>{if(iH(u,x),n++,m!==null){let E=OE({source:f,sourceUrl:_,share:s});if(E!==null){let b=e.createElement("a");b.className="nowline-share",b.href=E,b.target="_blank",b.rel="noopener noreferrer",b.textContent="Share on Nowline",m.insertBefore(b,y)}}},x=>{i++,console.error("nowline: render failed",x)}))}return await Promise.all(a),{rendered:n,failed:i}}function rH(t){let e=t.parentElement;return e&&e.tagName.toUpperCase()==="PRE"?e:t}function nH(t){return t.textContent??""}function iH(t,e){t.outerHTML=e}function UC(){$C=0}function Kh(){if(typeof globalThis>"u")return"light";let t=globalThis.matchMedia;if(typeof t!="function")return"light";try{return t("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function BC(t,e){return t&&t!=="auto"?b_(t)??e:e}var oH="0.0.0-dev.20261004035821.gd8a6927",sH="d8a6927",aH="pre code.language-nowline, code.language-nowline",XC={theme:"auto",startOnLoad:!0,selector:aH,systemTheme:Kh(),share:!0},rt={...XC},LE=!1;function cH(t={}){rt={theme:t.theme??rt.theme,startOnLoad:t.startOnLoad??rt.startOnLoad,selector:t.selector??rt.selector,locale:t.locale??rt.locale,width:t.width??rt.width,today:t.today!==void 0?t.today:rt.today,timezone:t.timezone??rt.timezone,share:t.share??rt.share,sourceUrl:t.sourceUrl??rt.sourceUrl,systemTheme:Kh()}}function GC(){return{theme:BC(rt.theme,rt.systemTheme),locale:rt.locale,width:rt.width,today:rt.today,timezone:rt.timezone}}async function lH(t,e={}){let r={...GC(),...e};return Vh(t,r)}async function uH(t){return TC(t)}async function DE(t){let e={selector:t?.selector??rt.selector,theme:t?.theme??GC().theme,locale:t?.locale??rt.locale,width:t?.width??rt.width,today:t?.today!==void 0?t.today:rt.today,timezone:t?.timezone??rt.timezone,share:t?.share??rt.share,sourceUrl:t?.sourceUrl??rt.sourceUrl,document:t?.document};return FC(e)}var fH=DE;if(typeof document<"u"&&!LE){LE=!0;let t=()=>{rt.startOnLoad&&DE()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):queueMicrotask(t)}function dH(){rt={...XC,systemTheme:Kh()},LE=!1,_C(),UC()}return wu(pH);})();
2641
+ `).map(i=>i.trim()),r=0,n=e.length;for(;r<n&&e[r]==="";)r+=1;for(;n>r&&e[n-1]==="";)n-=1;return e.slice(r,n)}function A_(t,e,r,n=e){let i=t,o=cN(t);if(o){if(o.length>=2)return{textSpills:!(r<=e&&o.every((l,u)=>St(l,gh)<=(u===0?n:e))),titleLines:o};i=o[0]??""}let s=i.length>0&&St(i,gh)>n,a=r>e;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let c=Tc(i,e,gh,n);if(c.length>=2&&c.length<=ym&&c.every((l,u)=>St(l,gh)<=(u===0?n:e)))return{textSpills:!1,titleLines:c}}return{textSpills:!0,titleLines:[i]}}function S_(t,e,r){let n=cN(t);return n&&n.length>=2?n:!e.textSpills&&!r&&e.titleLines.length>=2?e.titleLines:[n?n[0]??"":t]}var yh=class{constructor(e){S(this,"input");this.input=e}get id(){return this.input.id}measure(e){return{width:Math.max(hr,this.input.logicalRightX-this.input.logicalLeftX),height:e.bands.bandwidth()}}place(e,r){let n=this.measure(r),i=Math.max(hr,n.width-2*rr),o=e.x+rr,s={x:o,y:e.y,width:i,height:n.height},a=Qn(!!this.input.hasLinkIcon,this.input.hasAfterGlyph?{barWidth:i}:void 0),c=Math.max(0,i-a-r3),l=this.input.title,u=R_(this.input.metaText,this.input.metaTrailingWidth??0),f=Math.max(0,i-a-(this.input.titleFirstLineRightReservePx??wc({barWidth:i,footnoteLabels:[],hasBeforeGlyph:!1}))),{textSpills:d,titleLines:p}=A_(l,c,u,f),m=d?o+i+n3:o+a;return{id:this.input.id,box:s,textX:m,textSpills:d,titleLines:p}}};var xh=class{constructor(e,r){S(this,"node");S(this,"deps");this.node=e,this.deps=r}get id(){return this.node.name??""}place(e,r){let{node:n}=this,{deps:i}=this,o=st("parallel",n.properties,r.styleCtx),s=e.x,a=br(tt(n.properties,"after")),c=br(tt(n.properties,"before")),l=n.title??n.name,u=KE(!!(a||c)),f=e.y+u,d=[],p=s,m=0,y=r.currentFlowKey;r.nextParallelId+=1;let v=n.name??`parallel-${r.nextParallelId}`,_=0;for(let D of n.content){if(D.$type==="DescriptionDirective")continue;r.currentFlowKey=`${y}/par:${v}#${_}`;let I=i.newCursor(s,f+m),M=i.sequenceOne(D,I,r);d.push(M),m+=Math.max(r.bandScale.step(),I.height),p=Math.max(p,I.maxX),_++}r.currentFlowKey=y;let x={x:s,y:f,width:p-s,height:m};e.x=p+dc,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,u+m);let E=n.name;E&&(r.entityLeftEdges.set(E,x.x),r.entityRightEdges.set(E,x.x+x.width));let b=ph({box:x,afterDate:a,beforeDate:c,row:{kind:"header-band",title:l,titleInsetX:rs}});return{kind:"parallel",id:E,title:l,box:x,children:d,style:o,inlineDatePins:b.length>0?b:void 0}}};function Lo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function I_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Do(t){let e,r,n;t.length!==2?(e=Lo,r=(a,c)=>Lo(t(a),c),n=(a,c)=>t(a)-c):(e=t===Lo||t===I_?t:o3,r=t,n=t);function i(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&n(a[f-1],c)>-n(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function o3(){return 0}function k_(t){return t===null?NaN:+t}var lN=Do(Lo),uN=lN.right,s3=lN.left,a3=Do(k_).center,N_=uN;var za=class extends Map{constructor(e,r=u3){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[n,i]of e)this.set(n,i)}get(e){return super.get(fN(this,e))}has(e){return super.has(fN(this,e))}set(e,r){return super.set(c3(this,e),r)}delete(e){return super.delete(l3(this,e))}};function fN({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function c3({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function l3({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function u3(t){return t!==null&&typeof t=="object"?t.valueOf():t}var f3=Math.sqrt(50),d3=Math.sqrt(10),p3=Math.sqrt(2);function dN(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=f3?10:o>=d3?5:o>=p3?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(t*l),c=Math.round(e*l),a/l<t&&++a,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(t/l),c=Math.round(e/l),a*l<t&&++a,c*l>e&&--c),c<a&&.5<=r&&r<2?dN(t,e,r*2):[a,c,l]}function P_(t,e,r){return e=+e,t=+t,r=+r,dN(t,e,r)[2]}function Th(t,e,r){e=+e,t=+t,r=+r;let n=e<t,i=n?P_(e,t,r):P_(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function _h(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,o=new Array(i);++n<i;)o[n]=t+n*r;return o}function Wa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var pN=Symbol("implicit");function Eh(){var t=new za,e=[],r=[],n=pN;function i(o){let s=t.get(o);if(s===void 0){if(n!==pN)return n;t.set(o,s=e.push(o)-1)}return r[s%r.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new za;for(let s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Eh(e,r).unknown(n)},Wa.apply(i,arguments),i}function su(){var t=Eh().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete t.unknown;function f(){var d=e().length,p=i<n,m=p?i:n,y=p?n:i;o=(y-m)/Math.max(1,d-c+l*2),a&&(o=Math.floor(o)),m+=(y-m-o*(d-c))*u,s=o*(1-c),a&&(m=Math.round(m),s=Math.round(s));var v=_h(d).map(function(_){return m+o*_});return r(p?v.reverse():v)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,a=!0,f()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(d){return arguments.length?(a=!!d,f()):a},t.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),f()):c},t.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},t.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},t.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},t.copy=function(){return su(e(),[n,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Wa.apply(f(),arguments)}function vh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function C_(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function lu(){}var au=.7,Rh=1/au,qa="\\s*([+-]?\\d+)\\s*",cu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ln="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",h3=/^#([0-9a-f]{3,8})$/,m3=new RegExp(`^rgb\\(${qa},${qa},${qa}\\)$`),g3=new RegExp(`^rgb\\(${ln},${ln},${ln}\\)$`),y3=new RegExp(`^rgba\\(${qa},${qa},${qa},${cu}\\)$`),x3=new RegExp(`^rgba\\(${ln},${ln},${ln},${cu}\\)$`),T3=new RegExp(`^hsl\\(${cu},${ln},${ln}\\)$`),_3=new RegExp(`^hsla\\(${cu},${ln},${ln},${cu}\\)$`),hN={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vh(lu,Xi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:mN,formatHex:mN,formatHex8:E3,formatHsl:v3,formatRgb:gN,toString:gN});function mN(){return this.rgb().formatHex()}function E3(){return this.rgb().formatHex8()}function v3(){return vN(this).formatHsl()}function gN(){return this.rgb().formatRgb()}function Xi(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=h3.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?yN(e):r===3?new Zt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?bh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?bh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=m3.exec(t))?new Zt(e[1],e[2],e[3],1):(e=g3.exec(t))?new Zt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=y3.exec(t))?bh(e[1],e[2],e[3],e[4]):(e=x3.exec(t))?bh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=T3.exec(t))?_N(e[1],e[2]/100,e[3]/100,1):(e=_3.exec(t))?_N(e[1],e[2]/100,e[3]/100,e[4]):hN.hasOwnProperty(t)?yN(hN[t]):t==="transparent"?new Zt(NaN,NaN,NaN,0):null}function yN(t){return new Zt(t>>16&255,t>>8&255,t&255,1)}function bh(t,e,r,n){return n<=0&&(t=e=r=NaN),new Zt(t,e,r,n)}function b3(t){return t instanceof lu||(t=Xi(t)),t?(t=t.rgb(),new Zt(t.r,t.g,t.b,t.opacity)):new Zt}function Va(t,e,r,n){return arguments.length===1?b3(t):new Zt(t,e,r,n??1)}function Zt(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}vh(Zt,Va,C_(lu,{brighter(t){return t=t==null?Rh:Math.pow(Rh,t),new Zt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?au:Math.pow(au,t),new Zt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zt($o(this.r),$o(this.g),$o(this.b),Ah(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xN,formatHex:xN,formatHex8:w3,formatRgb:TN,toString:TN}));function xN(){return`#${Mo(this.r)}${Mo(this.g)}${Mo(this.b)}`}function w3(){return`#${Mo(this.r)}${Mo(this.g)}${Mo(this.b)}${Mo((isNaN(this.opacity)?1:this.opacity)*255)}`}function TN(){let t=Ah(this.opacity);return`${t===1?"rgb(":"rgba("}${$o(this.r)}, ${$o(this.g)}, ${$o(this.b)}${t===1?")":`, ${t})`}`}function Ah(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $o(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Mo(t){return t=$o(t),(t<16?"0":"")+t.toString(16)}function _N(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Hr(t,e,r,n)}function vN(t){if(t instanceof Hr)return new Hr(t.h,t.s,t.l,t.opacity);if(t instanceof lu||(t=Xi(t)),!t)return new Hr;if(t instanceof Hr)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(r-n)/a+(r<n)*6:r===o?s=(n-e)/a+2:s=(e-r)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new Hr(s,a,c,t.opacity)}function bN(t,e,r,n){return arguments.length===1?vN(t):new Hr(t,e,r,n??1)}function Hr(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}vh(Hr,bN,C_(lu,{brighter(t){return t=t==null?Rh:Math.pow(Rh,t),new Hr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?au:Math.pow(au,t),new Hr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Zt(O_(t>=240?t-240:t+120,i,n),O_(t,i,n),O_(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Hr(EN(this.h),wh(this.s),wh(this.l),Ah(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Ah(this.opacity);return`${t===1?"hsl(":"hsla("}${EN(this.h)}, ${wh(this.s)*100}%, ${wh(this.l)*100}%${t===1?")":`, ${t})`}`}}));function EN(t){return t=(t||0)%360,t<0?t+360:t}function wh(t){return Math.max(0,Math.min(1,t||0))}function O_(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function L_(t,e,r,n,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*r+(1+3*t+3*o-3*s)*n+s*i)/6}function wN(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],s=n>0?t[n-1]:2*i-o,a=n<e-1?t[n+2]:2*o-i;return L_((r-n/e)*e,s,i,o,a)}}function RN(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],o=t[n%e],s=t[(n+1)%e],a=t[(n+2)%e];return L_((r-n/e)*e,i,o,s,a)}}var uu=t=>()=>t;function R3(t,e){return function(r){return t+r*e}}function A3(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function AN(t){return(t=+t)==1?Sh:function(e,r){return r-e?A3(e,r,t):uu(isNaN(e)?r:e)}}function Sh(t,e){var r=e-t;return r?R3(t,r):uu(isNaN(t)?e:t)}var D_=(function t(e){var r=AN(e);function n(i,o){var s=r((i=Va(i)).r,(o=Va(o)).r),a=r(i.g,o.g),c=r(i.b,o.b),l=Sh(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return n.gamma=t,n})(1);function SN(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),o=new Array(r),s,a;for(s=0;s<r;++s)a=Va(e[s]),n[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return n=t(n),i=t(i),o=t(o),a.opacity=1,function(c){return a.r=n(c),a.g=i(c),a.b=o(c),a+""}}}var pne=SN(wN),hne=SN(RN);function IN(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=t[i]*(1-o)+e[i]*o;return n}}function kN(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function NN(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),o=new Array(r),s;for(s=0;s<n;++s)i[s]=Fo(t[s],e[s]);for(;s<r;++s)o[s]=e[s];return function(a){for(s=0;s<n;++s)o[s]=i[s](a);return o}}function PN(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Gi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function CN(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Fo(t[i],e[i]):n[i]=e[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var $_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,M_=new RegExp($_.source,"g");function S3(t){return function(){return t}}function I3(t){return function(e){return t(e)+""}}function ON(t,e){var r=$_.lastIndex=M_.lastIndex=0,n,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(n=$_.exec(t))&&(i=M_.exec(e));)(o=i.index)>r&&(o=e.slice(r,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:Gi(n,i)})),r=M_.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?I3(c[0].x):S3(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function Fo(t,e){var r=typeof e,n;return e==null||r==="boolean"?uu(e):(r==="number"?Gi:r==="string"?(n=Xi(e))?(e=n,D_):ON:e instanceof Xi?D_:e instanceof Date?PN:kN(e)?IN:Array.isArray(e)?NN:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?CN:Gi)(t,e)}function F_(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function U_(t){return function(){return t}}function B_(t){return+t}var LN=[0,1];function Ya(t){return t}function X_(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:U_(isNaN(e)?NaN:.5)}function k3(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function N3(t,e,r){var n=t[0],i=t[1],o=e[0],s=e[1];return i<n?(n=X_(i,n),o=r(s,o)):(n=X_(n,i),o=r(o,s)),function(a){return o(n(a))}}function P3(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),o=new Array(n),s=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<n;)i[s]=X_(t[s],t[s+1]),o[s]=r(e[s],e[s+1]);return function(a){var c=N_(t,a,1,n)-1;return o[c](i[c](a))}}function DN(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function C3(){var t=LN,e=LN,r=Fo,n,i,o,s=Ya,a,c,l;function u(){var d=Math.min(t.length,e.length);return s!==Ya&&(s=k3(t[0],t[d-1])),a=d>2?P3:N3,c=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(c||(c=a(t.map(n),e,r)))(n(s(d)))}return f.invert=function(d){return s(i((l||(l=a(e,t.map(n),Gi)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,B_),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),r=F_,u()},f.clamp=function(d){return arguments.length?(s=d?!0:Ya,u()):s!==Ya},f.interpolate=function(d){return arguments.length?(r=d,u()):r},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,p){return n=d,i=p,u()}}function G_(){return C3()(Ya,Ya)}function H_(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],o=t[n],s;return o<i&&(s=r,r=n,n=s,s=i,i=o,o=s),t[r]=e.floor(i),t[n]=e.ceil(o),t}var j_=new Date,z_=new Date;function qe(t,e,r,n){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),e(o,a),t(o);while(l<o&&o<s);return c},i.filter=o=>qe(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),r&&(i.count=(o,s)=>(j_.setTime(+o),z_.setTime(+s),t(j_),t(z_),Math.floor(r(j_,z_))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var fu=qe(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);fu.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?qe(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):fu);var Kne=fu.range;var un=qe(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),MN=un.range;var Ka=qe(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),O3=Ka.range,Ih=qe(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),L3=Ih.range;var Za=qe(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),D3=Za.range,kh=qe(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),M3=kh.range;var jn=qe(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),$3=jn.range,pu=qe(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),F3=pu.range,Nh=qe(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),U3=Nh.range;function Xo(t){return qe(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var zn=Xo(0),Ja=Xo(1),FN=Xo(2),UN=Xo(3),Hi=Xo(4),BN=Xo(5),XN=Xo(6),GN=zn.range,B3=Ja.range,X3=FN.range,G3=UN.range,H3=Hi.range,j3=BN.range,z3=XN.range;function Go(t){return qe(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var Ho=Go(0),Qa=Go(1),HN=Go(2),jN=Go(3),ji=Go(4),zN=Go(5),WN=Go(6),qN=Ho.range,W3=Qa.range,q3=HN.range,V3=jN.range,Y3=ji.range,K3=zN.range,Z3=WN.range;var ec=qe(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),J3=ec.range,Ph=qe(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),Q3=Ph.range;var lr=qe(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());lr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:qe(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});var e4=lr.range,jr=qe(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());jr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:qe(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});var t4=jr.range;function YN(t,e,r,n,i,o){let s=[[un,1,1e3],[un,5,5*1e3],[un,15,15*1e3],[un,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(l,u,f){let d=u<l;d&&([l,u]=[u,l]);let p=f&&typeof f.range=="function"?f:c(l,u,f),m=p?p.range(l,+u+1):[];return d?m.reverse():m}function c(l,u,f){let d=Math.abs(u-l)/f,p=Do(([,,v])=>v).right(s,d);if(p===s.length)return t.every(Th(l/31536e6,u/31536e6,f));if(p===0)return fu.every(Math.max(Th(l,u,f),1));let[m,y]=s[d/s[p-1][2]<s[p][2]/d?p-1:p];return m.every(y)}return[a,c]}var[n4,i4]=YN(jr,Ph,Ho,Nh,kh,Ih),[W_,q_]=YN(lr,ec,zn,jn,Za,Ka);function V_(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Y_(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function hu(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function K_(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,o=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,l=mu(i),u=gu(i),f=mu(o),d=gu(o),p=mu(s),m=gu(s),y=mu(a),v=gu(a),_=mu(c),x=gu(c),E={a:N,A:B,b:j,B:W,c:null,d:tP,e:tP,f:S4,g:$4,G:U4,H:w4,I:R4,j:A4,L:sP,m:I4,M:k4,p:Q,q:J,Q:iP,s:oP,S:N4,u:P4,U:C4,V:O4,w:L4,W:D4,x:null,X:null,y:M4,Y:F4,Z:B4,"%":nP},b={a:ce,A:K,b:ie,B:ue,c:null,d:rP,e:rP,f:j4,g:eX,G:rX,H:X4,I:G4,j:H4,L:cP,m:z4,M:W4,p:Ee,q:we,Q:iP,s:oP,S:q4,u:V4,U:Y4,V:K4,w:Z4,W:J4,x:null,X:null,y:Q4,Y:tX,Z:nX,"%":nP},D={a:re,A:$,b:R,B:O,c:F,d:QN,e:QN,f:_4,g:JN,G:ZN,H:eP,I:eP,j:g4,L:T4,m:m4,M:y4,p:Y,q:h4,Q:v4,s:b4,S:x4,u:l4,U:u4,V:f4,w:c4,W:d4,x:A,X:k,y:JN,Y:ZN,Z:p4,"%":E4};E.x=I(r,E),E.X=I(n,E),E.c=I(e,E),b.x=I(r,b),b.X=I(n,b),b.c=I(e,b);function I(V,G){return function(oe){var U=[],pe=-1,he=0,ge=V.length,De,q,It;for(oe instanceof Date||(oe=new Date(+oe));++pe<ge;)V.charCodeAt(pe)===37&&(U.push(V.slice(he,pe)),(q=KN[De=V.charAt(++pe)])!=null?De=V.charAt(++pe):q=De==="e"?" ":"0",(It=G[De])&&(De=It(oe,q)),U.push(De),he=pe+1);return U.push(V.slice(he,pe)),U.join("")}}function M(V,G){return function(oe){var U=hu(1900,void 0,1),pe=H(U,V,oe+="",0),he,ge;if(pe!=oe.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(G&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(he=Y_(hu(U.y,0,1)),ge=he.getUTCDay(),he=ge>4||ge===0?Qa.ceil(he):Qa(he),he=pu.offset(he,(U.V-1)*7),U.y=he.getUTCFullYear(),U.m=he.getUTCMonth(),U.d=he.getUTCDate()+(U.w+6)%7):(he=V_(hu(U.y,0,1)),ge=he.getDay(),he=ge>4||ge===0?Ja.ceil(he):Ja(he),he=jn.offset(he,(U.V-1)*7),U.y=he.getFullYear(),U.m=he.getMonth(),U.d=he.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),ge="Z"in U?Y_(hu(U.y,0,1)).getUTCDay():V_(hu(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(ge+5)%7:U.w+U.U*7-(ge+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,Y_(U)):V_(U)}}function H(V,G,oe,U){for(var pe=0,he=G.length,ge=oe.length,De,q;pe<he;){if(U>=ge)return-1;if(De=G.charCodeAt(pe++),De===37){if(De=G.charAt(pe++),q=D[De in KN?G.charAt(pe++):De],!q||(U=q(V,oe,U))<0)return-1}else if(De!=oe.charCodeAt(U++))return-1}return U}function Y(V,G,oe){var U=l.exec(G.slice(oe));return U?(V.p=u.get(U[0].toLowerCase()),oe+U[0].length):-1}function re(V,G,oe){var U=p.exec(G.slice(oe));return U?(V.w=m.get(U[0].toLowerCase()),oe+U[0].length):-1}function $(V,G,oe){var U=f.exec(G.slice(oe));return U?(V.w=d.get(U[0].toLowerCase()),oe+U[0].length):-1}function R(V,G,oe){var U=_.exec(G.slice(oe));return U?(V.m=x.get(U[0].toLowerCase()),oe+U[0].length):-1}function O(V,G,oe){var U=y.exec(G.slice(oe));return U?(V.m=v.get(U[0].toLowerCase()),oe+U[0].length):-1}function F(V,G,oe){return H(V,e,G,oe)}function A(V,G,oe){return H(V,r,G,oe)}function k(V,G,oe){return H(V,n,G,oe)}function N(V){return s[V.getDay()]}function B(V){return o[V.getDay()]}function j(V){return c[V.getMonth()]}function W(V){return a[V.getMonth()]}function Q(V){return i[+(V.getHours()>=12)]}function J(V){return 1+~~(V.getMonth()/3)}function ce(V){return s[V.getUTCDay()]}function K(V){return o[V.getUTCDay()]}function ie(V){return c[V.getUTCMonth()]}function ue(V){return a[V.getUTCMonth()]}function Ee(V){return i[+(V.getUTCHours()>=12)]}function we(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var G=I(V+="",E);return G.toString=function(){return V},G},parse:function(V){var G=M(V+="",!1);return G.toString=function(){return V},G},utcFormat:function(V){var G=I(V+="",b);return G.toString=function(){return V},G},utcParse:function(V){var G=M(V+="",!0);return G.toString=function(){return V},G}}}var KN={"-":"",_:" ",0:"0"},Rt=/^\s*\d+/,o4=/^%/,s4=/[\\^$*+?|[\]().{}]/g;function Pe(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(e)+i:i)}function a4(t){return t.replace(s4,"\\$&")}function mu(t){return new RegExp("^(?:"+t.map(a4).join("|")+")","i")}function gu(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function c4(t,e,r){var n=Rt.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function l4(t,e,r){var n=Rt.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function u4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function f4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function d4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function ZN(t,e,r){var n=Rt.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function JN(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function p4(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function h4(t,e,r){var n=Rt.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function m4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function QN(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function g4(t,e,r){var n=Rt.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function eP(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function y4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function x4(t,e,r){var n=Rt.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function T4(t,e,r){var n=Rt.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function _4(t,e,r){var n=Rt.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function E4(t,e,r){var n=o4.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function v4(t,e,r){var n=Rt.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function b4(t,e,r){var n=Rt.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function tP(t,e){return Pe(t.getDate(),e,2)}function w4(t,e){return Pe(t.getHours(),e,2)}function R4(t,e){return Pe(t.getHours()%12||12,e,2)}function A4(t,e){return Pe(1+jn.count(lr(t),t),e,3)}function sP(t,e){return Pe(t.getMilliseconds(),e,3)}function S4(t,e){return sP(t,e)+"000"}function I4(t,e){return Pe(t.getMonth()+1,e,2)}function k4(t,e){return Pe(t.getMinutes(),e,2)}function N4(t,e){return Pe(t.getSeconds(),e,2)}function P4(t){var e=t.getDay();return e===0?7:e}function C4(t,e){return Pe(zn.count(lr(t)-1,t),e,2)}function aP(t){var e=t.getDay();return e>=4||e===0?Hi(t):Hi.ceil(t)}function O4(t,e){return t=aP(t),Pe(Hi.count(lr(t),t)+(lr(t).getDay()===4),e,2)}function L4(t){return t.getDay()}function D4(t,e){return Pe(Ja.count(lr(t)-1,t),e,2)}function M4(t,e){return Pe(t.getFullYear()%100,e,2)}function $4(t,e){return t=aP(t),Pe(t.getFullYear()%100,e,2)}function F4(t,e){return Pe(t.getFullYear()%1e4,e,4)}function U4(t,e){var r=t.getDay();return t=r>=4||r===0?Hi(t):Hi.ceil(t),Pe(t.getFullYear()%1e4,e,4)}function B4(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Pe(e/60|0,"0",2)+Pe(e%60,"0",2)}function rP(t,e){return Pe(t.getUTCDate(),e,2)}function X4(t,e){return Pe(t.getUTCHours(),e,2)}function G4(t,e){return Pe(t.getUTCHours()%12||12,e,2)}function H4(t,e){return Pe(1+pu.count(jr(t),t),e,3)}function cP(t,e){return Pe(t.getUTCMilliseconds(),e,3)}function j4(t,e){return cP(t,e)+"000"}function z4(t,e){return Pe(t.getUTCMonth()+1,e,2)}function W4(t,e){return Pe(t.getUTCMinutes(),e,2)}function q4(t,e){return Pe(t.getUTCSeconds(),e,2)}function V4(t){var e=t.getUTCDay();return e===0?7:e}function Y4(t,e){return Pe(Ho.count(jr(t)-1,t),e,2)}function lP(t){var e=t.getUTCDay();return e>=4||e===0?ji(t):ji.ceil(t)}function K4(t,e){return t=lP(t),Pe(ji.count(jr(t),t)+(jr(t).getUTCDay()===4),e,2)}function Z4(t){return t.getUTCDay()}function J4(t,e){return Pe(Qa.count(jr(t)-1,t),e,2)}function Q4(t,e){return Pe(t.getUTCFullYear()%100,e,2)}function eX(t,e){return t=lP(t),Pe(t.getUTCFullYear()%100,e,2)}function tX(t,e){return Pe(t.getUTCFullYear()%1e4,e,4)}function rX(t,e){var r=t.getUTCDay();return t=r>=4||r===0?ji(t):ji.ceil(t),Pe(t.getUTCFullYear()%1e4,e,4)}function nX(){return"+0000"}function nP(){return"%"}function iP(t){return+t}function oP(t){return Math.floor(+t/1e3)}var tc,Ch,uP,fP,dP;Z_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Z_(t){return tc=K_(t),Ch=tc.format,uP=tc.parse,fP=tc.utcFormat,dP=tc.utcParse,tc}function iX(t){return new Date(t)}function oX(t){return t instanceof Date?+t:+new Date(+t)}function pP(t,e,r,n,i,o,s,a,c,l){var u=G_(),f=u.invert,d=u.domain,p=l(".%L"),m=l(":%S"),y=l("%I:%M"),v=l("%I %p"),_=l("%a %d"),x=l("%b %d"),E=l("%B"),b=l("%Y");function D(I){return(c(I)<I?p:a(I)<I?m:s(I)<I?y:o(I)<I?v:n(I)<I?i(I)<I?_:x:r(I)<I?E:b)(I)}return u.invert=function(I){return new Date(f(I))},u.domain=function(I){return arguments.length?d(Array.from(I,oX)):d().map(iX)},u.ticks=function(I){var M=d();return t(M[0],M[M.length-1],I??10)},u.tickFormat=function(I,M){return M==null?D:l(M)},u.nice=function(I){var M=d();return(!I||typeof I.range!="function")&&(I=e(M[0],M[M.length-1],I??10)),I?d(H_(M,I)):u},u.copy=function(){return DN(u,pP(t,e,r,n,i,o,s,a,c,l))},u}function Oh(){return Wa.apply(pP(W_,q_,lr,ec,zn,jn,Za,Ka,un,Ch).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var J_=class t{constructor(e,r,n){S(this,"bandwidthPx");S(this,"stepPx");S(this,"d3");this.bandwidthPx=e,this.stepPx=r,this.d3=n}static fixedRow(e){return new t(e.bandwidth,e.step)}static forRows(e){let r=Array.from({length:e.count},(i,o)=>String(o)),n=su().domain(r).range(e.range).paddingInner(e.paddingInner??0).paddingOuter(e.paddingOuter??0);return new t(n.bandwidth(),n.step(),n)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(e){if(!this.d3)throw new Error("BandScale.forward is only available on closed-domain bands (BandScale.forRows)");let r=this.d3(e);if(r===void 0)throw new Error(`BandScale: unknown band id "${e}"`);return r}},sX={bandwidth:56,step:64};function hP(){return J_.fixedRow(sX)}var yu=class{constructor(e){S(this,"domain");S(this,"range");S(this,"pixelsPerDay");S(this,"calendar");S(this,"d3");this.domain=e.domain,this.range=e.range,this.calendar=e.calendar;let r=Math.max(1,vr(e.domain[0],e.domain[1]));this.pixelsPerDay=(e.range[1]-e.range[0])/r,this.d3=Oh().domain(e.domain).range(e.range)}forward(e){let r=vr(this.domain[0],e);return this.range[0]+r*this.pixelsPerDay}forwardWithinDomain(e){return e<this.domain[0]||e>this.domain[1]?null:this.forward(e)}invert(e){return this.d3.invert(e)}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};function Lh(t){return t.endsWith(":")?t.slice(0,-1):t}function mP(t,e){let n=t.roadmapDecl?.properties.find(c=>Lh(c.key)==="scale")?.value,i="weeks",o,s;if(n)if(n==="days"||n==="weeks"||n==="months"||n==="quarters"||n==="years")i=n;else{let c=/^(\d+)([dwmqy])$/.exec(n);if(c){let l=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=Dh(i)*l,s=1}}let a=s??WE[i]??4;if(e){let l=e.properties.find(m=>Lh(m.key)==="unit")?.value??i,u=e.properties.find(m=>Lh(m.key)==="label-every"),f=e.properties.find(m=>Lh(m.key)==="pixels-per-unit"),d=u?Math.max(1,parseInt(u.value,10)||a):a,p=f?Math.max(1,parseInt(f.value,10)||Dh(l)):o??Dh(l);return{unit:l,labelEvery:d,pixelsPerUnit:p}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Dh(i)}}function Dh(t){switch(t){case"days":return GE;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}function Q_(t,e,r,n=iu){let i=r.daysPerUnit(e.unit),o=i*t.pixelsPerDay,s=Math.max(1,Math.round(t.widthPx/t.pixelsPerDay)),a=Math.floor(s/i)+1,c=[];for(let l=0;l<a;l++){let u=l*i,f=t.originX+u*t.pixelsPerDay,d=l%e.labelEvery===0,p=l===a-1;c.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?aX(e.unit,Bi(t.domain[0],u),l,n):void 0})}return c}function aX(t,e,r,n){switch(t){case"days":return`${e.getUTCMonth()+1}/${e.getUTCDate()}`;case"weeks":{let i=e.toLocaleString(n,{month:"short",timeZone:"UTC"}),o=e.getUTCDate().toString().padStart(2,"0");return`${i} ${o}`}case"months":return e.toLocaleString(n,{month:"short",timeZone:"UTC"});case"quarters":{let i=Math.floor(e.getUTCMonth()/3)+1;return`${dh(n).quarterPrefix}${i} ${e.getUTCFullYear()}`}case"years":return`${e.getUTCFullYear()}`}}function gP(t){return{daysPerUnit:e=>eE(e,t),addUnits:(e,r,n)=>Bi(e,r*eE(n,t)),isWorkingDay:()=>!0}}function yP(t,e){return eE(t,e)}function eE(t,e){switch(t){case"days":return 1;case"weeks":return e.daysPerWeek;case"months":return e.daysPerMonth;case"quarters":return e.daysPerQuarter;case"years":return e.daysPerYear}}var tE=class{constructor(e,r){S(this,"id");S(this,"anchor");this.id=e,this.anchor=r}place(e,r){let n=le(this.anchor.properties,"date"),i=dt(n);if(!i)return null;let o=e.scale.forwardWithinDomain(i);if(o===null)return null;let s=st("anchor",this.anchor.properties,e.styleCtx),a=e.markerRowPlacements.get(this.id),c=a?.centerY??e.timeline.markerRow.y,l={x:o,y:c},u=a?.labelBox??{x:o+6+6,y:c-4,width:0,height:12},f=a?.labelSide??"right";return e.entityLeftEdges.set(this.id,o),e.entityRightEdges.set(this.id,o),e.entityMidpoints.set(this.id,l),{id:this.id,title:this.anchor.title??this.id,center:l,radius:6,style:s,predecessorPoints:[],cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f}}};function TP(t,e,r){let n=[];for(let[i,o]of t){let s=new tE(i,o).place(e,r);s&&n.push(s)}return n}function rc(t){let e=0;for(let r of t)e=Math.max(e,_P(r.children)),r.nested.length>0&&(e=Math.max(e,rc(r.nested)));return e}function _P(t){let e=0;for(let r of t)r.kind==="item"?e=Math.max(e,r.box.x+r.box.width):e=Math.max(e,_P(r.children));return e}function rE(t,e,r){let n=[],i=new Map,o=new Map;return[...t.entries()].sort(([c],[l])=>c.localeCompare(l)).forEach(([c,l],u)=>{let f=u+1;i.set(c,f),o.set(c,tt(l.properties,"on")),n.push({number:f,title:l.title??c,description:l.description?.text,style:st("footnote",l.properties,e.styleCtx)})}),{area:{box:{x:Sr,y:r+Sr,width:e.chartRightX-2*Sr,height:n.length===0?0:mc+n.length*gc+Sr},entries:n},index:i,hosts:o}}var cX=.8,lX=1;function uX(t){let e=[];return vP(t,e),e}function vP(t,e){for(let r of t)if(r.kind==="item"){let n=fX(r);n>0&&r.box.width>0&&e.push({startX:r.box.x,endX:r.box.x+r.box.width,load:n})}else(r.kind==="parallel"||r.kind==="group")&&vP(r.children,e)}function fX(t){return t.capacity?t.capacity.value:t.size?1:0}function bP(t){if(t.capacityValue<=0||t.warnFraction===null&&t.overFraction===null)return null;let e=uX(t.children);if(e.length===0)return null;let r=new Set;for(let s of e)r.add(s.startX),r.add(s.endX);let n=Array.from(r).sort((s,a)=>s-a);if(n.length<2)return null;let i=[];for(let s=0;s<n.length-1;s++){let a=n[s],c=n[s+1],l=(a+c)/2,u=0;for(let f of e)f.startX<=l&&l<f.endX&&(u+=f.load);i.push({startX:a,endX:c,load:u,classification:dX(u,t.capacityValue,t.warnFraction,t.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:t.capacityValue,warnFraction:t.warnFraction,overFraction:t.overFraction}}function dX(t,e,r,n){let i=t/e;return n!==null&&i>=n?"red":r!==null&&i>=r?"yellow":"green"}function wP(t,e){let r=e.get("swimlane"),n=EP(le(t.properties,"utilization-warn-at"),r?le(r.properties,"utilization-warn-at"):void 0,cX),i=EP(le(t.properties,"utilization-over-at"),r?le(r.properties,"utilization-over-at"):void 0,lX);return{warn:n,over:i}}function EP(t,e,r){let i=mX(t??e);return i.kind==="unset"?r:i.kind==="none"?null:i.value}var pX=/^\d+(?:\.\d+)?%$/,hX=/^\d+\.\d+$/;function mX(t){if(t===void 0)return{kind:"unset"};if(t==="none")return{kind:"none"};if(pX.test(t)){let e=parseFloat(t)/100;return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}if(hX.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}return{kind:"unset"}}var RP=10;function gX(t,e,r){let n=le(t.properties,"capacity"),i=Yn(n);if(i===null)return{capacity:null,badgeWidthPx:0};let o=lc(i),s=uc(e.capacityIcon,r),a=Wi(o,s,RP);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var yX=10,xX=38,TX=8;function _X(t,e,r){let n=t.title??t.name??"";if(!n)return 0;let i=le(t.properties,"owner");return Sc(0,n,i??void 0,e,r).rightX}function EX(t,e){if(!t.name)return[];let r=[];for(let[n,i]of e.footnoteHosts.entries())if(i.includes(t.name)){let o=e.footnoteIndex.get(n);o!==void 0&&r.push(o)}return r.sort((n,i)=>n-i),r}function vX(t,e,r,n){for(let i of t.content){if(i.$type==="DescriptionDirective")continue;let o=cr(i)?i.properties:i.properties??[];return n.resolveChildStart(o,e,e,r)}}var nc=class{constructor(e,r){S(this,"input");S(this,"deps");this.input=e,this.deps=r}get id(){return this.input.lane.name??""}place(e,r){let{lane:n,bandIndex:i}=this.input,{deps:o}=this,s=st("swimlane",n.properties,r.styleCtx),a=e.x,c=r.bandScale.step(),l=r.currentFlowKey;r.currentFlowKey=`lane:${n.name??i}`;let{capacity:u,badgeWidthPx:f}=gX(n,s,r.symbols),d=EX(n,r),p=d.length>0?o.estimateTextWidth(d.join(","),RP):0,m=_X(n,f,p),y=vX(n,a,r,o),v=!n.title||y===void 0||y>=m+TX,_=e.y+(v?yX:xX),x=new Ha({laneLeftX:a,originY:_,minRowHeight:c,slackCorridors:r.slackCorridors}),E=a,b=[];for(let R of n.content){if(R.$type==="DescriptionDirective")continue;if(!cr(R)){let we=R.properties??[],V=o.resolveChildStart(we,E,a,r),{rowIndex:G,y:oe}=x.placeBlock(),U=o.newCursor(V,oe),pe=o.sequenceOne(R,U,r);b.push(pe);let he=pe.box.x+pe.box.width,ge=Math.max(c,U.height);x.commitBlock({rowIndex:G,placed:pe,blockHeight:ge,blockEnd:he,spillReservation:Xu(pe)}),E=Math.max(E,he);continue}let O=R.properties,F=o.resolveChildStart(O,E,a,r),A=Ui(O,r.sizes,r.cal),k=Math.max(hr,A*r.timeline.pixelsPerDay),N=F+k,B=R.name??"",j=o.predictItemBarExtraHeight(R,r),W=c+j,{rowIndex:Q,y:J}=x.placeItem({childId:B,desiredStart:F,desiredEnd:N,predictedHeight:W}),ce=o.newCursor(F,J),K=o.sequenceItem(R,ce,r);b.push(K);let ie=K.box.x+K.box.width+rr;E=Math.max(E,ie);let ue=null;(K.textSpills||K.chipsOutside||K.dotSpills||K.iconSpills||K.footnoteSpills)&&(ue=Math.max(K.decorationsRightX,K.chipsOutside?K.chipsRightX:0)+6),x.commitItem({rowIndex:Q,placed:K,logicalEnd:ie,spillReservation:ue,rowHeight:Math.max(W,c+(K.box.height-r.bandScale.bandwidth()))})}let D=_-e.y,I=Math.max(c+32,D+x.usedHeight()+16),M=Math.max(x.usedRightX(),m),H={x:0,y:e.y,width:r.chartRightX,height:I},Y=le(n.properties,"owner"),re;if(Y){let R=r.teams.get(Y),O=r.persons.get(Y);re=R?.title??O?.title??Y}let $=u?(()=>{let{warn:R,over:O}=wP(n,r.styleCtx.defaults);return bP({children:b,capacityValue:u.value,warnFraction:R,overFraction:O})})():null;return r.currentFlowKey=l,{positioned:{id:n.name,title:n.title??n.name??"",box:H,bandIndex:i,children:b,nested:[],style:s,owner:re,footnoteIndicators:d,capacity:u,utilization:$},usedHeight:I,usedRightX:M}}};var bX=18,wX=14,RX=14,AX=16,SX=32;function AP(t,e,r,n){let i=r+bX,o=[],s=!0;for(let a of t){s||(i+=AX),s=!1;let c=a.content.roadmap?.title??a.sourcePath,l=i+wX,u={cal:e.cal,styleCtx:{theme:e.styleCtx.theme,styles:a.config.styles,defaults:a.config.defaults,labels:a.content.labels},sizes:uh(a.content.sizes,e.cal),labels:a.content.labels,teams:a.content.teams,persons:a.content.persons,symbols:a.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:e.timeline,scale:e.scale,calendar:e.calendar,bandScale:e.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:"",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:new Map,chartTopY:l,chartBottomY:l,swimlaneBottomY:l,chartRightX:e.chartRightX,nextParallelId:0,nextGroupId:0},f=[],d=l,p=0;for(let I of a.content.swimlanes.values()){u.nextParallelId=0,u.nextGroupId=0;let{positioned:M,usedHeight:H}=new nc({lane:I,bandIndex:p},n).place({x:u.timeline.originX,y:d},u);f.push(M),d+=H,p++}let m=d,y=Math.max(e.bandScale.bandwidth(),m-i+RX),v=0,{chromeRightX:_}=Ic(v,c,a.sourcePath),x=rc(f),E=Math.max(_,x)+SX,b=Math.min(e.chartRightX-v,E-v),D={x:v,y:i,width:b,height:y};for(let I of f)I.box.width=b;o.push({sourcePath:a.sourcePath,label:c,box:D,nestedSwimlanes:f,style:st("swimlane",[],e.styleCtx)}),i+=y}return{regions:o,endY:i}}function Fh(t,e){let r=[];for(let n of t){let o=e.entityVisualRightX.get(n)??e.entityRightEdges.get(n);if(o===void 0)continue;let s=e.itemSlackAttachY.get(n)??e.entityMidpoints.get(n)?.y??0,a=e.itemFlowKey.get(n)??`marker:${n}`;r.push({ref:n,x:o,y:s,flowKey:a})}return r}function Uh(t){let e=new Map;for(let r of t){let n=e.get(r.flowKey);(!n||r.x>n.x)&&e.set(r.flowKey,r)}return Array.from(e.values())}function SP(t,e,r,n,i,o,s,a){let c=n.length*i*.58*(o?1.05:1),l=t+r+6,u=t-r-6-c,f=l+c<=a,d=u>=s,p=f?"right":d?"left":"right";return{box:{x:p==="right"?l:u,y:e-4,width:c,height:12},side:p}}var nE=class{constructor(e,r){S(this,"id");S(this,"milestone");this.id=e,this.milestone=r}place(e){let r=this.milestone,n=st("milestone",r.properties,e.styleCtx),i=le(r.properties,"date"),o=tt(r.properties,"after"),s=dt(i),a=e.timeline.markerRow.y,c=6,l=r.title??this.id,u=null,f=a,d=null,p="right",m=!1,y,v=!1;if(s){let x=e.scale.forwardWithinDomain(s);if(x===null)return null;u=x,m=!0;let E=e.markerRowPlacements.get(this.id);E&&(f=E.centerY,d=E.labelBox,p=E.labelSide);let b=Fh(o,e),D=Uh(b),I=null;for(let M of D)(!I||M.x>I.x)&&(I=M);I&&I.x>x&&(v=!0,y=[{x:I.x,y:I.y>0?I.y:f}])}else if(o.length>0){let x=Fh(o,e),E=Uh(x);E.sort((M,H)=>H.x-M.x);let b=E[0]?.x??e.timeline.originX;u=b,m=!1;let D=SP(u,a,c,l,10,!0,e.timeline.box.x,e.chartRightX);f=a,d=D.box,p=D.side,e.markerRowPlacements.set(this.id,{rowIndex:0,centerY:f,labelBox:d,labelSide:p});let I=[];for(let M=1;M<E.length;M++){let H=E[M];H.x<b&&H.y>0&&I.push({x:H.x,y:H.y})}I.length>0&&(y=I)}if(u===null)return null;if(!d){let x=SP(u,f,c,l,10,!0,e.timeline.box.x,e.chartRightX);d=x.box,p=x.side}let _={x:u,y:f};return e.entityLeftEdges.set(this.id,_.x),e.entityRightEdges.set(this.id,_.x),e.entityMidpoints.set(this.id,_),{id:this.id,title:l,center:_,radius:c,fixed:m,slackArrows:y,isOverrun:v,style:n,cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,labelBox:d,labelSide:p}}};function IP(t,e){let r=[];for(let[n,i]of t){let o=new nE(n,i).place(e);o&&r.push(o)}return r}var kX=4;function NP(t,e){e>t.chartRightX&&(t.chartRightX=e)}var Xh=class{place(e,r,n,i){let o=n.theme??"light",s=v_[o],a=n.width??1280,c=eN(n.locale,CX(e)),l=Yk(e,r.config.calendar),u=mP(e,r.config.scale),f=uh(r.content.sizes,l),d={theme:s,styles:r.config.styles,defaults:r.config.defaults,labels:r.content.labels},{startDate:p,endDate:m}=i.computeDateWindow(e,{cal:l,sizes:f},r,n.today,u),y=st("roadmap",e.roadmapDecl?.properties??[],d),v=y.headerPosition==="beside",_=y.timelinePosition!=="bottom",x=y.timelinePosition==="bottom"||y.timelinePosition==="both",E=e.roadmapDecl?.title??e.roadmapDecl?.name??"",b=le(e.roadmapDecl?.properties??[],"author"),D=i.sizeBesideHeader(E,b),I=v?{x:0,y:0,width:D.boxWidth,height:0}:{x:0,y:0,width:0,height:Pu},M=v?D.boxWidth:0,H=v?8:Pu+8,Y=gP(l),re=u.pixelsPerUnit/Y.daysPerUnit(u.unit),$=Math.max(1,vr(p,m)),R=$*re,O=M+mr,F=R,A=M+mr+F+mr,k=Math.min(a,A),N=n.today!==void 0&&n.today>=p&&n.today<=m,B=r.content.anchors.size+r.content.milestones.size>0,j=N?Kn:0,W=_?fc:0,Q=new yu({domain:[p,m],range:[O,O+R],calendar:Y}),J=Math.max(k,O+F+mr),ce=[];for(let[X,ne]of r.content.anchors){let xe=dt(le(ne.properties,"date"));if(!xe)continue;let pr=Q.forwardWithinDomain(xe);pr!==null&&ce.push({id:X,centerX:pr,radius:6,title:ne.title??X,fontSize:10,bold:!1,date:xe,isMilestone:!1})}for(let[X,ne]of r.content.milestones){let xe=dt(le(ne.properties,"date"));if(!xe)continue;let pr=Q.forwardWithinDomain(xe);pr!==null&&ce.push({id:X,centerX:pr,radius:6,title:ne.title??X,fontSize:10,bold:!0,date:xe,isMilestone:!0})}let K=PP(ce,M,J,i.estimateTextWidth),ie=B?Math.max(1,K.rowCount):0,ue=ie*26,Ee=j+W+ue,we=Ee+8,V=v?D.cardHeight+kX:0,G=Math.max(H,V-Ee),oe=G+j,U=oe+W,pe=U+ue,he=Q_(Q,u,Y,c),ge={box:{x:O,y:G,width:R,height:0},ticks:he,pixelsPerDay:re,originX:O,startDate:p,endDate:m,labelStyle:st("roadmap",[],d),pillRowHeight:j,tickPanelY:oe,tickPanelHeight:W,markerRow:{y:U+13,height:ue,collisionY:U-8},minorGrid:y.minorGrid},De=new Map;for(let[X,ne]of K.placements){let xe=U+13+ne.rowIndex*26;De.set(X,{rowIndex:ne.rowIndex,centerY:xe,labelBox:{...ne.labelBox,y:xe-4},labelSide:ne.labelSide})}let q={cal:l,styleCtx:d,sizes:f,labels:r.content.labels,teams:r.content.teams,persons:r.content.persons,symbols:r.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:ge,scale:Q,calendar:Y,bandScale:hP(),entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:"",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:De,chartTopY:G+we,chartBottomY:0,swimlaneBottomY:0,chartRightX:J,nextParallelId:0,nextGroupId:0};for(let X of ce){let ne=De.get(X.id);ne&&(q.entityLeftEdges.set(X.id,X.centerX),q.entityRightEdges.set(X.id,X.centerX),q.entityMidpoints.set(X.id,{x:X.centerX,y:ne.centerY}))}let It=rE(r.content.footnotes,q,0);q.footnoteIndex=It.index,q.footnoteHosts=It.hosts;let oc=new Map(q.entityLeftEdges),wr=new Map(q.entityRightEdges),Rr=new Map(q.entityMidpoints),qo=[...r.content.swimlanes.values()],sc=st("swimlane",[],d),Ar=BE[sc.spacing]??0,dn=()=>{q.nextParallelId=0,q.nextGroupId=0;let X=[],ne=q.chartTopY,xe=0,pr=q.timeline.originX;for(let HC of qo){xe>0&&(ne+=Ar);let{positioned:jC,usedHeight:zC,usedRightX:$E}=new nc({lane:HC,bandIndex:xe},i).place({x:q.timeline.originX,y:ne},q);X.push(jC),ne+=zC,$E>pr&&(pr=$E),xe++}return{swimlanes:X,nextY:ne,maxRightX:pr}},fr=dn(),dr=fr.swimlanes,pn=fr.nextY,Qt=NX(r.content.milestones,q);Qt.length>0&&(q.entityLeftEdges=new Map(oc),q.entityRightEdges=new Map(wr),q.entityMidpoints=new Map(Rr),q.itemSlackAttachY=new Map,q.entityVisualLeftX=new Map,q.entityVisualRightX=new Map,q.itemArrowSource=new Map,q.itemFlowKey=new Map,q.currentFlowKey="",q.slackCorridors=Qt,fr=dn(),dr=fr.swimlanes,pn=fr.nextY),NP(q,fr.maxRightX+mr);for(let X of dr)X.box.width=q.chartRightX;let T=r.content.isolatedRegions,C=[];if(T.length>0){let X=AP(T,q,pn+8,i);C=X.regions,pn=X.endY}q.chartBottomY=pn,q.swimlaneBottomY=pn,ge.box.height=q.chartBottomY-ge.box.y;let z=IP(r.content.milestones,q),Z=rc(dr);for(let X of C)Z=Math.max(Z,rc(X.nestedSwimlanes));for(let X of ce)Z=Math.max(Z,X.centerX+X.radius);for(let X of z)Z=Math.max(Z,X.center.x+X.radius);let ye=Y.daysPerUnit(u.unit),He=(Z-O)/re,fe=He>0?Math.ceil(He/ye)*ye:0;if(fe>$){let X=Bi(p,fe),ne=fe*re,xe=new yu({domain:[p,X],range:[O,O+ne],calendar:Y});q.scale=xe,ge.endDate=X,ge.box.width=ne,ge.ticks=Q_(xe,u,Y,c),NP(q,O+ne+mr)}let Me=ce.map(X=>({id:X.id,centerX:X.centerX,radius:X.radius,title:X.title,fontSize:X.fontSize,bold:X.bold}));for(let X of z)X.fixed||Me.push({id:X.id??"",centerX:X.center.x,radius:X.radius,title:X.title,fontSize:10,bold:!0});let at=PP(Me,M,q.chartRightX,i.estimateTextWidth);q.markerRowPlacements.clear();for(let[X,ne]of at.placements){let xe=U+13+ne.rowIndex*26;q.markerRowPlacements.set(X,{rowIndex:ne.rowIndex,centerY:xe,labelBox:{...ne.labelBox,y:xe-4},labelSide:ne.labelSide})}for(let X of z){let ne=q.markerRowPlacements.get(X.id??"");ne&&(X.center={x:X.center.x,y:ne.centerY},X.labelBox=ne.labelBox,X.labelSide=ne.labelSide)}for(let X of ce){let ne=q.markerRowPlacements.get(X.id);ne&&q.entityMidpoints.set(X.id,{x:X.centerX,y:ne.centerY})}for(let X of z)X.fixed||q.entityMidpoints.set(X.id??"",{x:X.center.x,y:X.center.y});let Be=B?Math.max(1,at.rowCount):0;if(Be>ie){let X=(Be-ie)*26;q.timeline.markerRow.height=Be*26,q.timeline.box.height+=X,q.chartTopY+=X,q.chartBottomY+=X,q.swimlaneBottomY+=X;for(let ne of dr)iE(ne,X);for(let ne of C)PX(ne,X);for(let[ne,xe]of q.entityMidpoints)q.markerRowPlacements.has(ne)||q.entityMidpoints.set(ne,{x:xe.x,y:xe.y+X});for(let[ne,xe]of q.itemSlackAttachY)q.itemSlackAttachY.set(ne,xe+X);for(let[ne,xe]of q.itemArrowSource)q.itemArrowSource.set(ne,{x:xe.x,y:xe.y+X});for(let ne of z)if(ne.cutTopY=q.chartTopY,ne.cutBottomY=q.swimlaneBottomY,ne.slackArrows)for(let xe of ne.slackArrows)xe.y+=X}x&&(q.timeline.bottomTickPanelY=q.chartBottomY+8,q.timeline.bottomTickPanelHeight=fc,q.chartBottomY+=8+fc);let je=new Set(z.map(X=>X.center.x)),At=TP(r.content.anchors,q,je),er=i.collectItems(qo),tr=i.buildDependencies(er,dr,C,q),kt=i.buildNowline(n.today,q,c),mt=rE(r.content.footnotes,q,q.chartBottomY);q.footnoteIndex=mt.index,q.footnoteHosts=mt.hosts,I.height=I.height||q.chartBottomY,v||(I.width=q.chartRightX);let ac=v?{x:6,y:pe-D.cardHeight,width:D.cardWidth,height:D.cardHeight}:{x:0,y:0,width:q.chartRightX,height:Pu},Zh=mt.area.entries.length>0?mt.area.box.y+mt.area.box.height:q.chartBottomY,Vo={x:q.chartRightX-mr-pm,y:Zh+mr,width:pm,height:zE},ME=Vo.y+Vo.height+mr,Re={box:I,position:y.headerPosition,title:E,author:b,titleLines:D.titleLines,authorLines:D.authorLines,cardBox:ac,logo:void 0,style:y,attributionBox:Vo};return{width:q.chartRightX,height:ME,theme:o,palette:s,backgroundColor:s.surface.page,header:Re,timeline:ge,nowline:kt,swimlanes:dr,anchors:At,milestones:z,edges:tr,footnotes:mt.area,includes:C,chartBox:{x:M,y:q.chartTopY,width:q.chartRightX-M,height:q.chartBottomY-q.chartTopY}}}};function NX(t,e){let r=[];for(let[n,i]of t){let o=le(i.properties,"date"),s=tt(i.properties,"after"),a=dt(o),c=Fh(s,e),l=Uh(c);if(a){let f=e.scale.forwardWithinDomain(a);if(f===null)continue;let d=null;for(let p of l)(!d||p.x>d.x)&&(d=p);d&&d.x>f&&d.y>0&&r.push({xStart:Math.min(d.x,f),xEnd:Math.max(d.x,f),y:d.y,slackPredId:d.ref,milestoneId:n});continue}if(l.length===0)continue;l.sort((f,d)=>d.x-f.x);let u=l[0].x;for(let f=1;f<l.length;f++){let d=l[f];d.x<u&&d.y>0&&r.push({xStart:d.x,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:n})}}return r}function iE(t,e){t.box.y+=e;for(let r of t.children)CP(r,e);for(let r of t.nested)iE(r,e)}function CP(t,e){if(t.box.y+=e,t.kind==="item"){t.overflowBox&&(t.overflowBox.y+=e);for(let r of t.labelChips)r.box.y+=e;return}for(let r of t.children)CP(r,e)}function PX(t,e){t.box.y+=e;for(let r of t.nestedSwimlanes)iE(r,e)}function PP(t,e,r,n){let i=[...t].sort((a,c)=>a.centerX-c.centerX),o=new Map,s=[];for(let a of i){let c=n(a.title,a.fontSize)*(a.bold?1.05:1),l=a.centerX+a.radius+6,u=a.centerX-a.radius-6-c,f=l+c<=r,d=u>=e,p=a.centerX-a.radius,m=a.centerX+a.radius,y=M=>M==="right"?l:u,v=M=>M==="right"?f:d,_=(M,H)=>{let Y=Math.min(p,M),re=Math.max(m,M+c);return s[H].some($=>$.left<re&&$.right>Y)},x=-1,E="right",b=l;e:for(let M=s.length-1;M>=0;M--)for(let H of["right","left"]){if(!v(H))continue;let Y=y(H);if(!_(Y,M)){x=M,E=H,b=Y;break e}}if(x===-1){for(let[M,H]of o)o.set(M,{...H,rowIndex:H.rowIndex+1});s=[[],...s],x=0,E=f?"right":"left",b=y(E)}let D=Math.min(p,b),I=Math.max(m,b+c);s[x].push({left:D,right:I}),o.set(a.id,{rowIndex:x,labelBox:{x:b,y:0,width:c,height:12},labelSide:E})}return{placements:o,rowCount:s.length}}function CX(t){return t.directive?.properties.find(r=>OX(r.key)==="locale")?.value}function OX(t){return t.endsWith(":")?t.slice(0,-1):t}function LX(t){switch(t){case"done":case"completed":return"done";case"in-progress":case"active":return"in-progress";case"at-risk":case"blocked":case"planned":return t;case void 0:return"planned";default:return"neutral"}}function DX(t){if(!t)return 0;let e=/^(\d{1,3})%$/.exec(t);return e?Math.max(0,Math.min(100,parseInt(e[1],10)))/100:0}function MX(t,e){if(t)return/^\d+(?:\.\d+)?[dwmqy]$/.test(t)||/^\d+%$/.test(t)?t:e.sizes.get(t)?.effortLiteral??t}function $X(t,e){if(t)return e.teams.get(t)?.title??e.persons.get(t)?.title??t}function FX(t){if(!t)return{icon:"none"};let e=t.toLowerCase();return e.includes("linear.app")?{icon:"linear",href:t}:e.includes("github.com")?{icon:"github",href:t}:e.includes("atlassian.net")||e.includes("jira.")?{icon:"jira",href:t}:{icon:"generic",href:t}}function Gh(t,e,r,n,i){let o=aN(t,e),s=t.name??t.title??"",a=o.padding==="none"?"xs":o.padding,c=XE[a],l=Math.max(20,Math.round(s.length*5.5+c*2));return i!==void 0&&(l=Math.min(l,i)),{text:s,style:o,box:{x:r,y:n,width:l,height:Qi}}}function DP(t,e){let r=Zk(t,e.sizes,e.cal),n=Kk(le(t,"remaining"),e.sizes,e.cal),i=le(t,"status"),o=LX(i),s=DX(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(le(t,"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"&&n>0&&r>0&&(s=Math.max(0,Math.min(1,1-n/r))),{status:o,progress:s}}function MP(t,e,r,n,i,o,s){let a=le(t,"duration"),c=!!a&&/^\d+(?:\.\d+)?[dwmqy]$/.test(a),l=n?n.title??n.name:"",u=c?a:l||void 0,f=le(t,"remaining"),d=MX(f,e),p=$X(r??le(t,"owner"),e),m=()=>[u,p].filter(Boolean).join(" "),y;if(i==="in-progress"&&d){let b=m();y=b?`${b} \u2014 ${d} remaining`:`${d} remaining`}else if(i==="in-progress"&&o>0&&o<1){let b=Math.round((1-o)*100),D=m();y=D?`${D} \u2014 ${b}% remaining`:`${b}% remaining`}else(p||u)&&(y=m()||void 0);let v=le(t,"capacity"),_=Yn(v),x=null,E=0;if(_!==null){let b=lc(_),D=uc(s,e.symbols);x={value:_,text:b,icon:D};let I=11;E=(y?St(" ",I):0)+Wi(b,D,I)}return{metaText:y,ownerDisplay:p,capacity:x,capacityTrailingWidth:E}}function $P(t,e){let r=new Set;if(t){for(let[n,i]of e.footnoteHosts.entries())if(i.includes(t)){let o=e.footnoteIndex.get(n);o!==void 0&&r.add(o)}}return[...r].sort((n,i)=>n-i)}function FP(t,e,r){return wc({barWidth:t,footnoteLabels:e.map(String),hasBeforeGlyph:br(r)!==void 0})}function uE(t,e,r,n){let i=t.properties,o=st("item",i,r.styleCtx),s=le(i,"size"),a=s?r.sizes.get(s)??null:null,c=Ui(i,r.sizes,r.cal),l=tt(i,"after"),u=tt(i,"before"),f=le(i,"date"),d=e.x,p=dt(f);if(p){let Re=r.scale.forwardWithinDomain(p);Re!==null&&(d=Re)}else if(l.length>0){let Re=e.x;for(let Nt of l){let X=dt(Nt);if(X){let xe=r.scale.forwardWithinDomain(X);xe!==null&&(Re=Math.max(Re,xe));continue}let ne=r.entityRightEdges.get(Nt);ne!==void 0&&(Re=Math.max(Re,ne))}d=Math.max(e.x,Re)}let m=Math.max(hr,c*r.timeline.pixelsPerDay),y=d,v=d+m,_=le(i,"link"),x=FX(_),E=x.icon!=="none",b=Math.max(hr,m-2*rr),D=tt(i,"labels"),I=[];for(let Re of D){let Nt=r.labels.get(Re);if(!Nt)continue;let X=Gh(Nt,r.styleCtx,0,0);I.push({id:Nt,width:X.box.width})}let M=0;for(let Re=0;Re<I.length;Re+=1)Re>0&&(M+=xn),M+=I[Re].width;let H=Math.max(0,b-2*qr),Y=I.length>0&&M>H,re=!1,$,R;if(u.length>0){let Re,Nt;for(let X of u){let ne=dt(X),xe=ne?r.scale.forwardWithinDomain(ne)??void 0:r.entityLeftEdges.get(X);xe!==void 0&&(Re===void 0||xe<Re)&&(Re=xe,Nt=X)}Re!==void 0&&v>Re&&(re=!0,$={x:Re,y:e.y,width:v-Re,height:r.bandScale.bandwidth()},R=Nt)}let{status:O,progress:F}=DP(i,r),A={done:"#ecfdf5","in-progress":"#eff6ff","at-risk":"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},k={done:"#052e16","in-progress":"#172554","at-risk":"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},N={done:"#ebebeb","in-progress":"#e4e4e4","at-risk":"#eeeeee",blocked:"#dcdcdc",planned:"#f5f5f5",neutral:"#f5f5f5"},B={done:r.styleCtx.theme.status.done,"in-progress":r.styleCtx.theme.status.inProgress,"at-risk":r.styleCtx.theme.status.atRisk,blocked:r.styleCtx.theme.status.blocked,planned:r.styleCtx.theme.status.planned,neutral:r.styleCtx.theme.status.neutral},j=r.styleCtx.theme.name,W=j==="dark",Q=W?"#0f172a":"#ffffff",J=j==="grayscale"?"#9e9e9e":"#94a3b8";o.bg===Q&&(o.bg=j==="grayscale"?N[O]:W?k[O]:A[O]),o.fg===J&&(o.fg=B[O]);let{metaText:ce,ownerDisplay:K,capacity:ie,capacityTrailingWidth:ue}=MP(i,r,n,a,O,F,o.capacityIcon),Ee=t.title??t.name??"",we=$P(t.name,r),V=new yh({id:t.name??"",title:Ee,logicalLeftX:y,logicalRightX:v,metaText:ce,metaTrailingWidth:ue,hasLinkIcon:E,hasAfterGlyph:br(l)!==void 0,titleFirstLineRightReservePx:FP(b,we,u)}).place({x:y,y:e.y},{time:r.scale,bands:r.bandScale,style:o}),G=V.box,oe=r.bandScale.bandwidth(),U=G.width<Qo,pe=E&&G.width<Fu,he=G.width<Uu,ge=V.textSpills||pe,De=S_(Ee,V,pe),q=De.length,It=null;Y&&(It=Rm(I,G.width));let oc=It?It.rows.length:I.length>0?1:0,wr=ce!==void 0||ie!==null,Rr=vc(q,wr),qo=$u(q,wr),sc=BP(Y,ge,oc,oe,Rr),Ar=Math.max(qo,sc);Ar>0&&(G.height=oe+Ar);let dn=[],fr=G.y+oe-Wr-Qi-ei,dr=G.y+(Y&&ge?Math.max(Zo,Rr):Rr)+ei,Qt=Y&&ge||!Y&&I.length>0?Math.max(fr,dr):fr,T=Y?G.x+G.width+gn:G.x+qr,C=T;if(It)for(let Re=0;Re<It.rows.length;Re+=1){let Nt=Qt+Re*wm,X=T;for(let xe of It.rows[Re]){let pr=Gh(xe.id,r.styleCtx,X,Nt);dn.push(pr),X+=pr.box.width+xn}let ne=X-xn;ne>C&&(C=ne)}else{let Re=T;for(let Nt of I){let X=Gh(Nt.id,r.styleCtx,Re,Qt);dn.push(X),Re+=X.box.width+xn}C=I.length>0?Re-xn:T}let z=K??n??le(i,"owner"),Z=t.description?.text,ye=we.length>0&&he,fe=G.x+G.width+gn,Me=!1,at=null;pe&&(Me&&(fe+=gr),at=fe,fe=at+yn,Me=!0);let Be=0;if(ge){Me&&(fe+=gr);let Re=Math.max(...De.map(X=>St(X,_c))),Nt=(ce?St(ce,11):0)+ue;Be=Math.max(Re,Nt),fe+=Be,Me=!0}let je=null;ye&&(Me&&(fe+=gr),je=fe,fe+=we.length*Jn,Me=!0);let At=null;U&&(Me&&(fe+=gr),At=fe+Vr,fe=At+Vr,Me=!0);let er=Math.max(G.x+G.width,fe),tr=t.name;tr&&(r.entityLeftEdges.set(tr,y),r.entityRightEdges.set(tr,v));let kt=tr??UP(t),mt=G.y+oe/2;r.entityMidpoints.set(kt,{x:(y+v)/2,y:ge?G.y+G.height/2:mt}),r.entityVisualLeftX.set(kt,G.x),r.entityVisualRightX.set(kt,G.x+G.width);let ac=ge?{x:G.x+G.width,y:G.y+G.height-Wr/2}:{x:G.x+G.width,y:mt};r.itemArrowSource.set(kt,ac),r.itemFlowKey.set(kt,r.currentFlowKey);let Zh=ge?G.y+G.height-Wr/2:G.y+G.height/2;r.itemSlackAttachY.set(kt,Zh),e.x=v,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,r.bandScale.step()+Ar);let Vo=tN({box:G,afterDate:br(l),beforeDate:br(u),hasLinkIcon:E,footnoteCount:we.length});return{kind:"item",id:tr,title:Ee,...De.length>=2||De[0]!==Ee?{titleLines:De}:{},box:G,status:O,progressFraction:F,footnoteIndicators:we,labelChips:dn,chipsOutside:Y,chipsRightX:C,linkIcon:x.icon,linkHref:x.href,hasOverflow:re,overflowBox:$,overflowAnchorId:R,owner:z,description:Z,metaText:ce,textSpills:ge,dotSpills:U,iconSpills:pe,footnoteSpills:ye,dotSpillCx:At,iconSpillX:at,footnoteSpillStartX:je,decorationsRightX:er,capacity:ie,size:a,style:o,inlineDatePins:Vo.length>0?Vo:void 0}}function UX(t,e,r){return new xh(t,{sequenceOne:fE,newCursor:hh}).place(e,r)}function BX(t,e,r){return new mh(t,{sequenceItem:uE,sequenceOne:fE,resolveChildStart:GP,newCursor:hh,estimateTextWidth:St,predictItemBarExtraHeight:XP}).place(e,r)}function fE(t,e,r){if(cr(t))return uE(t,e,r);if(Xr(t))return UX(t,e,r);if(Br(t))return BX(t,e,r);throw new Error(`Unknown swimlane child type: ${t.$type??"unknown"}`)}function UP(t){let e=t.$cstNode?.range.start;return`#item@${e?e.line+1:0}:${e?e.character+1:0}`}function BP(t,e,r,n,i){if(r===0)return 0;let o=n-Wr-Qi-ei,s;t&&e?s=Math.max(Zo,i)+ei:t?s=o:s=Math.max(o,i+ei);let c=s+(r-1)*wm+Qi+ei+Wr;return Math.max(0,c-n)}function XP(t,e){let r=t.properties,n=e.bandScale.bandwidth(),i=Ui(r,e.sizes,e.cal),o=Math.max(hr,i*e.timeline.pixelsPerDay),s=Math.max(hr,o-2*rr),a=le(r,"size"),c=a?e.sizes.get(a)??null:null,{status:l,progress:u}=DP(r,e),{metaText:f,capacity:d,capacityTrailingWidth:p}=MP(r,e,void 0,c,l,u,st("item",r,e.styleCtx).capacityIcon),m=f!==void 0||d!==null,y=!!le(r,"link"),v=t.title??t.name??"",_=br(tt(r,"after"))!==void 0,x=Qn(y,_?{barWidth:s}:void 0),E=Math.max(0,s-x-qr),b=Math.max(0,s-x-FP(s,$P(t.name,e),tt(r,"before"))),D=A_(v,E,R_(f,p),b),I=y&&s<Fu,M=D.textSpills||I,H=S_(v,D,I).length,Y=$u(H,m),re=tt(r,"labels"),$=[];for(let B of re){let j=e.labels.get(B);if(!j)continue;let W=Gh(j,e.styleCtx,0,0);$.push({id:j,width:W.box.width})}if($.length===0)return Y;let R=0;for(let B=0;B<$.length;B+=1)B>0&&(R+=xn),R+=$[B].width;let O=Math.max(0,s-2*qr),F=R>O,A=F?Rm($,s):null,k=A?A.rows.length:1,N=BP(F,M,k,n,vc(H,m));return Math.max(Y,N)}function GP(t,e,r,n){let i=dt(le(t,"date"))??dt(le(t,"start"));if(i){let s=n.scale.forwardWithinDomain(i);if(s!==null)return s}let o=tt(t,"after");if(o.length>0){let s=r;for(let a of o){let c=dt(a);if(c){let u=n.scale.forwardWithinDomain(c);u!==null&&(s=Math.max(s,u));continue}let l=n.entityRightEdges.get(a);l!==void 0&&(s=Math.max(s,l))}return Math.max(r,s)}return e}var oE=6;function XX(t,e){let r=cm-32,n=Tc(t,r,16),i=Tc(e??"",r,11),o=0;for(let d of n)o=Math.max(o,St(d,16));for(let d of i)o=Math.max(o,St(d,11));let s=o+32,a=Math.max(HE-oE,Math.min(cm-oE,s)),c=n.length>0?(n.length-1)*20:0,l=i.length>0?18+(i.length-1)*14:0,u=26+c+l+14,f=a+oE;return{titleLines:n,authorLines:i,cardWidth:a,cardHeight:u,boxWidth:f}}function GX(t,e,r,n,i){let s=t.roadmapDecl?.properties??[],a=le(s,"start"),c=dt(a)??HX(n),l=le(s,"length"),u=0;if(l){let y=jX(l,e.cal);y>0&&(u=y)}let f=HP(r,e,c,u>0?void 0:n),d=yP(i.unit,e.cal),p=f>0?Math.ceil(f/d)*d:4*e.cal.daysPerWeek,m=Math.max(u,p);return{startDate:c,endDate:Bi(c,Math.max(1,m))}}function HX(t){let e=t??new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function jX(t,e){let r=/^(\d+(?:\.\d+)?)([dwmqy])$/.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case"d":return n;case"w":return n*e.daysPerWeek;case"m":return n*e.daysPerMonth;case"q":return n*e.daysPerQuarter;case"y":return n*e.daysPerYear;default:return 0}}function HP(t,e,r,n){let i=new Map,o=new Map,s=new Map,a=0,c=f=>{let d=dt(f);return d?vr(r,d):i.has(f)?i.get(f):o.has(f)?o.get(f):s.has(f)?s.get(f):0};for(let f of t.content.anchors.values()){let d=dt(le(f.properties,"date"));if(d&&f.name){let p=vr(r,d);o.set(f.name,p),a=Math.max(a,p)}}let l=(f,d)=>{let p=d;for(let m of f)m.$type!=="DescriptionDirective"&&(p=u(m,p),a=Math.max(a,p));return p},u=(f,d)=>{if(cr(f)){let p=Ui(f.properties,e.sizes,e.cal),m=dt(le(f.properties,"date")),y=dt(le(f.properties,"start")),v=tt(f.properties,"after"),_=d;m?_=vr(r,m):y?_=vr(r,y):v.length>0&&(_=Math.max(d,...v.map(c)));let x=_+p;return f.name&&i.set(f.name,x),x}if(Xr(f)){let p=tt(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d,y=m;for(let v of f.content){if(v.$type==="DescriptionDirective")continue;let _=u(v,m);y=Math.max(y,_)}return y}if(Br(f)){let p=tt(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d;return l(f.content,m)}return d};for(let f of t.content.swimlanes.values())l(f.content,0);for(let f of t.content.milestones.values()){let d=dt(le(f.properties,"date"));if(d){let m=vr(r,d);f.name&&s.set(f.name,m),a=Math.max(a,m);continue}let p=tt(f.properties,"after");if(p.length>0){let m=Math.max(0,...p.map(c));f.name&&s.set(f.name,m),a=Math.max(a,m)}}for(let f of t.content.isolatedRegions){let d=HP({config:f.config,content:f.content,diagnostics:[],processedFiles:new Set},e,r,void 0);a=Math.max(a,d)}if(n){let f=vr(r,n);f>0&&(a=Math.max(a,f))}return a}function zX(t,e,r,n){let i=new fh(Jk(e,r)),o=[],s=[];for(let[l,u]of t){let f=tt(u.properties,"after"),d=n.entityMidpoints.get(l),p=n.entityVisualLeftX.get(l);if(!d||p===void 0)continue;let m={x:p,y:d.y};for(let y of f){let v=n.itemArrowSource.get(y),_,x=v===void 0;if(v)_=v;else{let E=n.entityMidpoints.get(y);if(!E)continue;_={x:E.x,y:d.y}}!x&&Math.abs(_.y-m.y)<.5&&m.x-_.x<20||(o.push({fromId:y,toId:l,from:_,to:m,isMarkerSource:x}),s.push({fromId:y,toId:l}))}}let a=Qk(o,i),c=[];for(let l=0;l<a.length;l++){let u=a[l];c.push({fromId:s[l].fromId,toId:s[l].toId,waypoints:u.waypoints,kind:u.underBar?"underBar":"normal",style:st("item",[],n.styleCtx)})}return c}function WX(t,e,r){if(!t)return null;let n=e.scale.forwardWithinDomain(t);if(n===null)return null;let i=e.timeline.box.y,o=e.timeline.tickPanelY,s=dh(r).nowLabel,a=St(s,hc),c=Math.max(om,Math.ceil(a+2*Ko)),l=e.timeline.originX-mr,u=c/2,f;n-u<l?f="flag-right":n+u>e.chartRightX?f="flag-left":f="center";let d=e.timeline.bottomTickPanelY,p=e.timeline.bottomTickPanelHeight??0,m=d!==void 0&&p>0?d+p:e.swimlaneBottomY;return{x:n,topY:o,bottomY:m,pillTopY:i,pillMode:f,label:s,pillWidth:c,style:st("item",[],e.styleCtx)}}function qX(t){let e=new Map,r=n=>{if(cr(n)){e.set(n.name??UP(n),n);return}if(Xr(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}if(Br(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}};for(let n of t)for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return e}function dE(t,e,r={}){return new Xh().place(t,e,r,{sequenceItem:uE,sequenceOne:fE,resolveChildStart:GP,newCursor:hh,estimateTextWidth:St,predictItemBarExtraHeight:XP,computeDateWindow:GX,sizeBesideHeader:XX,collectItems:qX,buildDependencies:zX,buildNowline:WX})}function pE(t){return t.toISOString().slice(0,10)}function VX(t){return t.id!==void 0?t.id:/[\r\n]/.test(t.title)?t.title.replace(/\s*[\r\n]+\s*/g," ").trim():t.title}function jP(t,e){for(let r of t)r.kind==="item"?e(r):jP(r.children,e)}function YX(t,e,r){let n=VX(t);t.textSpills&&r.push(jo(e,"NL.I1000","info",{name:n},n)),t.chipsOutside&&r.push(jo(e,"NL.I1001","info",{name:n},n)),(t.box.width<Qo||t.dotSpills||t.iconSpills||t.footnoteSpills)&&r.push(jo(e,"NL.I1002","info",{name:n},n)),t.hasOverflow&&r.push(jo(e,"NL.I1003","info",{name:n,anchor:t.overflowAnchorId},n))}function jo(t,e,r,n,i){return{message:ru(t,e,n),severity:r,code:e,entityId:i,lspSeverity:r==="warning"?2:3,data:{code:e,args:n}}}function zP(t,e,r){let n=t.id??t.title,i=[];jP(t.children,a=>i.push(a));for(let a of i)YX(a,e,r);let o=new Set(i.map(a=>a.box.y));o.size>1&&r.push(jo(e,"NL.I1004","info",{lane:n,rows:o.size},n)),(t.utilization?.segments.some(a=>a.classification==="red")??!1)&&r.push(jo(e,"NL.I1005","info",{lane:n},n));for(let a of t.nested)zP(a,e,r)}function hE(t,e={}){let r=e.locale??"en-US",n=[];for(let i of t.swimlanes)zP(i,r,n);if(e.today){let i=e.today,o=t.timeline.startDate,s=t.timeline.endDate;(i<o||i>s)&&n.push(jo(r,"NL.W1000","warning",{date:pE(i),start:pE(o),end:pE(s)}))}return n}var zo=class extends Error{constructor(e){super(e),this.name="TimezoneError"}};function mE(t){if(!t||t.toLowerCase()==="local")return{kind:"local"};if(t.toUpperCase()==="UTC")return{kind:"utc"};if(t==="Z")return{kind:"offset",ms:0};let e=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(t);if(e){let r=e[1]==="+"?1:-1,n=parseInt(e[2],10),i=e[3]!==void 0?parseInt(e[3],10):0;if(n>23||i>59)throw new zo(`nowline: invalid timezone offset "${t}". Hours must be 0\u201323 and minutes 0\u201359.`);return{kind:"offset",ms:r*(n*60+i)*6e4}}try{return{kind:"iana",name:Intl.DateTimeFormat(void 0,{timeZone:t}).resolvedOptions().timeZone}}catch{throw new zo(`nowline: unrecognised timezone "${t}". 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 jh(t,e){switch(e.kind){case"local":return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));case"utc":return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));case"offset":{let r=new Date(t.getTime()+e.ms);return new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()))}case"iana":{let r=new Intl.DateTimeFormat("en-CA",{timeZone:e.name,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),n=0,i=0,o=0;for(let s of r)s.type==="year"?n=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(n,i,o))}}}var KX=/^(\d{4})-(\d{2})-(\d{2})$/,ZX=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,JX=/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function gE(t={}){let e=t.zone??{kind:"local"},r=t.clock??(()=>new Date),n=t.now;if(!(n==="-"||n===null)){if(n instanceof Date)return n;if(n!==void 0){let i=KX.exec(n);if(i)return new Date(Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10)));let o=ZX.exec(n);if(o){let a=new Date(n);if(!Number.isNaN(a.getTime())){if(o[2]==="Z")return jh(a,{kind:"utc"});let l=o[3]==="+"?1:-1,u=parseInt(o[4],10),f=o[5]!==void 0?parseInt(o[5],10):0,d=l*(u*60+f)*6e4;return jh(a,{kind:"offset",ms:d})}}let s=JX.exec(n);return s?new Date(Date.UTC(parseInt(s[1],10),parseInt(s[2],10)-1,parseInt(s[3],10))):void 0}return jh(r(),e)}}function QX(t){return t===2?"warning":t===3?"info":"error"}function WP(t,e){return{severity:QX(t.severity),code:km(t),message:t.message,suggestion:Im(t.message),file:e,line:(t.range?.start.line??0)+1,column:(t.range?.start.character??0)+1}}function qP(t,e){return{severity:"error",code:"parse-error",message:t.message,file:e,line:t.token?.startLine??1,column:t.token?.startColumn??1}}function VP(t,e){return{severity:"error",code:"lex-error",message:t.message,file:e,line:t.line??1,column:t.column??1}}function YP(t){return{severity:t.severity,code:"include",message:t.message,file:t.sourcePath,line:t.line!==void 0?t.line+1:1,column:1}}function KP(t,e,r="warning"){return{severity:r,code:"render.warning",message:t,file:e,line:1,column:1}}function ZP(t,e){return{severity:t.severity,code:t.code,message:t.message,file:e,line:1,column:1}}var JP="__nowline_browser_noop_include__";async function QP(t){throw new Error(`${JP}: include "${t}" was skipped \u2014 running in single-file mode.`)}function eC(t){return t.includes(JP)}var zi={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"}},eG={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"}},tC={...zi,...eG};var iae={none:"",multiplier:"x",person:zi.person.ascii,people:zi.people.ascii,points:zi.points.ascii,time:zi.time.ascii};var zh=class{constructor(e="nl"){S(this,"prefix");S(this,"counter",0);this.prefix=e}next(e){let r=`${this.prefix}-${this.counter++}`;return e?`${r}-${e}`:r}};var tG=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"]),rG=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","class","clip-path","mask","filter","font-family","font-size","font-weight","font-style","text-anchor","dx","dy","rotate","letter-spacing","word-spacing","style","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"]);function nG(t){let e=[],r=0,n=t.length;for(;r<n;){if(t[r]!=="<"){let u=r;for(;r<n&&t[r]!=="<";)r++;let f=t.slice(u,r);f.trim().length>0?e.push({kind:"text",text:f}):f.length>0&&e.push({kind:"text",text:f});continue}if(t.startsWith("<!--",r)){let u=t.indexOf("-->",r+4);if(u<0)break;e.push({kind:"comment",text:t.slice(r+4,u)}),r=u+3;continue}if(t.startsWith("<![CDATA[",r)){let u=t.indexOf("]]>",r+9);if(u<0)break;e.push({kind:"cdata",text:t.slice(r+9,u)}),r=u+3;continue}if(t.startsWith("<?",r)){let u=t.indexOf("?>",r+2);if(u<0)break;e.push({kind:"decl",text:t.slice(r+2,u)}),r=u+2;continue}if(t.startsWith("<!",r)){let u=t.indexOf(">",r+2);if(u<0)break;e.push({kind:"decl",text:t.slice(r+2,u)}),r=u+1;continue}if(t[r+1]==="/"){let u=t.indexOf(">",r+2);if(u<0)break;let f=t.slice(r+2,u).trim();e.push({kind:"close",name:f}),r=u+1;continue}let i=iG(t,r);if(i<0)break;let o=t.slice(r+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:c,attrs:l}=oG(a);e.push({kind:s?"self":"open",name:c,attrs:l}),r=i+1}return e}function iG(t,e){let r=e+1,n=null;for(;r<t.length;){let i=t[r];if(n)i===n&&(n=null);else if(i==='"'||i==="'")n=i;else if(i===">")return r;r++}return-1}function oG(t){let e=0;for(;e<t.length&&/\s/.test(t[e]);)e++;let r=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;let n=t.slice(r,e),i={};for(;e<t.length;){for(;e<t.length&&/\s/.test(t[e]);)e++;if(e>=t.length)break;let o=e;for(;e<t.length&&t[e]!=="="&&!/\s/.test(t[e]);)e++;let s=t.slice(o,e);if(e>=t.length||t[e]!=="="){s&&(i[s]="");continue}if(e++,e>=t.length)break;let a=t[e];if(a!=='"'&&a!=="'"){let l=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;i[s]=t.slice(l,e);continue}e++;let c=e;for(;e<t.length&&t[e]!==a;)e++;i[s]=t.slice(c,e),e<t.length&&e++}return{name:n,attrs:i}}function xu(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function sG(t,e){if(t.startsWith("#")){let r=e.get(t.slice(1));return r?`#${r}`:null}if(/^url\(#[^)]+\)$/.test(t)){let r=t.slice(5,-1),n=e.get(r);return n?`url(#${n})`:null}return null}function rC(t,e={}){let r=e.idPrefix??"nl-logo",n=e.onWarn??(()=>{}),i=nG(t),o=new Map,s=0;for(let l of i)if((l.kind==="open"||l.kind==="self")&&l.attrs&&"id"in l.attrs){let u=l.attrs.id;u&&!o.has(u)&&o.set(u,`${r}-${s++}`)}let a=[],c=[];for(let l of i)if(l.kind!=="comment"&&l.kind!=="decl"){if(l.kind==="cdata"){c[c.length-1]&&a.push(xu(l.text??""));continue}if(l.kind==="text"){if(c.length===0||c[c.length-1]){let u=(l.text??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a.push(u)}continue}if(l.kind==="open"||l.kind==="self"){let u=l.name??"";if(u==="script"||u==="foreignObject"||u==="animate"||u==="animateTransform"||u==="animateMotion"||u==="set"){n(`sanitizer: dropping <${u}>`),l.kind==="open"&&c.push(!1);continue}if(!tG.has(u)){n(`sanitizer: dropping unknown element <${u}>`),l.kind==="open"&&c.push(!1);continue}let f=[`<${u}`],d=Object.keys(l.attrs??{}).sort();for(let p of d){let m=l.attrs[p];if(/^on/i.test(p)){n(`sanitizer: dropping event handler ${p}`);continue}if(!rG.has(p)){n(`sanitizer: dropping attribute ${p}`);continue}if(p==="href"||p==="xlink:href"){let y=sG(m,o);if(y===null){n(`sanitizer: dropping external href ${m}`);continue}f.push(` ${p}="${xu(y)}"`);continue}if(p==="style"){n("sanitizer: dropping inline style");continue}if(p==="id"){let y=o.get(m);y&&f.push(` id="${xu(y)}"`);continue}if(/\burl\(#/i.test(m)){let y=m.replace(/url\(#([^)]+)\)/gi,(v,_)=>{let x=o.get(_);return x?`url(#${x})`:"none"});f.push(` ${p}="${xu(y)}"`);continue}if(/data:|javascript:|vbscript:/i.test(m)){n(`sanitizer: dropping suspicious value at ${p}`);continue}f.push(` ${p}="${xu(m)}"`)}f.push(l.kind==="self"?"/>":">"),a.push(f.join("")),l.kind==="open"&&c.push(!0);continue}l.kind==="close"&&c.pop()&&a.push(`</${l.name}>`)}return a.join("")}var nC=/&/g,iC=/</g,oC=/>/g,aG=/"/g,cG=/'/g;function Jt(t){return t.replace(nC,"&amp;").replace(iC,"&lt;").replace(oC,"&gt;")}function Wn(t){return t.replace(nC,"&amp;").replace(iC,"&lt;").replace(oC,"&gt;").replace(aG,"&quot;").replace(cG,"&#39;")}function ic(t){let e=Object.keys(t).sort(),r=[];for(let n of e){let i=t[n];i==null||i===!1||(i===!0?r.push(n):r.push(`${n}="${Wn(String(i))}"`))}return r.length?` ${r.join(" ")}`:""}function ee(t,e,r){return r===void 0||r===""?`<${t}${ic(e)}/>`:`<${t}${ic(e)}>${r}</${t}>`}function Ce(t,e){return`<text${ic(t)}>${Jt(e)}</text>`}function h(t){return Number.isFinite(t)?Number.isInteger(t)?t.toString():(Math.round(t*100)/100).toString():"0"}var lG={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 uG(t,e){let r=`${t}-shadow-${e}`,n=lG[e],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${n.stdDeviation}"/><feOffset dx="${n.dx}" dy="${n.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${n.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return ee("filter",{id:r,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function sC(t,e){return e==="none"?null:`url(#${t}-shadow-${e})`}function aC(t){return["subtle","soft","hard"].map(e=>uG(t,e)).join("")}var fG={thin:100,light:300,normal:400,bold:700};function dG(t){return Yo[t]??14}function xE(t,e,r){return{"font-family":e[t.font],"font-size":r??dG(t.textSize),"font-weight":fG[t.weight]??400,"font-style":t.italic?"italic":"normal",fill:t.text}}function pG(t){if(t.border==="dashed")return"4 3";if(t.border==="dotted")return"1 3"}function hG(t){if(!t||t==="none"||t==="transparent")return 1;let e=t.startsWith("#")?t.slice(1):t;if(e.length===3&&(e=e.split("").map(s=>s+s).join("")),e.length!==6)return 1;let r=parseInt(e.slice(0,2),16)/255,n=parseInt(e.slice(2,4),16)/255,i=parseInt(e.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(r)+.7152*o(n)+.0722*o(i)}function mG(t,e){return hG(t)>=.24?e.statusDot.onLight:e.statusDot.onDark}function yE(t,e){return t.length*e*.58}function fC(t,e,r,n,i,o,s){let a=i*.58,c=e?yE(e,i):0,l=e?a:0,u=r+c+l,{text:f,icon:d}=t,p=yE(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return Ce({x:h(u),y:h(n),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return Ce({x:h(u),y:h(n),...m},`${f}\xD7`);if(d.kind==="builtin"){let v=zi[d.name],_=Ce({x:h(u),y:h(n),...m},f),x=i*.1,E=i,b=u+p+x,D=n-i*.85,I=`<svg x="${h(b)}" y="${h(D)}" width="${h(E)}" height="${h(E)}" viewBox="${v.viewBox}" style="color:${Wn(s)}" aria-hidden="true">${v.body}</svg>`;return _+I}let y=h(i*.1);return`<text x="${h(u)}" y="${h(n)}" font-family="${Wn(o)}" font-size="${i}" fill="${Wn(s)}">${Jt(f)}<tspan dx="${y}">${Jt(d.text)}</tspan></text>`}var cC=.6,gG=.5;function yG(t){let{metaText:e,capacity:r,x:n,baselineY:i,fontSize:o,fontFamily:s,color:a}=t;if(!e&&!r)return"";let c={"font-family":s,"font-size":o,fill:a};if(!r)return Ce({x:h(n),y:h(i),...c},e);if(!e)return fC(r,void 0,n,i,o,s,a);let l=h(o*cC),u=`<text x="${h(n)}" y="${h(i)}" font-family="${Wn(s)}" font-size="${o}" fill="${Wn(a)}">`,{text:f,icon:d}=r;if(!d)return u+Jt(e)+`<tspan dx="${l}">${Jt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+Jt(e)+`<tspan dx="${l}">${Jt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let I=h(o*.1);return u+Jt(e)+`<tspan dx="${l}">${Jt(f)}</tspan><tspan dx="${I}">${Jt(d.text)}</tspan></text>`}let p=zi[d.name],m=I=>I.length*o*gG,y=n+m(e)+o*cC,v=o*.1,_=o,x=y+m(f)+v,E=i-o*.85,b=u+Jt(e)+`<tspan dx="${l}">${Jt(f)}</tspan></text>`,D=`<svg x="${h(x)}" y="${h(E)}" width="${h(_)}" height="${h(_)}" viewBox="${p.viewBox}" style="color:${Wn(a)}" aria-hidden="true">${p.body}</svg>`;return b+D}function xG(t,e){let r=tC.calendar,n=`<svg x="${h(t.glyphTopLeft.x)}" y="${h(t.glyphTopLeft.y)}" width="${h(t.glyphSize)}" height="${h(t.glyphSize)}" viewBox="${r.viewBox}" style="color:${Wn(e)}" aria-hidden="true">${r.body}</svg>`,i=`<title>${Jt(t.isoDate)}</title>`;return ee("g",{"data-layer":"inline-date-pin","data-side":t.side,"data-date":t.isoDate,"data-spilled":t.spilled?"true":null},i+n)}function TE(t,e){return!t||t.length===0?"":t.map(r=>xG(r,e)).join("")}function TG(t){return(t?.length??0)>0}function dC(t){return t?.some(e=>e.side==="after")??!1}function _G(t,e,r,n,i,o={}){let s=Math.min(Ru[i.cornerRadius]??4,n/2);return ee("rect",{x:h(t),y:h(e),width:h(r),height:h(n),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":pG(i)??null,...o})}function EG(t,e,r,n){let i=t.box.x+t.cardBox.x,o=t.box.y+t.cardBox.y,s=t.cardBox.width,a=t.cardBox.height,c=t.style.bg==="none"?r.surface.headerBox:t.style.bg,l=r.header.cardBorder,u=ee("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:c,stroke:l,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`}),f=[];t.titleLines.forEach((_,x)=>{f.push(Ce({x:h(i+16),y:h(o+26+x*20),"font-family":n[t.style.font],"font-size":16,"font-weight":600,fill:t.style.text},_))});let d=f.join(""),p=o+26+Math.max(0,t.titleLines.length-1)*20,m=r.header.author,y=[];t.authorLines.forEach((_,x)=>{y.push(Ce({x:h(i+16),y:h(p+18+x*14),"font-family":n[t.style.font],"font-size":11,fill:m},_))});let v=y.join("");return ee("g",{"data-layer":"header","data-id":`${e}-header`},u+d+v)}function vG(t,e,r){let n=r.timeline.gridLine,i=r.timeline.minorGridLine,o=t.bottomTickPanelHeight??0,s=t.bottomTickPanelY!==void 0&&o>0,a=t.tickPanelY,c=s?t.bottomTickPanelY+o:t.box.y+t.box.height,l=e,u=t.box.y+t.box.height,f=[];for(let d of t.ticks)if(d.major)f.push(ee("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(c),stroke:n,"stroke-width":1}));else if(t.minorGrid){if(d.labelX===void 0)continue;f.push(ee("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}return ee("g",{"data-layer":"grid"},f.join(""))}function bG(t,e,r){let n=e.timeline.panelFill,i=e.timeline.border,o=e.timeline.labelText,s=[],a=t.tickPanelY,c=t.tickPanelHeight,l=c>0,u=t.markerRow.height>0,f=a+c,d=t.markerRow.height,p=t.bottomTickPanelY,m=t.bottomTickPanelHeight??0,y=p!==void 0&&m>0;l&&s.push(ee("rect",{x:h(t.box.x),y:h(a),width:h(t.box.width),height:h(c),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1})),u&&s.push(ee("rect",{x:h(t.box.x),y:h(f),width:h(t.box.width),height:h(d),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1})),y&&s.push(ee("rect",{x:h(t.box.x),y:h(p),width:h(t.box.width),height:h(m),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1}));for(let v of t.ticks)v.major&&(!v.label||v.labelX===void 0||(l&&s.push(Ce({x:h(v.labelX),y:h(a+Au),"font-family":r.sans,"font-size":10,fill:o,"text-anchor":"middle"},v.label)),y&&s.push(Ce({x:h(v.labelX),y:h(p+Au),"font-family":r.sans,"font-size":10,fill:o,"text-anchor":"middle"},v.label))));return ee("g",{"data-layer":"timeline"},s.join(""))}function wG(t,e,r){if(!t)return"";let n=e.nowline.stroke,i=e.nowline.labelText,o=ee("line",{x1:h(t.x),y1:h(t.topY),x2:h(t.x),y2:h(t.bottomY),stroke:n,"stroke-width":Nu}),s=RG(t,n),a=AG(t,i,r);return ee("g",{"data-layer":"nowline"},o+s+a)}function pC(t){let e=Nu/2;return t.pillMode==="flag-right"?t.x-e:t.pillMode==="flag-left"?t.x+e:t.x}function RG(t,e){let r=t.pillTopY,n=t.pillTopY+Kn,i=sm,o=t.pillWidth;if(t.pillMode==="center")return ee("rect",{x:h(t.x-o/2),y:h(r),width:h(o),height:h(Kn),rx:i,ry:i,fill:e});let s=pC(t);if(t.pillMode==="flag-right"){let l=s+o,u=[`M ${h(s)} ${h(r)}`,`L ${h(l-i)} ${h(r)}`,`A ${i} ${i} 0 0 1 ${h(l)} ${h(r+i)}`,`L ${h(l)} ${h(n-i)}`,`A ${i} ${i} 0 0 1 ${h(l-i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,"Z"].join(" ");return ee("path",{d:u,fill:e})}let a=s-o,c=[`M ${h(s)} ${h(r)}`,`L ${h(a+i)} ${h(r)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(r+i)}`,`L ${h(a)} ${h(n-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,"Z"].join(" ");return ee("path",{d:c,fill:e})}function AG(t,e,r){let n=t.pillTopY+am,i=pC(t),o,s;return t.pillMode==="center"?(o=t.x,s="middle"):t.pillMode==="flag-right"?(o=i+Ko,s="start"):(o=i-Ko,s="end"),Ce({x:h(o),y:h(n),"font-family":r.sans,"font-size":hc,"font-weight":700,fill:e,"text-anchor":s},t.label)}function SG(t,e,r,n,i){let o=[],s=sC(r,t.style.shadow);o.push(_G(t.box.x,t.box.y,t.box.width,t.box.height,t.style,{filter:s??null}));let a=mG(t.style.bg,n),c={done:a.done,"in-progress":a.inProgress,"at-risk":a.atRisk,blocked:a.blocked,planned:a.planned,neutral:a.neutral},l=c[t.status]??c.neutral;if(t.progressFraction>0){let _=Math.max(0,Math.min(t.box.width,t.box.width*t.progressFraction));o.push(ee("rect",{x:h(t.box.x),y:h(t.box.y+t.box.height-Wr),width:h(_),height:Wr,fill:t.style.fg,opacity:.55}))}let u=t.dotSpills&&t.dotSpillCx!==null?t.dotSpillCx:t.box.x+t.box.width-Ki;o.push(ee("circle",{cx:h(u),cy:h(t.box.y+xm),r:Vr,fill:l})),o.push(TE(t.inlineDatePins,t.style.fg));let f;if(t.textSpills)f=t.box.x+t.box.width+gn,t.iconSpills&&(f+=yn+gr);else{let _=!!t.linkIcon&&t.linkIcon!=="none",E=t.inlineDatePins?.find(b=>b.side==="after"&&!b.spilled)?Qn(_,{barWidth:t.box.width}):Qn(!e.noLinks&&_&&!t.iconSpills);f=t.box.x+E}let d=t.style.text,p=n.entities.item.text,m=t.textSpills?p:d,y=t.textSpills?p:t.style.fg,v=t.titleLines??(t.title?[t.title]:[]);if(v.forEach((_,x)=>{_!==""&&o.push(Ce({x:h(f),y:h(t.box.y+Du+x*Ec),"font-family":i[t.style.font],"font-size":_c,"font-weight":600,fill:m},_))}),(t.metaText||t.capacity)&&o.push(yG({metaText:t.metaText,capacity:t.capacity,x:f,baselineY:t.box.y+Mu(v.length),fontSize:gm,fontFamily:i[t.style.font],color:y})),t.footnoteIndicators.length>0){let _=t.box.y+Tm;if(t.footnoteSpills&&t.footnoteSpillStartX!==null){let x=t.footnoteSpillStartX;for(let E=0;E<t.footnoteIndicators.length;E++){let b=t.footnoteIndicators[E];o.push(Ce({x:h(x),y:h(_),"font-family":i.sans,"font-size":bc,"font-weight":700,fill:p},String(b))),x+=Jn}}else{let x=t.box.x+t.box.width-Jo;for(let E=t.footnoteIndicators.length-1;E>=0;E--){let b=t.footnoteIndicators[E];o.push(Ce({x:h(x),y:h(_),"font-family":i.sans,"font-size":bc,"font-weight":700,fill:t.style.text,"text-anchor":"end"},String(b))),x-=Jn}}}if(!e.noLinks&&t.linkIcon&&t.linkIcon!=="none"){let _={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},x=_[t.linkIcon]??_.generic,E=yn,b=t.iconSpills&&t.iconSpillX!==null?t.iconSpillX:t.box.x+Zi,D=t.box.y+Zi,I=ee("rect",{x:h(b),y:h(D),width:E,height:E,rx:2,ry:2,fill:x}),M=b,H=D,Y=ee("path",{d:`M${h(M+4)} ${h(H+10)} L${h(M+10)} ${h(H+4)} M${h(M+6)} ${h(H+4)} H${h(M+10)} V${h(H+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),re=I+Y,$=t.linkHref?ee("a",{href:t.linkHref,target:"_blank",rel:"noopener"},re):re;o.push($)}if(t.hasOverflow&&t.overflowBox){let _=n.item.overflowTailFill,x=n.item.overflowTailStroke,E=n.item.overflowCaption;o.push(ee("rect",{x:h(t.overflowBox.x),y:h(t.overflowBox.y),width:h(t.overflowBox.width),height:h(t.overflowBox.height),fill:_,stroke:x,"stroke-width":1})),t.overflowAnchorId&&t.overflowBox.width>60&&o.push(Ce({x:h(t.overflowBox.x+t.overflowBox.width/2),y:h(t.overflowBox.y+t.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:E,"text-anchor":"middle"},`past ${t.overflowAnchorId}`))}for(let _ of t.labelChips){let x=Math.min(Ru[_.style.cornerRadius]??8,_.box.height/2);o.push(ee("rect",{x:h(_.box.x),y:h(_.box.y),width:h(_.box.width),height:h(_.box.height),rx:h(x),ry:h(x),fill:_.style.bg==="none"?"transparent":_.style.bg,stroke:_.style.fg,"stroke-width":.5})),o.push(Ce({x:h(_.box.x+_.box.width/2),y:h(_.box.y+_.box.height/2+3),...xE(_.style,i,Yo.xs),"text-anchor":"middle"},_.text))}return ee("g",{"data-layer":"item","data-id":t.id??null},o.join(""))}function IG(t,e,r,n,i){let o=[],s=Vi(t.style.bg);if(s){if(o.push(ee("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:t.style.bg,stroke:t.style.fg,"stroke-width":1,"fill-opacity":.18,filter:`url(#${r}-shadow-subtle)`})),t.title){let a=Yi(t.title),c=t.box.x,l=t.box.y,u=qi,f=6,d=`M${h(c+f)} ${h(l)}H${h(c+a)}V${h(l+u-f)}A${f} ${f} 0 0 1 ${h(c+a-f)} ${h(l+u)}H${h(c)}V${h(l+f)}A${f} ${f} 0 0 1 ${h(c+f)} ${h(l)}Z`;o.push(ee("path",{d,fill:t.style.fg})),o.push(Ce({x:h(c+pc),y:h(l+em),"font-family":i[t.style.font],"font-size":tm,"font-weight":600,fill:"#ffffff"},t.title))}}else{let a=t.style.fg,c=Ac(s,!!t.title,TG(t.inlineDatePins));if(t.style.bracket!=="none"){let u=t.box.y+t.box.height,f=t.style.bracket==="dashed"?"3 2":null,d=c>0?`M${h(t.box.x+4)} ${h(t.box.y-c)} L${h(t.box.x)} ${h(t.box.y-c)} L${h(t.box.x)} ${h(u)} L${h(t.box.x+4)} ${h(u)}`:`M${h(t.box.x)} ${h(t.box.y)} L${h(t.box.x)} ${h(u)} L${h(t.box.x+4)} ${h(u)}`;o.push(ee("path",{d,fill:"none",stroke:a,"stroke-width":1,"stroke-dasharray":f}))}t.title&&o.push(Ce({x:h(eo(t.box.x,ts,dC(t.inlineDatePins))),y:h(t.box.y-Bu),...xE(t.style,i,Rc),"fill-opacity":.7},t.title))}o.push(TE(t.inlineDatePins,t.style.fg));for(let a of t.children)o.push(_E(a,e,r,n,i));return ee("g",{"data-layer":"group","data-id":t.id??null},o.join(""))}function kG(t,e,r,n,i){let o=[];if(t.style.bracket==="solid"||t.style.bracket==="dashed"){let c=t.box.y-12,l=t.box.y+t.box.height+12,u=t.box.x,f=t.box.x+t.box.width,d=n.parallel.bracketStroke;o.push(ee("path",{d:`M${h(u+4)} ${h(c)} H${h(u)} V${h(l)} H${h(u+4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),o.push(ee("path",{d:`M${h(f-4)} ${h(c)} H${h(f)} V${h(l)} H${h(f-4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}t.title&&o.push(Ce({x:h(eo(t.box.x,rs,dC(t.inlineDatePins))),y:h(t.box.y-Bu),...xE(t.style,i,Rc),"fill-opacity":.7},t.title)),o.push(TE(t.inlineDatePins,t.style.fg));for(let s of t.children)o.push(_E(s,e,r,n,i));return ee("g",{"data-layer":"parallel","data-id":t.id??null},o.join(""))}function _E(t,e,r,n,i){return t.kind==="item"?SG(t,e,r,n,i):t.kind==="group"?IG(t,e,r,n,i):kG(t,e,r,n,i)}var lC=2;function NG(t,e){switch(t){case"green":return e.swimlane.utilizationOk;case"yellow":return e.swimlane.utilizationWarn;case"red":return e.swimlane.utilizationOver}}function PG(t,e){if(!t.utilization||t.utilization.segments.length===0)return"";let r=t.box.y+t.box.height-lC,n=t.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":ee("rect",{x:h(i.startX),y:h(r),width:h(o),height:lC,fill:NG(i.classification,e),"data-utilization":i.classification,"data-load":h(i.load)})});return ee("g",{"data-layer":"lane-utilization","data-id":t.id??null},n.join(""))}function CG(t,e){let r=t.bandIndex%2===0?e.swimlane.rowTintEven:e.swimlane.rowTintOdd,n=e.swimlane.border;return ee("g",{"data-layer":"swimlane-bg","data-id":t.id??null},ee("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),fill:r,stroke:n,"stroke-width":1}))}function hC(t,e,r,n,i){let o=n.swimlane.tabFill,s=n.swimlane.tabStroke,a=n.swimlane.tabText,c=n.swimlane.ownerText,l=n.swimlane.footnoteIndicator,u=[];if(t.title){let d=t.capacity?Wi(t.capacity.text,t.capacity.icon,10):0,p=t.footnoteIndicators.length>0?t.footnoteIndicators.join(","):"",m=p?yE(p,10):0,y=Sc(t.box.x,t.title,t.owner,d,m),v=Su,_=t.box.y+10,x=_+Iu;u.push(ee("rect",{x:h(y.tabX),y:h(_),width:h(y.tabW),height:h(v),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(Ce({x:h(y.titleX),y:h(x),"font-family":i[t.style.font],"font-size":12,"font-weight":600,fill:a},t.title)),t.owner&&u.push(Ce({x:h(y.ownerX),y:h(x),"font-family":i[t.style.font],"font-size":10,fill:c},`owner: ${t.owner}`)),t.capacity&&u.push(fC(t.capacity,void 0,y.badgeX,x,10,i[t.style.font],c)),p&&u.push(Ce({x:h(y.footnoteRightX),y:h(_+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:l,"text-anchor":"end"},p))}for(let f of t.children)u.push(_E(f,e,r,n,i));return u.push(PG(t,n)),ee("g",{"data-layer":"swimlane","data-id":t.id??null},u.join(""))}function OG(t,e,r){let n=t.radius,i=t.center.x,o=t.center.y,s=e.anchorDiamond.fill,a=e.anchorDiamond.stroke,c=ee("path",{d:`M${h(i)} ${h(o-n)} L${h(i+n)} ${h(o)} L${h(i)} ${h(o+n)} L${h(i-n)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),l=e.anchorDiamond.label,u=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,f={x:h(u),y:h(o+4),"font-family":r.sans,"font-size":10,fill:l};t.labelSide==="left"&&(f["text-anchor"]="end");let d=t.title?Ce(f,t.title):"";return ee("g",{"data-layer":"anchor","data-id":t.id??null},c+d)}function LG(t,e){let r=e.anchorDiamond.cutLine;return ee("line",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,"stroke-width":1,"stroke-dasharray":"1 3"})}function DG(t,e,r){let n=t.center.x,i=t.center.y,o=t.radius,s=e.milestoneDiamond.fill,a=ee("path",{d:`M${h(n)} ${h(i-o)} L${h(n+o)} ${h(i)} L${h(n)} ${h(i+o)} L${h(n-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),c=e.milestoneDiamond.label,l=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,u={x:h(l),y:h(i+4),"font-family":r.sans,"font-size":10,"font-weight":600,fill:c};t.labelSide==="left"&&(u["text-anchor"]="end");let f=t.title?Ce(u,t.title):"";return ee("g",{"data-layer":"milestone","data-id":t.id??null},a+f)}function MG(t,e){let r=t.isOverrun?e.milestoneDiamond.cutLineOverrun:e.milestoneDiamond.cutLineNormal,n=[];if(n.push(ee("line",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":ku,"stroke-linecap":"round"})),t.slackArrows&&t.slackArrows.length>0){let i=e.milestoneDiamond.slack;for(let o of t.slackArrows)n.push(ee("path",{d:`M${h(o.x)} ${h(o.y)} H${h(t.center.x-6)}`,fill:"none",stroke:i,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":"url(#nl-arrow-dark)"}))}return n.join("")}function uC(t,e){let r=t.kind==="overflow"?e.dependency.overflowStroke:e.dependency.edgeStroke,n=t.waypoints;if(n.length<2)return"";let i=t.kind==="underBar"?.8:1.1;return ee("path",{d:$G(n,hm),fill:"none",stroke:r,"stroke-width":i,"stroke-dasharray":t.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":"url(#nl-arrow)"})}function $G(t,e){if(t.length<2)return"";let r=[`M${h(t[0].x)} ${h(t[0].y)}`];for(let n=1;n<t.length;n++){let i=t[n-1],o=t[n];if(n===t.length-1){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=t[n+1],a=Math.sign(o.x-i.x),c=Math.sign(o.y-i.y),l=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(e,f/2,d/2);if(p<=0||a!==0&&l!==0||c!==0&&u!==0){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},y={x:o.x+l*p,y:o.y+u*p};r.push(`L${h(m.x)} ${h(m.y)}`),r.push(`Q${h(o.x)} ${h(o.y)} ${h(y.x)} ${h(y.y)}`)}return r.join(" ")}function FG(t,e,r,n){if(t.entries.length===0)return"";let i=r.footnotePanel.fill,o=r.footnotePanel.border,s=r.footnotePanel.header,a=r.footnotePanel.title,c=r.footnotePanel.description,l=r.footnotePanel.number,u=[];u.push(ee("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`})),u.push(Ce({x:h(t.box.x+Sr),y:h(t.box.y+lm),"font-family":n.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=t.box.y+mc+Sr,d=t.box.x+Sr,p=d+Sr;return t.entries.forEach((m,y)=>{let v=f+y*gc;u.push(Ce({x:h(d),y:h(v),"font-family":n.sans,"font-size":10,"font-weight":700,fill:l},String(m.number))),u.push(Ce({x:h(p),y:h(v),"font-family":n.sans,"font-size":11,"font-weight":600,fill:a},m.title)),m.description&&u.push(Ce({x:h(p+Math.max(120,m.title.length*6)),y:h(v),"font-family":n.sans,"font-size":11,fill:c},`\u2014 ${m.description}`))}),ee("g",{"data-layer":"footnotes"},u.join(""))}function UG(t,e,r,n,i){let o=n.includeRegion.border,s=n.includeRegion.fill,a=n.includeRegion.tabFill,c=n.includeRegion.tabStroke,l=n.includeRegion.tabText,u=n.includeRegion.badgeFill,f=n.includeRegion.badgeStroke,d=n.includeRegion.badgeText,p=t.box.x+8,m=t.box.y,y=t.box.width-16,v=t.box.height,_=ee("rect",{x:h(p),y:h(m),width:h(y),height:h(v),rx:8,ry:8,fill:s,stroke:o,"stroke-width":1,"stroke-dasharray":ku}),x=Su,E=Ic(t.box.x,t.label,t.sourcePath),b=m-x/2,D=ee("rect",{x:h(E.tabX),y:h(b),width:h(E.tabWidth),height:x,rx:4,ry:4,fill:a,stroke:c,"stroke-width":1}),I=Ce({x:h(E.tabLabelX),y:h(b+Iu),"font-family":i.sans,"font-size":11,"font-weight":600,fill:l},t.label),M=E.badgeX,H=E.badgeSize,Y=m-H/2,re=ee("rect",{x:h(M),y:h(Y),width:H,height:H,rx:4,ry:4,fill:u,stroke:f,"stroke-width":1}),$=ee("path",{d:`M${h(M+7)} ${h(Y+4)} H${h(M+14)} V${h(Y+11)} M${h(M+4)} ${h(Y+7)} H${h(M+11)} V${h(Y+14)} H${h(M+4)} Z`,stroke:d,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),R=9,O=m+4,F=ee("rect",{x:h(E.sourceHaloX),y:h(O-R),width:h(E.sourceHaloWidth),height:R+6,fill:s}),A=Ce({x:h(E.sourceTextX),y:h(O),"font-family":i.mono,"font-size":R,fill:d},t.sourcePath),k=t.nestedSwimlanes.map(N=>hC(N,e,r,n,i)).join("");return ee("g",{"data-layer":"include"},_+k+D+I+re+$+F+A)}function BG(t,e){let r=t.palette.attribution.mark,n=t.palette.attribution.link;if(t.swimlanes.length===0)return"";let i=t.header.attributionBox.x,o=t.header.attributionBox.y,s=Zn,a=Ce({x:"0",y:s,"font-family":e.sans,"font-size":Ou,"font-weight":400,fill:r},Cu)+Ce({x:xc,y:s,"font-family":e.sans,"font-size":Zn,"font-weight":700,fill:r},"now")+ee("rect",{x:fm,y:12,width:dm,height:Zn,fill:n})+Ce({x:Lu,y:s,"font-family":e.sans,"font-size":Zn,"font-weight":400,fill:r},"ine"),c=ee("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(yc)})`},a);return ee("a",{href:um,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},ee("g",{"data-layer":"attribution"},c))}async function XG(t,e,r,n,i,o,s){if(!e)return"";let a;try{a=await e(t)}catch(u){let f=`logo: failed to load ${t}: ${u instanceof Error?u.message:String(u)}`;if(n.strict)throw u;return n.warn?.(f),""}let c=(a.mime??"").toLowerCase();if(c==="image/svg+xml"){let u=new TextDecoder().decode(a.bytes),f=rC(u,{idPrefix:`${r}-logo`,onWarn:n.warn});return ee("g",{transform:`translate(${h(i)} ${h(o)})`},f)}if(c==="image/png"||c==="image/jpeg"||c==="image/jpg"||c==="image/webp"){let u=GG(a.bytes);return ee("image",{href:`data:${c};base64,${u}`,x:h(i),y:h(o),width:h(s),height:h(s),preserveAspectRatio:"xMidYMid meet"})}let l=`logo: unsupported mime ${c} for ${t}`;if(n.strict)throw new Error(l);return n.warn?.(l),""}function GG(t){if(typeof btoa<"u"){let r="";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)}let e=globalThis;if(e.Buffer)return e.Buffer.from(t).toString("base64");throw new Error("renderer: no base64 encoder available")}async function EE(t,e={}){let n=new zh(e.idPrefix??"nl").next("root"),i=t.palette,o=e.fontFamilies??mm,s=[],a=i.arrowhead.neutral,c=i.arrowhead.light,l=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>${aC(n)}`+u("nl-arrow",a)+u("nl-arrow-light",c)+u("nl-arrow-dark",l)+"</defs>";s.push(f),s.push(ee("rect",{x:0,y:0,width:h(t.width),height:h(t.height),fill:t.backgroundColor})),s.push(bG(t.timeline,i,o));for(let p of t.swimlanes)s.push(CG(p,i));s.push(vG(t.timeline,t.chartBox.y,i));for(let p of t.edges)p.kind==="underBar"&&s.push(uC(p,i));for(let p of t.swimlanes)s.push(hC(p,e,n,i,o));for(let p of t.includes)s.push(UG(p,e,n,i,o));for(let p of t.edges)p.kind!=="underBar"&&s.push(uC(p,i));for(let p of t.anchors)s.push(LG(p,i));for(let p of t.milestones)s.push(MG(p,i));for(let p of t.anchors)s.push(OG(p,i,o));for(let p of t.milestones)s.push(DG(p,i,o));if(s.push(wG(t.nowline,i,o)),s.push(FG(t.footnotes,n,i,o)),s.push(EG(t.header,n,i,o)),s.push(BG(t,o)),t.header.logo&&e.assetResolver){let p=await XG(t.header.logo.assetRef??"",e.assetResolver,n,e,t.header.logo.box.x,t.header.logo.box.y,Math.max(t.header.logo.box.width,t.header.logo.box.height));p&&s.push(p)}return`<svg${ic({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(t.width)} ${h(t.height)}`,width:h(t.width),height:h(t.height),"data-theme":t.theme,"data-generator":"nowline"})}>${s.join("")}</svg>`}var vE="/browser-source.nowline",HG={error:3,warning:2,info:1},jG={error:3,warning:2,info:1};function mC(t,e){return HG[t]>=jG[e]}var Wh,gC=0;function yC(){return Wh||(Wh=y_()),Wh}function zG(){return lt.parse(`memory:///nowline-browser-${++gC}.nowline`)}async function qh(t,e={}){let r=e.filePath??vE,n=yC(),o=n.shared.workspace.LangiumDocumentFactory.fromString(t,zG());await n.shared.workspace.DocumentBuilder.build([o],{validation:!0});let s=[];for(let a of Sm(o))a.origin==="lexer"?s.push(VP(a.error,r)):a.origin==="parser"?s.push(qP(a.error,r)):s.push(WP(a.diagnostic,r));return{ast:o.parseResult.value,diagnostics:s}}async function bE(t,e={}){let r=e.filePath??vE,n=await qh(t,{filePath:r});if(n.diagnostics.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:n.diagnostics};let i=yC(),o=e.readFile??QP,s=await o_(n.ast,r,{services:i.Nowline,readFile:o}),a=[...n.diagnostics];for(let x of s.diagnostics){if(x.severity==="error"&&eC(x.message)){e.onSkippedInclude?.({sourcePath:x.sourcePath,message:x.message});continue}a.push(YP(x))}if(a.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:a};let c;if(e.timezone)try{c=mE(e.timezone)}catch(x){if(x instanceof zo)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:x.message,file:r,line:1,column:1}]};throw x}let l=gE({now:e.today,zone:c}),u=dE(n.ast,s,{theme:e.theme,today:l,locale:e.locale,width:e.width}),f=e.diagnosticLevel??"error",d=hE(u,{today:l??void 0,locale:e.locale??"en-US"}).map(x=>ZP(x,r)),p=e.showLinks!==!1,m=e.strict===!0,y=[],v=await EE(u,{idPrefix:e.idPrefix,assetResolver:e.assetResolver,noLinks:!p,strict:m,warn:x=>y.push(x),fontFamilies:e.fontFamilies}),_=[...d,...y.map(x=>KP(x,r,m?"error":"warning"))].filter(x=>mC(x.severity,f));return m&&_.length>0?{kind:"diagnostics",diagnostics:[...a,..._]}:{kind:"svg",svg:v,warnings:_}}function wE(){Wh=void 0,gC=0}var xC="/embed.nowline",RE=!1;async function TC(t){let{ast:e,diagnostics:r}=await qh(t,{filePath:xC});return{ast:e,errors:r.filter(n=>n.severity==="error").map(n=>n.message)}}async function Vh(t,e={}){let r={filePath:xC,theme:e.theme,today:e.today,timezone:e.timezone,locale:e.locale,width:e.width,idPrefix:e.idPrefix,onSkippedInclude:()=>{RE||(RE=!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."))}},n=await bE(t,r);if(n.kind==="svg")return n.svg;let i=n.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Tu(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Tu=class extends Error{constructor(r,n){super(r);S(this,"details",n);this.name="EmbedRenderError"}};function _C(){RE=!1,wE()}var zr=Uint8Array,ur=Uint16Array,NE=Int32Array,PE=new zr([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]),CE=new zr([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]),EC=new zr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),RC=function(t,e){for(var r=new ur(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new NE(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return{b:r,r:i}},AC=RC(PE,2),WG=AC.b,SE=AC.r;WG[28]=258,SE[258]=28;var SC=RC(CE,0),Oae=SC.b,vC=SC.r,IE=new ur(32768);for(Le=0;Le<32768;++Le)qn=(Le&43690)>>1|(Le&21845)<<1,qn=(qn&52428)>>2|(qn&13107)<<2,qn=(qn&61680)>>4|(qn&3855)<<4,IE[Le]=((qn&65280)>>8|(qn&255)<<8)>>1;var qn,Le,vu=(function(t,e,r){for(var n=t.length,i=0,o=new ur(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new ur(e);for(i=1;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new ur(1<<e);var c=15-e;for(i=0;i<n;++i)if(t[i])for(var l=i<<4|t[i],u=e-t[i],f=s[t[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[IE[f]>>c]=l}else for(a=new ur(n),i=0;i<n;++i)t[i]&&(a[i]=IE[s[t[i]-1]++]>>15-t[i]);return a}),Wo=new zr(288);for(Le=0;Le<144;++Le)Wo[Le]=8;var Le;for(Le=144;Le<256;++Le)Wo[Le]=9;var Le;for(Le=256;Le<280;++Le)Wo[Le]=7;var Le;for(Le=280;Le<288;++Le)Wo[Le]=8;var Le,Yh=new zr(32);for(Le=0;Le<32;++Le)Yh[Le]=5;var Le,qG=vu(Wo,9,0);var VG=vu(Yh,5,0);var IC=function(t){return(t+7)/8|0},YG=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new zr(t.subarray(e,r))};var Vn=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},_u=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},AE=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return{t:NC,l:0};if(i==1){var s=new zr(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(D,I){return D.f-I.f}),r.push({s:-1,f:25001});var a=r[0],c=r[1],l=0,u=1,f=2;for(r[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=r[r[l].f<r[f].f?l++:f++],c=r[l!=u&&r[l].f<r[f].f?l++:f++],r[u++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=o[0].s,n=1;n<i;++n)o[n].s>d&&(d=o[n].s);var p=new ur(d+1),m=kE(r[u-1],p,0);if(m>e){var n=0,y=0,v=m-e,_=1<<v;for(o.sort(function(I,M){return p[M.s]-p[I.s]||I.f-M.f});n<i;++n){var x=o[n].s;if(p[x]>e)y+=_-(1<<m-p[x]),p[x]=e;else break}for(y>>=v;y>0;){var E=o[n].s;p[E]<e?y-=1<<e-p[E]++-1:++n}for(;n>=0&&y;--n){var b=o[n].s;p[b]==e&&(--p[b],++y)}m=e}return{t:new zr(p),l:m}},kE=function(t,e,r){return t.s==-1?Math.max(kE(t.l,e,r+1),kE(t.r,e,r+1)):e[t.s]=r},bC=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new ur(++e),n=0,i=t[0],o=1,s=function(c){r[n++]=c},a=1;a<=e;++a)if(t[a]==i&&a!=e)++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=t[a]}return{c:r.subarray(0,n),n:e}},Eu=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},kC=function(t,e,r){var n=r.length,i=IC(e+2);t[i]=n&255,t[i+1]=n>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<n;++o)t[i+o+4]=r[o];return(i+4+n)*8},wC=function(t,e,r,n,i,o,s,a,c,l,u){Vn(e,u++,r),++i[256];for(var f=AE(i,15),d=f.t,p=f.l,m=AE(o,15),y=m.t,v=m.l,_=bC(d),x=_.c,E=_.n,b=bC(y),D=b.c,I=b.n,M=new ur(19),H=0;H<x.length;++H)++M[x[H]&31];for(var H=0;H<D.length;++H)++M[D[H]&31];for(var Y=AE(M,7),re=Y.t,$=Y.l,R=19;R>4&&!re[EC[R-1]];--R);var O=l+5<<3,F=Eu(i,Wo)+Eu(o,Yh)+s,A=Eu(i,d)+Eu(o,y)+s+14+3*R+Eu(M,re)+2*M[16]+3*M[17]+7*M[18];if(c>=0&&O<=F&&O<=A)return kC(e,u,t.subarray(c,c+l));var k,N,B,j;if(Vn(e,u,1+(A<F)),u+=2,A<F){k=vu(d,p,0),N=d,B=vu(y,v,0),j=y;var W=vu(re,$,0);Vn(e,u,E-257),Vn(e,u+5,I-1),Vn(e,u+10,R-4),u+=14;for(var H=0;H<R;++H)Vn(e,u+3*H,re[EC[H]]);u+=3*R;for(var Q=[x,D],J=0;J<2;++J)for(var ce=Q[J],H=0;H<ce.length;++H){var K=ce[H]&31;Vn(e,u,W[K]),u+=re[K],K>15&&(Vn(e,u,ce[H]>>5&127),u+=ce[H]>>12)}}else k=qG,N=Wo,B=VG,j=Yh;for(var H=0;H<a;++H){var ie=n[H];if(ie>255){var K=ie>>18&31;_u(e,u,k[K+257]),u+=N[K+257],K>7&&(Vn(e,u,ie>>23&31),u+=PE[K]);var ue=ie&31;_u(e,u,B[ue]),u+=j[ue],ue>3&&(_u(e,u,ie>>5&8191),u+=CE[ue])}else _u(e,u,k[ie]),u+=N[ie]}return _u(e,u,k[256]),u+N[256]},KG=new NE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),NC=new zr(0),ZG=function(t,e,r,n,i,o){var s=o.z||t.length,a=new zr(n+s+5*(1+Math.ceil(s/7e3))+i),c=a.subarray(n,a.length-i),l=o.l,u=(o.r||0)&7;if(e){u&&(c[0]=o.r>>3);for(var f=KG[e-1],d=f>>13,p=f&8191,m=(1<<r)-1,y=o.p||new ur(32768),v=o.h||new ur(m+1),_=Math.ceil(r/3),x=2*_,E=function(he){return(t[he]^t[he+1]<<_^t[he+2]<<x)&m},b=new NE(25e3),D=new ur(288),I=new ur(32),M=0,H=0,Y=o.i||0,re=0,$=o.w||0,R=0;Y+2<s;++Y){var O=E(Y),F=Y&32767,A=v[O];if(y[F]=A,v[O]=F,$<=Y){var k=s-Y;if((M>7e3||re>24576)&&(k>423||!l)){u=wC(t,c,0,b,D,I,H,re,R,Y-R,u),re=M=H=0,R=Y;for(var N=0;N<286;++N)D[N]=0;for(var N=0;N<30;++N)I[N]=0}var B=2,j=0,W=p,Q=F-A&32767;if(k>2&&O==E(Y-Q))for(var J=Math.min(d,k)-1,ce=Math.min(32767,Y),K=Math.min(258,k);Q<=ce&&--W&&F!=A;){if(t[Y+B]==t[Y+B-Q]){for(var ie=0;ie<K&&t[Y+ie]==t[Y+ie-Q];++ie);if(ie>B){if(B=ie,j=Q,ie>J)break;for(var ue=Math.min(Q,ie-2),Ee=0,N=0;N<ue;++N){var we=Y-Q+N&32767,V=y[we],G=we-V&32767;G>Ee&&(Ee=G,A=we)}}}F=A,A=y[F],Q+=F-A&32767}if(j){b[re++]=268435456|SE[B]<<18|vC[j];var oe=SE[B]&31,U=vC[j]&31;H+=PE[oe]+CE[U],++D[257+oe],++I[U],$=Y+B,++M}else b[re++]=t[Y],++D[t[Y]]}}for(Y=Math.max(Y,$);Y<s;++Y)b[re++]=t[Y],++D[t[Y]];u=wC(t,c,l,b,D,I,H,re,R,Y-R,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=v,o.p=y,o.i=Y,o.w=$)}else{for(var Y=o.w||0;Y<s+l;Y+=65535){var pe=Y+65535;pe>=s&&(c[u/8|0]=l,pe=s),u=kC(c,u+1,t.subarray(Y,pe))}o.i=s}return YG(a,0,n+IC(u)+i)};var PC=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,o=r.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=n+=r[s];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}t=n,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},JG=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new zr(o.length+t.length);s.set(o),s.set(t,o.length),t=s,i.w=o.length}return ZG(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,i)};var CC=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};var QG=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;if(t[0]=120,t[1]=n<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=PC();i.p(e.dictionary),CC(t,2,i.d())}};function OC(t,e){e||(e={});var r=PC();r.p(t);var n=JG(t,e,e.dictionary?6:2,4);return QG(n,e),CC(n,n.length-4,r.d()),n}var eH=typeof TextDecoder<"u"&&new TextDecoder,tH=0;try{eH.decode(NC,{stream:!0}),tH=1}catch{}var MC="https://free.nowline.io/open";function LC(t){let e=new TextEncoder().encode(t),r=OC(e),n=32768,i="";for(let o=0;o<r.length;o+=n)i+=String.fromCharCode(...r.subarray(o,o+n));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function OE({source:t,sourceUrl:e,share:r}){if(r===!1||r==="none")return null;if(typeof r=="object")return e!==void 0&&DC(e)?r.remoteUrl.replace("{url}",encodeURIComponent(e)):r.textUrl.replace("{text}",LC(t));let n=r===!0?MC:r,i=new URL(n);return e!==void 0&&DC(e)?i.hash=`url=${encodeURIComponent(e)}`:i.hash=`text=${LC(t)}`,i.toString()}function DC(t){try{return new URL(t).protocol==="https:"}catch{return!1}}var $C=0;async function FC(t){let e=t.document??globalThis.document;if(!e)return{rendered:0,failed:0};let r=e.querySelectorAll(t.selector),n=0,i=0,o=++$C,s=t.share??!0,a=[],c=0;for(let l of Array.from(r)){let u=rH(l);if(!u)continue;let f=nH(l),d=`nl-r${o}-${c++}`,p={theme:t.theme,locale:t.locale,width:t.width,today:t.today,timezone:t.timezone,idPrefix:d},m=u.parentElement,y=u.nextSibling,_=l.getAttribute("data-nowline-source-url")??void 0??t.sourceUrl;a.push(Vh(f,p).then(x=>{if(iH(u,x),n++,m!==null){let E=OE({source:f,sourceUrl:_,share:s});if(E!==null){let b=e.createElement("a");b.className="nowline-share",b.href=E,b.target="_blank",b.rel="noopener noreferrer",b.textContent="Share on Nowline",m.insertBefore(b,y)}}},x=>{i++,console.error("nowline: render failed",x)}))}return await Promise.all(a),{rendered:n,failed:i}}function rH(t){let e=t.parentElement;return e&&e.tagName.toUpperCase()==="PRE"?e:t}function nH(t){return t.textContent??""}function iH(t,e){t.outerHTML=e}function UC(){$C=0}function Kh(){if(typeof globalThis>"u")return"light";let t=globalThis.matchMedia;if(typeof t!="function")return"light";try{return t("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function BC(t,e){return t&&t!=="auto"?b_(t)??e:e}var oH="0.0.0-dev.20261004042017.g9406f7f",sH="9406f7f",aH="pre code.language-nowline, code.language-nowline",XC={theme:"auto",startOnLoad:!0,selector:aH,systemTheme:Kh(),share:!0},rt={...XC},LE=!1;function cH(t={}){rt={theme:t.theme??rt.theme,startOnLoad:t.startOnLoad??rt.startOnLoad,selector:t.selector??rt.selector,locale:t.locale??rt.locale,width:t.width??rt.width,today:t.today!==void 0?t.today:rt.today,timezone:t.timezone??rt.timezone,share:t.share??rt.share,sourceUrl:t.sourceUrl??rt.sourceUrl,systemTheme:Kh()}}function GC(){return{theme:BC(rt.theme,rt.systemTheme),locale:rt.locale,width:rt.width,today:rt.today,timezone:rt.timezone}}async function lH(t,e={}){let r={...GC(),...e};return Vh(t,r)}async function uH(t){return TC(t)}async function DE(t){let e={selector:t?.selector??rt.selector,theme:t?.theme??GC().theme,locale:t?.locale??rt.locale,width:t?.width??rt.width,today:t?.today!==void 0?t.today:rt.today,timezone:t?.timezone??rt.timezone,share:t?.share??rt.share,sourceUrl:t?.sourceUrl??rt.sourceUrl,document:t?.document};return FC(e)}var fH=DE;if(typeof document<"u"&&!LE){LE=!0;let t=()=>{rt.startOnLoad&&DE()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):queueMicrotask(t)}function dH(){rt={...XC,systemTheme:Kh()},LE=!1,_C(),UC()}return wu(pH);})();
2642
2642
  //# 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.20261004035821.gd8a6927",
3
+ "version": "0.0.0-dev.20261004042017.g9406f7f",
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.20261004035821.gd8a6927",
43
- "@nowline/core": "0.0.0-dev.20261004035821.gd8a6927",
44
- "@nowline/layout": "0.0.0-dev.20261004035821.gd8a6927",
45
- "@nowline/renderer": "0.0.0-dev.20261004035821.gd8a6927",
46
- "@nowline/share-link": "0.0.0-dev.20261004035821.gd8a6927",
42
+ "@nowline/browser": "0.0.0-dev.20261004042017.g9406f7f",
43
+ "@nowline/core": "0.0.0-dev.20261004042017.g9406f7f",
44
+ "@nowline/layout": "0.0.0-dev.20261004042017.g9406f7f",
45
+ "@nowline/renderer": "0.0.0-dev.20261004042017.g9406f7f",
46
+ "@nowline/share-link": "0.0.0-dev.20261004042017.g9406f7f",
47
47
  "langium": "~4.4.0"
48
48
  },
49
49
  "devDependencies": {