@mintlify/cli 4.1.56 → 4.1.57

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.
@@ -4,7 +4,7 @@ import { dirname as __mintDirname } from 'node:path';
4
4
  const require = __mintCreateRequire(import.meta.url);
5
5
  const __filename = __mintFileURLToPath(import.meta.url);
6
6
  const __dirname = __mintDirname(__filename);
7
- import{$ as e,At as t,Ct as n,J as r,K as i,Mt as a,Nt as o,Q as s,T as c,X as l,Y as u,Z as d,_t as f,at as p,ft as m,i as h,k as g,lt as _,mt as v,n as y,nt as b,pt as x,q as S,r as ee,st as te,t as ne,tt as re,ut as ie,v as ae,wt as oe}from"./schemas-MyPSBsum.js";function se(){return[v(),x(),m(),ie(),_()]}var ce=t();function le(e,t){let n=e.position?.start.offset,r=e.position?.end.offset;return typeof n==`number`&&typeof r==`number`?t.slice(n,r):``}function ue(e,t){if(!t)return;let n=e.at(-1);n?.type===`text`?n.value+=t:e.push({type:`text`,value:t})}const de=/^([a-z][a-z\d+.-]*):/i,fe=/* @__PURE__ */ new Set([`http`,`https`,`mailto`,`tel`]);function pe(e){let t=de.exec(e.replace(/[\u0000- ]/g,``))?.[1];return!t||fe.has(t.toLowerCase())}function me(e,t){let n=le(e,t),r=e.url.trim();return n.startsWith(`[`)&&r.length>0&&pe(r)&&(/^(?:https?:\/\/|mailto:|tel:|\/|#|\.\.?\/)/i.test(r)||r.includes(`/`)||/^[^\s@]+\.[^\s]+$/u.test(r))}function he(e,t){let n=[];for(let r of e)switch(r.type){case`text`:ue(n,r.value.replace(/\n/g,` `));break;case`inlineCode`:n.push({type:`inlineCode`,value:r.value});break;case`strong`:case`emphasis`:case`delete`:n.push(Object.assign(Object.assign({},r),{children:he(r.children,t)}));break;case`link`:me(r,t)?n.push(Object.assign(Object.assign({},r),{children:he(r.children,t)})):ue(n,le(r,t));break;default:ue(n,le(r,t))}return n}const ge=/[\\&*_`[\]!<>~@\0\t\n\r]|:\/\/|www\.|\s$/i;function _e(e){if(!e)return[];if(!ge.test(e))return[{type:`text`,value:e}];try{let t=`title: `,n=`${t}${e.replace(/\n/g,` `)}`,r=f(n,{extensions:[te()],mdastExtensions:[se()]}),i=r.children.length===1?r.children[0]:void 0;if(i?.type!==`paragraph`)return[{type:`text`,value:e}];let a=he(i.children,n),o=a[0];return o?.type!==`text`||!o.value.startsWith(t)?[{type:`text`,value:e}]:(o.value=o.value.slice(7),o.value||a.shift(),a)}catch{return[{type:`text`,value:e}]}}function ve(e){return g({type:`paragraph`,children:_e(e)})}function ye(e){this.content=e}ye.prototype={constructor:ye,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new ye(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new ye(n)},addToStart:function(e,t){return new ye([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new ye(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new ye(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=ye.from(e),e.size?new ye(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=ye.from(e),e.size?new ye(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=ye.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},ye.from=function(e){if(e instanceof ye)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ye(t)};function be(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=be(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function xe(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=xe(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}var Se=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return be(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return xe(this,e,t,n)}findIndex(e){if(e==0)return we(0,e);if(e==this.size)return we(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?we(t+1,i):we(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Se.empty=new Se([],0);const Ce={index:0,offset:0};function we(e,t){return Ce.index=e,Ce.offset=t,Ce}function Te(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Te(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Te(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Ee=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Te(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Ee.none=[];var De=class extends Error{},Oe=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Ae(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(ke(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Se.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};Oe.empty=new Oe(Se.empty,0,0);function ke(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(ke(a.content,t-i-1,n-i-1)))}function Ae(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Ae(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function je(e,t,n){if(n.openStart>e.depth)throw new De(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new De(`Inconsistent open depths`);return Me(e,t,n,0)}function Me(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Me(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Ie(a,Re(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Ie(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=ze(n,e);return Ie(a,Le(e,i,o,t,r))}}function Ne(e,t){if(!t.type.compatibleContent(e.type))throw new De(`Cannot join `+t.type.name+` onto `+e.type.name)}function Pe(e,t,n){let r=e.node(n);return Ne(r,t.node(n)),r}function Fe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function C(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Fe(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Fe(i.child(e),r);t&&t.depth==n&&t.textOffset&&Fe(t.nodeBefore,r)}function Ie(e,t){return e.type.checkContent(t),e.copy(t)}function Le(e,t,n,r,i){let a=e.depth>i&&Pe(e,t,i+1),o=r.depth>i&&Pe(n,r,i+1),s=[];return C(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Ne(a,o),Fe(Ie(a,Le(e,t,n,r,i+1)),s)):(a&&Fe(Ie(a,Re(e,t,i+1)),s),C(t,n,i,s),o&&Fe(Ie(o,Re(n,r,i+1)),s)),C(r,null,i,s),new Se(s)}function Re(e,t,n){let r=[];return C(null,e,n,r),e.depth>n&&Fe(Ie(Pe(e,t,n+1),Re(e,t,n+1)),r),C(t,null,n,r),new Se(r)}function ze(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Se.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var w=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Ee.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ue(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=He.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else He.set(t,r=new Be);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Ve,i}},Be=class{constructor(){this.elts=[],this.i=0}};const Ve=12,He=/* @__PURE__ */ new WeakMap;var Ue=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const We=Object.create(null);var Ge=class e{constructor(e,t,n,r=Ee.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Se.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Te(this.attrs,t||e.defaultAttrs||We)&&Ee.sameSet(this.marks,n||Ee.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Oe.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new Oe(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return je(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return w.resolveCached(this,e)}resolveNoCache(e){return w.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),qe(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Se.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ee.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Ee.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Se.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Ge.prototype.text=void 0;var Ke=class e extends Ge{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function qe(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Je=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Ye(t,n);if(r.next==null)return e.empty;let i=T(r);r.next&&r.err(`Unexpected trailing text`);let a=it(tt(i));return at(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Se.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
7
+ import{$ as e,At as t,Ct as n,J as r,K as i,Mt as a,Nt as o,Q as s,T as c,X as l,Y as u,Z as d,_t as f,at as p,ft as m,i as h,k as g,lt as _,mt as v,n as y,nt as b,pt as x,q as S,r as ee,st as te,t as ne,tt as re,ut as ie,v as ae,wt as oe}from"./schemas-BBCiuhV1.js";function se(){return[v(),x(),m(),ie(),_()]}var ce=t();function le(e,t){let n=e.position?.start.offset,r=e.position?.end.offset;return typeof n==`number`&&typeof r==`number`?t.slice(n,r):``}function ue(e,t){if(!t)return;let n=e.at(-1);n?.type===`text`?n.value+=t:e.push({type:`text`,value:t})}const de=/^([a-z][a-z\d+.-]*):/i,fe=/* @__PURE__ */ new Set([`http`,`https`,`mailto`,`tel`]);function pe(e){let t=de.exec(e.replace(/[\u0000- ]/g,``))?.[1];return!t||fe.has(t.toLowerCase())}function me(e,t){let n=le(e,t),r=e.url.trim();return n.startsWith(`[`)&&r.length>0&&pe(r)&&(/^(?:https?:\/\/|mailto:|tel:|\/|#|\.\.?\/)/i.test(r)||r.includes(`/`)||/^[^\s@]+\.[^\s]+$/u.test(r))}function he(e,t){let n=[];for(let r of e)switch(r.type){case`text`:ue(n,r.value.replace(/\n/g,` `));break;case`inlineCode`:n.push({type:`inlineCode`,value:r.value});break;case`strong`:case`emphasis`:case`delete`:n.push(Object.assign(Object.assign({},r),{children:he(r.children,t)}));break;case`link`:me(r,t)?n.push(Object.assign(Object.assign({},r),{children:he(r.children,t)})):ue(n,le(r,t));break;default:ue(n,le(r,t))}return n}const ge=/[\\&*_`[\]!<>~@\0\t\n\r]|:\/\/|www\.|\s$/i;function _e(e){if(!e)return[];if(!ge.test(e))return[{type:`text`,value:e}];try{let t=`title: `,n=`${t}${e.replace(/\n/g,` `)}`,r=f(n,{extensions:[te()],mdastExtensions:[se()]}),i=r.children.length===1?r.children[0]:void 0;if(i?.type!==`paragraph`)return[{type:`text`,value:e}];let a=he(i.children,n),o=a[0];return o?.type!==`text`||!o.value.startsWith(t)?[{type:`text`,value:e}]:(o.value=o.value.slice(7),o.value||a.shift(),a)}catch{return[{type:`text`,value:e}]}}function ve(e){return g({type:`paragraph`,children:_e(e)})}function ye(e){this.content=e}ye.prototype={constructor:ye,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new ye(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new ye(n)},addToStart:function(e,t){return new ye([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new ye(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new ye(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=ye.from(e),e.size?new ye(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=ye.from(e),e.size?new ye(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=ye.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},ye.from=function(e){if(e instanceof ye)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ye(t)};function be(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=be(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function xe(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=xe(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}var Se=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return be(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return xe(this,e,t,n)}findIndex(e){if(e==0)return we(0,e);if(e==this.size)return we(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?we(t+1,i):we(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Se.empty=new Se([],0);const Ce={index:0,offset:0};function we(e,t){return Ce.index=e,Ce.offset=t,Ce}function Te(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Te(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Te(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Ee=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Te(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Ee.none=[];var De=class extends Error{},Oe=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Ae(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(ke(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Se.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};Oe.empty=new Oe(Se.empty,0,0);function ke(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(ke(a.content,t-i-1,n-i-1)))}function Ae(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Ae(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function je(e,t,n){if(n.openStart>e.depth)throw new De(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new De(`Inconsistent open depths`);return Me(e,t,n,0)}function Me(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Me(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Ie(a,Re(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Ie(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=ze(n,e);return Ie(a,Le(e,i,o,t,r))}}function Ne(e,t){if(!t.type.compatibleContent(e.type))throw new De(`Cannot join `+t.type.name+` onto `+e.type.name)}function Pe(e,t,n){let r=e.node(n);return Ne(r,t.node(n)),r}function Fe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function C(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Fe(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Fe(i.child(e),r);t&&t.depth==n&&t.textOffset&&Fe(t.nodeBefore,r)}function Ie(e,t){return e.type.checkContent(t),e.copy(t)}function Le(e,t,n,r,i){let a=e.depth>i&&Pe(e,t,i+1),o=r.depth>i&&Pe(n,r,i+1),s=[];return C(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Ne(a,o),Fe(Ie(a,Le(e,t,n,r,i+1)),s)):(a&&Fe(Ie(a,Re(e,t,i+1)),s),C(t,n,i,s),o&&Fe(Ie(o,Re(n,r,i+1)),s)),C(r,null,i,s),new Se(s)}function Re(e,t,n){let r=[];return C(null,e,n,r),e.depth>n&&Fe(Ie(Pe(e,t,n+1),Re(e,t,n+1)),r),C(t,null,n,r),new Se(r)}function ze(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Se.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var w=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Ee.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ue(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=He.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else He.set(t,r=new Be);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Ve,i}},Be=class{constructor(){this.elts=[],this.i=0}};const Ve=12,He=/* @__PURE__ */ new WeakMap;var Ue=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const We=Object.create(null);var Ge=class e{constructor(e,t,n,r=Ee.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Se.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Te(this.attrs,t||e.defaultAttrs||We)&&Ee.sameSet(this.marks,n||Ee.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Oe.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new Oe(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return je(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return w.resolveCached(this,e)}resolveNoCache(e){return w.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),qe(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Se.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ee.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Ee.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Se.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Ge.prototype.text=void 0;var Ke=class e extends Ge{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function qe(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Je=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Ye(t,n);if(r.next==null)return e.empty;let i=T(r);r.next&&r.err(`Unexpected trailing text`);let a=it(tt(i));return at(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Se.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
8
8
  `)}};Je.empty=new Je(!0);var Ye=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function T(e){let t=[];do t.push(Xe(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Xe(e){let t=[];do t.push(E(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function E(e){let t=et(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Qe(e,t);else break;return t}function Ze(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Qe(e,t){let n=Ze(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Ze(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function $e(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function et(e){if(e.eat(`(`)){let t=T(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=$e(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function tt(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function nt(e,t){return t-e}function rt(e,t){let n=[];return r(t),n.sort(nt);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function it(e){let t=Object.create(null);return n(rt(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);rt(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Je(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(nt);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function at(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function ot(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function st(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function ct(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function lt(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ft(e,r,t[r]);return n}var ut=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=lt(e,n.attrs),this.defaultAttrs=ot(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Je.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:st(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Ge(this,this.computeAttrs(e),Se.from(t),Ee.setFrom(n))}createChecked(e=null,t,n){return t=Se.from(t),this.checkContent(t),new Ge(this,this.computeAttrs(e),t,Ee.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=Se.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(Se.empty,!0);return i?new Ge(this,e,t.append(i),Ee.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ct(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Ee.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function dt(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var ft=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?dt(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},pt=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=lt(e,r.attrs),this.excluded=null;let i=ot(this.attrs);this.instance=i?new Ee(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ee(this,st(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ct(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},mt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=ye.from(e.nodes),t.marks=ye.from(e.marks||{}),this.nodes=ut.compile(this.spec.nodes,this),this.marks=pt.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Je.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?ht(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:ht(this,n.split(` `))}this.nodeFromJSON=e=>Ge.fromJSON(this,e),this.markFromJSON=e=>Ee.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof ut))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ke(n,n.defaultAttrs,e,Ee.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function ht(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}const gt={};function _t(e){let t=this,n=e||gt,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(te(n)),a.push(d()),o.push(s(n))}const vt={};function yt(e){let t=this,n=e||vt,i=t.data(),a=i.micromarkExtensions||=[],o=i.fromMarkdownExtensions||=[],s=i.toMarkdownExtensions||=[];a.push(S(n)),o.push(r()),s.push(u(n))}var bt=Object.create,xt=Object.defineProperty,St=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,Ct=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,Tt=(e,t)=>function(){return t||(0,e[D(e)[0]])((t={exports:{}}).exports,t),t.exports},Et=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of D(t))!wt.call(e,i)&&i!==n&&xt(e,i,{get:()=>t[i],enumerable:!(r=St(t,i))||r.enumerable});return e},Dt=(e,t,n)=>(n=e==null?{}:bt(Ct(e)),Et(t||!e||!e.__esModule?xt(n,`default`,{value:e,enumerable:!0}):n,e)),Ot=Tt({"../../node_modules/acorn-jsx/xhtml.js"(e,t){t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}}}),kt=Tt({"../../node_modules/acorn/dist/acorn.js"(e,t){(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(e,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],r=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t!==!1&&d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function ee(e){return e===10||e===13||e===8232||e===8233}function te(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(ee(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var ne=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,re=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ie=Object.prototype,ae=ie.hasOwnProperty,oe=ie.toString,se=Object.hasOwn||(function(e,t){return ae.call(e,t)}),ce=Array.isArray||(function(e){return oe.call(e)===`[object Array]`});function le(e){return RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`)}function ue(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var de=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,fe=function(e,t){this.line=e,this.column=t};fe.prototype.offset=function(e){return new fe(this.line,this.column+e)};var pe=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function me(e,t){for(var n=1,r=0;;){var i=te(e,r,t);if(i<0)return new fe(n,t-r);++n,r=i}}var he={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ge=!1;function _e(e){var t={};for(var n in he)t[n]=e&&se(e,n)?e[n]:he[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ge&&typeof console==`object`&&console.warn&&(ge=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
9
9
  Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ce(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return ce(t.onComment)&&(t.onComment=ve(t,t.onComment)),t}function ve(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new pe(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var ye=1,be=2,xe=4,Se=8,Ce=16,we=32,Te=64,Ee=128,De=256,Oe=ye|be|De;function ke(e,t){return be|(e?xe:0)|(t?Se:0)}var Ae=0,je=1,Me=2,Ne=3,Pe=4,Fe=5,C=function(e,t,n){this.options=e=_e(e),this.sourceFile=e.sourceFile,this.keywords=le(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=le(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=le(i),this.reservedWordsStrictBind=le(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
10
10
  `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(x).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=/* @__PURE__ */ Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(ye),this.regexpState=null,this.privateNameStack=[]},Ie={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};C.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Ie.inFunction.get=function(){return(this.currentVarScope().flags&be)>0},Ie.inGenerator.get=function(){return(this.currentVarScope().flags&Se)>0&&!this.currentVarScope().inClassFieldInit},Ie.inAsync.get=function(){return(this.currentVarScope().flags&xe)>0&&!this.currentVarScope().inClassFieldInit},Ie.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&De)return!1;if(t.flags&be)return(t.flags&xe)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ie.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&Te)>0||n||this.options.allowSuperOutsideMethod},Ie.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ee)>0},Ie.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ie.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&(be|De))>0||n},Ie.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&De)>0},C.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},C.parse=function(e,t){return new this(t,e).parse()},C.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},C.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(C.prototype,Ie);var Le=C.prototype,Re=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;Le.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){re.lastIndex=e,e+=re.exec(this.input)[0].length;var t=Re.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){re.lastIndex=e+t[0].length;var n=re.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||x.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,re.lastIndex=e,e+=re.exec(this.input)[0].length,this.input[e]===`;`&&e++}},Le.eat=function(e){return this.type===e&&(this.next(),!0)},Le.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},Le.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Le.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Le.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},Le.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Le.semicolon=function(){!this.eat(b.semi)&&!this.insertSemicolon()&&this.unexpected()},Le.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Le.expect=function(e){this.eat(e)||this.unexpected()},Le.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var ze=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Le.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Le.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Le.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Le.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var w=C.prototype;w.parseTopLevel=function(e){var t=/* @__PURE__ */ Object.create(null);for(e.body||=[];this.type!==b.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var Be={kind:`loop`},Ve={kind:`switch`};w.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;re.lastIndex=this.pos;var t=re.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(f(r,!0)){for(var i=n+1;p(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var a=this.input.slice(n,i);if(!c.test(a))return!0}return!1},w.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;re.lastIndex=this.pos;var e=re.exec(this.input),t=this.pos+e[0].length,n;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(p(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},w.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=b._var,a=`let`),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock(!0,i);case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:if(this.options.ecmaVersion>10&&r===b._import){re.lastIndex=this.pos;var o=re.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.value,u=this.parseExpression();return r===b.name&&u.type===`Identifier`&&this.eat(b.colon)?this.parseLabeledStatement(i,l,u,e):this.parseExpressionStatement(i,u)}},w.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type===b.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},w.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},w.parseDoStatement=function(e){return this.next(),this.labels.push(Be),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},w.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Be),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===b._var||this.type===b._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var a=this.isContextual(`let`),o=!1,s=new ze,c=this.parseExpression(t>-1?`await`:!0,s);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),a&&o&&this.raise(c.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(c,!1,s),this.checkLValPattern(c),this.parseForIn(e,c)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,c))},w.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Ue|(n?0:We),!1,t)},w.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(b._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},w.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},w.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(Ve),this.enterScope(0);for(var t,n=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var r=this.type===b._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},w.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var He=[];w.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();if(this.next(),this.eat(b.parenL)){t.param=this.parseBindingAtom();var n=t.param.type===`Identifier`;this.enterScope(n?we:0),this.checkLValPattern(t.param,n?Pe:Me),this.expect(b.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},w.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},w.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Be),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},w.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},w.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},w.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===b._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},w.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},w.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},w.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},w.parseForIn=function(e,t){var n=this.type===b._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},w.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(b.eq)?r.init=this.parseMaybeAssign(t):n===`const`&&!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():r.id.type!==`Identifier`&&(!t||this.type!==b._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):r.init=null,e.declarations.push(this.finishNode(r,`VariableDeclarator`)),!this.eat(b.comma))break}return e},w.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?je:Me,!1)};var Ue=1,We=2,Ge=4;w.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===b.star&&t&We&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Ue&&(e.id=t&Ge&&this.type!==b.name?null:this.parseIdent(),e.id&&!(t&We)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?je:Me:Ne));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ke(e.async,e.generator)),t&Ue||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Ue?`FunctionDeclaration`:`FunctionExpression`)},w.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},w.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raise(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Ke(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},w.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===b.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===b.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(b.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===b.parenL||o!==`method`||i||a){var l=!n.static&&qe(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},w.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},w.parseClassElementName=function(e){this.type===b.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},w.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&qe(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},w.parseClassField=function(e){if(qe(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&qe(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(b.eq)){var t=this.currentThisScope(),n=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=n}else e.value=null;return this.semicolon(),this.finishNode(e,`PropertyDefinition`)},w.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(De|Te);this.type!==b.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},w.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Me,!1)):(t===!0&&this.unexpected(),e.id=null)},w.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},w.enterClassBody=function(){var e={declared:/* @__PURE__ */ Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},w.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,n=e.used,r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];se(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Ke(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function qe(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}w.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`);if(this.eat(b._default)){this.checkExport(t,`default`,this.lastTokStart);var n;if(this.type===b._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,Ue|Ge,!1,n)}else if(this.type===b._class){var i=this.startNode();e.declaration=this.parseClass(i,`nullableID`)}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,`ExportDefaultDeclaration`)}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,o=e.specifiers;a<o.length;a+=1){var s=o[a];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type===`Literal`&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},w.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),se(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},w.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`?this.checkPatternExport(e,t.argument):n===`ParenthesizedExpression`&&this.checkPatternExport(e,t.expression)},w.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},w.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},w.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var r=this.startNode();r.local=this.parseModuleExportName(),r.exported=this.eatContextual(`as`)?this.parseModuleExportName():r.local,this.checkExport(e,r.exported,r.exported.start),t.push(this.finishNode(r,`ExportSpecifier`))}return t},w.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=He,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},w.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name){var n=this.startNode();if(n.local=this.parseIdent(),this.checkLValSimple(n.local,Me),e.push(this.finishNode(n,`ImportDefaultSpecifier`)),!this.eat(b.comma))return e}if(this.type===b.star){var r=this.startNode();return this.next(),this.expectContextual(`as`),r.local=this.parseIdent(),this.checkLValSimple(r.local,Me),e.push(this.finishNode(r,`ImportNamespaceSpecifier`)),e}for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var i=this.startNode();i.imported=this.parseModuleExportName(),this.eatContextual(`as`)?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLValSimple(i.local,Me),e.push(this.finishNode(i,`ImportSpecifier`))}return e},w.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return de.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},w.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},w.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Je=C.prototype;Je.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Je.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Je.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Je.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Je.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case b.braceL:return this.parseObj(!0)}return this.parseIdent()},Je.parseBindingList=function(e,t,n){for(var r=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(b.comma),t&&this.type===b.comma)r.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===b.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),r.push(a),this.type===b.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else{var o=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(o),r.push(o)}return r},Je.parseBindingListItem=function(e){return e},Je.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Je.checkLValSimple=function(e,t,n){t===void 0&&(t=Ae);var r=t!==Ae;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===Me&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(se(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Fe&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Je.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=Ae),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Je.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=Ae),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Ye=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},T={b_stat:new Ye(`{`,!1),b_expr:new Ye(`{`,!0),b_tmpl:new Ye("${",!1),p_stat:new Ye(`(`,!1),p_expr:new Ye(`(`,!0),q_tmpl:new Ye("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Ye(`function`,!1),f_expr:new Ye(`function`,!0),f_expr_gen:new Ye(`function`,!0,!1,null,!0),f_gen:new Ye(`function`,!1,!1,null,!0)},Xe=C.prototype;Xe.initialContext=function(){return[T.b_stat]},Xe.curContext=function(){return this.context[this.context.length-1]},Xe.braceIsBlock=function(e){var t=this.curContext();return t===T.f_expr||t===T.f_stat?!0:e===b.colon&&(t===T.b_stat||t===T.b_expr)?!t.isExpr:e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow?!0:e===b.braceL?t===T.b_stat:e===b._var||e===b._const||e===b.name?!1:!this.exprAllowed},Xe.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Xe.updateContext=function(e){var t,n=this.type;n.keyword&&e===b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Xe.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===T.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?T.b_stat:T.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(T.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?T.p_stat:T.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){e.beforeExpr&&e!==b._else&&(e!==b.semi||this.curContext()===T.p_stat)&&!(e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==b.colon&&e!==b.braceL||this.curContext()!==T.b_stat)?this.context.push(T.f_expr):this.context.push(T.f_stat),this.exprAllowed=!1},b.backQuote.updateContext=function(){this.curContext()===T.q_tmpl?this.context.pop():this.context.push(T.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===T.f_expr?this.context[t]=T.f_expr_gen:this.context[t]=T.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var E=C.prototype;E.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},E.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===b.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(b.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},E.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ze,r=!0);var s=this.start,c=this.startLoc;(this.type===b.parenL||this.type===b.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===b.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===b.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},E.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(b.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(b.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},E.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},E.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==b._in)&&a>r){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.type===b.coalesce;s&&(a=b.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===b.coalesce||s&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},E.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},E.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&s.argument.type===`Identifier`?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Ze(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===b.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(b.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function Ze(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Ze(e.expression)}E.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},E.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},E.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(b.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(b.bracketL);if(l||c&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(b.bracketR)):u.property=this.type===b.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(b.parenL)){var d=new ze,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseArrowExpression(this.startNodeAt(t,n),h,!0,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===b.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},E.parseExprAtom=function(e,t){this.type===b.slash&&this.readRegexp();var n,r=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),n=this.startNode(),this.next(),this.type===b.parenL&&!this.allowDirectSuper&&this.raise(n.start,`super() call outside constructor of a subclass`),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(n,`Super`);case b._this:return n=this.startNode(),this.next(),this.finishNode(n,`ThisExpression`);case b.name:var i=this.start,a=this.startLoc,o=this.containsEsc,s=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&s.name===`async`&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(T.f_expr),this.parseFunction(this.startNodeAt(i,a),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(i,a),[s],!1,t);if(this.options.ecmaVersion>=8&&s.name===`async`&&this.type===b.name&&!o&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return s=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(b.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,a),[s],!0,t)}return s;case b.regexp:var c=this.value;return n=this.parseLiteral(c.value),n.regex={pattern:c.pattern,flags:c.flags},n;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return n=this.startNode(),n.value=this.type===b._null?null:this.type===b._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,`Literal`);case b.parenL:var l=this.start,u=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),u;case b.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(n,`ArrayExpression`);case b.braceL:return this.overrideContext(T.b_expr),this.parseObj(!1,e);case b._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},E.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`);var t=this.parseIdent(!0);switch(this.type){case b.parenL:return this.parseDynamicImport(e);case b.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},E.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},E.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},E.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,``)),this.next(),this.finishNode(t,`Literal`)},E.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},E.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new ze,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),a&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}if(this.type===b.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raise(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(b.parenR),e&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},E.parseParenItem=function(e){return e},E.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Qe=[];E.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(b.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc,a=this.type===b._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0,!1),a&&e.callee.type===`ImportExpression`&&this.raise(r,`Cannot use new with import()`),e.arguments=this.eat(b.parenL)?this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):Qe,this.finishNode(e,`NewExpression`)},E.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
@@ -274,7 +274,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
274
274
  case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function mg(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=hg(n.start,r[0]||t.start),a=hg(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function hg(e,t){if(e&&typeof e==`object`){let n=`line`in e?gg(e.line):void 0,r=`column`in e?gg(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:gg(t)}}}function gg(e){return typeof e==`number`&&e>-1?e:void 0}const _g=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,vg=`#unexpected-type-in-code-expected-an-object-spread-spread`;function yg(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new df("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=_g+`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,e}if(z(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?bg.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||z(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new df("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=_g+`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,e}return V(t)?H(e,_,`linePrefix`,3)(t):_(t)}}function bg(e,t,n,r,i,a,o){let s=lg(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=mg(e),n=new df("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=_g+vg,n}if(e.expression.properties[1]){let t=new df(`Unexpected extra content in spread: only a single spread is supported`,{place:mg(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=_g+`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=mg(e.expression.properties[0]),n=new df("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=_g+vg,n}}if(s.error){let e=new df(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=_g+`#could-not-parse-expression-with-acorn`,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function xg(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return yg.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return V(t)?H(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||z(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return yg.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}const Sg=/[$_\p{ID_Start}]/u,Cg=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,wg=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,Tg={};function Eg(e){return e?Sg.test(String.fromCodePoint(e)):!1}function Dg(e,t){let n=(t||Tg).jsx?wg:Cg;return e?n.test(String.fromCodePoint(e)):!1}const Og=`https://github.com/micromark/micromark-extension-mdx-jsx`;function kg(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,D,te,ne,O){let k=this,A,re;return ie;function ie(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),ae}function ae(e){return B(e)?n(e):(A=oe,j(e))}function oe(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),A=se,j;if(t===62)return Oe(t);if(t!==null&&t>=0&&Eg(t))return e.enter(d),e.enter(f),e.consume(t),ce;je(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function se(t){if(t===62)return Oe(t);if(t!==null&&t>=0&&Eg(t))return e.enter(d),e.enter(f),e.consume(t),ce;je(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ce(t){if(t!==null&&t>=0&&Dg(t,{jsx:!0}))return e.consume(t),ce;if(t===46||t===47||t===58||t===62||t===123||B(t)||to(t))return e.exit(f),A=le,j(t);je(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function le(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),A=ue,j;if(t===58)return e.enter(h),e.consume(t),e.exit(h),A=pe,j;if(t===47||t===62||t===123||t!==null&&t>=0&&Eg(t))return e.exit(d),ge(t);je(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ue(t){if(t!==null&&t>=0&&Eg(t))return e.enter(m),e.consume(t),de;je(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(t){if(t!==null&&t>=0&&Dg(t,{jsx:!0}))return e.consume(t),de;if(t===46||t===47||t===62||t===123||B(t)||to(t))return e.exit(m),A=fe,j(t);je(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function fe(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),A=ue,j;if(t===47||t===62||t===123||t!==null&&t>=0&&Eg(t))return e.exit(d),ge(t);je(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function pe(t){if(t!==null&&t>=0&&Eg(t))return e.enter(g),e.consume(t),me;je(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function me(t){if(t!==null&&t>=0&&Dg(t,{jsx:!0}))return e.consume(t),me;if(t===47||t===62||t===123||B(t)||to(t))return e.exit(g),A=he,j(t);je(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(t){if(t===47||t===62||t===123||t!==null&&t>=0&&Eg(t))return e.exit(d),ge(t);je(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ge(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),A=De,j;if(t===62)return Oe(t);if(t===123)return yg.call(k,e,_e,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&Eg(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),ve;je(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e(e){return A=ge,j(e)}function ve(t){if(t!==null&&t>=0&&Dg(t,{jsx:!0}))return e.consume(t),ve;if(t===47||t===58||t===61||t===62||t===123||B(t)||to(t))return e.exit(S),A=ye,j(t);je(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function ye(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),A=be,j;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),A=Ce,j;if(t===47||t===62||t===123||B(t)||to(t)||t!==null&&t>=0&&Eg(t))return e.exit(x),e.exit(b),A=ge,j(t);je(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function be(t){if(t!==null&&t>=0&&Eg(t))return e.enter(w),e.consume(t),xe;je(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function xe(t){if(t!==null&&t>=0&&Dg(t,{jsx:!0}))return e.consume(t),xe;if(t===47||t===61||t===62||t===123||B(t)||to(t))return e.exit(w),e.exit(x),A=Se,j(t);je(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Se(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),A=Ce,j;if(t===47||t===62||t===123||t!==null&&t>=0&&Eg(t))return e.exit(b),ge(t);je(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ce(t){if(t===34||t===39)return e.enter(E),e.enter(ee),e.consume(t),e.exit(ee),re=t,Te;if(t===123)return yg.call(k,e,we,te,ne,O,r,i,a,!1,!1,o)(t);je(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function we(t){return e.exit(b),A=ge,j(t)}function Te(t){return t===null&&je(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(re)+"`"),t===re?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(E),e.exit(b),re=void 0,A=ge,j):z(t)?(A=Te,j(t)):(e.enter(D),Ee(t))}function Ee(t){return t===null||t===re||z(t)?(e.exit(D),Te(t)):(e.consume(t),Ee)}function De(e){if(e===62)return Oe(e);je(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Oe(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function j(t){return z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Ae):V(t)||to(t)?(e.enter(`esWhitespace`),ke(t)):A(t)}function ke(t){return z(t)?(e.exit(`esWhitespace`),j(t)):V(t)||to(t)?(e.consume(t),ke):(e.exit(`esWhitespace`),A(t))}function Ae(e){if(!o&&k.parser.lazy[k.now().line]){let e=new df("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",k.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=Og+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return j(e)}function je(e,t,n){let r=new df(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+Ag(e)+`)`)+` `+t+`, expected `+n,k.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=Og+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function Ag(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function jg(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return kg.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function Mg(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return kg.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return V(e)?H(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||z(e)?r(e):i(e)}}}function Ng(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:Mg(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:jg(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}var Pg=/* @__PURE__ */ t(Aa(),1);function Fg(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}const Ig={tokenize:Bg,partial:!0},Lg=`https://github.com/micromark/micromark-extension-mdxjs-esm`,Rg=/* @__PURE__ */ new Set([`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ImportDeclaration`]);function zg(e){let t={tokenize:i,concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw Error("Expected an `acorn` instance passed in as `options.acorn`");let n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:`module`},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}};function i(t,i,a){let o=this,s=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),c=this.events.length+1,l=``;return o.interrupt?a:u;function u(e){return o.now().column>1?a(e):(t.enter(`mdxjsEsm`),t.enter(`mdxjsEsmData`),t.consume(e),l+=String.fromCharCode(e),d)}function d(e){return qa(e)?(t.consume(e),l+=String.fromCharCode(e),d):(l===`import`||l===`export`)&&e===32?(t.consume(e),f):a(e)}function f(e){return e===null||z(e)?(t.exit(`mdxjsEsmData`),p(e)):(t.consume(e),f)}function p(e){return e===null?h(e):z(e)?t.check(Ig,h,m)(e):(t.enter(`mdxjsEsmData`),f(e))}function m(e){return t.enter(`lineEnding`),t.consume(e),t.exit(`lineEnding`),p}function h(a){let l=lg(o.events.slice(c),{acorn:n,acornOptions:r,tokenTypes:[`mdxjsEsmData`],prefix:s.length>0?`var `+s.join(`,`)+`
275
275
  `:``});if(l.error){if(a!==null&&l.swallow)return m(a);let e=new df(`Could not parse import/exports with acorn`,{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:`acorn`,source:`micromark-extension-mdxjs-esm`});throw e.url=Lg+`#could-not-parse-importexports-with-acorn`,e}s.length>0&&l.estree.body.shift();let u=-1;for(;++u<l.estree.body.length;){let e=l.estree.body[u];if(!Rg.has(e.type)){let t=new df("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:mg(e),ruleId:`non-esm`,source:`micromark-extension-mdxjs-esm`});throw t.url=Lg+`#unexpected-type-in-code-only-importexports-are-supported`,t}if(e.type===`ImportDeclaration`&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){let n=e.specifiers[t];s.push(n.local.name)}}}return Object.assign(t.exit(`mdxjsEsm`),e.addResult?{estree:l.estree}:void 0),i(a)}}}function Bg(e,t,n){return r;function r(r){return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),e.attempt(xo,t,n)}}function Vg(e){let t=Object.assign({acorn:Ym.extend((0,Pg.default)()),acornOptions:{ecmaVersion:2024,sourceType:`module`},addResult:!0},e);return Ha([zg(t),xg(t),Ng(t),Fg()])}const Hg=/^( {0,3})(#{1,6})\s+(.+?)\s*\{\s*#([^}]+?)\s*\}\s*$/,Ug=/^(\s*)(#{1,6})\s+(.+?)\s*\{\s*#([^}]+?)\s*\}\s*$/,Wg=/<MDX(?:\s[^>]*[^/>\s])?\s*>/g,Gg=/<\/MDX\s*>/g,Kg=/(`+).*?\1|=\s*'[^'\n]*'|"[^"\n]*"/g,qg=/[<>"]/g,Jg=/[<>"&?,;:!'()\[\]{}]/g,Yg=/\p{Emoji_Modifier}|\p{Emoji_Modifier_Base}|\p{Emoji_Presentation}|\p{Extended_Pictographic}|[\u200D\uFE0E\uFE0F]/gu;function Xg(e){return e.trim().replace(qg,``)}function Zg(e){return e.trim().replace(Jg,``).replace(Yg,``).replace(/\s+/g,`-`)}function Qg(e,t){return e_(e,t).content}function $g(e,t){return e_(e,t).sourceLines}function e_(e,t){let n=e.split(`
276
276
  `),r=[],i=[],a=0,o,s=0,c=0,l=!1;for(let e of n){a+=1;let n=e.trimStart();if(o!==void 0){r_(n,o,s)&&(o=void 0),r.push(e),i.push(a);continue}let u=!l&&n_(n);if(u){o=u.char,s=u.count,r.push(e),i.push(a);continue}let{visible:d,inComment:f}=t_(e,l),p=l||f;l=f;let m=!p&&(c>0?Ug:Hg).exec(e);if(m&&m[2]&&m[3]&&m[4]){let e=m[1]??``,n=m[2].length,o=t?.preserveOriginal?Xg(m[4]):Zg(m[4]);r.push(`${e}<h${n} id="${o}">`,`${e}${m[3]}`,`${e}</h${n}>`),i.push(a,a,a)}else c=Math.max(0,c+(d.match(Wg)?.length??0)-(d.match(Gg)?.length??0)),r.push(e),i.push(a)}return{content:r.join(`
277
- `),sourceLines:i}}function t_(e,t){let n=e.replace(Kg,e=>` `.repeat(e.length)),r=``,i=0;for(;;){if(t){let n=e.indexOf(`*/`,i);if(n===-1)return{visible:r,inComment:t};i=n+2}let a=n.indexOf(`{/*`,i);if(a===-1)return{visible:r+e.slice(i),inComment:!1};r+=e.slice(i,a),i=a+3,t=!0}}function n_(e){let t=e[0];if(t!=="`"&&t!==`~`)return;let n=1;for(;n<e.length&&e[n]===t;)n++;if(!(n<3))return{char:t,count:n}}function r_(e,t,n){let r=0;for(;r<e.length&&e[r]===t;)r++;if(r<n)return!1;for(;r<e.length;r++)if(e[r]!==` `&&e[r]!==` `&&e[r]!==`\r`)return!1;return!0}const i_=/* @__PURE__ */ new Set([`loc`,`range`,`start`,`end`,`comments`,`leadingComments`,`trailingComments`]),a_=/* @__PURE__ */ new Set([`ArrowFunctionExpression`,`FunctionExpression`,`FunctionDeclaration`]);function o_(e,t){if(!R(e))return;let n=e.type;if(n===`Identifier`)typeof e.name==`string`&&t.add(e.name);else if(n===`AssignmentPattern`)o_(e.left,t);else if(n===`RestElement`)o_(e.argument,t);else if(n===`ObjectPattern`&&Array.isArray(e.properties))for(let n of e.properties)R(n)&&(n.type===`RestElement`?o_(n.argument,t):n.type===`Property`&&o_(n.value,t));else if(n===`ArrayPattern`&&Array.isArray(e.elements))for(let n of e.elements)o_(n,t)}function s_(e,t){for(let[n,r]of Object.entries(e))i_.has(n)||t(r)}function c_(e,t){if(Array.isArray(e))for(let n of e)c_(n,t);else if(R(e)&&typeof e.type==`string`&&!(a_.has(e.type)||e.type===`ClassBody`)){if(e.type===`VariableDeclaration`&&e.kind===`var`){let n=Array.isArray(e.declarations)?e.declarations:[];for(let e of n)R(e)&&o_(e.id,t)}s_(e,e=>c_(e,t))}}function l_(e){let t=/* @__PURE__ */ new Set;for(let n of e)if(R(n)){if(n.type===`VariableDeclaration`&&n.kind!==`var`){let e=Array.isArray(n.declarations)?n.declarations:[];for(let n of e)R(n)&&o_(n.id,t)}else(n.type===`FunctionDeclaration`||n.type===`ClassDeclaration`)&&R(n.id)&&typeof n.id.name==`string`&&t.add(n.id.name)}return t}function u_(e,t){let n=new Set(e);for(let e of t)n.add(e);return n}function d_(e){return typeof e==`string`&&!/^[a-z]/.test(e)&&!e.includes(`-`)}const f_=/* @__PURE__ */ new Set([`push`,`pop`,`shift`,`unshift`,`splice`,`sort`,`reverse`,`fill`,`copyWithin`,`set`,`add`,`delete`,`clear`,`__defineGetter__`,`__defineSetter__`]),p_=/* @__PURE__ */ new Set([`assign`,`defineProperty`,`defineProperties`,`setPrototypeOf`]),m_=/* @__PURE__ */ new Map([[`Object`,p_],[`Reflect`,/* @__PURE__ */ new Set([`set`,`defineProperty`,`deleteProperty`,`setPrototypeOf`])]]);function h_(e){return e===`constructor`||p_.has(e)}function g_(e){let t=e.property;if(R(t))return e.computed!==!0&&typeof t.name==`string`?t.name:t.type===`Literal`&&typeof t.value==`string`?t.value:void 0}const __=/* @__PURE__ */ new Set([`globalThis`,`window`,`self`,`global`]),v_=/* @__PURE__ */ new Set([`Object`,`Reflect`,`Function`,`eval`,...__]),y_=/* @__PURE__ */ new WeakSet;function b_(e,t){let n=R(t)&&t.type===`Literal`&&(typeof t.value==`string`||typeof t.value==`number`);return e.computed===!0&&!n}function x_(e){let t=N_(e);for(;R(t)&&t.type===`MemberExpression`;){if(b_(t,t.property))return!0;t=N_(t.object)}return!1}function S_(e,t){var n;if(R(e))switch(e.type){case`AssignmentPattern`:S_(e.left,t);return;case`RestElement`:S_(e.argument,t);return;case`ArrayPattern`:if(Array.isArray(e.elements))for(let n of e.elements)S_(n,t);return;case`ObjectPattern`:{let r=Array.isArray(e.properties)?e.properties:[];for(let e of r){if(!R(e))continue;if(e.type===`RestElement`){S_(e.argument,t);continue}let r=e.key,i=e.computed!==!0&&R(r)&&typeof r.name==`string`?r.name:R(r)&&r.type===`Literal`?String(r.value):void 0;(b_(e,r)||i!==void 0&&(h_(i)||v_.has(i)))&&((n=t.unknownWrite)==null||n.call(t)),S_(e.value,t)}return}default:return}}const C_=/* @__PURE__ */ new WeakSet;function w_(e){let t=e.callee;if(!R(t)||t.type!==`MemberExpression`)return;let n=t.object;g_(t)!==void 0&&R(n)&&n.type===`Identifier`&&typeof n.name==`string`&&m_.has(n.name)&&C_.add(n)}function T_(e){let t=e.callee;if(!R(t)||t.type!==`MemberExpression`)return;let n=g_(t);if(n===void 0)return;let r=t.object;if(R(r)&&r.type===`Identifier`&&typeof r.name==`string`){let t=m_.get(r.name);if(t!==void 0)return t.has(n)&&Array.isArray(e.arguments)?e.arguments[0]:void 0}return f_.has(n)?r:void 0}function E_(e,t,n){var r;R(e)&&typeof e.name==`string`&&!t.has(e.name)&&((e.name===`eval`||e.name===`Function`||__.has(e.name)&&!y_.has(e)||m_.has(e.name)&&!C_.has(e))&&((r=n.unknownWrite)==null||r.call(n)),n.reference(e))}function D_(e,t,n){if(R(e))switch(e.type){case`AssignmentPattern`:D_(e.left,t,n),X(e.right,t,n);return;case`RestElement`:D_(e.argument,t,n);return;case`ObjectPattern`:{let r=Array.isArray(e.properties)?e.properties:[];for(let e of r)R(e)&&(e.type===`RestElement`?D_(e.argument,t,n):(e.computed===!0&&X(e.key,t,n),D_(e.value,t,n)));return}case`ArrayPattern`:{let r=Array.isArray(e.elements)?e.elements:[];for(let e of r)D_(e,t,n);return}case`MemberExpression`:X(e,t,n);return;default:return}}function X(e,t,n){var r,i,a,o,s,c,l,u,d,f;if(Array.isArray(e)){for(let r of e)X(r,t,n);return}if(!R(e)||typeof e.type!=`string`)return;let p=e.type;if(a_.has(p)){if(n.eagerOnly===!0)return;let r=Array.isArray(e.params)?e.params:[],i=/* @__PURE__ */ new Set;for(let e of r)o_(e,i);p===`FunctionExpression`&&R(e.id)&&typeof e.id.name==`string`&&i.add(e.id.name);let a=u_(t,i);for(let e of r)S_(e,n),D_(e,a,n);let o=/* @__PURE__ */ new Set;c_(e.body,o);let s=e.body,c=R(s)&&Array.isArray(s.body)?s.body:void 0;if(c!==void 0)for(let e of l_(c))o.add(e);X(c??s,u_(a,o),n)}else switch(p){case`Identifier`:E_(e,t,n);return;case`AssignmentExpression`:(r=n.write)==null||r.call(n,e.left,t),S_(e.left,n),X(e.left,t,n),X(e.right,t,n);return;case`UpdateExpression`:(i=n.write)==null||i.call(n,e.argument,t),X(e.argument,t,n);return;case`UnaryExpression`:if(e.operator===`delete`){let r=N_(e.argument);R(r)&&r.type===`MemberExpression`&&((a=n.mutate)==null||a.call(n,r.object,t))}X(e.argument,t,n);return;case`CallExpression`:{let r=T_(e);r!==void 0&&((o=n.mutate)==null||o.call(n,r,t)),x_(e.callee)&&((s=n.unknownWrite)==null||s.call(n)),w_(e),s_(e,e=>X(e,t,n));return}case`NewExpression`:case`TaggedTemplateExpression`:x_(p===`NewExpression`?e.callee:e.tag)&&((c=n.unknownWrite)==null||c.call(n)),s_(e,e=>X(e,t,n));return;case`ClassDeclaration`:case`ClassExpression`:{X(e.superClass,t,n);let r=p===`ClassExpression`&&R(e.id)&&typeof e.id.name==`string`?[e.id.name]:[];X(e.body,u_(t,r),n);return}case`BlockStatement`:case`StaticBlock`:{let r=Array.isArray(e.body)?e.body:[];X(r,u_(t,l_(r)),n);return}case`SwitchStatement`:{X(e.discriminant,t,n);let r=Array.isArray(e.cases)?e.cases:[];X(r,u_(t,l_(r.flatMap(e=>R(e)&&Array.isArray(e.consequent)?e.consequent:[]))),n);return}case`ForStatement`:{let r=u_(t,l_([e.init]));s_(e,e=>X(e,r,n));return}case`ForInStatement`:case`ForOfStatement`:{let r=e.left,i=u_(t,l_([r]));X(e.right,t,n),R(r)&&r.type===`VariableDeclaration`?X(r,i,n):((l=n.write)==null||l.call(n,r,t),S_(r,n),X(r,t,n)),X(e.body,i,n);return}case`CatchClause`:{let r=/* @__PURE__ */ new Set;o_(e.param,r);let i=u_(t,r);S_(e.param,n),D_(e.param,i,n),X(e.body,i,n);return}case`VariableDeclarator`:S_(e.id,n),D_(e.id,t,n),X(e.init,t,n);return;case`MemberExpression`:{let r=g_(e),i=e.object,a=R(i)&&i.type===`Identifier`&&typeof i.name==`string`&&m_.has(i.name);r!==void 0&&h_(r)&&!a&&((u=n.unknownWrite)==null||u.call(n)),r!==void 0&&v_.has(r)&&((d=n.unknownWrite)==null||d.call(n)),r!==void 0&&!h_(r)&&R(i)&&i.type===`Identifier`&&typeof i.name==`string`&&__.has(i.name)&&y_.add(i),X(e.object,t,n),e.computed===!0&&X(e.property,t,n);return}case`Property`:case`PropertyDefinition`:case`MethodDefinition`:if(e.computed===!0&&X(e.key,t,n),n.eagerOnly===!0&&p===`PropertyDefinition`&&e.static!==!0)return;X(e.value,t,n);return;case`LabeledStatement`:X(e.body,t,n);return;case`WithStatement`:(f=n.unknownWrite)==null||f.call(n),X(e.object,t,n),X(e.body,t,n);return;case`JSXOpeningElement`:case`JSXClosingElement`:{let r=e.name;R(r)&&r.type===`JSXIdentifier`&&d_(r.name)?E_(r,t,n):R(r)&&r.type===`JSXMemberExpression`&&X(r,t,n),X(e.attributes,t,n);return}case`JSXMemberExpression`:{let r=e.object;R(r)&&r.type===`JSXIdentifier`?E_(r,t,n):X(r,t,n);return}case`JSXAttribute`:X(e.value,t,n);return;case`BreakStatement`:case`ContinueStatement`:case`MetaProperty`:case`JSXIdentifier`:case`JSXNamespacedName`:return;default:s_(e,e=>X(e,t,n))}}function O_(e,t=!1){let n=/* @__PURE__ */ new Set;return X(e,/* @__PURE__ */ new Set,{reference:e=>{typeof e.name==`string`&&n.add(e.name)},eagerOnly:t}),n}const k_=/* @__PURE__ */ new Set([`ParenthesizedExpression`,`TSAsExpression`,`TSSatisfiesExpression`,`TSNonNullExpression`,`TSTypeAssertion`,`ChainExpression`]);function A_(e){let t=e.property;if(R(t)){if(e.computed!==!0)return typeof t.name==`string`?t.name:void 0;if(t.type===`Literal`&&(typeof t.value==`string`||typeof t.value==`number`))return String(t.value)}}function j_(e){if(e.computed===!0){let t=e.key;return R(t)&&t.type===`Literal`&&(typeof t.value==`string`||typeof t.value==`number`)?String(t.value):void 0}let t=e.key;if(R(t)&&typeof t.name==`string`)return t.name;if(R(t)&&t.type===`Literal`&&typeof t.value==`string`)return t.value}function M_(e,t){let n=A_(t);if(n===void 0)return`unknown`;let r=N_(e);if(!R(r))return`unknown`;if(r.type===`ObjectExpression`){let e=Array.isArray(r.properties)?r.properties:[],t=`contained`;for(let r of e){if(!R(r))continue;if(r.type===`SpreadElement`){t=`unknown`;continue}if(r.type!==`Property`)continue;let e=j_(r);e===void 0?t=`unknown`:e===n&&(t=r.value)}return t}if(r.type===`ArrayExpression`){if(!/^\d+$/.test(n))return`contained`;let e=Number(n),t=Array.isArray(r.elements)?r.elements:[],i=0;for(let n of t){if(R(n)&&n.type===`SpreadElement`)return`unknown`;if(i===e)return n??`contained`;i+=1}return`contained`}return`unknown`}function N_(e){let t=e;for(;R(t)&&typeof t.type==`string`&&k_.has(t.type);)t=t.expression;return t}function P_(e,t){if(Array.isArray(e))for(let n of e)P_(n,t);else if(R(e)&&typeof e.type==`string`){if(a_.has(e.type)&&Array.isArray(e.params))for(let n of e.params)o_(n,t);if(e.type===`CatchClause`&&o_(e.param,t),e.type===`VariableDeclarator`&&e.init==null&&o_(e.id,t),(e.type===`ForOfStatement`||e.type===`ForInStatement`)&&R(e.left)){let n=e.left;if(n.type===`VariableDeclaration`&&Array.isArray(n.declarations))for(let e of n.declarations)R(e)&&o_(e.id,t)}s_(e,e=>P_(e,t))}}function F_(e,t){if(Array.isArray(e)){for(let n of e)F_(n,t);return}if(!R(e))return;let n=(e,n)=>{let r=/* @__PURE__ */ new Set;o_(e,r);let i=O_(n);for(let e of r){let n=t.get(e)??/* @__PURE__ */ new Set;for(let e of i)n.add(e);t.set(e,n)}};e.type===`VariableDeclarator`&&n(e.id,e.init),e.type===`AssignmentExpression`&&n(N_(e.left),e.right),s_(e,e=>F_(e,t))}const I_=/* @__PURE__ */ new Set([`CallExpression`,`NewExpression`,`TaggedTemplateExpression`]);function L_(e,t){let n=N_(e);if(!R(n))return!1;switch(n.type){case`Identifier`:return typeof n.name==`string`&&t.has(n.name);case`MemberExpression`:return b_(n,n.property)||L_(n.object,t);case`LogicalExpression`:return L_(n.left,t)||L_(n.right,t);case`ConditionalExpression`:return L_(n.consequent,t)||L_(n.alternate,t);case`SequenceExpression`:{let e=Array.isArray(n.expressions)?n.expressions:[];return L_(e[e.length-1],t)}case`AwaitExpression`:case`SpreadElement`:return L_(n.argument,t);case`ArrayExpression`:return Array.isArray(n.elements)?n.elements.some(e=>L_(e,t)):!1;case`ObjectExpression`:return Array.isArray(n.properties)?n.properties.some(e=>R(e)&&L_(e.type===`SpreadElement`?e:e.value,t)):!1;default:return!1}}function R_(e,t){if(Array.isArray(e))for(let n of e)R_(n,t);else R(e)&&(e.type===`VariableDeclarator`&&L_(e.init,t)&&o_(e.id,t),e.type===`AssignmentExpression`&&L_(e.right,t)&&o_(N_(e.left),t),s_(e,e=>R_(e,t)))}const z_=/* @__PURE__ */ new Set([`apply`,`construct`]);function B_(e,t,n){if(Array.isArray(e))return e.some(e=>B_(e,t,n));if(!R(e)||typeof e.type!=`string`||n&&a_.has(e.type))return!1;if(I_.has(e.type)){let n=e.type===`TaggedTemplateExpression`?e.tag:e.callee;if(L_(n,t))return!0;let r=N_(n),i=Array.isArray(e.arguments)?e.arguments:[];if(R(r)&&r.type===`MemberExpression`&&R(r.object)&&r.object.type===`Identifier`&&r.object.name===`Reflect`&&z_.has(g_(r)??``)&&L_(i[0],t))return!0}let r=!1;return s_(e,e=>{r||=B_(e,t,n)}),r}function V_(e){if(Array.isArray(e))return e.some(V_);if(!R(e)||typeof e.type!=`string`||a_.has(e.type))return!1;if(I_.has(e.type))return!0;if(e.type===`PropertyDefinition`&&e.static!==!0)return e.computed===!0&&V_(e.key);let t=!1;return s_(e,e=>{t||=V_(e)}),t}function H_(e,t=!1){let n={reassigned:/* @__PURE__ */ new Set,mutated:/* @__PURE__ */ new Set},r=/* @__PURE__ */ new Map;F_(e,r);let i=/* @__PURE__ */ new Set;P_(e,i);let a=/* @__PURE__ */ new Set,o=-1;for(;a.size!==o;)o=a.size,R_(e,a);B_(e,a,t)&&n.mutated.add(`*`);let s=(e,t,a)=>{if(!t.has(e)){n.mutated.add(e);return}if(a.has(e))return;a.add(e);let o=r.get(e);if(o===void 0||i.has(e))n.mutated.add(`*`);else for(let e of o)s(e,/* @__PURE__ */ new Set,a)},c=(e,t)=>{let r=[],i=N_(e);for(;R(i)&&i.type===`MemberExpression`;)r.push(i),i=N_(i.object);if(R(i)){if(i.type===`ObjectExpression`||i.type===`ArrayExpression`){let e=i;for(let i=r.length-1;i>=0;--i){let a=r[i];if(a===void 0)return;let o=M_(e,a);if(o===`contained`)return;if(o===`unknown`){n.mutated.add(`*`);return}e=o;let s=N_(e);if(!R(s)||s.type!==`ObjectExpression`&&s.type!==`ArrayExpression`){c(e,t);return}e=s}}else switch(i.type){case`Identifier`:typeof i.name==`string`&&s(i.name,t,/* @__PURE__ */ new Set);return;case`ConditionalExpression`:c(i.consequent,t),c(i.alternate,t);return;case`LogicalExpression`:c(i.left,t),c(i.right,t);return;case`SequenceExpression`:{let e=Array.isArray(i.expressions)?i.expressions:[];c(e[e.length-1],t);return}case`ThisExpression`:case`ObjectExpression`:case`ArrayExpression`:case`NewExpression`:case`Literal`:case`TemplateLiteral`:return;default:n.mutated.add(`*`)}}},l=(e,t)=>{let r=N_(e);if(R(r))switch(r.type){case`Identifier`:typeof r.name==`string`&&!t.has(r.name)&&n.reassigned.add(r.name);return;case`MemberExpression`:c(r.object,t);return;case`AssignmentPattern`:l(r.left,t);return;case`RestElement`:l(r.argument,t);return;case`ObjectPattern`:{let e=Array.isArray(r.properties)?r.properties:[];for(let n of e)R(n)&&l(n.type===`RestElement`?n.argument:n.value,t);return}case`ArrayPattern`:{let e=Array.isArray(r.elements)?r.elements:[];for(let n of e)l(n,t);return}default:return}};return X(e,/* @__PURE__ */ new Set,{reference:()=>void 0,write:l,mutate:c,unknownWrite:()=>{n.mutated.add(`*`)},eagerOnly:t}),n}function U_(e,t=/* @__PURE__ */ new Set){if(Array.isArray(e)){for(let n of e)U_(n,t);return t}if(!R(e))return t;if(e.type===`VariableDeclarator`&&o_(e.id,t),(e.type===`FunctionDeclaration`||e.type===`ClassDeclaration`)&&R(e.id)&&typeof e.id.name==`string`&&t.add(e.id.name),Array.isArray(e.params))for(let n of e.params)o_(n,t);return e.type===`CatchClause`&&o_(e.param,t),(e.type===`ImportSpecifier`||e.type===`ImportDefaultSpecifier`||e.type===`ImportNamespaceSpecifier`)&&R(e.local)&&typeof e.local.name==`string`&&t.add(e.local.name),s_(e,e=>U_(e,t)),t}function W_(e){return R(e)&&typeof e.type==`string`?e.type:void 0}function G_(e){return R(e)}const K_=/* @__PURE__ */ new WeakMap;function q_(e){if(typeof e==`string`)return 1+e.length;if(typeof e!=`object`||!e)return 1;let t=K_.get(e);if(t!==void 0)return t;let n=1;if(Array.isArray(e)){for(let t of e)if(n+=q_(t),n>1e5)break}else for(let[t,r]of Object.entries(e))if(n+=t.length+q_(r),n>1e5)break;return K_.set(e,n),n}function J_(e){return q_(e)>1e5?Z:{ok:!0,value:e}}function Y_(e){return e==null||typeof e==`boolean`||typeof e==`number`}function X_(e){return Object.is(e,-0)?`-0`:Number.isNaN(e)?`0/0`:Number.isFinite(e)?JSON.stringify(e):e>0?`1e999`:`-1e999`}function Z_(e){return e===void 0?`void 0`:e===null?`null`:typeof e==`number`?X_(e):typeof e==`string`||typeof e==`boolean`?JSON.stringify(e):Array.isArray(e)?`[${e.map(e=>Z_(e)).join(`,`)}]`:`{${Object.entries(e).map(([e,t])=>`${e===`__proto__`?`["__proto__"]`:JSON.stringify(e)}:${Z_(t)}`).join(`,`)}}`}function Q_(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0})}function $_(e){if(W_(e)===`Identifier`&&R(e)&&typeof e.name==`string`)return e.name}function ev(e){return typeof e!=`object`||!e}const Z={ok:!1};function tv(e,t){if(e!==void 0){if(e===t.propsObjectName)return t.failedProps;if(e===t.restName)return t.restFailedProps}}function nv(e){return e==null}function rv(e){return typeof e==`object`&&!!e}function iv(e,t){return e===t?!0:nv(e)||nv(t)?nv(e)&&nv(t):rv(e)||rv(t)?rv(e)&&rv(t)?!1:void 0:typeof e==`boolean`||typeof t==`boolean`?Number(e)===Number(t):typeof e==`number`&&typeof t==`string`?e===Number(t):typeof e==`string`&&typeof t==`number`&&Number(e)===t}function av(e,t){if(!t.scope.has(e))return Z;let n=t.scope.get(e);return{ok:!0,value:n===void 0?void 0:n}}function ov(e,t){if(e.computed===!0){let n=uv(e.key,t);return n.ok&&typeof n.value==`string`?n.value:void 0}let n=$_(e.key);if(n!==void 0)return n;if(W_(e.key)===`Literal`&&R(e.key)&&typeof e.key.value==`string`)return e.key.value}function sv(e,t){return Array.isArray(e)?typeof t!=`number`||!Number.isInteger(t)||t<0?Z:t>=e.length?{ok:!0,value:void 0}:{ok:!0,value:e[t]}:!G_(e)||typeof t!=`string`?Z:{ok:!0,value:Object.hasOwn(e,t)?e[t]:void 0}}function cv(e,t){let n=/* @__PURE__ */ new Set;o_(e,n);for(let e of n)t.scope.delete(e)}function lv(e,t,n){let r=W_(e);if(r===`Identifier`){let r=$_(e);r!==void 0&&n.scope.set(r,t)}else if(r===`AssignmentPattern`&&R(e)){let r=t===void 0?uv(e.right,n):{ok:!0,value:t};r.ok?lv(e.left,r.value,n):cv(e.left,n)}else if(r===`ObjectPattern`&&R(e)&&Array.isArray(e.properties)){if(!G_(t)){cv(e,n);return}let r=Object.assign({},t),i=!0;for(let a of e.properties){if(W_(a)===`RestElement`&&R(a)){i?lv(a.argument,r,n):cv(a.argument,n);continue}if(W_(a)!==`Property`||!R(a))continue;let e=ov(a,n);e===void 0?(i=!1,cv(a.value,n)):(delete r[e],lv(a.value,Object.hasOwn(t,e)?t[e]:void 0,n))}}else if(r===`ArrayPattern`&&R(e)&&Array.isArray(e.elements)){if(!Array.isArray(t)){cv(e,n);return}for(let r=0;r<e.elements.length;r++){let i=e.elements[r];if(i!=null){if(W_(i)===`RestElement`&&R(i)){lv(i.argument,t.slice(r),n);break}lv(i,r<t.length?t[r]:void 0,n)}}}}function uv(e,t){if(!R(e))return Z;switch(e.type){case`Literal`:{let t=e.value;return typeof t==`string`||typeof t==`number`||typeof t==`boolean`||t===null?{ok:!0,value:t}:Z}case`Identifier`:return typeof e.name==`string`?e.name===`undefined`&&!t.scope.has(`undefined`)?{ok:!0,value:void 0}:(tv(e.name,t)?.size??0)>0?Z:av(e.name,t):Z;case`ParenthesizedExpression`:return uv(e.expression,t);case`MemberExpression`:{if(gv(e.object,t))return Z;let n=e.property,r=e.computed===!0?uv(n,t):{ok:!0,value:$_(n)};if(!r.ok||r.value===void 0)return Z;let i=$_(e.object),a=tv(i,t);if(a!==void 0&&i!==void 0){if(typeof r.value==`string`&&a.has(r.value))return Z;let e=av(i,t);return e.ok?sv(e.value,r.value):Z}let o=uv(e.object,t);return o.ok?sv(o.value,r.value):Z}case`ObjectExpression`:{if(!Array.isArray(e.properties))return Z;let n={};for(let r of e.properties){if(!R(r))return Z;if(r.type===`SpreadElement`){let e=uv(r.argument,t);if(!e.ok)return Z;if(Y_(e.value))continue;if(!G_(e.value))return Z;for(let[t,r]of Object.entries(e.value))Q_(n,t,r);continue}if(r.type!==`Property`)return Z;let e=ov(r,t);if(e===void 0||e===`__proto__`&&r.computed!==!0&&r.shorthand!==!0)return Z;let i=uv(r.value,t);if(!i.ok)return Z;Q_(n,e,i.value)}return J_(n)}case`ArrayExpression`:{if(!Array.isArray(e.elements))return Z;let n=[];for(let r of e.elements){if(r===null)return Z;if(R(r)&&r.type===`SpreadElement`){let e=uv(r.argument,t);if(!e.ok||!Array.isArray(e.value)||n.length+e.value.length>1e5)return Z;for(let t of e.value)n.push(t);continue}let e=uv(r,t);if(!e.ok)return Z;n.push(e.value)}return J_(n)}case`TemplateLiteral`:{let n=Array.isArray(e.quasis)?e.quasis:[],r=Array.isArray(e.expressions)?e.expressions:[],i=``;for(let e=0;e<n.length;e++){let a=n[e],o=R(a)&&R(a.value)&&typeof a.value.cooked==`string`?a.value.cooked:``;if(i+=o,e<r.length){let n=uv(r[e],t);if(!n.ok||typeof n.value==`object`&&n.value!==null)return Z;i+=String(n.value)}if(i.length>1e5)return Z}return{ok:!0,value:i}}case`BinaryExpression`:{let n=uv(e.left,t),r=uv(e.right,t);if(!n.ok||!r.ok)return Z;switch(e.operator){case`+`:if(rv(n.value)||rv(r.value))return Z;if(typeof n.value==`string`||typeof r.value==`string`){let e=`${String(n.value)}${String(r.value)}`;return e.length>1e5?Z:{ok:!0,value:e}}if(typeof n.value==`number`&&typeof r.value==`number`){let e=n.value+r.value;return Number.isNaN(e)?Z:{ok:!0,value:e}}return Z;case`===`:return{ok:!0,value:n.value===r.value};case`!==`:return{ok:!0,value:n.value!==r.value};case`==`:case`!=`:{let t=iv(n.value,r.value);return t===void 0?Z:{ok:!0,value:e.operator===`==`?t:!t}}default:return Z}}case`LogicalExpression`:{let n=uv(e.left,t);if(!n.ok)return Z;let r=!!n.value;return e.operator===`&&`?r?uv(e.right,t):n:e.operator===`||`?r?n:uv(e.right,t):e.operator===`??`?n.value===null||n.value===void 0?uv(e.right,t):n:Z}case`ConditionalExpression`:{let n=uv(e.test,t);return n.ok?uv(n.value?e.consequent:e.alternate,t):Z}case`CallExpression`:return mv(e,t);case`UnaryExpression`:{if(e.operator===`typeof`)return vv(e.argument,t);let n=uv(e.argument,t);if(!n.ok)return Z;if(e.operator===`void`)return{ok:!0,value:void 0};if(e.operator===`!`)return{ok:!0,value:!n.value};if(e.operator===`-`||e.operator===`+`){if(typeof n.value==`object`&&n.value!==null)return Z;let t=e.operator===`-`?-Number(n.value):Number(n.value);return Number.isNaN(t)?Z:{ok:!0,value:t}}return Z}default:return Z}}function dv(e){return e===void 0||typeof e==`number`&&Number.isFinite(e)}function fv(e,t,n){let[r,i]=n,a=typeof r==`string`?r:void 0;switch(t){case`startsWith`:case`endsWith`:case`includes`:case`indexOf`:case`lastIndexOf`:return a===void 0||!dv(i)?Z:{ok:!0,value:e[t](a,i)};case`slice`:case`substring`:return!dv(r)||!dv(i)?Z:{ok:!0,value:e[t](r??0,i)};case`at`:case`charAt`:return dv(r)?{ok:!0,value:t===`at`?e.at(r??0):e.charAt(r??0)}:Z;case`toLowerCase`:case`toUpperCase`:case`trim`:case`trimStart`:case`trimEnd`:return n.length===0?{ok:!0,value:e[t]()}:Z;case`replace`:case`replaceAll`:{if(a===void 0||typeof i!=`string`||i.includes(`$`))return Z;let n=a===``?t===`replaceAll`?e.length+1:1:t===`replaceAll`?e.split(a).length-1:Number(e.includes(a));return e.length+n*(i.length-a.length)>1e5?Z:{ok:!0,value:e[t](a,i)}}case`split`:return a===void 0||!dv(i)?Z:J_(e.split(a,i));case`padStart`:case`padEnd`:return typeof r!=`number`||r>1e5||i!==void 0&&typeof i!=`string`?Z:{ok:!0,value:e[t](r,i)};case`repeat`:return typeof r!=`number`||r<0||e.length*r>1e5?Z:{ok:!0,value:e.repeat(r)};case`concat`:{if(!n.every(e=>typeof e==`string`||typeof e==`number`))return Z;let t=n.map(String);return t.reduce((e,t)=>e+t.length,e.length)>1e5?Z:{ok:!0,value:e.concat(...t)}}default:return Z}}function pv(e,t,n){let[r,i]=n;switch(t){case`join`:{if(r!==void 0&&typeof r!=`string`||!e.every(e=>typeof e!=`object`||!e))return Z;let t=e.map(e=>e==null?``:String(e)),n=r??`,`;return t.reduce((e,t)=>e+t.length,0)+n.length*Math.max(t.length-1,0)>1e5?Z:{ok:!0,value:t.join(n)}}case`includes`:case`indexOf`:return typeof r==`object`&&r||!dv(i)?Z:{ok:!0,value:e[t](r,i)};case`slice`:return!dv(r)||!dv(i)?Z:{ok:!0,value:e.slice(r,i)};case`at`:return dv(r)?{ok:!0,value:e.at(r??0)}:Z;default:return Z}}function mv(e,t){let n=e.callee;if(W_(n)!==`MemberExpression`||!R(n)||n.optional===!0)return Z;let r=n.computed===!0?R(n.property)&&typeof n.property.value==`string`?n.property.value:void 0:$_(n.property);if(r===void 0||gv(n.object,t))return Z;let i=uv(n.object,t);if(!i.ok)return Z;let a=Array.isArray(e.arguments)?e.arguments:[],o=[];for(let e of a){if(W_(e)===`SpreadElement`)return Z;let n=uv(e,t);if(!n.ok)return Z;o.push(n.value)}try{if(typeof i.value==`string`)return fv(i.value,r,o);if(Array.isArray(i.value))return pv(i.value,r,o)}catch{return Z}return Z}const hv=/* @__PURE__ */ new Set([`window`,`document`,`navigator`,`location`,`history`,`localStorage`,`sessionStorage`,`matchMedia`,`requestAnimationFrame`]);function gv(e,t){if(t.markdownChildren!==!0||!R(e))return!1;if(e.type===`Identifier`)return e.name===t.childrenName&&!(t.failedProps?.has(`children`)??!1);if(e.type!==`MemberExpression`)return!1;let n=$_(e.object);return _v(e)===`children`&&n!==void 0&&(n===t.propsObjectName||n===t.restName)}function _v(e){if(e.computed!==!0)return $_(e.property);let t=e.property;return R(t)&&t.type===`Literal`&&typeof t.value==`string`?t.value:void 0}function vv(e,t){if(gv(e,t))return Z;if(W_(e)===`Identifier`&&R(e)&&typeof e.name==`string`&&hv.has(e.name)&&!t.scope.has(e.name)&&t.declaredNames!==void 0&&!t.declaredNames.has(e.name))return{ok:!0,value:`undefined`};let n=uv(e,t);if(!n.ok)return Z;let r=n.value;return{ok:!0,value:r===null?`object`:typeof r}}function yv(e){let t=W_(e);return t===`ArrowFunctionExpression`||t===`FunctionExpression`||t===`FunctionDeclaration`}function bv(e){if(e.type!==`mdxjsEsm`)return[];let t=e.data?.estree;return!R(t)||!Array.isArray(t.body)?[]:t.body}function xv(e,t){if(Array.isArray(e))for(let n of e)xv(n,t);else if(R(e)){R(e.data)&&e.data.estree!==void 0&&t.push(e.data.estree);for(let[n,r]of Object.entries(e))n!==`data`&&n!==`position`&&xv(r,t)}}function Sv(e){for(let[t,n]of e)typeof n==`object`&&n&&e.delete(t)}function Cv(e,t){let{reassigned:n,mutated:r}=H_(e,!0);return n.size>0||r.size>0||t&&V_(e)}function wv(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=[],a=e.children.flatMap(bv),o=(e,n)=>{let r=Array.isArray(n.params)?n.params:[];t.set(e,{params:r,body:n.body})},s=(e,t)=>{if(W_(e)!==`VariableDeclarator`||!R(e))return;Cv(e,f)&&Sv(n);let i=e.init,a=$_(e.id);if(a!==void 0&&yv(i)&&R(i)){o(a,i);return}if(t!==`const`)return;let s=uv(i,{scope:r,declaredNames:l});if(s.ok){let t=new Map(r);lv(e.id,s.value,{scope:t});let n=/* @__PURE__ */ new Set;o_(e.id,n);for(let e of n){if(!t.has(e))continue;let n=t.get(e),i=n===void 0?void 0:n;ev(i)&&r.set(e,i)}}let c=uv(i,{scope:n,declaredNames:l});c.ok&&lv(e.id,c.value,{scope:n})},c=[];xv(e,c);let l=U_(c),{reassigned:u,mutated:d}=H_(c),f=u.size>0||d.size>0;for(let e of a)if(R(e)){if(!(e.type===`VariableDeclaration`||e.type===`ExportNamedDeclaration`&&R(e.declaration)&&e.declaration.type===`VariableDeclaration`)&&Cv(e,f)&&Sv(n),e.type===`VariableDeclaration`){let t=Array.isArray(e.declarations)?e.declarations:[];for(let n of t)s(n,e.kind)}else if(e.type===`FunctionDeclaration`){let t=e.id;W_(t)===`Identifier`&&R(t)&&typeof t.name==`string`&&o(t.name,e)}else{if(e.type===`ExportNamedDeclaration`){let t=e.declaration;if(W_(t)===`VariableDeclaration`&&R(t)){let e=Array.isArray(t.declarations)?t.declarations:[];for(let n of e)s(n,t.kind)}if(W_(t)===`FunctionDeclaration`&&R(t)){let e=t.id;W_(e)===`Identifier`&&R(e)&&typeof e.name==`string`&&o(e.name,t)}if(e.source!=null)continue;let n=Array.isArray(e.specifiers)?e.specifiers:[];for(let e of n){if(W_(e)!==`ExportSpecifier`||!R(e))continue;let t=e.local,n=e.exported;R(t)&&typeof t.name==`string`&&R(n)&&typeof n.name==`string`&&i.push([t.name,n.name])}}if(e.type===`ExportDefaultDeclaration`){let t=e.declaration;if(yv(t)&&R(t)){let e=t.id;W_(e)===`Identifier`&&R(e)&&typeof e.name==`string`&&o(e.name,t)}}}}for(let e of u)n.delete(e),r.delete(e),t.delete(e);d.size>0&&Sv(n);let p=!0;for(;p;){p=!1;for(let[e,a]of i){let i=t.get(e);if(i&&!t.has(a)&&(t.set(a,i),p=!0),n.has(e)&&!n.has(a)){let t=n.get(e);n.set(a,t===void 0?void 0:t),p=!0}if(r.has(e)&&!r.has(a)){let t=r.get(e);r.set(a,t===void 0?void 0:t),p=!0}}}return{defs:t,moduleScope:n,literalScope:r,declaredNames:l}}`${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`;function Tv(e){if(!R(e)||!Array.isArray(e.body))return;let[t]=e.body;if(W_(t)===`ExpressionStatement`&&R(t))return t.expression}const Ev=e=>[...new Set(e.map(e=>e.trim()))],Dv=e=>e.every(e=>typeof e==`string`),Ov=e=>Array.isArray(e)?e:[e];function kv(e){if(Array.isArray(e)){if(e.length===0||!ua(e)||!Dv(e))return;let t=Ev(e);return ua(t)?t:void 0}let t=[e];if(!ua(t)||Dv(t))return;let[n]=t.map(({includes:e,excludes:t})=>Object.assign(Object.assign({},e&&{includes:Ev(e)}),t&&{excludes:Ev(t)}));return n&&ua([n])?n:void 0}function Av(e){if(!R(e)||Object.keys(e).length!==1)return;let t=kv(e.groups);return t&&{groups:t}}function jv(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`Visibility`}const Mv=[`humans`,`agents`,`signed-in`,`signed-out`];function Nv(e){return Mv.some(t=>t===e)}function Pv(e){let t=(e.data?.estree)?.body[0];return t?.type===`ExpressionStatement`?t.expression:void 0}function Fv(e){switch(e?.type){case`Literal`:return typeof e.value==`string`?e.value:void 0;case`TemplateLiteral`:{let t=e.quasis[0]?.value.cooked??void 0;for(let[n,r]of e.expressions.entries()){let i=Fv(r),a=e.quasis[n+1]?.value.cooked;if(t===void 0||i===void 0||a==null)return;t+=i+a}return t}case`BinaryExpression`:{if(e.operator!==`+`)return;let t=Fv(e.left),n=Fv(e.right);return t===void 0||n===void 0?void 0:t+n}default:return}}function Iv(e){if(!(e.type!==`Property`||e.computed))return e.key.type===`Identifier`?e.key.name:e.key.type===`Literal`&&typeof e.key.value==`string`?e.key.value:void 0}function Lv(e){let t=e.elements.map(e=>Fv(e));return t.every(e=>e!==void 0)?t:void 0}function Rv(e){let t={};for(let n of e.properties){let e=Iv(n);if(n.type!==`Property`||e!==`includes`&&e!==`excludes`)return;let r=n.value.type===`ArrayExpression`?Lv(n.value):void 0;if(!r)return;t[e]=r}return t}function zv(e){let t=Pv(e);if(t?.type!==`ObjectExpression`||t.properties.length!==1)return;let[n]=t.properties;if(n?.type===`Property`&&Iv(n)===`groups`)return n.value.type===`ObjectExpression`?kv(Rv(n.value)):n.value.type===`ArrayExpression`?kv(Lv(n.value)):void 0}function Bv(e){if(e.type!==`mdxJsxExpressionAttribute`)return!1;let t=Pv(e),n=t?.type===`ObjectExpression`&&t.properties.length===1?t.properties[0]:void 0;return n?.type!==`SpreadElement`||n.argument.type!==`ObjectExpression`||n.argument.properties.some(e=>{if(e.type!==`Property`||e.computed)return!0;let t=e.key.type===`Identifier`?e.key.name:void 0,n=e.key.type===`Literal`?e.key.value:void 0;return(t??n)===`for`})}function Vv(e,t=/* @__PURE__ */ new Map,n){let r,i=!1,a=e.attributes.findLastIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`for`);if(e.attributes.slice(a+1).some(Bv))return{kind:`dynamic`};for(let o of a===-1?[]:e.attributes.slice(a,a+1))if(o.type===`mdxJsxAttribute`&&o.name===`for`){if(typeof o.value==`string`){if(Nv(o.value))return{kind:`audience`,audience:o.value};r??=o.value}else if(o.value&&typeof o.value==`object`){if(`value`in o.value&&typeof o.value.value==`string`){let e=o.value.value.trim(),t=Fv(Pv(o.value));if(t!==void 0){if(Nv(t))return{kind:`audience`,audience:t};r??=t;continue}let n=e.match(/^(["'`])((?:\\.|(?!\1)[^\\])*)\1$/);if(n){let e=n[2]??``;if(!(n[1]==="`"&&e.includes("${"))){if(Nv(e))return{kind:`audience`,audience:e};r??=e;continue}}let i=zv(o.value);if(i)return{kind:`groups`,groups:i};if(Pv(o.value)?.type===`ObjectExpression`||e.startsWith(`{`)){r??=e;continue}}let e=Tv(`data`in o.value?o.value.data?.estree:void 0),a=uv(e,{scope:t});if(a.ok){let t=a.value;if(Nv(t)){let r={kind:`audience`,audience:t};if(n===void 0||Uv(r))return r;let a=uv(e,{scope:n});if(a.ok&&a.value===t)return r;i=!0;continue}let o=Av(t);if(o)return{kind:`groups`,groups:o.groups};if(typeof t==`string`){r??=t;continue}}i=!0}}return r===void 0?i?{kind:`dynamic`}:{kind:`missing`}:{kind:`invalid`,raw:r}}function Hv(e){switch(e.kind){case`audience`:return e.audience===`agents`;case`groups`:return!1;case`invalid`:case`missing`:return!0;case`dynamic`:return!1}}function Uv(e){switch(e.kind){case`audience`:return e.audience===`humans`||e.audience===`signed-in`;case`groups`:case`invalid`:case`dynamic`:case`missing`:return!0}}function Wv(e){if(e.kind===`groups`)return{groups:e.groups};if(e.kind===`audience`&&(e.audience===`signed-in`||e.audience===`signed-out`))return e.audience}const Gv=(e,t)=>({type:`mdxJsxAttribute`,name:e,value:t});function Kv(e,t){let n=e.data,r=n&&`mintlifyTitleMarkdown`in n?n.mintlifyTitleMarkdown:void 0;return r&&typeof r==`object`&&`text`in r&&typeof r.text==`string`?r.text:t}const qv=[],Jv=(e,t=1,n=qv)=>{if(`name`in e&&e.name===`Update`)return e.attributes.find(e=>`name`in e&&e.name===`label`&&typeof e.value==`string`)?.value??``;if(jv(e)){let t=Vv(e);if(!(t.kind===`dynamic`||t.kind===`audience`&&t.audience===`humans`))return``}let r=n[t-1],i=e.type===`text`,a=e.type===`inlineCode`,o=r?.type!==`mdxJsxFlowElement`,s=r&&`value`in r&&typeof r.value==`string`&&!r.value.startsWith(`<small`);if(a||i&&(o||s))return e.value;if(`children`in e&&Array.isArray(e.children)){let t=``;return e.children.forEach((e,n,r)=>{t+=Jv(e,n,r)}),t}return``},Yv=[`animate`,`animateMotion`,`animateTransform`,`mpath`,`set`],Xv=e=>e.type===`mdxjsEsm`;function Zv(e){return e.data?.estree!=null}const Qv=e=>e.type===`ImportDeclaration`,$v=e=>[`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`].includes(e),ey=e=>e.type===`mdxJsxFlowElement`,ty=e=>e instanceof Object&&`type`in e&&(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`),ny=e=>ey(e)&&e.name==null,ry=(e,t)=>`${e}_${t}`,iy=[`ApiPlayground`,`Accordion`,`AccordionGroup`,`Badge`,`Callout`,`CodeGroup`,`CodeBlock`,`Color`,`Color.Row`,`Color.Item`,`CustomCode`,`CustomComponent`,`DynamicCustomComponent`,`Danger`,`Tile`,`Tree`,`Tree.Folder`,`Tree.File`,`Table`,`Table.Header`,`Table.Body`,`Table.Row`,`Table.HeaderCell`,`Table.RowHeader`,`Table.Cell`,`FileTree`,`SnippetGroup`,`Panel`,`RequestExample`,`ResponseExample`,`Param`,`ParamField`,`Prompt`,`Card`,`CardGroup`,`Columns`,`Column`,`Expandable`,`Frame`,`GitHub`,`GitHub.Repo`,`Github`,`Github.Repo`,`Heading`,`Info`,`Icon`,`MDX`,`Link`,`MDXContentController`,`ResponseField`,`Warning`,`Note`,`Tip`,`Check`,`Tabs`,`Tab`,`Tooltip`,`Latex`,`Step`,`Steps`,`Update`,`a`,`b`,`br`,`button`,`clipPath`,`col`,`colgroup`,`defs`,`div`,`form`,`g`,`h1`,`h2`,`h3`,`h4`,`head`,`hr`,`iframe`,`img`,`input`,`label`,`li`,`link`,`ol`,`p`,`path`,`picture`,`rect`,`script`,`section`,`source`,`span`,`sub`,`sup`,`u`,`svg`,...Yv,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`track`,`ul`,`video`,`code`,`kbd`,`pre`,`ZoomImage`,`OptimizedVideo`,`Mermaid`,`Variation`,`Visibility`,`View`,`zapier-zap-templates`],ay=(e,t)=>{let n=e.position?.start.offset,r=e.position?.end.offset;return n===void 0||r===void 0?!1:!t.startsWith(`$$`,n)&&/^\d/.test(e.value)&&/\d/.test(t[r]??``)},oy=(e,t)=>{Da(e,`inlineMath`,(e,n,r)=>{if(r&&n!==void 0&&ay(e,t))return r.children.splice(n,1,{type:`text`,value:`$${e.value}$`}),[wa,n]})};Object.freeze({status:`aborted`});/* @__NO_SIDE_EFFECTS__ */
277
+ `),sourceLines:i}}function t_(e,t){let n=e.replace(Kg,e=>` `.repeat(e.length)),r=``,i=0;for(;;){if(t){let n=e.indexOf(`*/`,i);if(n===-1)return{visible:r,inComment:t};i=n+2}let a=n.indexOf(`{/*`,i);if(a===-1)return{visible:r+e.slice(i),inComment:!1};r+=e.slice(i,a),i=a+3,t=!0}}function n_(e){let t=e[0];if(t!=="`"&&t!==`~`)return;let n=1;for(;n<e.length&&e[n]===t;)n++;if(!(n<3))return{char:t,count:n}}function r_(e,t,n){let r=0;for(;r<e.length&&e[r]===t;)r++;if(r<n)return!1;for(;r<e.length;r++)if(e[r]!==` `&&e[r]!==` `&&e[r]!==`\r`)return!1;return!0}const i_=/* @__PURE__ */ new Set([`loc`,`range`,`start`,`end`,`comments`,`leadingComments`,`trailingComments`]),a_=/* @__PURE__ */ new Set([`ArrowFunctionExpression`,`FunctionExpression`,`FunctionDeclaration`]);function o_(e,t){if(!R(e))return;let n=e.type;if(n===`Identifier`)typeof e.name==`string`&&t.add(e.name);else if(n===`AssignmentPattern`)o_(e.left,t);else if(n===`RestElement`)o_(e.argument,t);else if(n===`ObjectPattern`&&Array.isArray(e.properties))for(let n of e.properties)R(n)&&(n.type===`RestElement`?o_(n.argument,t):n.type===`Property`&&o_(n.value,t));else if(n===`ArrayPattern`&&Array.isArray(e.elements))for(let n of e.elements)o_(n,t)}function s_(e,t){for(let[n,r]of Object.entries(e))i_.has(n)||t(r)}function c_(e,t){if(Array.isArray(e))for(let n of e)c_(n,t);else if(R(e)&&typeof e.type==`string`&&!(a_.has(e.type)||e.type===`ClassBody`)){if(e.type===`VariableDeclaration`&&e.kind===`var`){let n=Array.isArray(e.declarations)?e.declarations:[];for(let e of n)R(e)&&o_(e.id,t)}s_(e,e=>c_(e,t))}}function l_(e){let t=/* @__PURE__ */ new Set;for(let n of e)if(R(n)){if(n.type===`VariableDeclaration`&&n.kind!==`var`){let e=Array.isArray(n.declarations)?n.declarations:[];for(let n of e)R(n)&&o_(n.id,t)}else(n.type===`FunctionDeclaration`||n.type===`ClassDeclaration`)&&R(n.id)&&typeof n.id.name==`string`&&t.add(n.id.name)}return t}function u_(e,t){let n=new Set(e);for(let e of t)n.add(e);return n}function d_(e){return typeof e==`string`&&!/^[a-z]/.test(e)&&!e.includes(`-`)}const f_=/* @__PURE__ */ new Set([`push`,`pop`,`shift`,`unshift`,`splice`,`sort`,`reverse`,`fill`,`copyWithin`,`set`,`add`,`delete`,`clear`,`__defineGetter__`,`__defineSetter__`]),p_=/* @__PURE__ */ new Set([`assign`,`defineProperty`,`defineProperties`,`setPrototypeOf`]),m_=/* @__PURE__ */ new Map([[`Object`,p_],[`Reflect`,/* @__PURE__ */ new Set([`set`,`defineProperty`,`deleteProperty`,`setPrototypeOf`])]]);function h_(e){return e===`constructor`||p_.has(e)}function g_(e){let t=e.property;if(R(t))return e.computed!==!0&&typeof t.name==`string`?t.name:t.type===`Literal`&&typeof t.value==`string`?t.value:void 0}const __=/* @__PURE__ */ new Set([`globalThis`,`window`,`self`,`global`]),v_=/* @__PURE__ */ new Set([`Object`,`Reflect`,`Function`,`eval`,...__]),y_=/* @__PURE__ */ new WeakSet;function b_(e,t){let n=R(t)&&t.type===`Literal`&&(typeof t.value==`string`||typeof t.value==`number`);return e.computed===!0&&!n}function x_(e){let t=N_(e);for(;R(t)&&t.type===`MemberExpression`;){if(b_(t,t.property))return!0;t=N_(t.object)}return!1}function S_(e,t){var n;if(R(e))switch(e.type){case`AssignmentPattern`:S_(e.left,t);return;case`RestElement`:S_(e.argument,t);return;case`ArrayPattern`:if(Array.isArray(e.elements))for(let n of e.elements)S_(n,t);return;case`ObjectPattern`:{let r=Array.isArray(e.properties)?e.properties:[];for(let e of r){if(!R(e))continue;if(e.type===`RestElement`){S_(e.argument,t);continue}let r=e.key,i=e.computed!==!0&&R(r)&&typeof r.name==`string`?r.name:R(r)&&r.type===`Literal`?String(r.value):void 0;(b_(e,r)||i!==void 0&&(h_(i)||v_.has(i)))&&((n=t.unknownWrite)==null||n.call(t)),S_(e.value,t)}return}default:return}}const C_=/* @__PURE__ */ new WeakSet;function w_(e){let t=e.callee;if(!R(t)||t.type!==`MemberExpression`)return;let n=t.object;g_(t)!==void 0&&R(n)&&n.type===`Identifier`&&typeof n.name==`string`&&m_.has(n.name)&&C_.add(n)}function T_(e){let t=e.callee;if(!R(t)||t.type!==`MemberExpression`)return;let n=g_(t);if(n===void 0)return;let r=t.object;if(R(r)&&r.type===`Identifier`&&typeof r.name==`string`){let t=m_.get(r.name);if(t!==void 0)return t.has(n)&&Array.isArray(e.arguments)?e.arguments[0]:void 0}return f_.has(n)?r:void 0}function E_(e,t,n){var r;R(e)&&typeof e.name==`string`&&!t.has(e.name)&&((e.name===`eval`||e.name===`Function`||__.has(e.name)&&!y_.has(e)||m_.has(e.name)&&!C_.has(e))&&((r=n.unknownWrite)==null||r.call(n)),n.reference(e))}function D_(e,t,n){if(R(e))switch(e.type){case`AssignmentPattern`:D_(e.left,t,n),X(e.right,t,n);return;case`RestElement`:D_(e.argument,t,n);return;case`ObjectPattern`:{let r=Array.isArray(e.properties)?e.properties:[];for(let e of r)R(e)&&(e.type===`RestElement`?D_(e.argument,t,n):(e.computed===!0&&X(e.key,t,n),D_(e.value,t,n)));return}case`ArrayPattern`:{let r=Array.isArray(e.elements)?e.elements:[];for(let e of r)D_(e,t,n);return}case`MemberExpression`:X(e,t,n);return;default:return}}function X(e,t,n){var r,i,a,o,s,c,l,u,d,f;if(Array.isArray(e)){for(let r of e)X(r,t,n);return}if(!R(e)||typeof e.type!=`string`)return;let p=e.type;if(a_.has(p)){if(n.eagerOnly===!0)return;let r=Array.isArray(e.params)?e.params:[],i=/* @__PURE__ */ new Set;for(let e of r)o_(e,i);p===`FunctionExpression`&&R(e.id)&&typeof e.id.name==`string`&&i.add(e.id.name);let a=u_(t,i);for(let e of r)S_(e,n),D_(e,a,n);let o=/* @__PURE__ */ new Set;c_(e.body,o);let s=e.body,c=R(s)&&Array.isArray(s.body)?s.body:void 0;if(c!==void 0)for(let e of l_(c))o.add(e);X(c??s,u_(a,o),n)}else switch(p){case`Identifier`:E_(e,t,n);return;case`AssignmentExpression`:(r=n.write)==null||r.call(n,e.left,t),S_(e.left,n),X(e.left,t,n),X(e.right,t,n);return;case`UpdateExpression`:(i=n.write)==null||i.call(n,e.argument,t),X(e.argument,t,n);return;case`UnaryExpression`:if(e.operator===`delete`){let r=N_(e.argument);R(r)&&r.type===`MemberExpression`&&((a=n.mutate)==null||a.call(n,r.object,t))}X(e.argument,t,n);return;case`CallExpression`:{let r=T_(e);r!==void 0&&((o=n.mutate)==null||o.call(n,r,t)),x_(e.callee)&&((s=n.unknownWrite)==null||s.call(n)),w_(e),s_(e,e=>X(e,t,n));return}case`NewExpression`:case`TaggedTemplateExpression`:x_(p===`NewExpression`?e.callee:e.tag)&&((c=n.unknownWrite)==null||c.call(n)),s_(e,e=>X(e,t,n));return;case`ClassDeclaration`:case`ClassExpression`:{X(e.superClass,t,n);let r=p===`ClassExpression`&&R(e.id)&&typeof e.id.name==`string`?[e.id.name]:[];X(e.body,u_(t,r),n);return}case`BlockStatement`:case`StaticBlock`:{let r=Array.isArray(e.body)?e.body:[];X(r,u_(t,l_(r)),n);return}case`SwitchStatement`:{X(e.discriminant,t,n);let r=Array.isArray(e.cases)?e.cases:[];X(r,u_(t,l_(r.flatMap(e=>R(e)&&Array.isArray(e.consequent)?e.consequent:[]))),n);return}case`ForStatement`:{let r=u_(t,l_([e.init]));s_(e,e=>X(e,r,n));return}case`ForInStatement`:case`ForOfStatement`:{let r=e.left,i=u_(t,l_([r]));X(e.right,t,n),R(r)&&r.type===`VariableDeclaration`?X(r,i,n):((l=n.write)==null||l.call(n,r,t),S_(r,n),X(r,t,n)),X(e.body,i,n);return}case`CatchClause`:{let r=/* @__PURE__ */ new Set;o_(e.param,r);let i=u_(t,r);S_(e.param,n),D_(e.param,i,n),X(e.body,i,n);return}case`VariableDeclarator`:S_(e.id,n),D_(e.id,t,n),X(e.init,t,n);return;case`MemberExpression`:{let r=g_(e),i=e.object,a=R(i)&&i.type===`Identifier`&&typeof i.name==`string`&&m_.has(i.name);r!==void 0&&h_(r)&&!a&&((u=n.unknownWrite)==null||u.call(n)),r!==void 0&&v_.has(r)&&((d=n.unknownWrite)==null||d.call(n)),r!==void 0&&!h_(r)&&R(i)&&i.type===`Identifier`&&typeof i.name==`string`&&__.has(i.name)&&y_.add(i),X(e.object,t,n),e.computed===!0&&X(e.property,t,n);return}case`Property`:case`PropertyDefinition`:case`MethodDefinition`:if(e.computed===!0&&X(e.key,t,n),n.eagerOnly===!0&&p===`PropertyDefinition`&&e.static!==!0)return;X(e.value,t,n);return;case`LabeledStatement`:X(e.body,t,n);return;case`WithStatement`:(f=n.unknownWrite)==null||f.call(n),X(e.object,t,n),X(e.body,t,n);return;case`JSXOpeningElement`:case`JSXClosingElement`:{let r=e.name;R(r)&&r.type===`JSXIdentifier`&&d_(r.name)?E_(r,t,n):R(r)&&r.type===`JSXMemberExpression`&&X(r,t,n),X(e.attributes,t,n);return}case`JSXMemberExpression`:{let r=e.object;R(r)&&r.type===`JSXIdentifier`?E_(r,t,n):X(r,t,n);return}case`JSXAttribute`:X(e.value,t,n);return;case`BreakStatement`:case`ContinueStatement`:case`MetaProperty`:case`JSXIdentifier`:case`JSXNamespacedName`:return;default:s_(e,e=>X(e,t,n))}}function O_(e,t=!1){let n=/* @__PURE__ */ new Set;return X(e,/* @__PURE__ */ new Set,{reference:e=>{typeof e.name==`string`&&n.add(e.name)},eagerOnly:t}),n}const k_=/* @__PURE__ */ new Set([`ParenthesizedExpression`,`TSAsExpression`,`TSSatisfiesExpression`,`TSNonNullExpression`,`TSTypeAssertion`,`ChainExpression`]);function A_(e){let t=e.property;if(R(t)){if(e.computed!==!0)return typeof t.name==`string`?t.name:void 0;if(t.type===`Literal`&&(typeof t.value==`string`||typeof t.value==`number`))return String(t.value)}}function j_(e){if(e.computed===!0){let t=e.key;return R(t)&&t.type===`Literal`&&(typeof t.value==`string`||typeof t.value==`number`)?String(t.value):void 0}let t=e.key;if(R(t)&&typeof t.name==`string`)return t.name;if(R(t)&&t.type===`Literal`&&typeof t.value==`string`)return t.value}function M_(e,t){let n=A_(t);if(n===void 0)return`unknown`;let r=N_(e);if(!R(r))return`unknown`;if(r.type===`ObjectExpression`){let e=Array.isArray(r.properties)?r.properties:[],t=`contained`;for(let r of e){if(!R(r))continue;if(r.type===`SpreadElement`){t=`unknown`;continue}if(r.type!==`Property`)continue;let e=j_(r);e===void 0?t=`unknown`:e===n&&(t=r.value)}return t}if(r.type===`ArrayExpression`){if(!/^\d+$/.test(n))return`contained`;let e=Number(n),t=Array.isArray(r.elements)?r.elements:[],i=0;for(let n of t){if(R(n)&&n.type===`SpreadElement`)return`unknown`;if(i===e)return n??`contained`;i+=1}return`contained`}return`unknown`}function N_(e){let t=e;for(;R(t)&&typeof t.type==`string`&&k_.has(t.type);)t=t.expression;return t}function P_(e,t){if(Array.isArray(e))for(let n of e)P_(n,t);else if(R(e)&&typeof e.type==`string`){if(a_.has(e.type)&&Array.isArray(e.params))for(let n of e.params)o_(n,t);if(e.type===`CatchClause`&&o_(e.param,t),e.type===`VariableDeclarator`&&e.init==null&&o_(e.id,t),(e.type===`ForOfStatement`||e.type===`ForInStatement`)&&R(e.left)){let n=e.left;if(n.type===`VariableDeclaration`&&Array.isArray(n.declarations))for(let e of n.declarations)R(e)&&o_(e.id,t)}s_(e,e=>P_(e,t))}}function F_(e,t){if(Array.isArray(e)){for(let n of e)F_(n,t);return}if(!R(e))return;let n=(e,n)=>{let r=/* @__PURE__ */ new Set;o_(e,r);let i=O_(n);for(let e of r){let n=t.get(e)??/* @__PURE__ */ new Set;for(let e of i)n.add(e);t.set(e,n)}};e.type===`VariableDeclarator`&&n(e.id,e.init),e.type===`AssignmentExpression`&&n(N_(e.left),e.right),s_(e,e=>F_(e,t))}const I_=/* @__PURE__ */ new Set([`CallExpression`,`NewExpression`,`TaggedTemplateExpression`]);function L_(e,t){let n=N_(e);if(!R(n))return!1;switch(n.type){case`Identifier`:return typeof n.name==`string`&&t.has(n.name);case`MemberExpression`:return b_(n,n.property)||L_(n.object,t);case`LogicalExpression`:return L_(n.left,t)||L_(n.right,t);case`ConditionalExpression`:return L_(n.consequent,t)||L_(n.alternate,t);case`SequenceExpression`:{let e=Array.isArray(n.expressions)?n.expressions:[];return L_(e[e.length-1],t)}case`AwaitExpression`:case`SpreadElement`:return L_(n.argument,t);case`ArrayExpression`:return Array.isArray(n.elements)?n.elements.some(e=>L_(e,t)):!1;case`ObjectExpression`:return Array.isArray(n.properties)?n.properties.some(e=>R(e)&&L_(e.type===`SpreadElement`?e:e.value,t)):!1;default:return!1}}function R_(e,t){if(Array.isArray(e))for(let n of e)R_(n,t);else R(e)&&(e.type===`VariableDeclarator`&&L_(e.init,t)&&o_(e.id,t),e.type===`AssignmentExpression`&&L_(e.right,t)&&o_(N_(e.left),t),s_(e,e=>R_(e,t)))}const z_=/* @__PURE__ */ new Set([`apply`,`construct`]);function B_(e,t,n){if(Array.isArray(e))return e.some(e=>B_(e,t,n));if(!R(e)||typeof e.type!=`string`||n&&a_.has(e.type))return!1;if(I_.has(e.type)){let n=e.type===`TaggedTemplateExpression`?e.tag:e.callee;if(L_(n,t))return!0;let r=N_(n),i=Array.isArray(e.arguments)?e.arguments:[];if(R(r)&&r.type===`MemberExpression`&&R(r.object)&&r.object.type===`Identifier`&&r.object.name===`Reflect`&&z_.has(g_(r)??``)&&L_(i[0],t))return!0}let r=!1;return s_(e,e=>{r||=B_(e,t,n)}),r}function V_(e){if(Array.isArray(e))return e.some(V_);if(!R(e)||typeof e.type!=`string`||a_.has(e.type))return!1;if(I_.has(e.type))return!0;if(e.type===`PropertyDefinition`&&e.static!==!0)return e.computed===!0&&V_(e.key);let t=!1;return s_(e,e=>{t||=V_(e)}),t}function H_(e,t=!1){let n={reassigned:/* @__PURE__ */ new Set,mutated:/* @__PURE__ */ new Set},r=/* @__PURE__ */ new Map;F_(e,r);let i=/* @__PURE__ */ new Set;P_(e,i);let a=/* @__PURE__ */ new Set,o=-1;for(;a.size!==o;)o=a.size,R_(e,a);B_(e,a,t)&&n.mutated.add(`*`);let s=(e,t,a)=>{if(!t.has(e)){n.mutated.add(e);return}if(a.has(e))return;a.add(e);let o=r.get(e);if(o===void 0||i.has(e))n.mutated.add(`*`);else for(let e of o)s(e,/* @__PURE__ */ new Set,a)},c=(e,t)=>{let r=[],i=N_(e);for(;R(i)&&i.type===`MemberExpression`;)r.push(i),i=N_(i.object);if(R(i)){if(i.type===`ObjectExpression`||i.type===`ArrayExpression`){let e=i;for(let i=r.length-1;i>=0;--i){let a=r[i];if(a===void 0)return;let o=M_(e,a);if(o===`contained`)return;if(o===`unknown`){n.mutated.add(`*`);return}e=o;let s=N_(e);if(!R(s)||s.type!==`ObjectExpression`&&s.type!==`ArrayExpression`){c(e,t);return}e=s}}else switch(i.type){case`Identifier`:typeof i.name==`string`&&s(i.name,t,/* @__PURE__ */ new Set);return;case`ConditionalExpression`:c(i.consequent,t),c(i.alternate,t);return;case`LogicalExpression`:c(i.left,t),c(i.right,t);return;case`SequenceExpression`:{let e=Array.isArray(i.expressions)?i.expressions:[];c(e[e.length-1],t);return}case`ThisExpression`:case`ObjectExpression`:case`ArrayExpression`:case`NewExpression`:case`Literal`:case`TemplateLiteral`:return;default:n.mutated.add(`*`)}}},l=(e,t)=>{let r=N_(e);if(R(r))switch(r.type){case`Identifier`:typeof r.name==`string`&&!t.has(r.name)&&n.reassigned.add(r.name);return;case`MemberExpression`:c(r.object,t);return;case`AssignmentPattern`:l(r.left,t);return;case`RestElement`:l(r.argument,t);return;case`ObjectPattern`:{let e=Array.isArray(r.properties)?r.properties:[];for(let n of e)R(n)&&l(n.type===`RestElement`?n.argument:n.value,t);return}case`ArrayPattern`:{let e=Array.isArray(r.elements)?r.elements:[];for(let n of e)l(n,t);return}default:return}};return X(e,/* @__PURE__ */ new Set,{reference:()=>void 0,write:l,mutate:c,unknownWrite:()=>{n.mutated.add(`*`)},eagerOnly:t}),n}function U_(e,t=/* @__PURE__ */ new Set){if(Array.isArray(e)){for(let n of e)U_(n,t);return t}if(!R(e))return t;if(e.type===`VariableDeclarator`&&o_(e.id,t),(e.type===`FunctionDeclaration`||e.type===`ClassDeclaration`)&&R(e.id)&&typeof e.id.name==`string`&&t.add(e.id.name),Array.isArray(e.params))for(let n of e.params)o_(n,t);return e.type===`CatchClause`&&o_(e.param,t),(e.type===`ImportSpecifier`||e.type===`ImportDefaultSpecifier`||e.type===`ImportNamespaceSpecifier`)&&R(e.local)&&typeof e.local.name==`string`&&t.add(e.local.name),s_(e,e=>U_(e,t)),t}function W_(e){return R(e)&&typeof e.type==`string`?e.type:void 0}function G_(e){return R(e)}const K_=/* @__PURE__ */ new WeakMap;function q_(e){if(typeof e==`string`)return 1+e.length;if(typeof e!=`object`||!e)return 1;let t=K_.get(e);if(t!==void 0)return t;let n=1;if(Array.isArray(e)){for(let t of e)if(n+=q_(t),n>1e5)break}else for(let[t,r]of Object.entries(e))if(n+=t.length+q_(r),n>1e5)break;return K_.set(e,n),n}function J_(e){return q_(e)>1e5?Z:{ok:!0,value:e}}function Y_(e){return e==null||typeof e==`boolean`||typeof e==`number`}function X_(e){return Object.is(e,-0)?`-0`:Number.isNaN(e)?`0/0`:Number.isFinite(e)?JSON.stringify(e):e>0?`1e999`:`-1e999`}function Z_(e){return e===void 0?`void 0`:e===null?`null`:typeof e==`number`?X_(e):typeof e==`string`||typeof e==`boolean`?JSON.stringify(e):Array.isArray(e)?`[${e.map(e=>Z_(e)).join(`,`)}]`:`{${Object.entries(e).map(([e,t])=>`${e===`__proto__`?`["__proto__"]`:JSON.stringify(e)}:${Z_(t)}`).join(`,`)}}`}function Q_(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0})}function $_(e){if(W_(e)===`Identifier`&&R(e)&&typeof e.name==`string`)return e.name}function ev(e){return typeof e!=`object`||!e}const Z={ok:!1};function tv(e,t){if(e!==void 0){if(e===t.propsObjectName)return t.failedProps;if(e===t.restName)return t.restFailedProps}}function nv(e){return e==null}function rv(e){return typeof e==`object`&&!!e}function iv(e,t){return e===t?!0:nv(e)||nv(t)?nv(e)&&nv(t):rv(e)||rv(t)?rv(e)&&rv(t)?!1:void 0:typeof e==`boolean`||typeof t==`boolean`?Number(e)===Number(t):typeof e==`number`&&typeof t==`string`?e===Number(t):typeof e==`string`&&typeof t==`number`&&Number(e)===t}function av(e,t){if(!t.scope.has(e))return Z;let n=t.scope.get(e);return{ok:!0,value:n===void 0?void 0:n}}function ov(e,t){if(e.computed===!0){let n=uv(e.key,t);return n.ok&&typeof n.value==`string`?n.value:void 0}let n=$_(e.key);if(n!==void 0)return n;if(W_(e.key)===`Literal`&&R(e.key)&&typeof e.key.value==`string`)return e.key.value}function sv(e,t){return Array.isArray(e)?typeof t!=`number`||!Number.isInteger(t)||t<0?Z:t>=e.length?{ok:!0,value:void 0}:{ok:!0,value:e[t]}:!G_(e)||typeof t!=`string`?Z:{ok:!0,value:Object.hasOwn(e,t)?e[t]:void 0}}function cv(e,t){let n=/* @__PURE__ */ new Set;o_(e,n);for(let e of n)t.scope.delete(e)}function lv(e,t,n){let r=W_(e);if(r===`Identifier`){let r=$_(e);r!==void 0&&n.scope.set(r,t)}else if(r===`AssignmentPattern`&&R(e)){let r=t===void 0?uv(e.right,n):{ok:!0,value:t};r.ok?lv(e.left,r.value,n):cv(e.left,n)}else if(r===`ObjectPattern`&&R(e)&&Array.isArray(e.properties)){if(!G_(t)){cv(e,n);return}let r=Object.assign({},t),i=!0;for(let a of e.properties){if(W_(a)===`RestElement`&&R(a)){i?lv(a.argument,r,n):cv(a.argument,n);continue}if(W_(a)!==`Property`||!R(a))continue;let e=ov(a,n);e===void 0?(i=!1,cv(a.value,n)):(delete r[e],lv(a.value,Object.hasOwn(t,e)?t[e]:void 0,n))}}else if(r===`ArrayPattern`&&R(e)&&Array.isArray(e.elements)){if(!Array.isArray(t)){cv(e,n);return}for(let r=0;r<e.elements.length;r++){let i=e.elements[r];if(i!=null){if(W_(i)===`RestElement`&&R(i)){lv(i.argument,t.slice(r),n);break}lv(i,r<t.length?t[r]:void 0,n)}}}}function uv(e,t){if(!R(e))return Z;switch(e.type){case`Literal`:{let t=e.value;return typeof t==`string`||typeof t==`number`||typeof t==`boolean`||t===null?{ok:!0,value:t}:Z}case`Identifier`:return typeof e.name==`string`?e.name===`undefined`&&!t.scope.has(`undefined`)?{ok:!0,value:void 0}:(tv(e.name,t)?.size??0)>0?Z:av(e.name,t):Z;case`ParenthesizedExpression`:return uv(e.expression,t);case`MemberExpression`:{if(gv(e.object,t))return Z;let n=e.property,r=e.computed===!0?uv(n,t):{ok:!0,value:$_(n)};if(!r.ok||r.value===void 0)return Z;let i=$_(e.object),a=tv(i,t);if(a!==void 0&&i!==void 0){if(typeof r.value==`string`&&a.has(r.value))return Z;let e=av(i,t);return e.ok?sv(e.value,r.value):Z}let o=uv(e.object,t);return o.ok?sv(o.value,r.value):Z}case`ObjectExpression`:{if(!Array.isArray(e.properties))return Z;let n={};for(let r of e.properties){if(!R(r))return Z;if(r.type===`SpreadElement`){let e=uv(r.argument,t);if(!e.ok)return Z;if(Y_(e.value))continue;if(!G_(e.value))return Z;for(let[t,r]of Object.entries(e.value))Q_(n,t,r);continue}if(r.type!==`Property`)return Z;let e=ov(r,t);if(e===void 0||e===`__proto__`&&r.computed!==!0&&r.shorthand!==!0)return Z;let i=uv(r.value,t);if(!i.ok)return Z;Q_(n,e,i.value)}return J_(n)}case`ArrayExpression`:{if(!Array.isArray(e.elements))return Z;let n=[];for(let r of e.elements){if(r===null)return Z;if(R(r)&&r.type===`SpreadElement`){let e=uv(r.argument,t);if(!e.ok||!Array.isArray(e.value)||n.length+e.value.length>1e5)return Z;for(let t of e.value)n.push(t);continue}let e=uv(r,t);if(!e.ok)return Z;n.push(e.value)}return J_(n)}case`TemplateLiteral`:{let n=Array.isArray(e.quasis)?e.quasis:[],r=Array.isArray(e.expressions)?e.expressions:[],i=``;for(let e=0;e<n.length;e++){let a=n[e],o=R(a)&&R(a.value)&&typeof a.value.cooked==`string`?a.value.cooked:``;if(i+=o,e<r.length){let n=uv(r[e],t);if(!n.ok||typeof n.value==`object`&&n.value!==null)return Z;i+=String(n.value)}if(i.length>1e5)return Z}return{ok:!0,value:i}}case`BinaryExpression`:{let n=uv(e.left,t),r=uv(e.right,t);if(!n.ok||!r.ok)return Z;switch(e.operator){case`+`:if(rv(n.value)||rv(r.value))return Z;if(typeof n.value==`string`||typeof r.value==`string`){let e=`${String(n.value)}${String(r.value)}`;return e.length>1e5?Z:{ok:!0,value:e}}if(typeof n.value==`number`&&typeof r.value==`number`){let e=n.value+r.value;return Number.isNaN(e)?Z:{ok:!0,value:e}}return Z;case`===`:return{ok:!0,value:n.value===r.value};case`!==`:return{ok:!0,value:n.value!==r.value};case`==`:case`!=`:{let t=iv(n.value,r.value);return t===void 0?Z:{ok:!0,value:e.operator===`==`?t:!t}}default:return Z}}case`LogicalExpression`:{let n=uv(e.left,t);if(!n.ok)return Z;let r=!!n.value;return e.operator===`&&`?r?uv(e.right,t):n:e.operator===`||`?r?n:uv(e.right,t):e.operator===`??`?n.value===null||n.value===void 0?uv(e.right,t):n:Z}case`ConditionalExpression`:{let n=uv(e.test,t);return n.ok?uv(n.value?e.consequent:e.alternate,t):Z}case`CallExpression`:return mv(e,t);case`UnaryExpression`:{if(e.operator===`typeof`)return vv(e.argument,t);let n=uv(e.argument,t);if(!n.ok)return Z;if(e.operator===`void`)return{ok:!0,value:void 0};if(e.operator===`!`)return{ok:!0,value:!n.value};if(e.operator===`-`||e.operator===`+`){if(typeof n.value==`object`&&n.value!==null)return Z;let t=e.operator===`-`?-Number(n.value):Number(n.value);return Number.isNaN(t)?Z:{ok:!0,value:t}}return Z}default:return Z}}function dv(e){return e===void 0||typeof e==`number`&&Number.isFinite(e)}function fv(e,t,n){let[r,i]=n,a=typeof r==`string`?r:void 0;switch(t){case`startsWith`:case`endsWith`:case`includes`:case`indexOf`:case`lastIndexOf`:return a===void 0||!dv(i)?Z:{ok:!0,value:e[t](a,i)};case`slice`:case`substring`:return!dv(r)||!dv(i)?Z:{ok:!0,value:e[t](r??0,i)};case`at`:case`charAt`:return dv(r)?{ok:!0,value:t===`at`?e.at(r??0):e.charAt(r??0)}:Z;case`toLowerCase`:case`toUpperCase`:case`trim`:case`trimStart`:case`trimEnd`:return n.length===0?{ok:!0,value:e[t]()}:Z;case`replace`:case`replaceAll`:{if(a===void 0||typeof i!=`string`||i.includes(`$`))return Z;let n=a===``?t===`replaceAll`?e.length+1:1:t===`replaceAll`?e.split(a).length-1:Number(e.includes(a));return e.length+n*(i.length-a.length)>1e5?Z:{ok:!0,value:e[t](a,i)}}case`split`:return a===void 0||!dv(i)?Z:J_(e.split(a,i));case`padStart`:case`padEnd`:return typeof r!=`number`||r>1e5||i!==void 0&&typeof i!=`string`?Z:{ok:!0,value:e[t](r,i)};case`repeat`:return typeof r!=`number`||r<0||e.length*r>1e5?Z:{ok:!0,value:e.repeat(r)};case`concat`:{if(!n.every(e=>typeof e==`string`||typeof e==`number`))return Z;let t=n.map(String);return t.reduce((e,t)=>e+t.length,e.length)>1e5?Z:{ok:!0,value:e.concat(...t)}}default:return Z}}function pv(e,t,n){let[r,i]=n;switch(t){case`join`:{if(r!==void 0&&typeof r!=`string`||!e.every(e=>typeof e!=`object`||!e))return Z;let t=e.map(e=>e==null?``:String(e)),n=r??`,`;return t.reduce((e,t)=>e+t.length,0)+n.length*Math.max(t.length-1,0)>1e5?Z:{ok:!0,value:t.join(n)}}case`includes`:case`indexOf`:return typeof r==`object`&&r||!dv(i)?Z:{ok:!0,value:e[t](r,i)};case`slice`:return!dv(r)||!dv(i)?Z:{ok:!0,value:e.slice(r,i)};case`at`:return dv(r)?{ok:!0,value:e.at(r??0)}:Z;default:return Z}}function mv(e,t){let n=e.callee;if(W_(n)!==`MemberExpression`||!R(n)||n.optional===!0)return Z;let r=n.computed===!0?R(n.property)&&typeof n.property.value==`string`?n.property.value:void 0:$_(n.property);if(r===void 0||gv(n.object,t))return Z;let i=uv(n.object,t);if(!i.ok)return Z;let a=Array.isArray(e.arguments)?e.arguments:[],o=[];for(let e of a){if(W_(e)===`SpreadElement`)return Z;let n=uv(e,t);if(!n.ok)return Z;o.push(n.value)}try{if(typeof i.value==`string`)return fv(i.value,r,o);if(Array.isArray(i.value))return pv(i.value,r,o)}catch{return Z}return Z}const hv=/* @__PURE__ */ new Set([`window`,`document`,`navigator`,`location`,`history`,`localStorage`,`sessionStorage`,`matchMedia`,`requestAnimationFrame`]);function gv(e,t){if(t.markdownChildren!==!0||!R(e))return!1;if(e.type===`Identifier`)return e.name===t.childrenName&&!(t.failedProps?.has(`children`)??!1);if(e.type!==`MemberExpression`)return!1;let n=$_(e.object);return _v(e)===`children`&&n!==void 0&&(n===t.propsObjectName||n===t.restName)}function _v(e){if(e.computed!==!0)return $_(e.property);let t=e.property;return R(t)&&t.type===`Literal`&&typeof t.value==`string`?t.value:void 0}function vv(e,t){if(gv(e,t))return Z;if(W_(e)===`Identifier`&&R(e)&&typeof e.name==`string`&&hv.has(e.name)&&!t.scope.has(e.name)&&t.declaredNames!==void 0&&!t.declaredNames.has(e.name))return{ok:!0,value:`undefined`};let n=uv(e,t);if(!n.ok)return Z;let r=n.value;return{ok:!0,value:r===null?`object`:typeof r}}function yv(e){let t=W_(e);return t===`ArrowFunctionExpression`||t===`FunctionExpression`||t===`FunctionDeclaration`}function bv(e){if(e.type!==`mdxjsEsm`)return[];let t=e.data?.estree;return!R(t)||!Array.isArray(t.body)?[]:t.body}function xv(e,t){if(Array.isArray(e))for(let n of e)xv(n,t);else if(R(e)){R(e.data)&&e.data.estree!==void 0&&t.push(e.data.estree);for(let[n,r]of Object.entries(e))n!==`data`&&n!==`position`&&xv(r,t)}}function Sv(e){for(let[t,n]of e)typeof n==`object`&&n&&e.delete(t)}function Cv(e,t){let{reassigned:n,mutated:r}=H_(e,!0);return n.size>0||r.size>0||t&&V_(e)}function wv(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=[],a=e.children.flatMap(bv),o=(e,n)=>{let r=Array.isArray(n.params)?n.params:[];t.set(e,{params:r,body:n.body})},s=(e,t)=>{if(W_(e)!==`VariableDeclarator`||!R(e))return;Cv(e,f)&&Sv(n);let i=e.init,a=$_(e.id);if(a!==void 0&&yv(i)&&R(i)){o(a,i);return}if(t!==`const`)return;let s=uv(i,{scope:r,declaredNames:l});if(s.ok){let t=new Map(r);lv(e.id,s.value,{scope:t});let n=/* @__PURE__ */ new Set;o_(e.id,n);for(let e of n){if(!t.has(e))continue;let n=t.get(e),i=n===void 0?void 0:n;ev(i)&&r.set(e,i)}}let c=uv(i,{scope:n,declaredNames:l});c.ok&&lv(e.id,c.value,{scope:n})},c=[];xv(e,c);let l=U_(c),{reassigned:u,mutated:d}=H_(c),f=u.size>0||d.size>0;for(let e of a)if(R(e)){if(!(e.type===`VariableDeclaration`||e.type===`ExportNamedDeclaration`&&R(e.declaration)&&e.declaration.type===`VariableDeclaration`)&&Cv(e,f)&&Sv(n),e.type===`VariableDeclaration`){let t=Array.isArray(e.declarations)?e.declarations:[];for(let n of t)s(n,e.kind)}else if(e.type===`FunctionDeclaration`){let t=e.id;W_(t)===`Identifier`&&R(t)&&typeof t.name==`string`&&o(t.name,e)}else{if(e.type===`ExportNamedDeclaration`){let t=e.declaration;if(W_(t)===`VariableDeclaration`&&R(t)){let e=Array.isArray(t.declarations)?t.declarations:[];for(let n of e)s(n,t.kind)}if(W_(t)===`FunctionDeclaration`&&R(t)){let e=t.id;W_(e)===`Identifier`&&R(e)&&typeof e.name==`string`&&o(e.name,t)}if(e.source!=null)continue;let n=Array.isArray(e.specifiers)?e.specifiers:[];for(let e of n){if(W_(e)!==`ExportSpecifier`||!R(e))continue;let t=e.local,n=e.exported;R(t)&&typeof t.name==`string`&&R(n)&&typeof n.name==`string`&&i.push([t.name,n.name])}}if(e.type===`ExportDefaultDeclaration`){let t=e.declaration;if(yv(t)&&R(t)){let e=t.id;W_(e)===`Identifier`&&R(e)&&typeof e.name==`string`&&o(e.name,t)}}}}for(let e of u)n.delete(e),r.delete(e),t.delete(e);d.size>0&&Sv(n);let p=!0;for(;p;){p=!1;for(let[e,a]of i){let i=t.get(e);if(i&&!t.has(a)&&(t.set(a,i),p=!0),n.has(e)&&!n.has(a)){let t=n.get(e);n.set(a,t===void 0?void 0:t),p=!0}if(r.has(e)&&!r.has(a)){let t=r.get(e);r.set(a,t===void 0?void 0:t),p=!0}}}return{defs:t,moduleScope:n,literalScope:r,declaredNames:l}}`${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`;function Tv(e){if(!R(e)||!Array.isArray(e.body))return;let[t]=e.body;if(W_(t)===`ExpressionStatement`&&R(t))return t.expression}const Ev=e=>[...new Set(e.map(e=>e.trim()))],Dv=e=>e.every(e=>typeof e==`string`),Ov=e=>Array.isArray(e)?e:[e];function kv(e){if(Array.isArray(e)){if(e.length===0||!ua(e)||!Dv(e))return;let t=Ev(e);return ua(t)?t:void 0}let t=[e];if(!ua(t)||Dv(t))return;let[n]=t.map(({includes:e,excludes:t})=>Object.assign(Object.assign({},e&&{includes:Ev(e)}),t&&{excludes:Ev(t)}));return n&&ua([n])?n:void 0}function Av(e){if(!R(e)||Object.keys(e).length!==1)return;let t=kv(e.groups);return t&&{groups:t}}function jv(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`Visibility`}const Mv=[`humans`,`agents`,`signed-in`,`signed-out`];function Nv(e){return Mv.some(t=>t===e)}function Pv(e){let t=(e.data?.estree)?.body[0];return t?.type===`ExpressionStatement`?t.expression:void 0}function Fv(e){switch(e?.type){case`Literal`:return typeof e.value==`string`?e.value:void 0;case`TemplateLiteral`:{let t=e.quasis[0]?.value.cooked??void 0;for(let[n,r]of e.expressions.entries()){let i=Fv(r),a=e.quasis[n+1]?.value.cooked;if(t===void 0||i===void 0||a==null)return;t+=i+a}return t}case`BinaryExpression`:{if(e.operator!==`+`)return;let t=Fv(e.left),n=Fv(e.right);return t===void 0||n===void 0?void 0:t+n}default:return}}function Iv(e){if(!(e.type!==`Property`||e.computed))return e.key.type===`Identifier`?e.key.name:e.key.type===`Literal`&&typeof e.key.value==`string`?e.key.value:void 0}function Lv(e){let t=e.elements.map(e=>Fv(e));return t.every(e=>e!==void 0)?t:void 0}function Rv(e){let t={};for(let n of e.properties){let e=Iv(n);if(n.type!==`Property`||e!==`includes`&&e!==`excludes`)return;let r=n.value.type===`ArrayExpression`?Lv(n.value):void 0;if(!r)return;t[e]=r}return t}function zv(e){let t=Pv(e);if(t?.type!==`ObjectExpression`||t.properties.length!==1)return;let[n]=t.properties;if(n?.type===`Property`&&Iv(n)===`groups`)return n.value.type===`ObjectExpression`?kv(Rv(n.value)):n.value.type===`ArrayExpression`?kv(Lv(n.value)):void 0}function Bv(e){if(e.type!==`mdxJsxExpressionAttribute`)return!1;let t=Pv(e),n=t?.type===`ObjectExpression`&&t.properties.length===1?t.properties[0]:void 0;return n?.type!==`SpreadElement`||n.argument.type!==`ObjectExpression`||n.argument.properties.some(e=>{if(e.type!==`Property`||e.computed)return!0;let t=e.key.type===`Identifier`?e.key.name:void 0,n=e.key.type===`Literal`?e.key.value:void 0;return(t??n)===`for`})}function Vv(e,t=/* @__PURE__ */ new Map,n){let r,i=!1,a=e.attributes.findLastIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`for`);if(e.attributes.slice(a+1).some(Bv))return{kind:`dynamic`};for(let o of a===-1?[]:e.attributes.slice(a,a+1))if(o.type===`mdxJsxAttribute`&&o.name===`for`){if(typeof o.value==`string`){if(Nv(o.value))return{kind:`audience`,audience:o.value};r??=o.value}else if(o.value&&typeof o.value==`object`){if(`value`in o.value&&typeof o.value.value==`string`){let e=o.value.value.trim(),t=Fv(Pv(o.value));if(t!==void 0){if(Nv(t))return{kind:`audience`,audience:t};r??=t;continue}let n=e.match(/^(["'`])((?:\\.|(?!\1)[^\\])*)\1$/);if(n){let e=n[2]??``;if(!(n[1]==="`"&&e.includes("${"))){if(Nv(e))return{kind:`audience`,audience:e};r??=e;continue}}let i=zv(o.value);if(i)return{kind:`groups`,groups:i};if(Pv(o.value)?.type===`ObjectExpression`||e.startsWith(`{`)){r??=e;continue}}let e=Tv(`data`in o.value?o.value.data?.estree:void 0),a=uv(e,{scope:t});if(a.ok){let t=a.value;if(Nv(t)){let r={kind:`audience`,audience:t};if(n===void 0||Uv(r))return r;let a=uv(e,{scope:n});if(a.ok&&a.value===t)return r;i=!0;continue}let o=Av(t);if(o)return{kind:`groups`,groups:o.groups};if(typeof t==`string`){r??=t;continue}}i=!0}}return r===void 0?i?{kind:`dynamic`}:{kind:`missing`}:{kind:`invalid`,raw:r}}function Hv(e){switch(e.kind){case`audience`:return e.audience===`agents`;case`groups`:return!1;case`invalid`:case`missing`:return!0;case`dynamic`:return!1}}function Uv(e){switch(e.kind){case`audience`:return e.audience===`humans`||e.audience===`signed-in`;case`groups`:case`invalid`:case`dynamic`:case`missing`:return!0}}function Wv(e){if(e.kind===`groups`)return{groups:e.groups};if(e.kind===`audience`&&(e.audience===`signed-in`||e.audience===`signed-out`))return e.audience}const Gv=(e,t)=>({type:`mdxJsxAttribute`,name:e,value:t});function Kv(e,t){let n=e.data,r=n&&`mintlifyTitleMarkdown`in n?n.mintlifyTitleMarkdown:void 0;return r&&typeof r==`object`&&`text`in r&&typeof r.text==`string`?r.text:t}const qv=[],Jv=(e,t=1,n=qv)=>{if(`name`in e&&e.name===`Update`)return e.attributes.find(e=>`name`in e&&e.name===`label`&&typeof e.value==`string`)?.value??``;if(jv(e)){let t=Vv(e);if(!(t.kind===`dynamic`||t.kind===`audience`&&t.audience===`humans`))return``}let r=n[t-1],i=e.type===`text`,a=e.type===`inlineCode`,o=r?.type!==`mdxJsxFlowElement`,s=r&&`value`in r&&typeof r.value==`string`&&!r.value.startsWith(`<small`);if(a||i&&(o||s))return e.value;if(`children`in e&&Array.isArray(e.children)){let t=``;return e.children.forEach((e,n,r)=>{t+=Jv(e,n,r)}),t}return``},Yv=[`animate`,`animateMotion`,`animateTransform`,`mpath`,`set`],Xv=e=>e.type===`mdxjsEsm`;function Zv(e){return e.data?.estree!=null}const Qv=e=>e.type===`ImportDeclaration`,$v=e=>[`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`].includes(e),ey=e=>e.type===`mdxJsxFlowElement`,ty=e=>e instanceof Object&&`type`in e&&(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`),ny=e=>ey(e)&&e.name==null,ry=(e,t)=>`${e}_${t}`,iy=[`ApiPlayground`,`Accordion`,`AccordionGroup`,`Badge`,`Callout`,`CodeGroup`,`CodeBlock`,`Color`,`Color.Row`,`Color.Item`,`CustomCode`,`CustomComponent`,`DynamicCustomComponent`,`Danger`,`Tile`,`Tree`,`Tree.Folder`,`Tree.File`,`Table`,`Table.Header`,`Table.Body`,`Table.Row`,`Table.HeaderCell`,`Table.RowHeader`,`Table.Cell`,`FileTree`,`SnippetGroup`,`Panel`,`RequestExample`,`ResponseExample`,`Param`,`ParamField`,`Prompt`,`Quote`,`Card`,`CardGroup`,`Columns`,`Column`,`Expandable`,`Frame`,`GitHub`,`GitHub.Repo`,`Github`,`Github.Repo`,`Heading`,`Info`,`Icon`,`MDX`,`Link`,`MDXContentController`,`ResponseField`,`Warning`,`Note`,`Tip`,`Check`,`Tabs`,`Tab`,`Tooltip`,`Latex`,`Step`,`Steps`,`Update`,`a`,`b`,`br`,`button`,`clipPath`,`col`,`colgroup`,`defs`,`div`,`form`,`g`,`h1`,`h2`,`h3`,`h4`,`head`,`hr`,`iframe`,`img`,`input`,`label`,`li`,`link`,`ol`,`p`,`path`,`picture`,`rect`,`script`,`section`,`source`,`span`,`sub`,`sup`,`u`,`svg`,...Yv,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`track`,`ul`,`video`,`code`,`kbd`,`pre`,`ZoomImage`,`OptimizedVideo`,`Mermaid`,`Variation`,`Visibility`,`View`,`zapier-zap-templates`],ay=(e,t)=>{let n=e.position?.start.offset,r=e.position?.end.offset;return n===void 0||r===void 0?!1:!t.startsWith(`$$`,n)&&/^\d/.test(e.value)&&/\d/.test(t[r]??``)},oy=(e,t)=>{Da(e,`inlineMath`,(e,n,r)=>{if(r&&n!==void 0&&ay(e,t))return r.children.splice(n,1,{type:`text`,value:`$${e.value}$`}),[wa,n]})};Object.freeze({status:`aborted`});/* @__NO_SIDE_EFFECTS__ */
278
278
  function Q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:/* @__PURE__ */ new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var sy=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},cy=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const ly={};function uy(e){return e&&Object.assign(ly,e),ly}function dy(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function fy(e,t){return typeof t==`bigint`?t.toString():t}function py(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function my(e){return e==null}function hy(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function gy(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const _y=Symbol(`evaluating`);function vy(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==_y)return r===void 0&&(r=_y,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yy(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function by(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function xy(e){return JSON.stringify(e)}function Sy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Cy=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function wy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Ty=py(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ey(e){if(wy(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return wy(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Dy(e){return Ey(e)?{...e}:Array.isArray(e)?[...e]:e}const Oy=/* @__PURE__ */ new Set([`string`,`number`,`symbol`]);function ky(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ay(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function $(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function jy(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const My={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ny(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ay(e,by(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return yy(this,`shape`,e),e},checks:[]}))}function Py(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ay(e,by(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return yy(this,`shape`,r),r},checks:[]}))}function Fy(e,t){if(!Ey(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ay(e,by(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return yy(this,`shape`,n),n}}))}function Iy(e,t){if(!Ey(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ay(e,by(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return yy(this,`shape`,n),n}}))}function Ly(e,t){return Ay(e,by(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return yy(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Ry(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Ay(t,by(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return yy(this,`shape`,i),i},checks:[]}))}function zy(e,t,n){return Ay(t,by(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return yy(this,`shape`,i),i}}))}function By(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Vy(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Hy(e){return typeof e==`string`?e:e?.message}function Uy(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Hy(e.inst?._zod.def?.error?.(e))??Hy(t?.error?.(e))??Hy(n.customError?.(e))??Hy(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Wy(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Gy(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const Ky=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fy,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},qy=/* @__PURE__ */ Q(`$ZodError`,Ky),Jy=/* @__PURE__ */ Q(`$ZodError`,Ky,{Parent:Error});function Yy(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Xy(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}const Zy=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new sy;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Uy(e,a,uy())));throw Cy(t,i?.callee),t}return o.value},Qy=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Uy(e,a,uy())));throw Cy(t,i?.callee),t}return o.value},$y=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new sy;return a.issues.length?{success:!1,error:new(e??qy)(a.issues.map(e=>Uy(e,i,uy())))}:{success:!0,data:a.value}},eb=/* @__PURE__*/ $y(Jy),tb=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Uy(e,i,uy())))}:{success:!0,data:a.value}},nb=/* @__PURE__*/ tb(Jy),rb=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Zy(e)(t,n,i)},ib=e=>(t,n,r)=>Zy(e)(t,n,r),ab=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Qy(e)(t,n,i)},ob=e=>async(t,n,r)=>Qy(e)(t,n,r),sb=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return $y(e)(t,n,i)},cb=e=>(t,n,r)=>$y(e)(t,n,r),lb=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return tb(e)(t,n,i)},ub=e=>async(t,n,r)=>tb(e)(t,n,r),db=/^[cC][^\s-]{8,}$/,fb=/^[0-9a-z]+$/,pb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,mb=/^[0-9a-vA-V]{20}$/,hb=/^[A-Za-z0-9]{27}$/,gb=/^[a-zA-Z0-9_-]{21}$/,_b=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vb=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,yb=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,bb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function xb(){return/* @__PURE__ */ RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Sb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Cb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,wb=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Tb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Eb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Db=/^[A-Za-z0-9_-]*$/,Ob=/^\+[1-9]\d{6,14}$/,kb=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Ab=/*@__PURE__*/ RegExp(`^${kb}$`);function jb(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Mb(e){return RegExp(`^${jb(e)}$`)}function Nb(e){let t=jb({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${kb}T(?:${r})$`)}const Pb=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Fb=/^-?\d+$/,Ib=/^-?\d+(?:\.\d+)?$/,Lb=/^(?:true|false)$/i,Rb=/^[^A-Z]*$/,zb=/^[^a-z]*$/,Bb=/*@__PURE__*/ Q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Vb={number:`number`,bigint:`bigint`,object:`date`},Hb=/*@__PURE__*/ Q(`$ZodCheckLessThan`,(e,t)=>{Bb.init(e,t);let n=Vb[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ub=/*@__PURE__*/ Q(`$ZodCheckGreaterThan`,(e,t)=>{Bb.init(e,t);let n=Vb[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Wb=/*@__PURE__*/ Q(`$ZodCheckMultipleOf`,(e,t)=>{Bb.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):gy(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Gb=/*@__PURE__*/ Q(`$ZodCheckNumberFormat`,(e,t)=>{Bb.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=My[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Fb)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Kb=/*@__PURE__*/ Q(`$ZodCheckMaxLength`,(e,t)=>{var n;Bb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!my(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Wy(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qb=/*@__PURE__*/ Q(`$ZodCheckMinLength`,(e,t)=>{var n;Bb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!my(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Wy(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Jb=/*@__PURE__*/ Q(`$ZodCheckLengthEquals`,(e,t)=>{var n;Bb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!my(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Wy(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Yb=/*@__PURE__*/ Q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Bb.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=/* @__PURE__ */ new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Xb=/*@__PURE__*/ Q(`$ZodCheckRegex`,(e,t)=>{Yb.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Zb=/*@__PURE__*/ Q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Rb,Yb.init(e,t)}),Qb=/*@__PURE__*/ Q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=zb,Yb.init(e,t)}),$b=/*@__PURE__*/ Q(`$ZodCheckIncludes`,(e,t)=>{Bb.init(e,t);let n=ky(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=/* @__PURE__ */ new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ex=/*@__PURE__*/ Q(`$ZodCheckStartsWith`,(e,t)=>{Bb.init(e,t);let n=RegExp(`^${ky(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=/* @__PURE__ */ new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),tx=/*@__PURE__*/ Q(`$ZodCheckEndsWith`,(e,t)=>{Bb.init(e,t);let n=RegExp(`.*${ky(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=/* @__PURE__ */ new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),nx=/*@__PURE__*/ Q(`$ZodCheckOverwrite`,(e,t)=>{Bb.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var rx=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
279
279
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
280
280
  `))}};const ix={major:4,minor:3,patch:6},ax=/*@__PURE__*/ Q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ix;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=By(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new sy;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=By(e,t))});else{if(e.issues.length===t)continue;r||=By(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(By(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new sy;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new sy;return o.then(e=>t(e,r,a))}return t(o,r,a)}}vy(e,`~standard`,()=>({validate:t=>{try{let n=eb(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return nb(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),ox=/*@__PURE__*/ Q(`$ZodString`,(e,t)=>{ax.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Pb(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),sx=/*@__PURE__*/ Q(`$ZodStringFormat`,(e,t)=>{Yb.init(e,t),ox.init(e,t)}),cx=/*@__PURE__*/ Q(`$ZodGUID`,(e,t)=>{t.pattern??=vb,sx.init(e,t)}),lx=/*@__PURE__*/ Q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=yb(e)}else t.pattern??=yb();sx.init(e,t)}),ux=/*@__PURE__*/ Q(`$ZodEmail`,(e,t)=>{t.pattern??=bb,sx.init(e,t)}),dx=/*@__PURE__*/ Q(`$ZodURL`,(e,t)=>{sx.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),fx=/*@__PURE__*/ Q(`$ZodEmoji`,(e,t)=>{t.pattern??=xb(),sx.init(e,t)}),px=/*@__PURE__*/ Q(`$ZodNanoID`,(e,t)=>{t.pattern??=gb,sx.init(e,t)}),mx=/*@__PURE__*/ Q(`$ZodCUID`,(e,t)=>{t.pattern??=db,sx.init(e,t)}),hx=/*@__PURE__*/ Q(`$ZodCUID2`,(e,t)=>{t.pattern??=fb,sx.init(e,t)}),gx=/*@__PURE__*/ Q(`$ZodULID`,(e,t)=>{t.pattern??=pb,sx.init(e,t)}),_x=/*@__PURE__*/ Q(`$ZodXID`,(e,t)=>{t.pattern??=mb,sx.init(e,t)}),vx=/*@__PURE__*/ Q(`$ZodKSUID`,(e,t)=>{t.pattern??=hb,sx.init(e,t)}),yx=/*@__PURE__*/ Q(`$ZodISODateTime`,(e,t)=>{t.pattern??=Nb(t),sx.init(e,t)}),bx=/*@__PURE__*/ Q(`$ZodISODate`,(e,t)=>{t.pattern??=Ab,sx.init(e,t)}),xx=/*@__PURE__*/ Q(`$ZodISOTime`,(e,t)=>{t.pattern??=Mb(t),sx.init(e,t)}),Sx=/*@__PURE__*/ Q(`$ZodISODuration`,(e,t)=>{t.pattern??=_b,sx.init(e,t)}),Cx=/*@__PURE__*/ Q(`$ZodIPv4`,(e,t)=>{t.pattern??=Sb,sx.init(e,t),e._zod.bag.format=`ipv4`}),wx=/*@__PURE__*/ Q(`$ZodIPv6`,(e,t)=>{t.pattern??=Cb,sx.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Tx=/*@__PURE__*/ Q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=wb,sx.init(e,t)}),Ex=/*@__PURE__*/ Q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Tb,sx.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Dx(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ox=/*@__PURE__*/ Q(`$ZodBase64`,(e,t)=>{t.pattern??=Eb,sx.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Dx(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function kx(e){if(!Db.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Dx(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Ax=/*@__PURE__*/ Q(`$ZodBase64URL`,(e,t)=>{t.pattern??=Db,sx.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{kx(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),jx=/*@__PURE__*/ Q(`$ZodE164`,(e,t)=>{t.pattern??=Ob,sx.init(e,t)});function Mx(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Nx=/*@__PURE__*/ Q(`$ZodJWT`,(e,t)=>{sx.init(e,t),e._zod.check=n=>{Mx(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Px=/*@__PURE__*/ Q(`$ZodNumber`,(e,t)=>{ax.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ib,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Fx=/*@__PURE__*/ Q(`$ZodNumberFormat`,(e,t)=>{Gb.init(e,t),Px.init(e,t)}),Ix=/*@__PURE__*/ Q(`$ZodBoolean`,(e,t)=>{ax.init(e,t),e._zod.pattern=Lb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Lx=/*@__PURE__*/ Q(`$ZodUnknown`,(e,t)=>{ax.init(e,t),e._zod.parse=e=>e}),Rx=/*@__PURE__*/ Q(`$ZodNever`,(e,t)=>{ax.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function zx(e,t,n){e.issues.length&&t.issues.push(...Vy(n,e.issues)),t.value[n]=e.value}const Bx=/*@__PURE__*/ Q(`$ZodArray`,(e,t)=>{ax.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>zx(t,n,e))):zx(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Vx(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Vy(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Hx(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=jy(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ux(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Vx(e,n,i,t,u))):Vx(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Wx=/*@__PURE__*/ Q(`$ZodObject`,(e,t)=>{if(ax.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=py(()=>Hx(t));vy(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=/* @__PURE__ */ new Set);for(let e of r.values)n[t].add(e)}}return n});let r=wy,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Vx(n,t,e,s,r))):Vx(i,t,e,s,r)}return i?Ux(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Gx=/*@__PURE__*/ Q(`$ZodObjectJIT`,(e,t)=>{Wx.init(e,t);let n=e._zod.parse,r=py(()=>Hx(t)),i=e=>{let t=new rx([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=xy(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=xy(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
package/dist/start.js CHANGED
@@ -5,7 +5,7 @@ import { dirname as __mintDirname } from 'node:path';
5
5
  const require = __mintCreateRequire(import.meta.url);
6
6
  const __filename = __mintFileURLToPath(import.meta.url);
7
7
  const __dirname = __mintDirname(__filename);
8
- import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-CEAe2Uac.js";import{$ as o,$t as s,A as c,At as l,B as u,Bt as d,C as f,Ct as p,D as m,Dt as h,E as g,Et as _,F as v,Ft as y,G as b,Gt as x,H as S,Ht as C,I as w,It as T,J as E,Jt as D,K as O,Kt as k,L as A,Lt as ee,M as te,Mt as ne,N as re,Nt as ie,O as ae,Ot as oe,P as j,Pt as se,Q as ce,Qt as le,R as M,Rt as N,S as ue,St as de,Tt as fe,U as pe,Ut as me,V as he,Vt as ge,W as _e,Wt as ve,X as ye,Xt as be,Y as xe,Yt as Se,Z as Ce,Zt as P,_ as we,a as Te,an as Ee,at as De,b as Oe,bt as ke,c as Ae,ct as je,d as Me,dt as Ne,en as Pe,et as Fe,f as F,g as Ie,h as Le,ht as Re,in as ze,it as Be,j as Ve,jt as He,k as Ue,kt as We,l as Ge,m as Ke,nn as qe,nt as Je,o as Ye,ot as Xe,p as I,q as Ze,qt as Qe,rn as $e,rt as et,s as tt,st as nt,tn as rt,tt as it,u as at,vt as ot,w as st,wt as ct,x as lt,xt as ut,y as dt,yt as ft,z as pt,zt as mt}from"./schemas-MyPSBsum.js";import{createRequire as ht}from"node:module";import gt from"os";import*as _t from"path";import vt,{basename as yt,dirname as bt,extname as xt,isAbsolute as St,join as Ct,normalize as wt,parse as Tt,posix as Et,relative as Dt,resolve as Ot,sep as kt}from"path";import*as At from"url";import jt,{fileURLToPath as Mt}from"url";import Nt,{createHash as Pt,randomFillSync as Ft,randomUUID as It}from"crypto";import{Buffer as Lt}from"buffer";import Rt,{basename as zt,join as Bt,posix as Vt,win32 as Ht}from"node:path";import Ut,{cwd as Wt,env as Gt}from"node:process";import Kt,{fileURLToPath as qt,pathToFileURL as Jt}from"node:url";import Yt,{existsSync as Xt,promises as Zt,readFileSync as Qt,readdirSync as $t,realpathSync as en,statSync as tn,unlinkSync as nn,writeFile as rn,writeFileSync as an}from"fs";import on from"stream";import sn,{createServer as cn}from"http";import ln from"https";import un,*as dn from"zlib";import fn from"vm";import{format as pn,inspect as mn,promisify as hn,types as gn}from"util";import*as _n from"fs/promises";import vn,{readFile as yn,readdir as bn,realpath as xn}from"fs/promises";import Sn from"node:os";import Cn from"node:tty";import wn,{notStrictEqual as Tn,strictEqual as En}from"assert";import*as Dn from"node:fs";import On,{createReadStream as kn,existsSync as An,readFileSync as jn,readdirSync as Mn}from"node:fs";import Nn,{createHash as Pn,randomBytes as Fn,randomUUID as In}from"node:crypto";import{createRequire as Ln}from"module";import{lookup as Rn}from"node:dns/promises";import zn,{request as Bn}from"node:https";import Vn,{BlockList as Hn,isIP as Un}from"node:net";import Wn,{mkdir as Gn,mkdtemp as Kn,open as qn,readFile as Jn,writeFile as Yn}from"node:fs/promises";import Xn from"sharp";import Zn,{EventEmitter as Qn,errorMonitor as $n}from"events";import{execFile as er,spawn as tr,spawnSync as nr}from"child_process";import rr,{Duplex as ir,PassThrough as ar,Readable as or,Stream as sr}from"node:stream";import cr,{EventEmitter as lr}from"node:events";import{Buffer as ur}from"node:buffer";import dr,{ServerResponse as fr}from"node:http";import{format as pr,inspect as mr,promisify as hr,stripVTControlCharacters as gr}from"node:util";import{checkServerIdentity as _r}from"node:tls";import{ADDRCONFIG as vr,ALL as yr,V4MAPPED as br,lookup as xr,promises as L}from"node:dns";import{BlockList as Sr,isIP as Cr}from"net";import{pipeline as wr}from"node:stream/promises";import{StringDecoder as Tr}from"node:string_decoder";import Er from"node:assert";import Dr from"dns";import{AsyncLocalStorage as Or,AsyncResource as kr}from"node:async_hooks";import*as Ar from"node:readline";import jr,{createInterface as Mr}from"node:readline";import{execFile as Nr,spawn as Pr}from"node:child_process";import{sep as Fr}from"path/win32";import{setTimeout as Ir}from"node:timers/promises";
8
+ import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-CEAe2Uac.js";import{$ as o,$t as s,A as c,At as l,B as u,Bt as d,C as f,Ct as p,D as m,Dt as h,E as g,Et as _,F as v,Ft as y,G as b,Gt as x,H as S,Ht as C,I as w,It as T,J as E,Jt as D,K as O,Kt as k,L as A,Lt as ee,M as te,Mt as ne,N as re,Nt as ie,O as ae,Ot as oe,P as j,Pt as se,Q as ce,Qt as le,R as M,Rt as N,S as ue,St as de,Tt as fe,U as pe,Ut as me,V as he,Vt as ge,W as _e,Wt as ve,X as ye,Xt as be,Y as xe,Yt as Se,Z as Ce,Zt as P,_ as we,a as Te,an as Ee,at as De,b as Oe,bt as ke,c as Ae,ct as je,d as Me,dt as Ne,en as Pe,et as Fe,f as F,g as Ie,h as Le,ht as Re,in as ze,it as Be,j as Ve,jt as He,k as Ue,kt as We,l as Ge,m as Ke,nn as qe,nt as Je,o as Ye,ot as Xe,p as I,q as Ze,qt as Qe,rn as $e,rt as et,s as tt,st as nt,tn as rt,tt as it,u as at,vt as ot,w as st,wt as ct,x as lt,xt as ut,y as dt,yt as ft,z as pt,zt as mt}from"./schemas-BBCiuhV1.js";import{createRequire as ht}from"node:module";import gt from"os";import*as _t from"path";import vt,{basename as yt,dirname as bt,extname as xt,isAbsolute as St,join as Ct,normalize as wt,parse as Tt,posix as Et,relative as Dt,resolve as Ot,sep as kt}from"path";import*as At from"url";import jt,{fileURLToPath as Mt}from"url";import Nt,{createHash as Pt,randomFillSync as Ft,randomUUID as It}from"crypto";import{Buffer as Lt}from"buffer";import Rt,{basename as zt,join as Bt,posix as Vt,win32 as Ht}from"node:path";import Ut,{cwd as Wt,env as Gt}from"node:process";import Kt,{fileURLToPath as qt,pathToFileURL as Jt}from"node:url";import Yt,{existsSync as Xt,promises as Zt,readFileSync as Qt,readdirSync as $t,realpathSync as en,statSync as tn,unlinkSync as nn,writeFile as rn,writeFileSync as an}from"fs";import on from"stream";import sn,{createServer as cn}from"http";import ln from"https";import un,*as dn from"zlib";import fn from"vm";import{format as pn,inspect as mn,promisify as hn,types as gn}from"util";import*as _n from"fs/promises";import vn,{readFile as yn,readdir as bn,realpath as xn}from"fs/promises";import Sn from"node:os";import Cn from"node:tty";import wn,{notStrictEqual as Tn,strictEqual as En}from"assert";import*as Dn from"node:fs";import On,{createReadStream as kn,existsSync as An,readFileSync as jn,readdirSync as Mn}from"node:fs";import Nn,{createHash as Pn,randomBytes as Fn,randomUUID as In}from"node:crypto";import{createRequire as Ln}from"module";import{lookup as Rn}from"node:dns/promises";import zn,{request as Bn}from"node:https";import Vn,{BlockList as Hn,isIP as Un}from"node:net";import Wn,{mkdir as Gn,mkdtemp as Kn,open as qn,readFile as Jn,writeFile as Yn}from"node:fs/promises";import Xn from"sharp";import Zn,{EventEmitter as Qn,errorMonitor as $n}from"events";import{execFile as er,spawn as tr,spawnSync as nr}from"child_process";import rr,{Duplex as ir,PassThrough as ar,Readable as or,Stream as sr}from"node:stream";import cr,{EventEmitter as lr}from"node:events";import{Buffer as ur}from"node:buffer";import dr,{ServerResponse as fr}from"node:http";import{format as pr,inspect as mr,promisify as hr,stripVTControlCharacters as gr}from"node:util";import{checkServerIdentity as _r}from"node:tls";import{ADDRCONFIG as vr,ALL as yr,V4MAPPED as br,lookup as xr,promises as L}from"node:dns";import{BlockList as Sr,isIP as Cr}from"net";import{pipeline as wr}from"node:stream/promises";import{StringDecoder as Tr}from"node:string_decoder";import Er from"node:assert";import Dr from"dns";import{AsyncLocalStorage as Or,AsyncResource as kr}from"node:async_hooks";import*as Ar from"node:readline";import jr,{createInterface as Mr}from"node:readline";import{execFile as Nr,spawn as Pr}from"node:child_process";import{sep as Fr}from"path/win32";import{setTimeout as Ir}from"node:timers/promises";
9
9
  /**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.js
@@ -580,7 +580,7 @@ https://www.w3ctech.com/topic/2226`));let i=t(...r);return i.postcssPlugin=e,i.p
580
580
  (e,t)=>t&&(`json`in t||`lossy`in t)?tMe(aMe(e,t)):structuredClone(e):(e,t)=>tMe(aMe(e,t));const CO=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);var sMe=/* @__PURE__ */ a((e=>{function t(){var e={};return e[`align-content`]=!1,e[`align-items`]=!1,e[`align-self`]=!1,e[`alignment-adjust`]=!1,e[`alignment-baseline`]=!1,e.all=!1,e[`anchor-point`]=!1,e.animation=!1,e[`animation-delay`]=!1,e[`animation-direction`]=!1,e[`animation-duration`]=!1,e[`animation-fill-mode`]=!1,e[`animation-iteration-count`]=!1,e[`animation-name`]=!1,e[`animation-play-state`]=!1,e[`animation-timing-function`]=!1,e.azimuth=!1,e[`backface-visibility`]=!1,e.background=!0,e[`background-attachment`]=!0,e[`background-clip`]=!0,e[`background-color`]=!0,e[`background-image`]=!0,e[`background-origin`]=!0,e[`background-position`]=!0,e[`background-repeat`]=!0,e[`background-size`]=!0,e[`baseline-shift`]=!1,e.binding=!1,e.bleed=!1,e[`bookmark-label`]=!1,e[`bookmark-level`]=!1,e[`bookmark-state`]=!1,e.border=!0,e[`border-bottom`]=!0,e[`border-bottom-color`]=!0,e[`border-bottom-left-radius`]=!0,e[`border-bottom-right-radius`]=!0,e[`border-bottom-style`]=!0,e[`border-bottom-width`]=!0,e[`border-collapse`]=!0,e[`border-color`]=!0,e[`border-image`]=!0,e[`border-image-outset`]=!0,e[`border-image-repeat`]=!0,e[`border-image-slice`]=!0,e[`border-image-source`]=!0,e[`border-image-width`]=!0,e[`border-left`]=!0,e[`border-left-color`]=!0,e[`border-left-style`]=!0,e[`border-left-width`]=!0,e[`border-radius`]=!0,e[`border-right`]=!0,e[`border-right-color`]=!0,e[`border-right-style`]=!0,e[`border-right-width`]=!0,e[`border-spacing`]=!0,e[`border-style`]=!0,e[`border-top`]=!0,e[`border-top-color`]=!0,e[`border-top-left-radius`]=!0,e[`border-top-right-radius`]=!0,e[`border-top-style`]=!0,e[`border-top-width`]=!0,e[`border-width`]=!0,e.bottom=!1,e[`box-decoration-break`]=!0,e[`box-shadow`]=!0,e[`box-sizing`]=!0,e[`box-snap`]=!0,e[`box-suppress`]=!0,e[`break-after`]=!0,e[`break-before`]=!0,e[`break-inside`]=!0,e[`caption-side`]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e[`clip-path`]=!1,e[`clip-rule`]=!1,e.color=!0,e[`color-interpolation-filters`]=!0,e[`column-count`]=!1,e[`column-fill`]=!1,e[`column-gap`]=!1,e[`column-rule`]=!1,e[`column-rule-color`]=!1,e[`column-rule-style`]=!1,e[`column-rule-width`]=!1,e[`column-span`]=!1,e[`column-width`]=!1,e.columns=!1,e.contain=!1,e.content=!1,e[`counter-increment`]=!1,e[`counter-reset`]=!1,e[`counter-set`]=!1,e.crop=!1,e.cue=!1,e[`cue-after`]=!1,e[`cue-before`]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e[`display-inside`]=!0,e[`display-list`]=!0,e[`display-outside`]=!0,e[`dominant-baseline`]=!1,e.elevation=!1,e[`empty-cells`]=!1,e.filter=!1,e.flex=!1,e[`flex-basis`]=!1,e[`flex-direction`]=!1,e[`flex-flow`]=!1,e[`flex-grow`]=!1,e[`flex-shrink`]=!1,e[`flex-wrap`]=!1,e.float=!1,e[`float-offset`]=!1,e[`flood-color`]=!1,e[`flood-opacity`]=!1,e[`flow-from`]=!1,e[`flow-into`]=!1,e.font=!0,e[`font-family`]=!0,e[`font-feature-settings`]=!0,e[`font-kerning`]=!0,e[`font-language-override`]=!0,e[`font-size`]=!0,e[`font-size-adjust`]=!0,e[`font-stretch`]=!0,e[`font-style`]=!0,e[`font-synthesis`]=!0,e[`font-variant`]=!0,e[`font-variant-alternates`]=!0,e[`font-variant-caps`]=!0,e[`font-variant-east-asian`]=!0,e[`font-variant-ligatures`]=!0,e[`font-variant-numeric`]=!0,e[`font-variant-position`]=!0,e[`font-weight`]=!0,e.grid=!1,e[`grid-area`]=!1,e[`grid-auto-columns`]=!1,e[`grid-auto-flow`]=!1,e[`grid-auto-rows`]=!1,e[`grid-column`]=!1,e[`grid-column-end`]=!1,e[`grid-column-start`]=!1,e[`grid-row`]=!1,e[`grid-row-end`]=!1,e[`grid-row-start`]=!1,e[`grid-template`]=!1,e[`grid-template-areas`]=!1,e[`grid-template-columns`]=!1,e[`grid-template-rows`]=!1,e[`hanging-punctuation`]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e[`image-orientation`]=!1,e[`image-resolution`]=!1,e[`ime-mode`]=!1,e[`initial-letters`]=!1,e[`inline-box-align`]=!1,e[`justify-content`]=!1,e[`justify-items`]=!1,e[`justify-self`]=!1,e.left=!1,e[`letter-spacing`]=!0,e[`lighting-color`]=!0,e[`line-box-contain`]=!1,e[`line-break`]=!1,e[`line-grid`]=!1,e[`line-height`]=!1,e[`line-snap`]=!1,e[`line-stacking`]=!1,e[`line-stacking-ruby`]=!1,e[`line-stacking-shift`]=!1,e[`line-stacking-strategy`]=!1,e[`list-style`]=!0,e[`list-style-image`]=!0,e[`list-style-position`]=!0,e[`list-style-type`]=!0,e.margin=!0,e[`margin-bottom`]=!0,e[`margin-left`]=!0,e[`margin-right`]=!0,e[`margin-top`]=!0,e[`marker-offset`]=!1,e[`marker-side`]=!1,e.marks=!1,e.mask=!1,e[`mask-box`]=!1,e[`mask-box-outset`]=!1,e[`mask-box-repeat`]=!1,e[`mask-box-slice`]=!1,e[`mask-box-source`]=!1,e[`mask-box-width`]=!1,e[`mask-clip`]=!1,e[`mask-image`]=!1,e[`mask-origin`]=!1,e[`mask-position`]=!1,e[`mask-repeat`]=!1,e[`mask-size`]=!1,e[`mask-source-type`]=!1,e[`mask-type`]=!1,e[`max-height`]=!0,e[`max-lines`]=!1,e[`max-width`]=!0,e[`min-height`]=!0,e[`min-width`]=!0,e[`move-to`]=!1,e[`nav-down`]=!1,e[`nav-index`]=!1,e[`nav-left`]=!1,e[`nav-right`]=!1,e[`nav-up`]=!1,e[`object-fit`]=!1,e[`object-position`]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e[`outline-color`]=!1,e[`outline-offset`]=!1,e[`outline-style`]=!1,e[`outline-width`]=!1,e.overflow=!1,e[`overflow-wrap`]=!1,e[`overflow-x`]=!1,e[`overflow-y`]=!1,e.padding=!0,e[`padding-bottom`]=!0,e[`padding-left`]=!0,e[`padding-right`]=!0,e[`padding-top`]=!0,e.page=!1,e[`page-break-after`]=!1,e[`page-break-before`]=!1,e[`page-break-inside`]=!1,e[`page-policy`]=!1,e.pause=!1,e[`pause-after`]=!1,e[`pause-before`]=!1,e.perspective=!1,e[`perspective-origin`]=!1,e.pitch=!1,e[`pitch-range`]=!1,e[`play-during`]=!1,e.position=!1,e[`presentation-level`]=!1,e.quotes=!1,e[`region-fragment`]=!1,e.resize=!1,e.rest=!1,e[`rest-after`]=!1,e[`rest-before`]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e[`rotation-point`]=!1,e[`ruby-align`]=!1,e[`ruby-merge`]=!1,e[`ruby-position`]=!1,e[`shape-image-threshold`]=!1,e[`shape-outside`]=!1,e[`shape-margin`]=!1,e.size=!1,e.speak=!1,e[`speak-as`]=!1,e[`speak-header`]=!1,e[`speak-numeral`]=!1,e[`speak-punctuation`]=!1,e[`speech-rate`]=!1,e.stress=!1,e[`string-set`]=!1,e[`tab-size`]=!1,e[`table-layout`]=!1,e[`text-align`]=!0,e[`text-align-last`]=!0,e[`text-combine-upright`]=!0,e[`text-decoration`]=!0,e[`text-decoration-color`]=!0,e[`text-decoration-line`]=!0,e[`text-decoration-skip`]=!0,e[`text-decoration-style`]=!0,e[`text-emphasis`]=!0,e[`text-emphasis-color`]=!0,e[`text-emphasis-position`]=!0,e[`text-emphasis-style`]=!0,e[`text-height`]=!0,e[`text-indent`]=!0,e[`text-justify`]=!0,e[`text-orientation`]=!0,e[`text-overflow`]=!0,e[`text-shadow`]=!0,e[`text-space-collapse`]=!0,e[`text-transform`]=!0,e[`text-underline-position`]=!0,e[`text-wrap`]=!0,e.top=!1,e.transform=!1,e[`transform-origin`]=!1,e[`transform-style`]=!1,e.transition=!1,e[`transition-delay`]=!1,e[`transition-duration`]=!1,e[`transition-property`]=!1,e[`transition-timing-function`]=!1,e[`unicode-bidi`]=!1,e[`vertical-align`]=!1,e.visibility=!1,e[`voice-balance`]=!1,e[`voice-duration`]=!1,e[`voice-family`]=!1,e[`voice-pitch`]=!1,e[`voice-range`]=!1,e[`voice-rate`]=!1,e[`voice-stress`]=!1,e[`voice-volume`]=!1,e.volume=!1,e[`white-space`]=!1,e.widows=!1,e.width=!0,e[`will-change`]=!1,e[`word-break`]=!0,e[`word-spacing`]=!0,e[`word-wrap`]=!0,e[`wrap-flow`]=!1,e[`wrap-through`]=!1,e[`writing-mode`]=!1,e[`z-index`]=!1,e}function n(e,t,n){}function r(e,t,n){}var i=/javascript\s*\:/gim;function a(e,t){return i.test(t)?``:t}e.whiteList=t(),e.getDefaultWhiteList=t,e.onAttr=n,e.onIgnoreAttr=r,e.safeAttrValue=a})),cMe=/* @__PURE__ */ a(((e,t)=>{t.exports={indexOf:function(e,t){var n,r;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var r,i;if(Array.prototype.forEach)return e.forEach(t,n);for(r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,``)},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,``)}}})),lMe=/* @__PURE__ */ a(((e,t)=>{var n=cMe();function r(e,t){e=n.trimRight(e),e[e.length-1]!==`;`&&(e+=`;`);var r=e.length,i=!1,a=0,o=0,s=``;function c(){if(!i){var r=n.trim(e.slice(a,o)),c=r.indexOf(`:`);if(c!==-1){var l=n.trim(r.slice(0,c)),u=n.trim(r.slice(c+1));if(l){var d=t(a,s.length,l,u,r);d&&(s+=d+`; `)}}}a=o+1}for(;o<r;o++){var l=e[o];if(l===`/`&&e[o+1]===`*`){var u=e.indexOf(`*/`,o+2);if(u===-1)break;o=u+1,a=o+1,i=!1}else l===`(`?i=!0:l===`)`?i=!1:l===`;`?i||c():l===`
581
581
  `&&c()}return n.trim(s)}t.exports=r})),uMe=/* @__PURE__ */ a(((e,t)=>{var n=sMe(),r=lMe();cMe();function i(e){return e==null}function a(e){var t={};for(var n in e)t[n]=e[n];return t}function o(e){e=a(e||{}),e.whiteList=e.whiteList||n.whiteList,e.onAttr=e.onAttr||n.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||n.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||n.safeAttrValue,this.options=e}o.prototype.process=function(e){if(e||=``,e=e.toString(),!e)return``;var t=this.options,n=t.whiteList,a=t.onAttr,o=t.onIgnoreAttr,s=t.safeAttrValue;return r(e,function(e,t,r,c,l){var u=n[r],d=!1;if(u===!0?d=u:typeof u==`function`?d=u(c):u instanceof RegExp&&(d=u.test(c)),d!==!0&&(d=!1),c=s(r,c),c){var f={position:t,sourcePosition:e,source:l,isWhite:d};if(d){var p=a(r,c,f);return i(p)?r+`:`+c:p}var p=o(r,c,f);if(!i(p))return p}})},t.exports=o})),wO=/* @__PURE__ */ a(((e,t)=>{var n=sMe(),r=uMe();function i(e,t){return new r(t).process(e)}for(var a in e=t.exports=i,e.FilterCSS=r,n)e[a]=n[a];typeof window<`u`&&(window.filterCSS=t.exports)})),TO=/* @__PURE__ */ a(((e,t)=>{t.exports={indexOf:function(e,t){var n,r;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var r,i;if(Array.prototype.forEach)return e.forEach(t,n);for(r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,``)},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1}}})),dMe=/* @__PURE__ */ a((e=>{var t=wO().FilterCSS,n=wO().getDefaultWhiteList,r=TO();function i(){return{a:[`target`,`href`,`title`],abbr:[`title`],address:[],area:[`shape`,`coords`,`href`,`alt`],article:[],aside:[],audio:[`autoplay`,`controls`,`crossorigin`,`loop`,`muted`,`preload`,`src`],b:[],bdi:[`dir`],bdo:[`dir`],big:[],blockquote:[`cite`],br:[],caption:[],center:[],cite:[],code:[],col:[`align`,`valign`,`span`,`width`],colgroup:[`align`,`valign`,`span`,`width`],dd:[],del:[`datetime`],details:[`open`],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:[`color`,`size`,`face`],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:[`src`,`alt`,`title`,`width`,`height`,`loading`],ins:[`datetime`],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:[`width`,`border`,`align`,`valign`],tbody:[`align`,`valign`],td:[`width`,`rowspan`,`colspan`,`align`,`valign`],tfoot:[`align`,`valign`],th:[`width`,`rowspan`,`colspan`,`align`,`valign`],thead:[`align`,`valign`],tr:[`rowspan`,`align`,`valign`],tt:[],u:[],ul:[],video:[`autoplay`,`controls`,`crossorigin`,`loop`,`muted`,`playsinline`,`poster`,`preload`,`src`,`height`,`width`]}}var a=new t;function o(e,t,n){}function s(e,t,n){}function c(e,t,n){}function l(e,t,n){}function u(e){return e.replace(f,`&lt;`).replace(p,`&gt;`)}function d(e,t,n,i){if(n=D(n),t===`href`||t===`src`){if(n=r.trim(n),n===`#`)return`#`;if(n.substr(0,7)!==`http://`&&n.substr(0,8)!==`https://`&&n.substr(0,7)!==`mailto:`&&n.substr(0,4)!==`tel:`&&n.substr(0,11)!==`data:image/`&&n.substr(0,6)!==`ftp://`&&n.substr(0,2)!==`./`&&n.substr(0,3)!==`../`&&n[0]!==`#`&&n[0]!==`/`)return``}else if(t===`background`){if(y.lastIndex=0,y.test(n))return``}else if(t===`style`){if(b.lastIndex=0,b.test(n)||(x.lastIndex=0,x.test(n)&&(y.lastIndex=0,y.test(n))))return``;i!==!1&&(i||=a,n=i.process(n))}return n=O(n),n}var f=/</g,p=/>/g,m=/"/g,h=/&quot;/g,g=/&#([a-zA-Z0-9]*);?/gim,_=/&colon;?/gim,v=/&newline;?/gim,y=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,b=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,x=/u\s*r\s*l\s*\(.*/gi;function S(e){return e.replace(m,`&quot;`)}function C(e){return e.replace(h,`"`)}function w(e){return e.replace(g,function(e,t){return t[0]===`x`||t[0]===`X`?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})}function T(e){return e.replace(_,`:`).replace(v,` `)}function E(e){for(var t=``,n=0,i=e.length;n<i;n++)t+=e.charCodeAt(n)<32?` `:e.charAt(n);return r.trim(t)}function D(e){return e=C(e),e=w(e),e=T(e),e=E(e),e}function O(e){return e=S(e),e=u(e),e}function k(){return``}function A(e,t){typeof t!=`function`&&(t=function(){});var n=!Array.isArray(e);function i(t){return n?!0:r.indexOf(e,t)!==-1}var a=[],o=!1;return{onIgnoreTag:function(e,n,r){if(i(e)){if(r.isClosing){var s=`[/removed]`,c=r.position+s.length;return a.push([o===!1?r.position:o,c]),o=!1,s}return o||=r.position,`[removed]`}return t(e,n,r)},remove:function(e){var t=``,n=0;return r.forEach(a,function(r){t+=e.slice(n,r[0]),n=r[1]}),t+=e.slice(n),t}}}function ee(e){for(var t=``,n=0;n<e.length;){var r=e.indexOf(`<!--`,n);if(r===-1){t+=e.slice(n);break}t+=e.slice(n,r);var i=e.indexOf(`-->`,r);if(i===-1)break;n=i+3}return t}function te(e){var t=e.split(``);return t=t.filter(function(e){var t=e.charCodeAt(0);return t===127?!1:t<=31?t===10||t===13:!0}),t.join(``)}e.whiteList=i(),e.getDefaultWhiteList=i,e.onTag=o,e.onIgnoreTag=s,e.onTagAttr=c,e.onIgnoreTagAttr=l,e.safeAttrValue=d,e.escapeHtml=u,e.escapeQuote=S,e.unescapeQuote=C,e.escapeHtmlEntities=w,e.escapeDangerHtml5Entities=T,e.clearNonPrintableCharacter=E,e.friendlyAttrValue=D,e.escapeAttrValue=O,e.onIgnoreTagStripAll=k,e.StripTagBody=A,e.stripCommentTag=ee,e.stripBlankChar=te,e.attributeWrapSign=`"`,e.cssFilter=a,e.getDefaultCSSWhiteList=n})),fMe=/* @__PURE__ */ a((e=>{var t=TO();function n(e){var n=t.spaceIndex(e),r=n===-1?e.slice(1,-1):e.slice(1,n+1);return r=t.trim(r).toLowerCase(),r.slice(0,1)===`/`&&(r=r.slice(1)),r.slice(-1)===`/`&&(r=r.slice(0,-1)),r}function r(e){return e.slice(0,2)===`</`}function i(e,t,i){var a=``,o=0,s=!1,c=!1,l=0,u=e.length,d=``,f=``;chariterator:for(l=0;l<u;l++){var p=e.charAt(l);if(s===!1){if(p===`<`){s=l;continue}}else if(c===!1){if(p===`<`){a+=i(e.slice(o,l)),s=l,o=l;continue}if(p===`>`||l===u-1){a+=i(e.slice(o,s)),f=e.slice(s,l+1),d=n(f),a+=t(s,a.length,d,f,r(f)),o=l+1,s=!1;continue}if(p===`"`||p===`'`)for(var m=1,h=e.charAt(l-m);h.trim()===``||h===`=`;){if(h===`=`){c=p;continue chariterator}h=e.charAt(l-++m)}}else if(p===c){c=!1;continue}}return o<u&&(a+=i(e.substr(o))),a}var a=/[^a-zA-Z0-9\\_:.-]/gim;function o(e,n){var r=0,i=0,o=[],u=!1,f=e.length;function p(e,r){if(e=t.trim(e),e=e.replace(a,``).toLowerCase(),!(e.length<1)){var i=n(e,r||``);i&&o.push(i)}}for(var m=0;m<f;m++){var h=e.charAt(m),g,_;if(u===!1&&h===`=`)u=e.slice(r,m),r=m+1,i=e.charAt(r)===`"`||e.charAt(r)===`'`?r:c(e,m+1);else if(u!==!1&&m===i){if(_=e.indexOf(h,m+1),_===-1)break;g=t.trim(e.slice(i+1,_)),p(u,g),u=!1,m=_,r=m+1}else if(/\s|\n|\t/.test(h)){if(e=e.replace(/\s|\n|\t/g,` `),u===!1){if(_=s(e,m),_===-1){g=t.trim(e.slice(r,m)),p(g),u=!1,r=m+1;continue}m=_-1;continue}if(_=l(e,m-1),_===-1){g=t.trim(e.slice(r,m)),g=d(g),p(u,g),u=!1,r=m+1;continue}}}return r<e.length&&(u===!1?p(e.slice(r)):p(u,d(t.trim(e.slice(r))))),t.trim(o.join(` `))}function s(e,t){for(;t<e.length;t++){var n=e[t];if(n!==` `)return n===`=`?t:-1}}function c(e,t){for(;t<e.length;t++){var n=e[t];if(n!==` `)return n===`'`||n===`"`?t:-1}}function l(e,t){for(;t>0;t--){var n=e[t];if(n!==` `)return n===`=`?t:-1}}function u(e){return e[0]===`"`&&e[e.length-1]===`"`||e[0]===`'`&&e[e.length-1]===`'`}function d(e){return u(e)?e.substr(1,e.length-2):e}e.parseTag=i,e.parseAttr=o})),pMe=/* @__PURE__ */ a(((e,t)=>{var n=wO().FilterCSS,r=dMe(),i=fMe(),a=i.parseTag,o=i.parseAttr,s=TO();function c(e){return e==null}function l(e){var t=s.spaceIndex(e);if(t===-1)return{html:``,closing:e[e.length-2]===`/`};e=s.trim(e.slice(t+1,-1));var n=e[e.length-1]===`/`;return n&&(e=s.trim(e.slice(0,-1))),{html:e,closing:n}}function u(e){var t={};for(var n in e)t[n]=e[n];return t}function d(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(e){return e.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function f(e){e=u(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error(`Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time`),e.onIgnoreTag=r.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=d(e.whiteList||e.allowList):e.whiteList=r.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?`'`:r.attributeWrapSign,e.onTag=e.onTag||r.onTag,e.onTagAttr=e.onTagAttr||r.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||r.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||r.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||r.safeAttrValue,e.escapeHtml=e.escapeHtml||r.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new n(e.css))}f.prototype.process=function(e){if(e||=``,e=e.toString(),!e)return``;var t=this,n=t.options,i=n.whiteList,u=n.onTag,d=n.onIgnoreTag,f=n.onTagAttr,p=n.onIgnoreTagAttr,m=n.safeAttrValue,h=n.escapeHtml,g=t.attributeWrapSign,_=t.cssFilter;n.stripBlankChar&&(e=r.stripBlankChar(e)),n.allowCommentTag||(e=r.stripCommentTag(e));var v=!1;n.stripIgnoreTagBody&&(v=r.StripTagBody(n.stripIgnoreTagBody,d),d=v.onIgnoreTag);var y=a(e,function(e,t,n,r,a){var v={sourcePosition:e,position:t,isClosing:a,isWhite:Object.prototype.hasOwnProperty.call(i,n)},y=u(n,r,v);if(!c(y))return y;if(v.isWhite){if(v.isClosing)return`</`+n+`>`;var b=l(r),x=i[n],S=o(b.html,function(e,t){var r=s.indexOf(x,e)!==-1,i=f(n,e,t,r);return c(i)?r?(t=m(n,e,t,_),t?e+`=`+g+t+g:e):(i=p(n,e,t,r),c(i)?void 0:i):i});return r=`<`+n,S&&(r+=` `+S),b.closing&&(r+=` /`),r+=`>`,r}return y=d(n,r,v),c(y)?h(r):y},h);return v&&(y=v.remove(y)),y},t.exports=f})),mMe=/* @__PURE__ */ r((/* @__PURE__ */ a(((e,t)=>{var n=dMe(),r=fMe(),i=pMe();function a(e,t){return new i(t).process(e)}e=t.exports=a,e.filterXSS=a,e.FilterXSS=i,(function(){for(var t in n)e[t]=n[t];for(var i in r)e[i]=r[i]})(),typeof window<`u`&&(window.filterXSS=t.exports);function o(){return typeof self<`u`&&typeof DedicatedWorkerGlobalScope<`u`&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=t.exports)})))(),1);const hMe=/\{\{\s*([\w.\-]+)\s*\}\}/g,gMe=[`script`,`style`,`iframe`,`object`,`embed`,`form`,`link`,`meta`,`base`];function _Me(e){return(0,mMe.default)(e,{whiteList:{},stripIgnoreTag:!0,stripIgnoreTagBody:gMe})}function EO(e,t){return!t||Object.keys(t).length===0||!e.includes(`{{`)?e:e.replace(hMe,(e,n)=>{let r=t[n];return r===void 0?e:_Me(r)})}const DO=/^[A-Za-z_$][\w$]*$/,OO=e=>({type:`Literal`,value:e}),kO=e=>({type:`Identifier`,name:e}),vMe=e=>e.type===`ParenthesizedExpression`?vMe(e.expression):e,AO=(e,t,n)=>{if(!e)return{ok:!1,reason:`expression`};switch(e.type){case`ParenthesizedExpression`:return AO(e.expression,t,n);case`Literal`:{if(`regex`in e||`bigint`in e)return{ok:!1,reason:`expression`};let{value:t}=e;return t===null||typeof t==`string`||typeof t==`boolean`||typeof t==`number`&&Number.isFinite(t)?{ok:!0,expression:OO(t)}:{ok:!1,reason:`expression`}}case`TemplateLiteral`:return e.expressions.length>0?{ok:!1,reason:`expression`}:{ok:!0,expression:OO(e.quasis.map(e=>e.value.cooked??e.value.raw).join(``))};case`UnaryExpression`:{let t=vMe(e.argument);return e.operator===`-`&&t.type===`Literal`&&typeof t.value==`number`&&Number.isFinite(t.value)?{ok:!0,expression:{type:`UnaryExpression`,operator:`-`,prefix:!0,argument:OO(t.value)}}:{ok:!1,reason:`expression`}}case`ArrayExpression`:{let r=[];for(let i of e.elements){if(!i||i.type===`SpreadElement`)return{ok:!1,reason:`expression`};let e=AO(i,t,n);if(!e.ok)return e;r.push(e.expression)}return{ok:!0,expression:{type:`ArrayExpression`,elements:r}}}case`ObjectExpression`:{let r=[];for(let i of e.properties){if(i.type===`SpreadElement`||i.computed)return{ok:!1,reason:`expression`};if(i.kind!==`init`||i.method)return{ok:!1,reason:`function`};let e;if(i.key.type===`Identifier`?e=i.key.name:i.key.type===`Literal`&&(typeof i.key.value==`string`||typeof i.key.value==`number`)&&(e=String(i.key.value)),e===void 0)return{ok:!1,reason:`expression`};if(CO.has(e))return{ok:!1,reason:`key`,name:e};let a=AO(i.value,t,n);if(!a.ok)return a;let o={type:`Property`,key:DO.test(e)?kO(e):OO(e),value:a.expression,kind:`init`,method:!1,shorthand:!1,computed:!1};r.push(o)}return{ok:!0,expression:{type:`ObjectExpression`,properties:r}}}case`Identifier`:{if(e.name===`undefined`)return{ok:!0,expression:kO(`undefined`)};let r=t?.get(e.name);return r?r.expression?(n.add(e.name),{ok:!0,expression:kO(e.name)}):{ok:!1,reason:`const`,name:e.name}:{ok:!1,reason:`identifier`,name:e.name}}case`ArrowFunctionExpression`:case`FunctionExpression`:return{ok:!1,reason:`function`};case`JSXElement`:case`JSXFragment`:return{ok:!1,reason:`jsx`};default:return{ok:!1,reason:`expression`}}},jO=(e,t=0)=>{if(!(t>32)){if(e===void 0)return kO(`undefined`);if(e===null||typeof e==`string`||typeof e==`boolean`)return OO(e);if(typeof e==`number`)return Number.isFinite(e)?e<0||Object.is(e,-0)?{type:`UnaryExpression`,operator:`-`,prefix:!0,argument:OO(-e)}:OO(e):void 0;if(Array.isArray(e)){let n=[];for(let r of e){let e=jO(r,t+1);if(!e)return;n.push(e)}return{type:`ArrayExpression`,elements:n}}if(typeof e==`object`&&Object.getPrototypeOf(e)===Object.prototype){let n=[];for(let[r,i]of Object.entries(e)){if(CO.has(r))return;let e=jO(i,t+1);if(!e)return;n.push({type:`Property`,key:DO.test(r)?kO(r):OO(r),value:e,kind:`init`,method:!1,shorthand:!1,computed:!1})}return{type:`ObjectExpression`,properties:n}}}},MO=e=>e.position?.start.line,yMe=e=>{if(e.type===`ImportDefaultSpecifier`)return{imported:`default`};if(e.type===`ImportNamespaceSpecifier`)return{imported:`*`};let t=ATe(e);return XT(t)?{imported:t}:{imported:t,invalidName:!0}},bMe=(e,t)=>{let n=[],r=e=>{if(st(e)){let r=GTe(e,t);for(let t of e.data?.estree?.body??[])n.push({statement:t,line:t.loc?.start.line??MO(e),importer:r})}else if(`children`in e)for(let t of e.children)r(t)};return r(e),n},xMe=(e,t)=>`${e===`*`||XT(e)?e:JSON.stringify(e)} from "${t}"`,SMe=(e,t)=>{let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=[],a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Set,l=(e,t,n,r)=>{let a=s.get(e);if(!a){s.set(e,{described:t,island:n});return}let o=JSON.stringify([e,t]);a.described!==t&&(a.island||n)&&!c.has(o)&&(c.add(o),i.push({line:r,message:`${e} is imported twice on this page, as ${a.described} and as ${t}. Snippets on a page share its imports, so import one of them under another name.`}))};for(let{statement:i,importer:s,line:c}of e){if(i.type!==`ImportDeclaration`)continue;let e=i.source.value;if(typeof e!=`string`)continue;let u=aE(e,t.packageNames),d=!u&&oE(e),f=u||d?null:KT(e,s),p=f!==null&&(t.packageSnippets?t.packageSnippets.has(f):sE(f)),m=p?f:e;(u||p)&&(o.add(m),i.specifiers.length===0&&!a.has(m)&&a.set(m,c));for(let t of i.specifiers){let i=t.local.name,a=yMe(t);l(i,xMe(a.imported,m),u||d||p,c),d?r.set(i,e):(u||p)&&n.set(i,Object.assign({source:m,kind:u?`package`:`snippet`,local:i},a))}}return{bindings:n,undeclared:r,conflicts:i,sideEffects:a,order:[...o]}},CMe=(e,t)=>{let n=/* @__PURE__ */ new Map;for(let[e,r]of Object.entries(t.exportedConsts??{}))DO.test(e)&&n.set(e,{expression:jO(r)});let r=/* @__PURE__ */ new Set;for(let{statement:t}of e){if(t.type!==`ExportNamedDeclaration`)continue;let e=t.declaration;if(e?.type===`VariableDeclaration`)for(let t of e.declarations){if(t.id.type!==`Identifier`)continue;let i=e.kind===`const`?AO(t.init,void 0,r):void 0;n.set(t.id.name,{expression:i?.ok?i.expression:void 0})}}return n},wMe=e=>e.includes(`:`)?void 0:e.split(`.`)[0],TMe=(e,t)=>{let n=[];return lE(e,{enter(e,r,i){if(e.type===`JSXIdentifier`){if(r?.type===`JSXAttribute`||r?.type===`JSXMemberExpression`&&i===`property`||r?.type===`JSXNamespacedName`)return;t.has(e.name)&&n.push({name:e.name,jsx:!0,line:e.loc?.start.line})}else e.type===`Identifier`&&t.has(e.name)&&(r?.type!==`MemberExpression`||i!==`property`||r.computed)&&(r?.type!==`Property`||i!==`key`||r.computed)&&r?.type!==`ImportSpecifier`&&r?.type!==`ImportDefaultSpecifier`&&r?.type!==`ImportNamespaceSpecifier`&&n.push({name:e.name,jsx:!1,line:e.loc?.start.line})}}),n},EMe=/* @__PURE__ */ new Set([`table`,`thead`,`tbody`,`tfoot`,`tr`,`colgroup`,`svg`]),DMe=/* @__PURE__ */ new Set([`foreignObject`,`desc`,`title`]),OMe=/* @__PURE__ */ new Set([`head`,`script`]),kMe=e=>e.spread===null||e.spread===void 0?e.children.length>1:e.spread,AMe=e=>!!e.spread||e.children.some(kMe),NO=e=>/^[a-z]/.test(e)&&!e.includes(`.`),jMe=(e,t)=>e===`p`?`p`:!e||!NO(e)||t===`p`||t===`paragraph`||t&&OMe.has(t)?t:OMe.has(e)?e:t===`svg`?!DMe.has(e)&&t:EMe.has(e)?e:e===`form`&&t,MMe=e=>e.type===`JSXIdentifier`?e.name:e.type===`JSXNamespacedName`?`${e.namespace.name}:${e.name.name}`:`${MMe(e.object)}.${e.property.name}`,PO=e=>e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ArrowFunctionExpression`,FO=(e,t)=>{if(!t&&e.type===`Identifier`)return e.name;if(e.type===`Literal`&&typeof e.value==`string`)return e.value},IO=(e,t,n)=>{if(e.type===`Identifier`)n.set(e.name,t);else if(e.type===`AssignmentPattern`)IO(e.left,t,n);else if(e.type===`RestElement`)IO(e.argument,t,n);else if(e.type===`ArrayPattern`)for(let t of e.elements)t&&IO(t,!1,n);else if(e.type===`ObjectPattern`){let r=e.properties.some(e=>e.type===`Property`&&FO(e.key,e.computed)===`children`);for(let i of e.properties)if(i.type===`RestElement`)IO(i.argument,t===`props`&&!r&&`props`,n);else{let e=t===`props`&&FO(i.key,i.computed)===`children`&&`children`;IO(i.value,e,n)}}},NMe=(e,t)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(r?.has(e))return r.get(e)??!1}return!1},LO=(e,t)=>e?.type===`Identifier`?NMe(e.name,t):e?.type===`ChainExpression`?LO(e.expression,t):e?.type===`MemberExpression`&&LO(e.object,t)===`props`&&FO(e.property,e.computed)===`children`&&`children`,PMe=e=>{let t=/* @__PURE__ */ new Map;for(let n of e.body)if(n.type===`VariableDeclaration`)for(let e of n.declarations)IO(e.id,!1,t);else(n.type===`FunctionDeclaration`||n.type===`ClassDeclaration`)&&n.id&&t.set(n.id.name,!1);return t},FMe=(e,t)=>{if(e.children.some(e=>e.type!==`JSXText`||e.value.trim().length>0))return!1;let n=e.openingElement.attributes,r=n.indexOf(t);return!n.slice(r+1).some(e=>e.type===`JSXAttribute`&&e.name.name===`children`)},IMe=e=>{let t=[],n=[],r=[],i=[],a=[];return lE(e,{enter(o,s,c){if(PO(o)){if(o!==e&&n.length===0){this.skip();return}let r=/* @__PURE__ */ new Map;for(let[t,n]of o.params.entries())IO(n,o===e&&t===0&&`props`,r);t.push(r)}else if(o.type===`BlockStatement`)t.push(PMe(o));else if(o.type===`CatchClause`){let e=/* @__PURE__ */ new Map;o.param&&IO(o.param,!1,e),t.push(e)}else if(o.type===`VariableDeclarator`){let e=t.at(-1);e&&IO(o.id,LO(o.init,t),e)}else if(o.type===`JSXElement`)n.push(MMe(o.openingElement.name)),r.push(o);else if(o.type===`JSXFragment`)n.push(null),r.push(null);else if(o.type===`JSXExpressionContainer`)i.push(s?.type===`JSXElement`||s?.type===`JSXFragment`||s?.type===`JSXAttribute`&&s.name.name===`children`);else if(o.type===`JSXSpreadAttribute`){let e=r.at(-1);e&&LO(o.argument,t)===`props`&&FMe(e,o)&&a.push([...n])}else i.at(-1)&&n.length>0&&LO(o,t)===`children`&&(s?.type!==`Property`||c!==`key`||s.computed)&&(s?.type!==`MemberExpression`||c!==`property`||s.computed)&&a.push([...n])},leave(e){PO(e)||e.type===`BlockStatement`||e.type===`CatchClause`?t.pop():e.type===`JSXElement`||e.type===`JSXFragment`?(n.pop(),r.pop()):e.type===`JSXExpressionContainer`&&i.pop()}}),a},LMe=e=>{let t=/* @__PURE__ */ new Map;for(let{statement:n}of e){if(n.type!==`ExportNamedDeclaration`)continue;let e=n.declaration;if(e?.type===`FunctionDeclaration`&&e.id){let n=IMe(e);n.length>0&&t.set(e.id.name,n)}else if(e?.type===`VariableDeclaration`)for(let n of e.declarations){if(n.id.type!==`Identifier`||!n.init||!PO(n.init))continue;let e=IMe(n.init);e.length>0&&t.set(n.id.name,e)}}return t},RMe=(e,t,n,r=/* @__PURE__ */ new Set)=>{if(e===null||NO(e))return jMe(e,t);let i=/* @__PURE__ */ new Set([...r,e]);for(let a of r.has(e)?[]:n.get(e)??[]){let e=a.reduce((e,t)=>RMe(t,e,n,i),t);if(e)return e}return t},zMe=/* @__PURE__ */ new Set([`script`,`style`,`iframe`,`object`,`embed`,`form`,`base`,`meta`,`link`,`foreignobject`]),RO=`Move this into a snippet.`,BMe=new Set(dt),VMe=/* @__PURE__ */ new Map([[`a`,`href`],[`img`,`src`],[`source`,`src`]]),zO=e=>({type:`JSXExpressionContainer`,expression:e}),BO=e=>{if(e.includes(`:`)){let[t=``,n=``]=e.split(`:`);return{type:`JSXNamespacedName`,namespace:{type:`JSXIdentifier`,name:t},name:{type:`JSXIdentifier`,name:n}}}let[t=``,...n]=e.split(`.`),r={type:`JSXIdentifier`,name:t};for(let e of n)r={type:`JSXMemberExpression`,object:r,property:{type:`JSXIdentifier`,name:e}};return r},VO=(e,t,n)=>{let r=BO(e),i=n.length===0;return{type:`JSXElement`,openingElement:{type:`JSXOpeningElement`,name:r,attributes:t,selfClosing:i},closingElement:i?null:{type:`JSXClosingElement`,name:BO(e)},children:n}},HO=(e,t)=>{let n=BO(e);return{type:`JSXAttribute`,name:n.type===`JSXMemberExpression`?{type:`JSXIdentifier`,name:e}:n,value:t?zO(t):null}},UO=()=>zO(OO(`
582
582
  `)),HMe=e=>[UO(),...e.flatMap((e,t)=>t>0?[UO(),...e]:e),...e.length>0?[UO()]:[]],UMe=e=>e.replace(/[\t ]*(\r?\n|\r)[\t ]*/g,`$1`),WMe=e=>e.replace(/^[\t ]+/,``),GMe=e=>e.replace(/\r?\n|\r/g,` `),KMe=e=>{switch(e.type){case`text`:return Object.assign(Object.assign({},e),{value:WMe(e.value)});case`inlineCode`:return Object.assign(Object.assign({},e),{value:WMe(GMe(e.value))});case`strong`:case`emphasis`:case`delete`:case`link`:{let[t,...n]=e.children;return t?.type===`text`?Object.assign(Object.assign({},e),{children:[Object.assign(Object.assign({},t),{value:WMe(t.value)}),...n]}):e}default:return e}},qMe=e=>e.type===`mdxJsxTextElement`||e.type===`mdxTextExpression`,WO=e=>e.flatMap(e=>e.type===`paragraph`&&e.children.some(qMe)&&e.children.every(e=>qMe(e)||e.type===`text`&&/^[\t\n\v\f\r ]*$/.test(e.value))?e.children.filter(e=>e.type!==`text`||!/^[\t\r\n ]+$/.test(e.value)):[e]),GO=(e,t,n)=>{let r=(n===void 0?void 0:YE(n))||$E(t);return r?e.claim(r):void 0},JMe=new Map(vO.map(e=>[`h${e}`,e])),YMe=(e,t=40)=>e.length>t?`${e.slice(0,t-1)}…`:e;var XMe=class{constructor(e,t,n,r,i,a,o,s){this.rootName=e,this.pagePath=t,this.bindings=n,this.undeclared=r,this.consts=i,this.sideEffects=a,this.order=o,this.headingSlugs=s,this.usedBindings=/* @__PURE__ */ new Map,this.usedConsts=/* @__PURE__ */ new Set,this.errors=[],this.headings=[]}url(e,t){return OO(TTe(this.pagePath,e,t))}fail(e,t){this.errors.push({line:MO(e),message:t})}insideRoot(){return`the package component <${this.rootName}>`}element(e){if(!e.name)return{type:`JSXFragment`,openingFragment:{type:`JSXOpeningFragment`},closingFragment:{type:`JSXClosingFragment`},children:this.children(e.children)};let t=e.name,n=wMe(t),r=n===void 0?void 0:this.bindings.get(n);if(r?.invalidName){this.fail(e,`<${t}> is imported from "${r.source}" by the string name ${JSON.stringify(r.imported)}, which isn't a valid identifier. Import it by an identifier name, or move this into a snippet.`);return}if(r&&n!==void 0)this.usedBindings.set(n,r);else if(NO(t)){if(zMe.has(t.toLowerCase())){this.fail(e,`<${t}> isn't allowed inside ${this.insideRoot()}.`);return}}else if(n!==void 0&&this.undeclared.has(n)){this.fail(e,`<${t}> is imported from "${this.undeclared.get(n)}", which isn't listed in package.json dependencies.`);return}else if(BMe.has(t)){this.fail(e,`<${t}> is a Mintlify component and can't render inside ${this.insideRoot()}. Move <${t}> outside <${this.rootName}>.`);return}else{this.fail(e,`<${t}> isn't imported from a package or a package snippet, so it can't render inside ${this.insideRoot()}. ${RO}`);return}let i=[];for(let n of e.attributes){let r=this.attribute(e,t,n);r&&i.push(r)}let a=JMe.get(t);return a!==void 0&&this.addHeadingId(e,a,i),VO(t,i,this.children(e.children))}addHeadingId(e,t,n){let r=n.findIndex(e=>e.name.type===`JSXIdentifier`&&e.name.name===`id`),i;if(r!==-1){let e=n[r]?.value;if(e?.type!==`JSXExpressionContainer`||e.expression.type!==`Literal`||typeof e.expression.value!=`string`)return;i=e.expression.value}let a=this.headingTitle(e),o=GO(this.headingSlugs,a,i);if(o===void 0)return;let s=HO(`id`,OO(YE(o)));r===-1?n.unshift(s):n[r]=s,a.trim()&&this.headings.push({title:a,slug:o,depth:t})}headingTitle(e){return`children`in e?e.children.map((e,t,n)=>{if(e.type!==`mdxTextExpression`&&e.type!==`mdxFlowExpression`)return`children`in e?this.headingTitle(e):Ue(e,t,n);let r=(e.data?.estree)?.body[0];if(r?.type!==`ExpressionStatement`)return``;let i=AO(r.expression,this.consts,/* @__PURE__ */ new Set);if(!i.ok)return``;let a=i.expression.type===`Identifier`?this.consts.get(i.expression.name)?.expression:i.expression;return a?.type===`Literal`&&(typeof a.value==`string`||typeof a.value==`number`)?String(a.value):``}).join(``):Ue(e)}attribute(e,t,n){let r=n.position?n:e;if(n.type===`mdxJsxExpressionAttribute`){this.fail(r,`<${t}> spreads props ({...}), which can't be evaluated at build time. ${RO}`);return}let i=`Prop "${n.name}" on <${t}>`;if(/^on[A-Z]/.test(n.name)||NO(t)&&/^on/i.test(n.name)){this.fail(r,`${i} is an event handler, and package components in MDX only take static props. ${RO}`);return}if(n.name===`dangerouslySetInnerHTML`||n.name===`ref`){this.fail(r,`${i} isn't allowed inside ${this.insideRoot()}.`);return}if(n.value===null||n.value===void 0)return HO(n.name,null);if(typeof n.value==`string`){if(n.name===`style`&&NO(t)){let e=Rje(n.value),t=jO(e);if(t)return HO(`style`,t);let a=Object.keys(e).find(e=>CO.has(e));this.fail(r,this.propFailure(i,{reason:`key`,name:a}));return}return HO(n.name,VMe.get(t)===n.name?this.url(n.value,n.name===`href`):OO(n.value))}let a=n.value.data?.estree,o=a?.body[0];if(!a||a.body.length!==1||o?.type!==`ExpressionStatement`){this.fail(r,`${i} is an expression that can't be evaluated at build time. ${RO}`);return}let s=AO(o.expression,this.consts,this.usedConsts);if(s.ok)return HO(n.name,s.expression);this.fail(r,this.propFailure(i,s))}propFailure(e,t){switch(t.reason){case`function`:return`${e} is a function, and package components in MDX only take static props. ${RO}`;case`jsx`:return`${e} is JSX, and package components in MDX only take static props. ${RO}`;case`identifier`:return`${e} uses "${t.name}", which isn't a literal \`export const\` in this page. ${RO}`;case`const`:return`${e} uses \`export const ${t.name}\`, whose value isn't a literal (strings, numbers, booleans, arrays and objects only). ${RO}`;case`key`:return`${e} uses the object key "${t.name}", which isn't allowed.`;case`expression`:return`${e} is an expression that can't be evaluated at build time. ${RO}`}}intrinsic(e,t,n=[]){return VO(e,n,this.children(t))}children(e){let t=[],n=!1;for(let r of WO(e)){let e=this.child(n?KMe(r):r);n=r.type===`break`,e&&t.push(...e)}return t}child(e){switch(e.type){case`mdxJsxFlowElement`:case`mdxJsxTextElement`:{let t=this.element(e);return t?[t]:void 0}case`text`:{let t=UMe(e.value);return t===``?[]:[zO(OO(t))]}case`paragraph`:return[this.intrinsic(`p`,e.children)];case`strong`:return[this.intrinsic(`strong`,e.children)];case`emphasis`:return[this.intrinsic(`em`,e.children)];case`delete`:return[this.intrinsic(`del`,e.children)];case`inlineCode`:return[VO(`code`,[],[zO(OO(GMe(e.value)))])];case`break`:return[VO(`br`,[],[]),UO()];case`thematicBreak`:return[VO(`hr`,[],[])];case`blockquote`:return[VO(`blockquote`,[],HMe(WO(e.children).map(e=>this.child(e)??[])))];case`heading`:{let t=[];return vO.includes(e.depth)&&this.addHeadingId(e,e.depth,t),[this.intrinsic(`h${e.depth}`,e.children,t)]}case`link`:{let t=[HO(`href`,this.url(e.url,!0))];return e.title&&t.push(HO(`title`,OO(e.title))),[this.intrinsic(`a`,e.children,t)]}case`image`:{let t=[HO(`src`,this.url(e.url,!1)),HO(`alt`,OO(e.alt??``))];return e.title&&t.push(HO(`title`,OO(e.title))),[VO(`img`,t,[])]}case`code`:{let t=e.lang?[HO(`className`,OO(`language-${e.lang}`))]:[];return[VO(`pre`,[],[VO(`code`,t,[zO(OO(e.value))])])]}case`list`:{let t=AMe(e),n=e.ordered&&typeof e.start==`number`&&e.start!==1?[HO(`start`,OO(e.start))]:[];return e.children.some(e=>typeof e.checked==`boolean`)&&n.push(HO(`className`,OO(`contains-task-list`))),[VO(e.ordered?`ol`:`ul`,n,HMe(e.children.map(e=>[this.listItem(e,t)])))]}case`table`:{let[t,...n]=e.children,r=(e,t)=>VO(`tr`,[],e.map(e=>this.intrinsic(t,`children`in e?e.children:[]))),i=[];return t&&i.push(VO(`thead`,[],[r(t.children,`th`)])),n.length>0&&i.push(VO(`tbody`,[],n.map(e=>r(e.children,`td`)))),[VO(`table`,[],i)]}case`mdxFlowExpression`:case`mdxTextExpression`:{let t=e.data?.estree;if(t&&t.body.length===0)return[];let n=t?.body[0];if(t?.body.length===1&&n?.type===`ExpressionStatement`){let e=AO(n.expression,this.consts,this.usedConsts);if(e.ok&&this.isRenderableText(e.expression))return[zO(e.expression)]}this.fail(e,`{${YMe(e.value.trim())}} inside ${this.insideRoot()} can't be evaluated at build time. ${RO}`);return}default:this.fail(e,`Markdown ${e.type} content isn't supported inside ${this.insideRoot()}. ${RO}`);return}}listItem(e,t){let n=WO(e.children).map(e=>e.type===`paragraph`?{p:!0,empty:e.children.length===0,children:this.children(e.children)}:{p:!1,empty:!1,children:this.child(e)??[]}),r=[];if(typeof e.checked==`boolean`){let t=VO(`input`,[HO(`type`,OO(`checkbox`)),HO(`checked`,OO(e.checked)),HO(`disabled`,null)],[]),[i]=n;i?.p?i.children.unshift(t,...i.empty?[]:[zO(OO(` `))]):n.unshift({p:!0,empty:!0,children:[t]}),r.push(HO(`className`,OO(`task-list-item`)))}let i=n.flatMap(({p:e,children:n},r)=>[...t||r>0||!e?[UO()]:[],...e&&t?[VO(`p`,[],n)]:n]),a=n.at(-1);return a&&(t||!a.p)&&i.push(UO()),VO(`li`,r,i)}isRenderableText(e){if(e.type===`Literal`)return typeof e.value==`string`||typeof e.value==`number`;if(e.type===`UnaryExpression`)return!0;if(e.type!==`Identifier`||e.name===`undefined`)return!1;let t=this.consts.get(e.name)?.expression;return t!==void 0&&this.isRenderableText(t)&&t.type!==`Identifier`}module(e){let t=[],n=/* @__PURE__ */ new Map;for(let e of[...this.usedBindings.values()].sort((e,t)=>KO(e.local,t.local)))n.set(e.source,[...n.get(e.source)??[],e]);let r=this.sideEffects.size===0?[...n.keys()].sort(KO):this.order.filter(e=>n.has(e)||this.sideEffects.has(e));for(let e of r){let r=n.get(e)??[],i=t=>({type:`ImportDeclaration`,specifiers:t,source:{type:`Literal`,value:e}}),[a,...o]=r.filter(e=>e.imported==="default"),s=r.filter(e=>e.imported!=="default"&&e.imported!==`*`),c=[];a&&c.push({type:`ImportDefaultSpecifier`,local:kO(a.local)});for(let e of s)c.push({type:`ImportSpecifier`,imported:kO(e.imported),local:kO(e.local)});(c.length>0||r.length===0)&&t.push(i(c));for(let e of o)t.push(i([{type:`ImportDefaultSpecifier`,local:kO(e.local)}]));for(let e of r.filter(e=>e.imported===`*`))t.push(i([{type:`ImportNamespaceSpecifier`,local:kO(e.local)}]))}for(let e of[...this.usedConsts].sort(KO)){let n=this.consts.get(e)?.expression;n&&t.push({type:`VariableDeclaration`,kind:`const`,declarations:[{type:`VariableDeclarator`,id:kO(e),init:n}]})}let i=/* @__PURE__ */ new Set([...this.usedBindings.keys(),...this.usedConsts]),a=`Island`;for(;i.has(a);)a=`${a}_`;return t.push({type:`ExportDefaultDeclaration`,declaration:{type:`FunctionDeclaration`,id:kO(a),params:[],generator:!1,async:!1,body:{type:`BlockStatement`,body:[{type:`ReturnStatement`,argument:e}]}}}),HT({type:`Program`,sourceType:`module`,body:t},{handlers:UT}).value}imports(){return[...this.usedBindings.values()].map(({local:e,source:t,imported:n})=>({local:e,pkg:t,imported:n})).sort((e,t)=>KO(e.local,t.local))}};const KO=(e,t)=>e<t?-1:+(e>t),ZMe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),qO=(e,t)=>e>>>t|e<<32-t,JO=(e,t)=>e[t]??0,QMe=e=>{let t=new TextEncoder().encode(e),n=t.length*8,r=Math.ceil((t.length+9)/64)*64,i=new Uint8Array(r);i.set(t),i[t.length]=128;let a=new DataView(i.buffer);a.setUint32(r-8,Math.floor(n/4294967296)),a.setUint32(r-4,n>>>0);let o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=/* @__PURE__ */ new Uint32Array(64);for(let e=0;e<r;e+=64){for(let t=0;t<16;t++)s[t]=a.getUint32(e+t*4);for(let e=16;e<64;e++){let t=JO(s,e-15),n=JO(s,e-2),r=qO(t,7)^qO(t,18)^t>>>3,i=qO(n,17)^qO(n,19)^n>>>10;s[e]=JO(s,e-16)+r+JO(s,e-7)+i>>>0}let t=JO(o,0),n=JO(o,1),r=JO(o,2),i=JO(o,3),c=JO(o,4),l=JO(o,5),u=JO(o,6),d=JO(o,7);for(let e=0;e<64;e++){let a=qO(c,6)^qO(c,11)^qO(c,25),o=c&l^~c&u,f=d+a+o+JO(ZMe,e)+JO(s,e)>>>0,p=(qO(t,2)^qO(t,13)^qO(t,22))+(t&n^t&r^n&r)>>>0;d=u,u=l,l=c,c=i+f>>>0,i=r,r=n,n=t,t=f+p>>>0}o[0]=JO(o,0)+t>>>0,o[1]=JO(o,1)+n>>>0,o[2]=JO(o,2)+r>>>0,o[3]=JO(o,3)+i>>>0,o[4]=JO(o,4)+c>>>0,o[5]=JO(o,5)+l>>>0,o[6]=JO(o,6)+u>>>0,o[7]=JO(o,7)+d>>>0}return Array.from(o,e=>e.toString(16).padStart(8,`0`)).join(``)},$Me=/\.css(?:[?#].*)?$/,eNe=e=>`i${QMe(e).slice(0,16)}`,tNe=(e,t)=>`${e.endsWith(`
583
- `)?e:`${e}\n`}// placement ${t}\n`,nNe=e=>{let t=e.children.filter(e=>e.type!==`text`||e.value.trim()!==``);return t.length===1?t[0]:void 0},rNe=(e,t)=>{let n=bMe(e,t.pagePath),{bindings:r,undeclared:i,conflicts:a,sideEffects:o,order:s}=SMe(n,t),c=/* @__PURE__ */ new Map,l=[...a],u=[],d=()=>l.length>0||u.length>0?[]:[...o].map(([e,t])=>({line:t,code:`side-effect-import-without-island`,message:$Me.test(e)?`"${e}" is imported on a page without package components, so it never loads. Use a package component on this page or remove this import.`:`"${e}" is imported on a page without package components, so it never runs. Use a package component on this page or remove this import.`}));if(r.size===0&&i.size===0)return{islands:[],errors:[...l,...d()],roots:u};let f=CMe(n,t),p=LMe(n),m=(e,t)=>{for(let n of TMe(e,r)){let e=r.get(n.name),i=e?`"${e.source}"`:`a package`;l.push({line:n.line??t,message:n.jsx?`<${n.name}> (from ${i}) is used inside JavaScript. Package components can only be written as JSX directly in MDX. ${RO}`:`${n.name} (from ${i}) is used inside JavaScript. Package components can only be written as JSX directly in MDX. ${RO}`})}};for(let{statement:e,line:t}of n)e.type!==`ImportDeclaration`&&m(e,t);let h=zje(),g=/* @__PURE__ */ new WeakSet,_=/* @__PURE__ */ new Map,v=(e,n,a=n,d)=>{for(let y of e.children)if(y.type===`mdxJsxFlowElement`||y.type===`mdxJsxTextElement`){let g=y.name?wMe(y.name):void 0,b=g===void 0?void 0:r.get(g);if(y.name&&b){let p=e.type===`paragraph`&&nNe(e)===y?a:n;if(p){let e;e=p===`paragraph`?`<${y.name}> is inside a line of text. Package components render as a block, so put <${y.name}> on its own line.`:d?`<${y.name}> is inside <${d}>, which renders it inside a <${p}>. Package components render as a block, so move <${y.name}> out of <${d}>.`:`<${y.name}> is inside a <${p}>. Package components render as a block, so move <${y.name}> out of the <${p}>.`,l.push({line:MO(y),message:e});continue}let m=new XMe(y.name,t.pagePath,r,i,f,o,s,h),g=m.element(y);if(m.errors.length>0||!g){l.push(...m.errors);continue}let v=m.module(g),x=eNe(v),S=(_.get(x)??0)+1;_.set(x,S);let C=S===1?v:tNe(v,S),w=S===1?x:eNe(C);c.has(w)||c.set(w,{id:w,pagePath:t.pagePath,kind:b.kind===`snippet`?`snippet`:`inline`,imports:m.imports(),module:C}),u.push({id:w,name:y.name,node:y,parent:e,headings:m.headings});continue}if(y.name&&g!==void 0&&i.has(g)){l.push({line:MO(y),message:`<${y.name}> is imported from "${i.get(g)}", which isn't listed in package.json dependencies.`});continue}if(y.name&&JMe.has(y.name)){let e=y.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`id`);(e===void 0||typeof e.value==`string`)&&GO(h,Ue(y),typeof e?.value==`string`?e.value:void 0)}for(let e of y.attributes){let t;e.type===`mdxJsxExpressionAttribute`?t=e.data?.estree:typeof e.value==`object`&&(t=e.value?.data?.estree),t&&m(t,MO(y))}let x=RMe(y.name,n,p),S;x===n?S=d:y.name&&!NO(y.name)&&(S=y.name),v(y,x,x,S)}else if(y.type===`mdxFlowExpression`||y.type===`mdxTextExpression`)y.data?.estree&&m(y.data.estree,MO(y));else{if(y.type===`heading`&&vO.includes(y.depth)&&GO(h,Ue(y)),y.type===`list`&&!AMe(y))for(let e of y.children)g.add(e);if(y.type===`paragraph`){let t=!(e.type===`listItem`&&g.has(e));v(y,n===`p`||!t?n:`paragraph`,n,d)}else`children`in y&&v(y,n,n,d)}};return v(e,!1),{islands:[...c.values()],errors:[...l,...d()],roots:u}};var iNe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const aNe=e=>`mi-${e}-`,oNe=(e,t)=>O(Py(EO(e,t))),sNe=(e,t)=>rNe(PT().parse(e),t),cNe=e=>{var{content:t,variables:n}=e,r=iNe(e,[`content`,`variables`]);return sNe(oNe(t,n),r)},lNe=e=>e.split(/[\\/]/).filter(e=>e!==``),uNe=/* @__PURE__ */ new Set([`codeFenced`,`codeText`,`yaml`,`toml`]),dNe=[Fe([`yaml`,`toml`]),je(),{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}],fNe=e=>{let t=+!!e.startsWith(``),n=ft(ke({extensions:dNe}).document().write(ot()(e.slice(t),void 0,!0))),r=[];for(let[e,i]of n)e===`enter`&&uNe.has(i.type)&&r.push([i.start.offset+t,i.end.offset+t]);return r},pNe=/* @__PURE__ */ new Set(/* @__PURE__ */ `Info.Warning.Note.Tip.Check.Danger.Callout.AccordionGroup.Card.CardGroup.Tabs.CodeGroup.Column.Columns.CustomCode.CustomComponent.DynamicCustomComponent.Expandable.Frame.GitHub.Github.Icon.Latex.Mermaid.Panel.Popup.Prompt.RequestExample.ResponseExample.SnippetGroup.Steps.Tile.Tooltip.Tree.FileTree.Variation.Visibility.MDX.Badge.Color.ZoomImage`.split(`.`)),mNe=/* @__PURE__ */ new Set([`Heading`,`Step`,`Update`]),hNe=[`Example`,`Snippet`],gNe=e=>dt.includes(e)||hNe.includes(e),_Ne=e=>typeof e==`object`&&!!e&&!Array.isArray(e),vNe=e=>{let t;try{t=JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{packageNames:/* @__PURE__ */ new Set,error:`is not valid JSON: ${t}`}}if(!_Ne(t))return{packageNames:/* @__PURE__ */ new Set,error:`is not a JSON object`};let{dependencies:n}=t;return{packageNames:new Set(_Ne(n)?Object.keys(n):[])}},yNe=[`readme`,`license`,`contributing`,`contribute`],bNe=[`llms.txt`,`robots.txt`,`sitemap.xml`,`llms-full.txt`],xNe=[`package.json`,`package-lock.json`,`pnpm-lock.yaml`],SNe=e=>{let t=xh(e);return xNe.some(e=>e===t)},CNe=[`.jpeg`,`.jpg`,`.jfif`,`.pjpeg`,`.pjp`,`.png`,`.svg`,`.svgz`,`.ico`,`.webp`,`.gif`,`.apng`,`.avif`,`.bmp`,`.tiff`,`.tif`],wNe=[`.mp4`,`.webm`,`.ogg`,`.avi`,`.mov`,`.wmv`,`.flv`,`.mkv`,`.m4v`],TNe=[`.mp3`,`.wav`,`.flac`,`.aac`,`.ogg`,`.wma`,`.m4a`],ENe=[`.pdf`,`.txt`,`.doc`,`.docx`,`.xls`,`.xlsx`,`.ppt`,`.pptx`,`.rtf`,`.odt`,`.ods`,`.odp`],DNe=[`.csv`,`.tsv`,`.xml`],ONe=[`.woff`,`.woff2`,`.ttf`,`.eot`,`.otf`],kNe=[`.zip`,`.rar`,`.7z`,`.tar`,`.gz`,`.bz2`],ANe=[...CNe,...wNe,...TNe,...ENe,...DNe,...ONe,...kNe];[...ENe,...DNe,...kNe];const YO=(e,t)=>{let n=xh(e.toLowerCase()),r=Tt(n);if(r.base===`mint.json`)return`mintConfig`;if(r.base===`docs.json`)return`docsConfig`;if(r.base===`.mintignore`)return`mintIgnore`;let i=r.name,a=r.ext;if(bNe.includes(r.base))return`generatedStaticFile`;if(n===`skill.md`||n.startsWith(`.mintlify/skills/`)&&r.base===`skill.md`)return`skillFile`;if((n.startsWith(`_snippets/`)||n.startsWith(`snippets/`))&&kTe.some(e=>a===e)){if(n.startsWith(`_snippets/`))return`snippet`;if(n.startsWith(`snippets/`))return`snippet-v2`}else if(a===`.mdx`)return t?.importedFiles!=null&&tE(e,t.importedFiles)?`snippet-v2`:`page`;else if(a===`.md`)return yNe.includes(i)?null:t?.importedFiles!=null&&tE(e,t.importedFiles)?`snippet-v2`:`page`;else if(a===`.jsx`||a===`.tsx`)return`snippet-v2`;else if(a===`.yaml`||a===`.yml`)return`potentialYamlOpenApiSpec`;else if(a===`.json`)return`potentialJsonOpenApiSpec`;else if(a===`.css`)return`css`;else if(a===`.js`)return`js`;else if(ANe.includes(a))return`staticFile`;return null},jNe=/\bfrom\s*['"]([^'"\n]+)['"]|\bimport\s*['"]([^'"\n]+)['"]/g,MNe=(e,t)=>e<t?-1:+(e>t),NNe=e=>e instanceof Error?e.message:String(e),PNe=(e,t)=>{try{return FT(e,t)}catch(e){return NNe(e)}},FNe=/* @__PURE__ */ new Set([`ImportDeclaration`]),INe=/* @__PURE__ */ new Set([`ImportDeclaration`,`ExportNamedDeclaration`,`ExportAllDeclaration`]),LNe=(e,t=FNe)=>e.children.flatMap(e=>st(e)?(e.data?.estree?.body??[]).flatMap(n=>!t.has(n.type)||!(`source`in n)||typeof n.source?.value!=`string`?[]:[{source:n.source.value,line:n.loc?.start.line??e.position?.start.line}]):[]),RNe=(e,{packageNames:t,variables:n,normalizeImportSource:r=e=>e})=>{let i=(e,t)=>KT(r(e,t),t),a=(e,n)=>{let i=r(e,n);if(aE(i,t))return!0;let a=KT(i,n);return a!==null&&sE(a)},o=({path:e,content:t})=>[...EO(t,n).matchAll(jNe)].some(([,t,n])=>a(t??n??``,e)),s=[],c=[];for(let t of[...e].sort((e,t)=>MNe(e.path,t.path))){let e=PNe(EO(t.content,n),t.path);typeof e==`string`?c.push(Object.assign(Object.assign({},t),{message:e})):s.push(Object.assign(Object.assign({},t),{tree:e,imports:LNe(e)}))}let l=/* @__PURE__ */ new Set;for(let e of s)for(let t of GT(e.tree)){let n=i(t,e.path);n!==null&&l.add(n.toLowerCase())}let u=e=>{let t=YO(e,{importedFiles:l});return t===`page`?`page`:t===`snippet-v2`?`snippet`:t===`snippet`?`legacySnippet`:`other`},d={pages:[],snippets:[],unparsed:[],errors:[]};for(let e of c){let t=u(e.path);d.unparsed.push({path:e.path,content:e.content,category:t}),o(e)&&d.errors.push({file:e.path,message:e.message})}for(let e of s){let n=u(e.path);if(n===`legacySnippet`&&LNe(e.tree,INe).some(({source:t})=>a(t,e.path))&&d.errors.push({file:e.path,message:`uses npm package components, which don't work in files included with <Snippet>. Import it into the page instead.`}),n===`page`||n===`snippet`){(n===`page`?d.pages:d.snippets).push(e);for(let{source:n,line:i}of e.imports){let a=r(n,e.path);oE(a)&&!aE(a,t)&&d.errors.push(Object.assign(Object.assign({file:e.path},i!==void 0&&{line:i}),{message:`imports "${rE(a)??a}", which isn't listed in package.json dependencies.`}))}}}return d},zNe=e=>e.replace(/\.mdx?$/,``),BNe=({path:e,content:t,packageNames:n,packageSnippets:r,variables:i,resolvedTree:a})=>{let o={packageNames:n,packageSnippets:r,pagePath:zNe(e)},s;try{s=cNe(Object.assign(Object.assign({},o),{content:t,variables:i}))}catch(t){return{islands:[],ids:[],errors:[{file:e,message:`can't be parsed after resolving imports: ${NNe(t)}`}]}}let c=a&&s.errors.length>0&&!s.errors.some(e=>e.code)?rNe(a,o).errors.filter(e=>!e.code):[];return{islands:s.islands,ids:s.roots.map(e=>e.id),errors:(c.length>0?c:s.errors).map(({line:t,message:n})=>Object.assign(Object.assign({file:e},t!==void 0&&{line:t}),{message:n}))}},VNe=e=>{let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Map;for(let r of e)for(let e of r.islands)t.has(e.id)||t.set(e.id,e),n.set(e.id,(n.get(e.id)??/* @__PURE__ */ new Set).add(e.pagePath));return{islands:[...t.values()],islandPages:Object.fromEntries([...n].map(([e,t])=>[e,[...t].sort(MNe)]))}},HNe=e=>e.split(/(?=[A-Z])/).map(e=>e.toLowerCase()).map((e,t)=>t===0?e.charAt(0).toUpperCase()+e.slice(1):e).join(` `),UNe=(e,t)=>{let n=jce(e);if(n==null)return;let{channelId:r,filename:i}=n,a;for(let e of t){let t=e.spec,n=r&&t.allChannels().has(r),o=!i||i===e.filename||i===e.originalFileLocation;n&&o&&(a=e)}if(a==null)return;let o=r?a.spec.channels().get(r):void 0,s=o?.title()||HNe(r),c=o?.description()||o?.summary()||``;return{channelId:r,filename:a.filename,title:s,description:c}};function WNe(e,t){if(!t)return;let n=jce(t);if(n?.filename&&Ice(n.filename)){if(Th(n.filename))return`${n.filename} ${n.channelId}`;let t=Tt(e).dir;return`${bh(t,n.filename)} ${n.channelId}`}return t}var XO=/* @__PURE__ */ a(((e,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function o(e,t){for(var n=``,r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a})),ZO=/* @__PURE__ */ a(((e,t)=>{function n(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=(this.reason||`(unknown reason)`)+(this.mark?` `+this.mark.toString():``),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(/* @__PURE__ */ Error()).stack||``}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){var t=this.name+`: `;return t+=this.reason||`(unknown reason)`,!e&&this.mark&&(t+=` `+this.mark.toString()),t},t.exports=n})),GNe=/* @__PURE__ */ a(((e,t)=>{var n=XO();function r(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}r.prototype.getSnippet=function(e,t){var r,i,a,o,s;if(!this.buffer)return null;for(e||=4,t||=75,r=``,i=this.position;i>0&&`\0\r
583
+ `)?e:`${e}\n`}// placement ${t}\n`,nNe=e=>{let t=e.children.filter(e=>e.type!==`text`||e.value.trim()!==``);return t.length===1?t[0]:void 0},rNe=(e,t)=>{let n=bMe(e,t.pagePath),{bindings:r,undeclared:i,conflicts:a,sideEffects:o,order:s}=SMe(n,t),c=/* @__PURE__ */ new Map,l=[...a],u=[],d=()=>l.length>0||u.length>0?[]:[...o].map(([e,t])=>({line:t,code:`side-effect-import-without-island`,message:$Me.test(e)?`"${e}" is imported on a page without package components, so it never loads. Use a package component on this page or remove this import.`:`"${e}" is imported on a page without package components, so it never runs. Use a package component on this page or remove this import.`}));if(r.size===0&&i.size===0)return{islands:[],errors:[...l,...d()],roots:u};let f=CMe(n,t),p=LMe(n),m=(e,t)=>{for(let n of TMe(e,r)){let e=r.get(n.name),i=e?`"${e.source}"`:`a package`;l.push({line:n.line??t,message:n.jsx?`<${n.name}> (from ${i}) is used inside JavaScript. Package components can only be written as JSX directly in MDX. ${RO}`:`${n.name} (from ${i}) is used inside JavaScript. Package components can only be written as JSX directly in MDX. ${RO}`})}};for(let{statement:e,line:t}of n)e.type!==`ImportDeclaration`&&m(e,t);let h=zje(),g=/* @__PURE__ */ new WeakSet,_=/* @__PURE__ */ new Map,v=(e,n,a=n,d)=>{for(let y of e.children)if(y.type===`mdxJsxFlowElement`||y.type===`mdxJsxTextElement`){let g=y.name?wMe(y.name):void 0,b=g===void 0?void 0:r.get(g);if(y.name&&b){let p=e.type===`paragraph`&&nNe(e)===y?a:n;if(p){let e;e=p===`paragraph`?`<${y.name}> is inside a line of text. Package components render as a block, so put <${y.name}> on its own line.`:d?`<${y.name}> is inside <${d}>, which renders it inside a <${p}>. Package components render as a block, so move <${y.name}> out of <${d}>.`:`<${y.name}> is inside a <${p}>. Package components render as a block, so move <${y.name}> out of the <${p}>.`,l.push({line:MO(y),message:e});continue}let m=new XMe(y.name,t.pagePath,r,i,f,o,s,h),g=m.element(y);if(m.errors.length>0||!g){l.push(...m.errors);continue}let v=m.module(g),x=eNe(v),S=(_.get(x)??0)+1;_.set(x,S);let C=S===1?v:tNe(v,S),w=S===1?x:eNe(C);c.has(w)||c.set(w,{id:w,pagePath:t.pagePath,kind:b.kind===`snippet`?`snippet`:`inline`,imports:m.imports(),module:C}),u.push({id:w,name:y.name,node:y,parent:e,headings:m.headings});continue}if(y.name&&g!==void 0&&i.has(g)){l.push({line:MO(y),message:`<${y.name}> is imported from "${i.get(g)}", which isn't listed in package.json dependencies.`});continue}if(y.name&&JMe.has(y.name)){let e=y.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`id`);(e===void 0||typeof e.value==`string`)&&GO(h,Ue(y),typeof e?.value==`string`?e.value:void 0)}for(let e of y.attributes){let t;e.type===`mdxJsxExpressionAttribute`?t=e.data?.estree:typeof e.value==`object`&&(t=e.value?.data?.estree),t&&m(t,MO(y))}let x=RMe(y.name,n,p),S;x===n?S=d:y.name&&!NO(y.name)&&(S=y.name),v(y,x,x,S)}else if(y.type===`mdxFlowExpression`||y.type===`mdxTextExpression`)y.data?.estree&&m(y.data.estree,MO(y));else{if(y.type===`heading`&&vO.includes(y.depth)&&GO(h,Ue(y)),y.type===`list`&&!AMe(y))for(let e of y.children)g.add(e);if(y.type===`paragraph`){let t=!(e.type===`listItem`&&g.has(e));v(y,n===`p`||!t?n:`paragraph`,n,d)}else`children`in y&&v(y,n,n,d)}};return v(e,!1),{islands:[...c.values()],errors:[...l,...d()],roots:u}};var iNe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const aNe=e=>`mi-${e}-`,oNe=(e,t)=>O(Py(EO(e,t))),sNe=(e,t)=>rNe(PT().parse(e),t),cNe=e=>{var{content:t,variables:n}=e,r=iNe(e,[`content`,`variables`]);return sNe(oNe(t,n),r)},lNe=e=>e.split(/[\\/]/).filter(e=>e!==``),uNe=/* @__PURE__ */ new Set([`codeFenced`,`codeText`,`yaml`,`toml`]),dNe=[Fe([`yaml`,`toml`]),je(),{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}],fNe=e=>{let t=+!!e.startsWith(``),n=ft(ke({extensions:dNe}).document().write(ot()(e.slice(t),void 0,!0))),r=[];for(let[e,i]of n)e===`enter`&&uNe.has(i.type)&&r.push([i.start.offset+t,i.end.offset+t]);return r},pNe=/* @__PURE__ */ new Set(/* @__PURE__ */ `Info.Warning.Note.Tip.Check.Danger.Callout.AccordionGroup.Card.CardGroup.Tabs.CodeGroup.Column.Columns.CustomCode.CustomComponent.DynamicCustomComponent.Expandable.Frame.GitHub.Github.Icon.Latex.Mermaid.Panel.Popup.Prompt.Quote.RequestExample.ResponseExample.SnippetGroup.Steps.Tile.Tooltip.Tree.FileTree.Variation.Visibility.MDX.Badge.Color.ZoomImage`.split(`.`)),mNe=/* @__PURE__ */ new Set([`Heading`,`Step`,`Update`]),hNe=[`Example`,`Snippet`],gNe=e=>dt.includes(e)||hNe.includes(e),_Ne=e=>typeof e==`object`&&!!e&&!Array.isArray(e),vNe=e=>{let t;try{t=JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{packageNames:/* @__PURE__ */ new Set,error:`is not valid JSON: ${t}`}}if(!_Ne(t))return{packageNames:/* @__PURE__ */ new Set,error:`is not a JSON object`};let{dependencies:n}=t;return{packageNames:new Set(_Ne(n)?Object.keys(n):[])}},yNe=[`readme`,`license`,`contributing`,`contribute`],bNe=[`llms.txt`,`robots.txt`,`sitemap.xml`,`llms-full.txt`],xNe=[`package.json`,`package-lock.json`,`pnpm-lock.yaml`],SNe=e=>{let t=xh(e);return xNe.some(e=>e===t)},CNe=[`.jpeg`,`.jpg`,`.jfif`,`.pjpeg`,`.pjp`,`.png`,`.svg`,`.svgz`,`.ico`,`.webp`,`.gif`,`.apng`,`.avif`,`.bmp`,`.tiff`,`.tif`],wNe=[`.mp4`,`.webm`,`.ogg`,`.avi`,`.mov`,`.wmv`,`.flv`,`.mkv`,`.m4v`],TNe=[`.mp3`,`.wav`,`.flac`,`.aac`,`.ogg`,`.wma`,`.m4a`],ENe=[`.pdf`,`.txt`,`.doc`,`.docx`,`.xls`,`.xlsx`,`.ppt`,`.pptx`,`.rtf`,`.odt`,`.ods`,`.odp`],DNe=[`.csv`,`.tsv`,`.xml`],ONe=[`.woff`,`.woff2`,`.ttf`,`.eot`,`.otf`],kNe=[`.zip`,`.rar`,`.7z`,`.tar`,`.gz`,`.bz2`],ANe=[...CNe,...wNe,...TNe,...ENe,...DNe,...ONe,...kNe];[...ENe,...DNe,...kNe];const YO=(e,t)=>{let n=xh(e.toLowerCase()),r=Tt(n);if(r.base===`mint.json`)return`mintConfig`;if(r.base===`docs.json`)return`docsConfig`;if(r.base===`.mintignore`)return`mintIgnore`;let i=r.name,a=r.ext;if(bNe.includes(r.base))return`generatedStaticFile`;if(n===`skill.md`||n.startsWith(`.mintlify/skills/`)&&r.base===`skill.md`)return`skillFile`;if((n.startsWith(`_snippets/`)||n.startsWith(`snippets/`))&&kTe.some(e=>a===e)){if(n.startsWith(`_snippets/`))return`snippet`;if(n.startsWith(`snippets/`))return`snippet-v2`}else if(a===`.mdx`)return t?.importedFiles!=null&&tE(e,t.importedFiles)?`snippet-v2`:`page`;else if(a===`.md`)return yNe.includes(i)?null:t?.importedFiles!=null&&tE(e,t.importedFiles)?`snippet-v2`:`page`;else if(a===`.jsx`||a===`.tsx`)return`snippet-v2`;else if(a===`.yaml`||a===`.yml`)return`potentialYamlOpenApiSpec`;else if(a===`.json`)return`potentialJsonOpenApiSpec`;else if(a===`.css`)return`css`;else if(a===`.js`)return`js`;else if(ANe.includes(a))return`staticFile`;return null},jNe=/\bfrom\s*['"]([^'"\n]+)['"]|\bimport\s*['"]([^'"\n]+)['"]/g,MNe=(e,t)=>e<t?-1:+(e>t),NNe=e=>e instanceof Error?e.message:String(e),PNe=(e,t)=>{try{return FT(e,t)}catch(e){return NNe(e)}},FNe=/* @__PURE__ */ new Set([`ImportDeclaration`]),INe=/* @__PURE__ */ new Set([`ImportDeclaration`,`ExportNamedDeclaration`,`ExportAllDeclaration`]),LNe=(e,t=FNe)=>e.children.flatMap(e=>st(e)?(e.data?.estree?.body??[]).flatMap(n=>!t.has(n.type)||!(`source`in n)||typeof n.source?.value!=`string`?[]:[{source:n.source.value,line:n.loc?.start.line??e.position?.start.line}]):[]),RNe=(e,{packageNames:t,variables:n,normalizeImportSource:r=e=>e})=>{let i=(e,t)=>KT(r(e,t),t),a=(e,n)=>{let i=r(e,n);if(aE(i,t))return!0;let a=KT(i,n);return a!==null&&sE(a)},o=({path:e,content:t})=>[...EO(t,n).matchAll(jNe)].some(([,t,n])=>a(t??n??``,e)),s=[],c=[];for(let t of[...e].sort((e,t)=>MNe(e.path,t.path))){let e=PNe(EO(t.content,n),t.path);typeof e==`string`?c.push(Object.assign(Object.assign({},t),{message:e})):s.push(Object.assign(Object.assign({},t),{tree:e,imports:LNe(e)}))}let l=/* @__PURE__ */ new Set;for(let e of s)for(let t of GT(e.tree)){let n=i(t,e.path);n!==null&&l.add(n.toLowerCase())}let u=e=>{let t=YO(e,{importedFiles:l});return t===`page`?`page`:t===`snippet-v2`?`snippet`:t===`snippet`?`legacySnippet`:`other`},d={pages:[],snippets:[],unparsed:[],errors:[]};for(let e of c){let t=u(e.path);d.unparsed.push({path:e.path,content:e.content,category:t}),o(e)&&d.errors.push({file:e.path,message:e.message})}for(let e of s){let n=u(e.path);if(n===`legacySnippet`&&LNe(e.tree,INe).some(({source:t})=>a(t,e.path))&&d.errors.push({file:e.path,message:`uses npm package components, which don't work in files included with <Snippet>. Import it into the page instead.`}),n===`page`||n===`snippet`){(n===`page`?d.pages:d.snippets).push(e);for(let{source:n,line:i}of e.imports){let a=r(n,e.path);oE(a)&&!aE(a,t)&&d.errors.push(Object.assign(Object.assign({file:e.path},i!==void 0&&{line:i}),{message:`imports "${rE(a)??a}", which isn't listed in package.json dependencies.`}))}}}return d},zNe=e=>e.replace(/\.mdx?$/,``),BNe=({path:e,content:t,packageNames:n,packageSnippets:r,variables:i,resolvedTree:a})=>{let o={packageNames:n,packageSnippets:r,pagePath:zNe(e)},s;try{s=cNe(Object.assign(Object.assign({},o),{content:t,variables:i}))}catch(t){return{islands:[],ids:[],errors:[{file:e,message:`can't be parsed after resolving imports: ${NNe(t)}`}]}}let c=a&&s.errors.length>0&&!s.errors.some(e=>e.code)?rNe(a,o).errors.filter(e=>!e.code):[];return{islands:s.islands,ids:s.roots.map(e=>e.id),errors:(c.length>0?c:s.errors).map(({line:t,message:n})=>Object.assign(Object.assign({file:e},t!==void 0&&{line:t}),{message:n}))}},VNe=e=>{let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Map;for(let r of e)for(let e of r.islands)t.has(e.id)||t.set(e.id,e),n.set(e.id,(n.get(e.id)??/* @__PURE__ */ new Set).add(e.pagePath));return{islands:[...t.values()],islandPages:Object.fromEntries([...n].map(([e,t])=>[e,[...t].sort(MNe)]))}},HNe=e=>e.split(/(?=[A-Z])/).map(e=>e.toLowerCase()).map((e,t)=>t===0?e.charAt(0).toUpperCase()+e.slice(1):e).join(` `),UNe=(e,t)=>{let n=jce(e);if(n==null)return;let{channelId:r,filename:i}=n,a;for(let e of t){let t=e.spec,n=r&&t.allChannels().has(r),o=!i||i===e.filename||i===e.originalFileLocation;n&&o&&(a=e)}if(a==null)return;let o=r?a.spec.channels().get(r):void 0,s=o?.title()||HNe(r),c=o?.description()||o?.summary()||``;return{channelId:r,filename:a.filename,title:s,description:c}};function WNe(e,t){if(!t)return;let n=jce(t);if(n?.filename&&Ice(n.filename)){if(Th(n.filename))return`${n.filename} ${n.channelId}`;let t=Tt(e).dir;return`${bh(t,n.filename)} ${n.channelId}`}return t}var XO=/* @__PURE__ */ a(((e,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function o(e,t){for(var n=``,r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a})),ZO=/* @__PURE__ */ a(((e,t)=>{function n(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=(this.reason||`(unknown reason)`)+(this.mark?` `+this.mark.toString():``),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(/* @__PURE__ */ Error()).stack||``}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){var t=this.name+`: `;return t+=this.reason||`(unknown reason)`,!e&&this.mark&&(t+=` `+this.mark.toString()),t},t.exports=n})),GNe=/* @__PURE__ */ a(((e,t)=>{var n=XO();function r(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}r.prototype.getSnippet=function(e,t){var r,i,a,o,s;if(!this.buffer)return null;for(e||=4,t||=75,r=``,i=this.position;i>0&&`\0\r
584
584
  …\u2028\u2029`.indexOf(this.buffer.charAt(i-1))===-1;)if(--i,this.position-i>t/2-1){r=` ... `,i+=5;break}for(a=``,o=this.position;o<this.buffer.length&&`\0\r
585
585
  …\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>t/2-1){a=` ... `,o-=5;break}return s=this.buffer.slice(i,o),n.repeat(` `,e)+r+s+a+`
586
586
  `+n.repeat(` `,e+this.position-i+r.length)+`^`},r.prototype.toString=function(e){var t,n=``;return this.name&&(n+=`in "`+this.name+`" `),n+=`at line `+(this.line+1)+`, column `+(this.column+1),e||(t=this.getSnippet(),t&&(n+=`:
@@ -2235,7 +2235,7 @@ Next steps:`,`1. Clone the knowledge base into ./${i}:`,` git -c http.${r.remo
2235
2235
  Next steps:`,`1. Clone the hosted repository into a separate directory. Do not replace the user’s existing Git remote.`,`2. Copy the selected documentation into its root, including docs.json, .md/.mdx pages, images, and other required assets. Exclude credentials, .env files, node_modules, and .git.`,`3. Commit the documentation. For subsequent updates, fetch the hosted main branch and commit on top of it. Do not force-push.`,`4. Push to main. Supply the write token as an HTTP Authorization: Bearer header for this Git operation only; never embed it in the remote URL or persist it in Git config.`,`5. If the write token expires, run mint deploy again from the same documentation directory to obtain a fresh token.`,`A successful push starts the normal build. Provisioning and Git success do not confirm build success.`,``,`Git examples (POSIX shell): set REPOSITORY_URL and WRITE_TOKEN from the output above. Set CHECKOUT_DIR to a new directory outside the source documentation directory. Keep the token private and do not enable shell tracing.`,'GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.${REPOSITORY_URL}.extraHeader" GIT_CONFIG_VALUE_0="Authorization: Bearer ${WRITE_TOKEN}" git clone "$REPOSITORY_URL" "$CHECKOUT_DIR"',`After copying and committing the documentation:`,'GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.${REPOSITORY_URL}.extraHeader" GIT_CONFIG_VALUE_0="Authorization: Bearer ${WRITE_TOKEN}" git -C "$CHECKOUT_DIR" push origin HEAD:main',`These settings apply only to that Git process. Use the same authentication settings for later fetches.`,``,...t?[`Claim link for the user: ${t}`,`Show this link to the user. They open it, sign in, and click Confirm; the site moves into their account. Do not sign in on their behalf. There is no code to relay.`]:ZRt].join(`
2236
2236
  `):``}var F2=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const tzt=F({id:Me().int().positive(),full_name:Ke().regex(/^[\w.-]+\/[\w.-]+$/),default_branch:Ke().min(1)}),I2=Rt.join(`.github`,`workflows`,`mintlify.yml`);function L2(e,t,n){return new Promise((r,i)=>{Nr(e,t,{cwd:n},(e,t)=>e?i(e):r(String(t).trim()))})}function nzt(e){let t=e.trim().match(/^(?:https:\/\/(?:[^@/]+@)?github\.com\/|ssh:\/\/git@github\.com(?::\d+)?\/|git@github\.com:)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return t?.[1]&&t[2]?{owner:t[1],repo:t[2]}:null}function rzt(e,t,n=``){let r=/^[\w./-]+$/.test(n)?n:JSON.stringify(n);return[`name: Deploy to Mintlify`,`on:`,` push:`,` branches: [${JSON.stringify(e)}]`,...n?[` paths: [${JSON.stringify(`${n}/**`)}, ".github/workflows/mintlify.yml"]`]:[],`permissions:`,` id-token: write`,` contents: read`,`concurrency:`,` group: mintlify-deploy`,` cancel-in-progress: true`,`jobs:`,` deploy:`,` runs-on: ubuntu-latest`,` steps:`,` - uses: actions/checkout@v4`,` - run: npx mint@latest deploy --subdomain ${t}${n?` --directory ${r}`:``}`,``].join(`
2237
2237
  `)}function izt(e){return F2(this,void 0,void 0,function*(){return Wn.readFile(e,`utf8`).catch(e=>{if(e.code!==`ENOENT`)throw e})})}function azt(e,t){return F2(this,arguments,void 0,function*(e,t,n=!1){let r=Rt.join(e,I2),i=yield izt(r);if(i===t)return`unchanged`;if(i!==void 0&&!n)throw Error(`${I2} already exists with different contents. Pass --force to overwrite it.`);return yield Wn.mkdir(Rt.dirname(r),{recursive:!0}),yield Wn.writeFile(r,t),i===void 0?`created`:`updated`})}function ozt(e){return F2(this,void 0,void 0,function*(){try{return yield L2(`git`,[`rev-parse`,`--show-toplevel`],e)}catch{throw Error(`--github requires a Git repository. Run it inside your docs repository.`)}})}function szt(e){return F2(this,void 0,void 0,function*(){let t=yield L2(`git`,[`remote`,`get-url`,`origin`],e).catch(()=>{throw Error(`This repository has no origin remote. Add a github.com origin and retry.`)}),n=nzt(t);if(!n)throw Error(`The origin remote (${t}) is not a github.com repository.`);let r=yield L2(`gh`,[`api`,`repos/${n.owner}/${n.repo}`,`--jq`,`{id: .id, full_name: .full_name, default_branch: .default_branch}`],e).catch(e=>{throw e.code===`ENOENT`?Error("The GitHub CLI (gh) is required. Install it and run `gh auth login`."):Error(`Could not read ${n.owner}/${n.repo} with gh. Run \`gh auth login\` with access to the repository and retry.`)});try{return tzt.parse(JSON.parse(r))}catch{throw Error(`gh returned an unexpected repository response.`)}})}function czt(e,t){return F2(this,arguments,void 0,function*(e,t,n=()=>{}){let r=Rt.resolve(e.directory),i=yield ozt(r),[a,o]=yield Promise.all([Wn.realpath(i),Wn.realpath(r)]),s=Rt.relative(a,o).split(Rt.sep).join(`/`);if(!(yield izt(Rt.join(r,`docs.json`))))throw Error(`No docs.json in ${r}. Pass the docs folder with --directory.`);n(`Resolving the GitHub repository...`);let c=yield szt(i),l=yield zRt(e,t,n);if(l.status===`claimed`)throw Error(`This site has been claimed. Setting up GitHub deploys for claimed sites is not supported yet; connect the repository from the Mintlify dashboard.`);let u=l.credentials.accessToken;if(!u)throw Error(`Agent authentication did not return an access token.`);n(`Trusting ${c.full_name}@${c.default_branch} to deploy...`),yield LRt(e.apiUrl,u,{repositoryId:String(c.id),repository:c.full_name,branch:c.default_branch});let d=yield azt(i,rzt(c.default_branch,l.site.subdomain,s),e.force);return{siteUrl:M2(e.apiUrl,l.site.subdomain),subdomain:l.site.subdomain,repository:c.full_name,branch:c.default_branch,workflowPath:I2,workflow:d}})}function lzt(e){return[`Site: ${e.siteUrl}`,`Trusted repository: ${e.repository} (branch ${e.branch})`,`Workflow: ${e.workflowPath} (${e.workflow})`,``,`Next steps:`,`1. Commit and push ${e.workflowPath} to ${e.branch}.`,`2. Every push to ${e.branch} then deploys ${e.subdomain} through GitHub Actions. No secrets are stored in the repository.`,``,...ZRt].join(`
2238
- `)}var uzt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const dzt=[`bug`,`docs`,`idea`];function fzt(e){return uzt(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${C1}/api/cli/feedback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},e),{source:`cli`}))})}catch{return`could not reach the server`}return t.ok?void 0:`could not send feedback (HTTP ${t.status})`})}function pzt(e){return uzt(this,void 0,void 0,function*(){let t=yield fzt(e);return OH(t?(0,R.jsx)(bH,{message:t}):(0,R.jsx)(_H,{message:`feedback sent`})),!t})}var mzt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},R2=function(e){return this instanceof R2?(this.v=e,this):new R2(e)},hzt=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},gzt=function(e){var t={},n;return r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:R2(e[r](t)),done:!1}:i?i(t):t}:i}},_zt=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof R2?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function vzt(){return mzt(this,void 0,void 0,function*(){try{return CP(yield Wn.readFile(Rt.join(a1,`.gitignore`),`utf-8`))}catch{return[]}})}function yzt(e,t){return _zt(this,arguments,function*(){let n=yield R2(Wn.readdir(e,{withFileTypes:!0}));for(let r of n){let n=Rt.join(e,r.name);TP(Rt.relative(a1,n).split(Rt.sep).join(`/`),t,r.isDirectory())||(r.isDirectory()?yield R2(yield*gzt(hzt(yzt(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield R2(n)))}})}const bzt=()=>mzt(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:o}=yield import(`./converter-DOyxDrKr.js`),s=EP([...yield vzt(),...yield dF(a1)]),c=0,l=0,u=0;try{for(var d=!0,f=hzt(yzt(a1,s)),p;p=yield f.next(),e=p.done,!e;d=!0){r=p.value,d=!1;let e=r;c++;let t=Rt.relative(a1,e);try{let t=yield Wn.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:s}=i(n);e===0&&(r=Object.keys(s).length);let c=`${a(t,Object.assign({frontmatter:s},o))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield Wn.writeFile(e,n),l++)}catch(e){u++,OH((0,R.jsx)(bH,{message:`${t}: ${e instanceof Error?e.message:`unknown error`}`}))}}}catch(e){t={error:e}}finally{try{!d&&!e&&(n=f.return)&&(yield n.call(f))}finally{if(t)throw t.error}}OH((0,R.jsx)(_H,{message:`formatted ${l} of ${c} mdx file${c===1?``:`s`}${u>0?` (${u} failed)`:``}`})),yield d1(+(u>0))});var z2=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const B2=`mintlify`,V2=`templates`,H2=`main`;function U2(){return z2(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${B2}/${V2}/contents/?ref=${H2}`,{headers:{Accept:`application/vnd.github.v3+json`}});if(!e.ok)throw Error(`Failed to fetch templates: ${e.status} ${e.statusText}`);return(yield e.json()).filter(e=>e.type===`dir`).map(e=>e.name)})}function xzt(e){return z2(this,void 0,void 0,function*(){if(!e||e===`.`||e===`..`||e.includes(`/`))throw Error(`Invalid template name: "${e}".`);let t=`https://api.github.com/repos/${B2}/${V2}/contents/${encodeURIComponent(e)}?ref=${H2}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield U2().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${B2}/${V2}.${n}`)}if(!(yield n.json()).some(e=>e.name===`docs.json`))throw Error(`Template "${e}" is not a valid Mintlify template (missing docs.json).`);return e})}function Szt(){return z2(this,void 0,void 0,function*(){OH((0,R.jsx)(vH,{message:`fetching available templates...`}));let e;try{e=yield U2()}catch{throw NH(),Error(`Failed to fetch templates. Please check your network connection and try again.`)}if(NH(),e.length===0)throw Error(`No templates are currently available.`);return O0({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Czt(e,t,n,r){return z2(this,void 0,void 0,function*(){let i=vt.join(e,`__template__.zip`),a=vt.join(e,`__template_extract__`);try{OH((0,R.jsx)(vH,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${B2}/${V2}/archive/refs/heads/${H2}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield D$.default.writeFile(i,Buffer.from(t))}finally{NH()}OH((0,R.jsx)(vH,{message:`extracting template...`}));try{new YK.default(i).extractAllTo(a,!0)}finally{NH()}let n=vt.join(a,`${V2}-${H2}`),r=vt.join(n,t);if(!(yield D$.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield D$.default.copy(r,e,{overwrite:!0})}finally{yield D$.default.remove(i).catch(()=>{}),yield D$.default.remove(a).catch(()=>{})}let o=vt.join(e,`docs.json`);if(yield D$.default.pathExists(o)){let e=yield D$.default.readJson(o);n&&(e.name=n),r&&(e.theme=r),yield D$.default.writeJson(o,e,{spaces:2})}})}var W2=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const wzt=e=>{kH((0,R.jsx)(pH,{bold:!0,children:`Documentation Setup!`}),(0,R.jsx)(pH,{children:`To see your docs run`}),(0,R.jsxs)(fH,{children:[(0,R.jsx)(pH,{color:`blue`,children:`cd`}),(0,R.jsxs)(pH,{children:[` `,e]})]}),(0,R.jsx)(pH,{color:`blue`,children:`mint dev`})),p1()&&OH((0,R.jsxs)(pH,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},Tzt=(e,t,n,r)=>{let i=r===void 0?`Unable to fetch templates — use --template flag if you know the name`:r.length>0?`Templates: ${JSON.stringify(r)}`:`No templates are currently available`;kH((0,R.jsx)(pH,{children:`Agent Detected - sending AI friendly prompt`}),(0,R.jsx)(pH,{children:`<system-message>`}),(0,R.jsx)(pH,{children:"Help the user set up a Mintlify docs site with `mint new`. Ask each step one at a time unless the user asks you to skip questions or use your best judgment."}),(0,R.jsx)(pH,{children:[`- [ ] Pick a theme or clone a template? (${i})`,`- [ ] If template: which one? If theme: which one? (Themes: ${JSON.stringify(n)})`,`- [ ] Project name?`,`- [ ] Directory? (default: "${e}", auto-created if needed)${t?` ⚠️ "${e}" is occupied — subdirectory, overwrite (--force), or different path?`:``}`].join(`
2238
+ `)}var uzt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const dzt=[`bug`,`docs`,`idea`];function fzt(e){return uzt(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${C1}/api/cli/feedback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},e),{source:`cli`}))})}catch{return`could not reach the server`}return t.ok?void 0:`could not send feedback (HTTP ${t.status})`})}function pzt(e){return uzt(this,void 0,void 0,function*(){let t=yield fzt(e);return OH(t?(0,R.jsx)(bH,{message:t}):(0,R.jsx)(_H,{message:`feedback sent`})),!t})}var mzt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},R2=function(e){return this instanceof R2?(this.v=e,this):new R2(e)},hzt=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},gzt=function(e){var t={},n;return r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:R2(e[r](t)),done:!1}:i?i(t):t}:i}},_zt=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof R2?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function vzt(){return mzt(this,void 0,void 0,function*(){try{return CP(yield Wn.readFile(Rt.join(a1,`.gitignore`),`utf-8`))}catch{return[]}})}function yzt(e,t){return _zt(this,arguments,function*(){let n=yield R2(Wn.readdir(e,{withFileTypes:!0}));for(let r of n){let n=Rt.join(e,r.name);TP(Rt.relative(a1,n).split(Rt.sep).join(`/`),t,r.isDirectory())||(r.isDirectory()?yield R2(yield*gzt(hzt(yzt(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield R2(n)))}})}const bzt=()=>mzt(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:o}=yield import(`./converter-RT8ulMSN.js`),s=EP([...yield vzt(),...yield dF(a1)]),c=0,l=0,u=0;try{for(var d=!0,f=hzt(yzt(a1,s)),p;p=yield f.next(),e=p.done,!e;d=!0){r=p.value,d=!1;let e=r;c++;let t=Rt.relative(a1,e);try{let t=yield Wn.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:s}=i(n);e===0&&(r=Object.keys(s).length);let c=`${a(t,Object.assign({frontmatter:s},o))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield Wn.writeFile(e,n),l++)}catch(e){u++,OH((0,R.jsx)(bH,{message:`${t}: ${e instanceof Error?e.message:`unknown error`}`}))}}}catch(e){t={error:e}}finally{try{!d&&!e&&(n=f.return)&&(yield n.call(f))}finally{if(t)throw t.error}}OH((0,R.jsx)(_H,{message:`formatted ${l} of ${c} mdx file${c===1?``:`s`}${u>0?` (${u} failed)`:``}`})),yield d1(+(u>0))});var z2=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const B2=`mintlify`,V2=`templates`,H2=`main`;function U2(){return z2(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${B2}/${V2}/contents/?ref=${H2}`,{headers:{Accept:`application/vnd.github.v3+json`}});if(!e.ok)throw Error(`Failed to fetch templates: ${e.status} ${e.statusText}`);return(yield e.json()).filter(e=>e.type===`dir`).map(e=>e.name)})}function xzt(e){return z2(this,void 0,void 0,function*(){if(!e||e===`.`||e===`..`||e.includes(`/`))throw Error(`Invalid template name: "${e}".`);let t=`https://api.github.com/repos/${B2}/${V2}/contents/${encodeURIComponent(e)}?ref=${H2}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield U2().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${B2}/${V2}.${n}`)}if(!(yield n.json()).some(e=>e.name===`docs.json`))throw Error(`Template "${e}" is not a valid Mintlify template (missing docs.json).`);return e})}function Szt(){return z2(this,void 0,void 0,function*(){OH((0,R.jsx)(vH,{message:`fetching available templates...`}));let e;try{e=yield U2()}catch{throw NH(),Error(`Failed to fetch templates. Please check your network connection and try again.`)}if(NH(),e.length===0)throw Error(`No templates are currently available.`);return O0({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Czt(e,t,n,r){return z2(this,void 0,void 0,function*(){let i=vt.join(e,`__template__.zip`),a=vt.join(e,`__template_extract__`);try{OH((0,R.jsx)(vH,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${B2}/${V2}/archive/refs/heads/${H2}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield D$.default.writeFile(i,Buffer.from(t))}finally{NH()}OH((0,R.jsx)(vH,{message:`extracting template...`}));try{new YK.default(i).extractAllTo(a,!0)}finally{NH()}let n=vt.join(a,`${V2}-${H2}`),r=vt.join(n,t);if(!(yield D$.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield D$.default.copy(r,e,{overwrite:!0})}finally{yield D$.default.remove(i).catch(()=>{}),yield D$.default.remove(a).catch(()=>{})}let o=vt.join(e,`docs.json`);if(yield D$.default.pathExists(o)){let e=yield D$.default.readJson(o);n&&(e.name=n),r&&(e.theme=r),yield D$.default.writeJson(o,e,{spaces:2})}})}var W2=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const wzt=e=>{kH((0,R.jsx)(pH,{bold:!0,children:`Documentation Setup!`}),(0,R.jsx)(pH,{children:`To see your docs run`}),(0,R.jsxs)(fH,{children:[(0,R.jsx)(pH,{color:`blue`,children:`cd`}),(0,R.jsxs)(pH,{children:[` `,e]})]}),(0,R.jsx)(pH,{color:`blue`,children:`mint dev`})),p1()&&OH((0,R.jsxs)(pH,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},Tzt=(e,t,n,r)=>{let i=r===void 0?`Unable to fetch templates — use --template flag if you know the name`:r.length>0?`Templates: ${JSON.stringify(r)}`:`No templates are currently available`;kH((0,R.jsx)(pH,{children:`Agent Detected - sending AI friendly prompt`}),(0,R.jsx)(pH,{children:`<system-message>`}),(0,R.jsx)(pH,{children:"Help the user set up a Mintlify docs site with `mint new`. Ask each step one at a time unless the user asks you to skip questions or use your best judgment."}),(0,R.jsx)(pH,{children:[`- [ ] Pick a theme or clone a template? (${i})`,`- [ ] If template: which one? If theme: which one? (Themes: ${JSON.stringify(n)})`,`- [ ] Project name?`,`- [ ] Directory? (default: "${e}", auto-created if needed)${t?` ⚠️ "${e}" is occupied — subdirectory, overwrite (--force), or different path?`:``}`].join(`
2239
2239
  `)}),(0,R.jsx)(pH,{children:"Command: `mint new [dir] --theme [theme] --name [name]` or `mint new [dir] --template [template] --name [name]`. --theme optionally overrides a template default. --force overwrites non-empty dirs. Use AskQuestion to present choices."}),(0,R.jsx)(pH,{children:`</system-message>`}))};function G2(e,t,n){return W2(this,void 0,void 0,function*(){let r=yield U2().catch(()=>void 0);Tzt(e,t,n,r)})}function Ezt(e,t,n){return W2(this,void 0,void 0,function*(){if(!n)return e;if(p1())return t?e:void 0;let r=yield O0({message:`Directory ${e} is not empty. What would you like to do?`,choices:[{name:`Create in a subdirectory`,value:`subdir`},{name:`Overwrite current directory (may lose contents)`,value:`overwrite`},{name:`Cancel`,value:`cancel`}]});if(r!==`cancel`){if(r===`subdir`){let t=yield T0({message:`Subdirectory name:`,default:`docs`});if(!t||t.trim()===``)throw Error(`Subdirectory name cannot be empty`);let n=e===`.`?t:`${e}/${t}`;return mf(n,process.cwd()),n}return e}})}function Dzt(e,t){return W2(this,void 0,void 0,function*(){return t||T0({message:`Project Name`,default:e===`.`?`Mintlify`:e})})}function Ozt(){return W2(this,void 0,void 0,function*(){if((yield O0({message:`How would you like to set up your docs?`,choices:[{name:`Pick a theme`,value:`theme`},{name:`Clone a template`,value:`template`}]}))===`template`)return Szt()})}function kzt(e,t,n,r,i){return W2(this,void 0,void 0,function*(){mf(e);let a=wl.options.map(e=>e.shape.theme._def.value),o=(yield D$.default.readdir(e).catch(()=>[])).length>0;if(p1()&&(!r||!i&&!n)||p1()&&o&&!t){yield G2(e,o,a);return}let s=i?yield xzt(i).then(()=>i):!p1()&&!n?yield Ozt():void 0;if(s){let i=yield Ezt(e,t,o);if(i===void 0){p1()&&(yield G2(e,o,a));return}let c=yield Dzt(i,r);yield D$.default.ensureDir(i),yield Czt(i,s,c,n),wzt(i);return}let c=yield Ezt(e,t,o);if(c===void 0){p1()&&(yield G2(e,o,a));return}let l=r,u=n;!p1()&&(!u||!l)&&(l=yield Dzt(c,l),u||=yield O0({message:`Theme`,choices:a.map(e=>({name:e,value:e}))})),l===void 0||u===void 0?yield G2(c,o,a):(yield D$.default.ensureDir(c),yield Azt(c,l,u),wzt(c))})}const Azt=(e,t,n)=>W2(void 0,void 0,void 0,function*(){OH((0,R.jsx)(vH,{message:`downloading starter template...`}));let r=yield(yield fetch(`https://github.com/mintlify/starter/archive/refs/heads/main.zip`)).arrayBuffer();yield D$.default.writeFile(e+`/starter.zip`,Buffer.from(r)),NH(),OH((0,R.jsx)(vH,{message:`extracting...`})),new YK.default(e+`/starter.zip`).extractAllTo(e,!0),NH(),yield D$.default.copy(e+`/starter-main`,e,{overwrite:!0,filter:e=>!e.includes(`starter-main/starter-main`)}),yield D$.default.remove(e+`/starter.zip`),yield D$.default.remove(e+`/starter-main`);let i=e+`/docs.json`,a=yield D$.default.readJson(i);a.theme=n,a.name=t,yield D$.default.writeJson(i,a,{spaces:2})});var jzt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Mzt=[{name:`overview`,when:`Start here: how Mintlify works and facts agents most often get wrong`},{name:`new-site`,when:`New docs site, first publish, no account, claim a site, login, no docs.json yet`},{name:`write`,when:`Before creating a page or writing more than a sentence or two; changelogs`},{name:`write components`,when:`Adding or changing components: callouts, cards, steps, tabs, accordions, fields`},{name:`configure`,when:`Changing docs.json: theme, colors, logo, favicon, required fields`},{name:`configure navigation`,when:`Changing navigation: groups, tabs, anchors, dropdowns, products, versions, languages`},{name:`configure settings`,when:`navbar, footer, banner, SEO, search, integrations, contextual menu, redirects, 404`},{name:`configure customization`,when:`Themes, fonts, CSS, JavaScript, or React snippets`},{name:`api-docs`,when:`API documentation: OpenAPI, AsyncAPI, GraphQL, playground`},{name:`api-docs sdk`,when:`SDK reference pages, x-codeSamples, oneOf/anyOf, multiple responses, hiding endpoints`},{name:`publish`,when:`Deploying, "is it live", previews, rollbacks, MCP, llms.txt, skill.md, Markdown export`},{name:`publish domain`,when:`Custom domain (mint add-domain), /docs subpath, reverse proxy, CSP`},{name:`publish repo`,when:`Monorepo, multi-repo, GitHub/GitLab/Bitbucket, offline export, self-host`},{name:`publish analytics`,when:`mint analytics, feedback, search data, analytics integrations`},{name:`publish assistant`,when:`AI assistant, widget, Assistant.md, skills, narration, own model`},{name:`access`,when:`Private docs, reader login, user groups, personalization`},{name:`access team`,when:`Team members, roles, SSO, SCIM, audit logs, session security`},{name:`automate`,when:`Keep docs in sync with code: agent, Autopilot, automations, Slack, CI`},{name:`migrate`,when:`Moving docs from Docusaurus, GitBook, ReadMe, Fern, Document360, Confluence, Markdown`},{name:`troubleshoot`,when:`An error, a failed build or deploy, or the site looks wrong`}],Nzt=()=>{let e=Math.max(...Mzt.map(({name:e})=>e.length))+2;return[`Usage: mint instructions <topic> [subtopic]`,``,...Mzt.map(({name:t,when:n})=>` ${t.padEnd(e)}${n}`),``].join(`
2240
2240
  `)},Pzt=e=>`https://www.mintlify.com/docs/mint-instructions/${e.map(encodeURIComponent).join(`/`)}.md`,Fzt=e=>e.replace(/^(?:>.*\n|\s*\n)*/,``);function Izt(e){return jzt(this,void 0,void 0,function*(){let t=Pzt(e),n=yield fetch(t);if(n.status===404)throw Error(`no instructions for "${e.join(` `)}". Run \`mint instructions\` to list topics.`);if(!n.ok)throw Error(`failed to fetch ${t}: ${n.status} ${n.statusText}`);return Fzt(yield n.text())})}var Lzt=/* @__PURE__ */ r($gt(),1);typeof navigator>`u`||navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const K2=`ERR_INVALID_ARG_VALUE`;function q2(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}const Rzt=Symbol(),zzt=Symbol(),Bzt=Symbol(),Vzt=new TextEncoder,Hzt=new TextDecoder;function Uzt(e){return typeof e==`string`?Vzt.encode(e):Hzt.decode(e)}let J2;if(Uint8Array.prototype.toBase64)J2=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;J2=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join(``)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}}let Wzt;Wzt=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw q2(`The input to be decoded is not correctly encoded.`,K2,e)}}:e=>{try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw q2(`The input to be decoded is not correctly encoded.`,K2,e)}};function Gzt(e){return typeof e==`string`?Wzt(e):J2(e)}var Kzt=class extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,t?.code&&(this.code=t?.code),Error.captureStackTrace?.(this,this.constructor)}};function qzt(e,t,n){return new Kzt(e,{code:t,cause:n})}function Jzt(e,t,n,r){try{if(typeof e!=`string`)throw q2(`${t} must be a string`,`ERR_INVALID_ARG_TYPE`,r);if(e.length===0)throw q2(`${t} must not be empty`,K2,r)}catch(e){throw n?qzt(e.message,n,r):e}}function Y2(){return Gzt(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)))}function Yzt(){return Y2()}function Xzt(){return Y2()}function Zzt(){return Y2()}async function Qzt(e){return Jzt(e,`codeVerifier`),Gzt(await crypto.subtle.digest(`SHA-256`,Uzt(e)))}function $zt(e){return Jzt(e,`"clientSecret"`),(t,n,r,i)=>{r.set(`client_id`,n.client_id),r.set(`client_secret`,e)}}function eBt(){return(e,t,n,r)=>{n.set(`client_id`,t.client_id)}}URL.parse;const tBt=Symbol();typeof navigator>`u`||navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const X2=e=>Z2.get(e);let Z2,Q2;function nBt(e){return e===void 0?(Q2||=/* @__PURE__ */ new WeakMap,(e,t,n,r)=>{let i;return(i=Q2.get(t))||(rBt(t.client_secret,`"metadata.client_secret"`),i=$zt(t.client_secret),Q2.set(t,i)),i(e,t,n,r)}):$zt(e)}function rBt(e,t){if(typeof e!=`string`)throw $2(`${t} must be a string`,sBt);if(e.length===0)throw $2(`${t} must not be empty`,oBt)}function iBt(){return eBt()}const aBt=Bzt,oBt=`ERR_INVALID_ARG_VALUE`,sBt=`ERR_INVALID_ARG_TYPE`;function $2(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}function cBt(e){return Qzt(e)}function lBt(){return Yzt()}function uBt(){return Zzt()}function dBt(){return Xzt()}new TextDecoder;function fBt(e){return{supportsPKCE:{__proto__:null,value(t=`S256`){return e.code_challenge_methods_supported?.includes(t)===!0}}}}function pBt(e){Object.defineProperties(e,fBt(e))}const mBt=Symbol();Object.freeze(class{constructor(e,t,n,r){if(typeof t!=`string`||!t.length)throw $2(`"clientId" must be a non-empty string`,sBt);if(typeof n==`string`&&(n={client_secret:n}),n?.client_id!==void 0&&t!==n.client_id)throw $2(`"clientId" and "metadata.client_id" must be the same`,oBt);let i={...structuredClone(n),client_id:t};i[Rzt]=n?.[Rzt]??0,i[zzt]=n?.[zzt]??30;let a;a=r||(typeof i.client_secret==`string`&&i.client_secret.length?nBt(i.client_secret):iBt());let o=Object.freeze(i),s=structuredClone(e);mBt in e&&(s[tBt]=({claims:{tid:t}})=>e.issuer.replace(`{tenantid}`,t));let c=Object.freeze(s);Z2||=/* @__PURE__ */ new WeakMap,Z2.set(this,{__proto__:null,as:c,c:o,auth:a,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(X2(this).as);return pBt(e),e}clientMetadata(){return structuredClone(X2(this).c)}get timeout(){return X2(this).timeout}set timeout(e){X2(this).timeout=e}get[aBt](){return X2(this).fetch}set[aBt](e){X2(this).fetch=e}}.prototype);var hBt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function gBt(){return hBt(this,void 0,void 0,function*(){let{default:e}=yield import(`http`),t,n,r=!1,i=new Promise((e,r)=>{t=e,n=r}),a=e.createServer((e,n)=>{if(n.setHeader(`Access-Control-Allow-Origin`,w1),n.setHeader(`Access-Control-Allow-Methods`,`POST, OPTIONS`),n.setHeader(`Access-Control-Allow-Headers`,`Content-Type`),e.method===`OPTIONS`)n.writeHead(204),n.end();else if(e.method===`POST`){let i=``;e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let{code:e}=JSON.parse(i);n.writeHead(200,{"Content-Type":`application/json`}),n.end(JSON.stringify({ok:!0})),r=!0,a.close(),t(e)}catch{n.writeHead(400),n.end(JSON.stringify({error:`invalid body`}))}})}else n.writeHead(405),n.end()});return a.listen(11582,`localhost`),{codePromise:i,close:()=>{r||(r=!0,a.close(),n(/* @__PURE__ */ Error(`Login cancelled`)))}}})}var _Bt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function vBt(){return _Bt(this,void 0,void 0,function*(){let e=lBt(),t=yield cBt(e),n=uBt(),r=dBt(),i=Buffer.from(JSON.stringify({nonce:n,clientState:r})).toString(`base64url`),a=new URL(`/api/cli/oauth/authorize`,w1);a.searchParams.set(`state`,i),a.searchParams.set(`code_challenge`,t);let o=a.toString();mNt();let{codePromise:s,close:c}=yield gBt();OH((0,R.jsxs)(fH,{flexDirection:`column`,gap:1,paddingY:1,children:[(0,R.jsxs)(pH,{bold:!0,children:[(0,R.jsx)(pH,{color:`green`,children:`◆ `}),`A browser window will open for Mintlify authentication`]}),(0,R.jsxs)(fH,{flexDirection:`column`,paddingLeft:3,gap:1,children:[(0,R.jsx)(pH,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL:`}),(0,R.jsx)(pH,{dimColor:!0,children:o})]})]})),(0,Lzt.default)(o).catch(()=>{}),OH((0,R.jsxs)(fH,{flexDirection:`column`,paddingLeft:1,marginTop:1,children:[(0,R.jsx)(pH,{dimColor:!0,children:`╭─ Paste the authorization code from your browser`}),(0,R.jsx)(pH,{dimColor:!0,children:`│`})]})),yield new Promise(e=>setTimeout(e,50));let l=T0({message:`█`,theme:{prefix:eY.dim(` │`),style:{answer:e=>eY.cyan(e)}}}),u;try{u=yield Promise.race([s,l])}catch{c(),l.cancel(),OH((0,R.jsx)(bH,{message:`login cancelled`}));return}c(),l.cancel();let d=yield fetch(T1,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`authorization_code`,code:u,code_verifier:e})}),f=yield d.json().catch(()=>({}));if(!d.ok){let e=f.error_message??f.error??`unknown error`;gNt(e),OH((0,R.jsx)(bH,{message:`login failed: ${e}`}));return}let p=f;yield b1(p.access_token,p.refresh_token,E1(p.id_token)??null),hNt(),OH((0,R.jsx)(_H,{message:`logged in successfully`})),yield bBt(p.access_token)})}function yBt(e){return e instanceof Error&&e.name===`ExitPromptError`}function bBt(e){return _Bt(this,void 0,void 0,function*(){let t=yield R1(e);if(t.length===0)return;if(t.length===1){yield P1(`subdomain`,t[0]),OH((0,R.jsx)(gH,{message:`default project set to ${t[0]}`}));return}yield new Promise(e=>setTimeout(e,50));let n;try{n=yield TPt({message:`Select a default project`,source:e=>(e?t.filter(t=>t.toLowerCase().includes(e.toLowerCase())):t).map(e=>({name:e,value:e}))})}catch(e){if(yBt(e)){OH((0,R.jsx)(gH,{message:`No project set. To set a default project, run ${eY.bold(`mintlify config set subdomain <subdomain>`)}`}));return}throw e}yield P1(`subdomain`,n),OH((0,R.jsx)(gH,{message:`default project set to ${n}`}))})}var xBt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function SBt(){return xBt(this,void 0,void 0,function*(){yield fMt(),OH((0,R.jsx)(_H,{message:`logged out successfully`}))})}var CBt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const wBt=(e,t)=>{let n=[],r=()=>t=>(p(t,t=>{if(t.type===`image`){(!t.alt||t.alt.trim()===``)&&n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:`img`,tagName:`image (markdown)`});return}let r=t;if(r.name===`img`||r.name===`video`){let i=r.attributes.findIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`alt`),a=r.attributes[i];a&&typeof a.value==`string`&&a.value.trim()!==``||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:r.name,tagName:r.name})}else if(r.name===`a`){let i=e=>e.some(e=>e.type===`text`?e.value.trim()!==``:`children`in e&&Array.isArray(e.children)?i(e.children):!1);i(r.children)||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:`a`,tagName:`<a>`})}}),t);try{let e=t.replace(/^( {0,3}#{1,6}\s+.+?)\s*\{#[^}]+\}\s*$/gm,`$1`);PT().use(r).processSync(e)}catch(t){console.warn(`Warning: Could not parse ${e}: ${t}`)}return n},TBt=(...e)=>CBt(void 0,[...e],void 0,function*(e=process.cwd()){let t=yield dF(e),{contentFilenames:n}=yield hF(e,t),r=[];for(let t of n)r.push(vt.join(e,t));let i=[],a=/* @__PURE__ */ new Set;for(let e of r)try{let t=Yt.readFileSync(e,`utf-8`),n=wBt(e,t);n.length>0&&(i.push(...n),a.add(e))}catch(t){console.warn(`Warning: Could not read file ${e}: ${t}`)}return{missingAltAttributes:i,totalFiles:r.length,filesWithIssues:a.size}});var EBt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const DBt=()=>EBt(void 0,void 0,void 0,function*(){try{OH((0,R.jsx)(pH,{bold:!0,color:`cyan`,children:`Checking mdx files for accessibility issues...`}));let e=yield TBt();if(e.missingAltAttributes.length===0)return OH((0,R.jsx)(_H,{message:`no accessibility issues found`})),OH((0,R.jsxs)(pH,{children:[`Checked `,e.totalFiles,` MDX files - all images and videos have alt attributes.`]})),0;let t={};e.missingAltAttributes.forEach(e=>{var n;t[e.filePath]||(t[e.filePath]=[]),(n=t[e.filePath])==null||n.push(e)}),OH((0,R.jsxs)(pH,{bold:!0,color:`red`,children:[`Found `,e.missingAltAttributes.length,` accessibility issues in`,` `,e.filesWithIssues,` files:`]})),OH((0,R.jsx)(pH,{}));for(let[e,n]of Object.entries(t)){let t=vt.relative(process.cwd(),e);OH((0,R.jsxs)(pH,{bold:!0,children:[t,`:`]}));for(let e of n){let t=e.line&&e.column?` (line ${e.line}, col ${e.column})`:``;e.element===`a`?OH((0,R.jsxs)(pH,{children:[(0,R.jsx)(pH,{color:`red`,children:` ✗`}),` Missing text attribute `,(0,R.jsx)(pH,{bold:!0,children:e.tagName}),` `,`element`,t]})):OH((0,R.jsxs)(pH,{children:[(0,R.jsx)(pH,{color:`red`,children:` ✗`}),` Missing alt attribute on `,(0,R.jsx)(pH,{bold:!0,children:e.tagName}),` `,`element`,t]}))}OH((0,R.jsx)(pH,{}))}return OH((0,R.jsxs)(pH,{color:`yellow`,children:[(0,R.jsx)(pH,{bold:!0,children:`Recommendation:`}),` Add alt attributes to all images and videos for better accessibility.`]})),1}catch(e){return OH((0,R.jsx)(bH,{message:`MDX accessibility check failed: ${e instanceof Error?e.message:`Unknown error`}`})),1}});var OBt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const kBt=/* @__PURE__ */ new Set([`page`,`site`,`openapi`]),ABt=/* @__PURE__ */ new Set([`stats`,`search`,`feedback`,`conversation`]),jBt=/* @__PURE__ */ new Set([`set`,`get`,`clear`]),MBt=/* @__PURE__ */ new Set([`list`,`view`,`buckets`]),NBt=/* @__PURE__ */ new Set([`list`,`view`]);function PBt(e){let t=e.filter(e=>typeof e==`string`);if(t.length===0)return``;let n=t[0],r=t[1],i=t[2];if(n===`scrape`&&r!==void 0&&kBt.has(r))return`scrape ${r}`;if(n===`config`&&r!==void 0&&jBt.has(r))return`config ${r}`;if(n===`analytics`&&r!==void 0&&ABt.has(r)){if(r===`conversation`&&i!==void 0&&MBt.has(i)){let e=t[3];return i===`buckets`&&e!==void 0&&NBt.has(e)?`analytics conversation buckets ${e}`:`analytics conversation ${i}`}return`analytics ${r}`}return n}function FBt(){let e=!1;return function(t){return OBt(this,void 0,void 0,function*(){if(typeof t._[0]==`string`){if(e)return;e=!0;let n=PBt(t._),{cli:r}=s1();pNt({command:n,cliVersion:r,subdomain:N1(`subdomain`)})}})}}const IBt=qt(new URL(`../migrate`,import.meta.url)),e4=(...e)=>jn(Rt.join(IBt,...e),`utf8`),t4=e=>Mn(Rt.join(IBt,e)).filter(e=>e.endsWith(`.md`)).map(e=>e.slice(0,-3)).sort(),LBt=()=>[e4(`index.md`).trimEnd(),`Topics: ${t4(`topics`).join(`, `)}. Run \`mint migrate --topic <name>\`.`,`Sources: ${t4(`sources`).join(`, `)}. Run \`mint migrate --from <name>\`.`].join(`
2241
2241
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.1.56",
3
+ "version": "4.1.57",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -47,19 +47,19 @@
47
47
  "sharp": "0.33.5"
48
48
  },
49
49
  "optionalDependencies": {
50
- "@mintlify/package-builder": "0.0.173",
50
+ "@mintlify/package-builder": "0.0.174",
51
51
  "fsevents": "2.3.3",
52
52
  "keytar": "7.9.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@inquirer/prompts": "7.9.0",
56
- "@mintlify/common": "1.0.1384",
57
- "@mintlify/editor": "0.0.664",
58
- "@mintlify/link-rot": "3.0.1636",
56
+ "@mintlify/common": "1.0.1385",
57
+ "@mintlify/editor": "0.0.665",
58
+ "@mintlify/link-rot": "3.0.1637",
59
59
  "@mintlify/models": "0.0.401",
60
- "@mintlify/og": "0.0.183",
61
- "@mintlify/prebuild": "1.0.1564",
62
- "@mintlify/previewing": "4.0.1653",
60
+ "@mintlify/og": "0.0.184",
61
+ "@mintlify/prebuild": "1.0.1565",
62
+ "@mintlify/previewing": "4.0.1654",
63
63
  "@mintlify/ts-config": "2.0.2",
64
64
  "@mintlify/validation": "0.1.982",
65
65
  "@tsconfig/recommended": "1.0.2",
@@ -108,5 +108,5 @@
108
108
  "yargs": "17.7.1",
109
109
  "zod": "4.3.6"
110
110
  },
111
- "gitHead": "d0ca57746e30763ffcb0879a8d109a6aa50e1cb6"
111
+ "gitHead": "f2062e2894dfc71048797592214d2ef1d88c4147"
112
112
  }