@rizom/brain 0.2.0-alpha.97 → 0.2.0-alpha.99
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.
- package/dist/brain.js +747 -743
- package/dist/entities.d.ts +47 -0
- package/dist/entities.js +14 -14
- package/dist/entities.js.map +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/plugins.d.ts +47 -0
- package/dist/plugins.js +17 -17
- package/dist/plugins.js.map +3 -3
- package/dist/services.js +15 -15
- package/dist/services.js.map +3 -3
- package/dist/site.js +293 -293
- package/dist/site.js.map +12 -9
- package/package.json +1 -1
package/dist/plugins.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var JV=Object.create;var{getPrototypeOf:HV,defineProperty:A5,getOwnPropertyNames:UV}=Object;var DV=Object.prototype.hasOwnProperty;function RV($){return this[$]}var MV,QV,t4=($,G,X)=>{var Y=$!=null&&typeof $==="object";if(Y){var W=G?MV??=new WeakMap:QV??=new WeakMap,V=W.get($);if(V)return V}X=$!=null?JV(HV($)):{};let q=G||!$||!$.__esModule?A5(X,"default",{value:$,enumerable:!0}):X;for(let J of UV($))if(!DV.call(q,J))A5(q,J,{get:RV.bind($,J),enumerable:!0});if(Y)W.set($,q);return q};var f=($,G)=>()=>(G||$((G={exports:{}}).exports,G),G.exports);var KV=($)=>$;function FV($,G){this[$]=KV.bind(null,G)}var b8=($,G)=>{for(var X in G)A5($,X,{get:G[X],enumerable:!0,configurable:!0,set:FV.bind(G,X)})};var w0=import.meta.require;var M4=f((
|
|
2
|
+
var JV=Object.create;var{getPrototypeOf:HV,defineProperty:A5,getOwnPropertyNames:UV}=Object;var DV=Object.prototype.hasOwnProperty;function RV($){return this[$]}var MV,QV,t4=($,G,X)=>{var Y=$!=null&&typeof $==="object";if(Y){var W=G?MV??=new WeakMap:QV??=new WeakMap,V=W.get($);if(V)return V}X=$!=null?JV(HV($)):{};let q=G||!$||!$.__esModule?A5(X,"default",{value:$,enumerable:!0}):X;for(let J of UV($))if(!DV.call(q,J))A5(q,J,{get:RV.bind($,J),enumerable:!0});if(Y)W.set($,q);return q};var f=($,G)=>()=>(G||$((G={exports:{}}).exports,G),G.exports);var KV=($)=>$;function FV($,G){this[$]=KV.bind(null,G)}var b8=($,G)=>{for(var X in G)A5($,X,{get:G[X],enumerable:!0,configurable:!0,set:FV.bind(G,X)})};var w0=import.meta.require;var M4=f((GB,g8)=>{var OV=Object.prototype.toString;g8.exports=function(G){if(G===void 0)return"undefined";if(G===null)return"null";var X=typeof G;if(X==="boolean")return"boolean";if(X==="string")return"string";if(X==="number")return"number";if(X==="symbol")return"symbol";if(X==="function")return _V(G)?"generatorfunction":"function";if(PV(G))return"array";if(jV(G))return"buffer";if(EV(G))return"arguments";if(ZV(G))return"date";if(NV(G))return"error";if(zV(G))return"regexp";switch(v8(G)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(LV(G))return"generator";switch(X=OV.call(G),X){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return X.slice(8,-1).toLowerCase().replace(/\s/g,"")};function v8($){return typeof $.constructor==="function"?$.constructor.name:null}function PV($){if(Array.isArray)return Array.isArray($);return $ instanceof Array}function NV($){return $ instanceof Error||typeof $.message==="string"&&$.constructor&&typeof $.constructor.stackTraceLimit==="number"}function ZV($){if($ instanceof Date)return!0;return typeof $.toDateString==="function"&&typeof $.getDate==="function"&&typeof $.setDate==="function"}function zV($){if($ instanceof RegExp)return!0;return typeof $.flags==="string"&&typeof $.ignoreCase==="boolean"&&typeof $.multiline==="boolean"&&typeof $.global==="boolean"}function _V($,G){return v8($)==="GeneratorFunction"}function LV($){return typeof $.throw==="function"&&typeof $.return==="function"&&typeof $.next==="function"}function EV($){try{if(typeof $.length==="number"&&typeof $.callee==="function")return!0}catch(G){if(G.message.indexOf("callee")!==-1)return!0}return!1}function jV($){if($.constructor&&typeof $.constructor.isBuffer==="function")return $.constructor.isBuffer($);return!1}});var y8=f((XB,h8)=>{/*!
|
|
3
3
|
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2015, Jon Schlinkert.
|
|
6
6
|
* Licensed under the MIT License.
|
|
7
|
-
*/h8.exports=function(G){return typeof G<"u"&&G!==null&&(typeof G==="object"||typeof G==="function")}});var u8=f((
|
|
7
|
+
*/h8.exports=function(G){return typeof G<"u"&&G!==null&&(typeof G==="object"||typeof G==="function")}});var u8=f((YB,m8)=>{var f8=y8();m8.exports=function(G){if(!f8(G))G={};var X=arguments.length;for(var Y=1;Y<X;Y++){var W=arguments[Y];if(f8(W))TV(G,W)}return G};function TV($,G){for(var X in G)if(CV(G,X))$[X]=G[X]}function CV($,G){return Object.prototype.hasOwnProperty.call($,G)}});var r8=f((WB,l8)=>{var SV=M4(),IV=u8();l8.exports=function($,G){if(typeof G==="function")G={parse:G};var X=kV($),Y={section_delimiter:"---",parse:vV},W=IV({},Y,G),V=W.section_delimiter,q=X.content.split(/\r?\n/),J=null,H=p8(),D=[],R=[];function M(L){X.content=L,J=[],D=[]}function A(L){if(R.length)H.key=bV(R[0],V),H.content=L,W.parse(H,J),J.push(H),H=p8(),D=[],R=[]}for(var F=0;F<q.length;F++){var Z=q[F],z=R.length,E=Z.trim();if(xV(E,V)){if(E.length===3&&F!==0){if(z===0||z===2){D.push(Z);continue}R.push(E),H.data=D.join(`
|
|
8
8
|
`),D=[];continue}if(J===null)M(D.join(`
|
|
9
9
|
`));if(z===2)A(D.join(`
|
|
10
10
|
`));R.push(E);continue}D.push(Z)}if(J===null)M(D.join(`
|
|
11
11
|
`));else A(D.join(`
|
|
12
|
-
`));return X.sections=J,X};function xV($,G){if($.slice(0,G.length)!==G)return!1;if($.charAt(G.length+1)===G.slice(-1))return!1;return!0}function kV($){if(SV($)!=="object")$={content:$};if(typeof $.content!=="string"&&!gV($.content))throw TypeError("expected a buffer or string");return $.content=$.content.toString(),$.sections=[],$}function bV($,G){return $?$.slice(G.length).trim():""}function p8(){return{key:"",data:"",content:""}}function vV($){return $}function gV($){if($&&$.constructor&&typeof $.constructor.isBuffer==="function")return $.constructor.isBuffer($);return!1}});var n0=f((pV,i0)=>{function d8($){return typeof $>"u"||$===null}function hV($){return typeof $==="object"&&$!==null}function yV($){if(Array.isArray($))return $;else if(d8($))return[];return[$]}function fV($,G){var X,Y,W,V;if(G){V=Object.keys(G);for(X=0,Y=V.length;X<Y;X+=1)W=V[X],$[W]=G[W]}return $}function mV($,G){var X="",Y;for(Y=0;Y<G;Y+=1)X+=$;return X}function uV($){return $===0&&Number.NEGATIVE_INFINITY===1/$}pV.isNothing=d8;pV.isObject=hV;pV.toArray=yV;pV.repeat=mV;pV.isNegativeZero=uV;pV.extend=fV});var P2=f((
|
|
12
|
+
`));return X.sections=J,X};function xV($,G){if($.slice(0,G.length)!==G)return!1;if($.charAt(G.length+1)===G.slice(-1))return!1;return!0}function kV($){if(SV($)!=="object")$={content:$};if(typeof $.content!=="string"&&!gV($.content))throw TypeError("expected a buffer or string");return $.content=$.content.toString(),$.sections=[],$}function bV($,G){return $?$.slice(G.length).trim():""}function p8(){return{key:"",data:"",content:""}}function vV($){return $}function gV($){if($&&$.constructor&&typeof $.constructor.isBuffer==="function")return $.constructor.isBuffer($);return!1}});var n0=f((pV,i0)=>{function d8($){return typeof $>"u"||$===null}function hV($){return typeof $==="object"&&$!==null}function yV($){if(Array.isArray($))return $;else if(d8($))return[];return[$]}function fV($,G){var X,Y,W,V;if(G){V=Object.keys(G);for(X=0,Y=V.length;X<Y;X+=1)W=V[X],$[W]=G[W]}return $}function mV($,G){var X="",Y;for(Y=0;Y<G;Y+=1)X+=$;return X}function uV($){return $===0&&Number.NEGATIVE_INFINITY===1/$}pV.isNothing=d8;pV.isObject=hV;pV.toArray=yV;pV.repeat=mV;pV.isNegativeZero=uV;pV.extend=fV});var P2=f((VB,c8)=>{function Q4($,G){if(Error.call(this),this.name="YAMLException",this.reason=$,this.mark=G,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}Q4.prototype=Object.create(Error.prototype);Q4.prototype.constructor=Q4;Q4.prototype.toString=function(G){var X=this.name+": ";if(X+=this.reason||"(unknown reason)",!G&&this.mark)X+=" "+this.mark.toString();return X};c8.exports=Q4});var o8=f((qB,n8)=>{var i8=n0();function w5($,G,X,Y,W){this.name=$,this.buffer=G,this.position=X,this.line=Y,this.column=W}w5.prototype.getSnippet=function(G,X){var Y,W,V,q,J;if(!this.buffer)return null;G=G||4,X=X||75,Y="",W=this.position;while(W>0&&`\x00\r
|
|
13
13
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(W-1))===-1)if(W-=1,this.position-W>X/2-1){Y=" ... ",W+=5;break}V="",q=this.position;while(q<this.buffer.length&&`\x00\r
|
|
14
14
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(q))===-1)if(q+=1,q-this.position>X/2-1){V=" ... ",q-=5;break}return J=this.buffer.slice(W,q),i8.repeat(" ",G)+Y+J+V+`
|
|
15
15
|
`+i8.repeat(" ",G+this.position-W+Y.length)+"^"};w5.prototype.toString=function(G){var X,Y="";if(this.name)Y+='in "'+this.name+'" ';if(Y+="at line "+(this.line+1)+", column "+(this.column+1),!G){if(X=this.getSnippet(),X)Y+=`:
|
|
16
|
-
`+X}return Y};n8.exports=w5});var A1=f((
|
|
17
|
-
\r`;function hq($){if($===null)return!1;var G,X,Y=0,W=$.length,V=Z5;for(X=0;X<W;X++){if(G=V.indexOf($.charAt(X)),G>64)continue;if(G<0)return!1;Y+=6}return Y%8===0}function yq($){var G,X,Y=$.replace(/[\r\n=]/g,""),W=Y.length,V=Z5,q=0,J=[];for(G=0;G<W;G++){if(G%4===0&&G)J.push(q>>16&255),J.push(q>>8&255),J.push(q&255);q=q<<6|V.indexOf(Y.charAt(G))}if(X=W%4*6,X===0)J.push(q>>16&255),J.push(q>>8&255),J.push(q&255);else if(X===18)J.push(q>>10&255),J.push(q>>2&255);else if(X===12)J.push(q>>4&255);if(s0)return s0.from?s0.from(J):new s0(J);return J}function fq($){var G="",X=0,Y,W,V=$.length,q=Z5;for(Y=0;Y<V;Y++){if(Y%3===0&&Y)G+=q[X>>18&63],G+=q[X>>12&63],G+=q[X>>6&63],G+=q[X&63];X=(X<<8)+$[Y]}if(W=V%3,W===0)G+=q[X>>18&63],G+=q[X>>12&63],G+=q[X>>6&63],G+=q[X&63];else if(W===2)G+=q[X>>10&63],G+=q[X>>4&63],G+=q[X<<2&63],G+=q[64];else if(W===1)G+=q[X>>2&63],G+=q[X<<4&63],G+=q[64],G+=q[64];return G}function mq($){return s0&&s0.isBuffer($)}_7.exports=new gq("tag:yaml.org,2002:binary",{kind:"scalar",resolve:hq,construct:yq,predicate:mq,represent:fq})});var j7=f((
|
|
16
|
+
`+X}return Y};n8.exports=w5});var A1=f((JB,a8)=>{var s8=P2(),oV=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],sV=["scalar","sequence","mapping"];function aV($){var G={};if($!==null)Object.keys($).forEach(function(X){$[X].forEach(function(Y){G[String(Y)]=X})});return G}function tV($,G){if(G=G||{},Object.keys(G).forEach(function(X){if(oV.indexOf(X)===-1)throw new s8('Unknown option "'+X+'" is met in definition of "'+$+'" YAML type.')}),this.tag=$,this.kind=G.kind||null,this.resolve=G.resolve||function(){return!0},this.construct=G.construct||function(X){return X},this.instanceOf=G.instanceOf||null,this.predicate=G.predicate||null,this.represent=G.represent||null,this.defaultStyle=G.defaultStyle||null,this.styleAliases=aV(G.styleAliases||null),sV.indexOf(this.kind)===-1)throw new s8('Unknown kind "'+this.kind+'" is specified for "'+$+'" YAML type.')}a8.exports=tV});var o0=f((HB,e8)=>{var t8=n0(),e4=P2(),eV=A1();function B5($,G,X){var Y=[];return $.include.forEach(function(W){X=B5(W,G,X)}),$[G].forEach(function(W){X.forEach(function(V,q){if(V.tag===W.tag&&V.kind===W.kind)Y.push(q)}),X.push(W)}),X.filter(function(W,V){return Y.indexOf(V)===-1})}function $q(){var $={scalar:{},sequence:{},mapping:{},fallback:{}},G,X;function Y(W){$[W.kind][W.tag]=$.fallback[W.tag]=W}for(G=0,X=arguments.length;G<X;G+=1)arguments[G].forEach(Y);return $}function N2($){this.include=$.include||[],this.implicit=$.implicit||[],this.explicit=$.explicit||[],this.implicit.forEach(function(G){if(G.loadKind&&G.loadKind!=="scalar")throw new e4("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=B5(this,"implicit",[]),this.compiledExplicit=B5(this,"explicit",[]),this.compiledTypeMap=$q(this.compiledImplicit,this.compiledExplicit)}N2.DEFAULT=null;N2.create=function(){var G,X;switch(arguments.length){case 1:G=N2.DEFAULT,X=arguments[0];break;case 2:G=arguments[0],X=arguments[1];break;default:throw new e4("Wrong number of arguments for Schema.create function")}if(G=t8.toArray(G),X=t8.toArray(X),!G.every(function(Y){return Y instanceof N2}))throw new e4("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!X.every(function(Y){return Y instanceof eV}))throw new e4("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new N2({include:G,explicit:X})};e8.exports=N2});var G7=f((UB,$7)=>{var Gq=A1();$7.exports=new Gq("tag:yaml.org,2002:str",{kind:"scalar",construct:function($){return $!==null?$:""}})});var Y7=f((DB,X7)=>{var Xq=A1();X7.exports=new Xq("tag:yaml.org,2002:seq",{kind:"sequence",construct:function($){return $!==null?$:[]}})});var V7=f((RB,W7)=>{var Yq=A1();W7.exports=new Yq("tag:yaml.org,2002:map",{kind:"mapping",construct:function($){return $!==null?$:{}}})});var $6=f((MB,q7)=>{var Wq=o0();q7.exports=new Wq({explicit:[G7(),Y7(),V7()]})});var H7=f((QB,J7)=>{var Vq=A1();function qq($){if($===null)return!0;var G=$.length;return G===1&&$==="~"||G===4&&($==="null"||$==="Null"||$==="NULL")}function Jq(){return null}function Hq($){return $===null}J7.exports=new Vq("tag:yaml.org,2002:null",{kind:"scalar",resolve:qq,construct:Jq,predicate:Hq,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var D7=f((KB,U7)=>{var Uq=A1();function Dq($){if($===null)return!1;var G=$.length;return G===4&&($==="true"||$==="True"||$==="TRUE")||G===5&&($==="false"||$==="False"||$==="FALSE")}function Rq($){return $==="true"||$==="True"||$==="TRUE"}function Mq($){return Object.prototype.toString.call($)==="[object Boolean]"}U7.exports=new Uq("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Dq,construct:Rq,predicate:Mq,represent:{lowercase:function($){return $?"true":"false"},uppercase:function($){return $?"TRUE":"FALSE"},camelcase:function($){return $?"True":"False"}},defaultStyle:"lowercase"})});var M7=f((FB,R7)=>{var Qq=n0(),Kq=A1();function Fq($){return 48<=$&&$<=57||65<=$&&$<=70||97<=$&&$<=102}function Aq($){return 48<=$&&$<=55}function wq($){return 48<=$&&$<=57}function Bq($){if($===null)return!1;var G=$.length,X=0,Y=!1,W;if(!G)return!1;if(W=$[X],W==="-"||W==="+")W=$[++X];if(W==="0"){if(X+1===G)return!0;if(W=$[++X],W==="b"){X++;for(;X<G;X++){if(W=$[X],W==="_")continue;if(W!=="0"&&W!=="1")return!1;Y=!0}return Y&&W!=="_"}if(W==="x"){X++;for(;X<G;X++){if(W=$[X],W==="_")continue;if(!Fq($.charCodeAt(X)))return!1;Y=!0}return Y&&W!=="_"}for(;X<G;X++){if(W=$[X],W==="_")continue;if(!Aq($.charCodeAt(X)))return!1;Y=!0}return Y&&W!=="_"}if(W==="_")return!1;for(;X<G;X++){if(W=$[X],W==="_")continue;if(W===":")break;if(!wq($.charCodeAt(X)))return!1;Y=!0}if(!Y||W==="_")return!1;if(W!==":")return!0;return/^(:[0-5]?[0-9])+$/.test($.slice(X))}function Oq($){var G=$,X=1,Y,W,V=[];if(G.indexOf("_")!==-1)G=G.replace(/_/g,"");if(Y=G[0],Y==="-"||Y==="+"){if(Y==="-")X=-1;G=G.slice(1),Y=G[0]}if(G==="0")return 0;if(Y==="0"){if(G[1]==="b")return X*parseInt(G.slice(2),2);if(G[1]==="x")return X*parseInt(G,16);return X*parseInt(G,8)}if(G.indexOf(":")!==-1)return G.split(":").forEach(function(q){V.unshift(parseInt(q,10))}),G=0,W=1,V.forEach(function(q){G+=q*W,W*=60}),X*G;return X*parseInt(G,10)}function Pq($){return Object.prototype.toString.call($)==="[object Number]"&&($%1===0&&!Qq.isNegativeZero($))}R7.exports=new Kq("tag:yaml.org,2002:int",{kind:"scalar",resolve:Bq,construct:Oq,predicate:Pq,represent:{binary:function($){return $>=0?"0b"+$.toString(2):"-0b"+$.toString(2).slice(1)},octal:function($){return $>=0?"0"+$.toString(8):"-0"+$.toString(8).slice(1)},decimal:function($){return $.toString(10)},hexadecimal:function($){return $>=0?"0x"+$.toString(16).toUpperCase():"-0x"+$.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var F7=f((AB,K7)=>{var Q7=n0(),Nq=A1(),Zq=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function zq($){if($===null)return!1;if(!Zq.test($)||$[$.length-1]==="_")return!1;return!0}function _q($){var G,X,Y,W;if(G=$.replace(/_/g,"").toLowerCase(),X=G[0]==="-"?-1:1,W=[],"+-".indexOf(G[0])>=0)G=G.slice(1);if(G===".inf")return X===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(G===".nan")return NaN;else if(G.indexOf(":")>=0)return G.split(":").forEach(function(V){W.unshift(parseFloat(V,10))}),G=0,Y=1,W.forEach(function(V){G+=V*Y,Y*=60}),X*G;return X*parseFloat(G,10)}var Lq=/^[-+]?[0-9]+e/;function Eq($,G){var X;if(isNaN($))switch(G){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===$)switch(G){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===$)switch(G){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Q7.isNegativeZero($))return"-0.0";return X=$.toString(10),Lq.test(X)?X.replace("e",".e"):X}function jq($){return Object.prototype.toString.call($)==="[object Number]"&&($%1!==0||Q7.isNegativeZero($))}K7.exports=new Nq("tag:yaml.org,2002:float",{kind:"scalar",resolve:zq,construct:_q,predicate:jq,represent:Eq,defaultStyle:"lowercase"})});var O5=f((wB,A7)=>{var Tq=o0();A7.exports=new Tq({include:[$6()],implicit:[H7(),D7(),M7(),F7()]})});var P5=f((BB,w7)=>{var Cq=o0();w7.exports=new Cq({include:[O5()]})});var N7=f((OB,P7)=>{var Sq=A1(),B7=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),O7=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Iq($){if($===null)return!1;if(B7.exec($)!==null)return!0;if(O7.exec($)!==null)return!0;return!1}function xq($){var G,X,Y,W,V,q,J,H=0,D=null,R,M,A;if(G=B7.exec($),G===null)G=O7.exec($);if(G===null)throw Error("Date resolve error");if(X=+G[1],Y=+G[2]-1,W=+G[3],!G[4])return new Date(Date.UTC(X,Y,W));if(V=+G[4],q=+G[5],J=+G[6],G[7]){H=G[7].slice(0,3);while(H.length<3)H+="0";H=+H}if(G[9]){if(R=+G[10],M=+(G[11]||0),D=(R*60+M)*60000,G[9]==="-")D=-D}if(A=new Date(Date.UTC(X,Y,W,V,q,J,H)),D)A.setTime(A.getTime()-D);return A}function kq($){return $.toISOString()}P7.exports=new Sq("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Iq,construct:xq,instanceOf:Date,represent:kq})});var z7=f((PB,Z7)=>{var bq=A1();function vq($){return $==="<<"||$===null}Z7.exports=new bq("tag:yaml.org,2002:merge",{kind:"scalar",resolve:vq})});var L7=f((NB,_7)=>{var s0;try{N5=w0,s0=N5("buffer").Buffer}catch($){}var N5,gq=A1(),Z5=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
17
|
+
\r`;function hq($){if($===null)return!1;var G,X,Y=0,W=$.length,V=Z5;for(X=0;X<W;X++){if(G=V.indexOf($.charAt(X)),G>64)continue;if(G<0)return!1;Y+=6}return Y%8===0}function yq($){var G,X,Y=$.replace(/[\r\n=]/g,""),W=Y.length,V=Z5,q=0,J=[];for(G=0;G<W;G++){if(G%4===0&&G)J.push(q>>16&255),J.push(q>>8&255),J.push(q&255);q=q<<6|V.indexOf(Y.charAt(G))}if(X=W%4*6,X===0)J.push(q>>16&255),J.push(q>>8&255),J.push(q&255);else if(X===18)J.push(q>>10&255),J.push(q>>2&255);else if(X===12)J.push(q>>4&255);if(s0)return s0.from?s0.from(J):new s0(J);return J}function fq($){var G="",X=0,Y,W,V=$.length,q=Z5;for(Y=0;Y<V;Y++){if(Y%3===0&&Y)G+=q[X>>18&63],G+=q[X>>12&63],G+=q[X>>6&63],G+=q[X&63];X=(X<<8)+$[Y]}if(W=V%3,W===0)G+=q[X>>18&63],G+=q[X>>12&63],G+=q[X>>6&63],G+=q[X&63];else if(W===2)G+=q[X>>10&63],G+=q[X>>4&63],G+=q[X<<2&63],G+=q[64];else if(W===1)G+=q[X>>2&63],G+=q[X<<4&63],G+=q[64],G+=q[64];return G}function mq($){return s0&&s0.isBuffer($)}_7.exports=new gq("tag:yaml.org,2002:binary",{kind:"scalar",resolve:hq,construct:yq,predicate:mq,represent:fq})});var j7=f((zB,E7)=>{var uq=A1(),pq=Object.prototype.hasOwnProperty,lq=Object.prototype.toString;function rq($){if($===null)return!0;var G=[],X,Y,W,V,q,J=$;for(X=0,Y=J.length;X<Y;X+=1){if(W=J[X],q=!1,lq.call(W)!=="[object Object]")return!1;for(V in W)if(pq.call(W,V))if(!q)q=!0;else return!1;if(!q)return!1;if(G.indexOf(V)===-1)G.push(V);else return!1}return!0}function dq($){return $!==null?$:[]}E7.exports=new uq("tag:yaml.org,2002:omap",{kind:"sequence",resolve:rq,construct:dq})});var C7=f((_B,T7)=>{var cq=A1(),iq=Object.prototype.toString;function nq($){if($===null)return!0;var G,X,Y,W,V,q=$;V=Array(q.length);for(G=0,X=q.length;G<X;G+=1){if(Y=q[G],iq.call(Y)!=="[object Object]")return!1;if(W=Object.keys(Y),W.length!==1)return!1;V[G]=[W[0],Y[W[0]]]}return!0}function oq($){if($===null)return[];var G,X,Y,W,V,q=$;V=Array(q.length);for(G=0,X=q.length;G<X;G+=1)Y=q[G],W=Object.keys(Y),V[G]=[W[0],Y[W[0]]];return V}T7.exports=new cq("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:nq,construct:oq})});var I7=f((LB,S7)=>{var sq=A1(),aq=Object.prototype.hasOwnProperty;function tq($){if($===null)return!0;var G,X=$;for(G in X)if(aq.call(X,G)){if(X[G]!==null)return!1}return!0}function eq($){return $!==null?$:{}}S7.exports=new sq("tag:yaml.org,2002:set",{kind:"mapping",resolve:tq,construct:eq})});var Z2=f((EB,x7)=>{var $J=o0();x7.exports=new $J({include:[P5()],implicit:[N7(),z7()],explicit:[L7(),j7(),C7(),I7()]})});var b7=f((jB,k7)=>{var GJ=A1();function XJ(){return!0}function YJ(){return}function WJ(){return""}function VJ($){return typeof $>"u"}k7.exports=new GJ("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:XJ,construct:YJ,predicate:VJ,represent:WJ})});var g7=f((TB,v7)=>{var qJ=A1();function JJ($){if($===null)return!1;if($.length===0)return!1;var G=$,X=/\/([gim]*)$/.exec($),Y="";if(G[0]==="/"){if(X)Y=X[1];if(Y.length>3)return!1;if(G[G.length-Y.length-1]!=="/")return!1}return!0}function HJ($){var G=$,X=/\/([gim]*)$/.exec($),Y="";if(G[0]==="/"){if(X)Y=X[1];G=G.slice(1,G.length-Y.length-1)}return new RegExp(G,Y)}function UJ($){var G="/"+$.source+"/";if($.global)G+="g";if($.multiline)G+="m";if($.ignoreCase)G+="i";return G}function DJ($){return Object.prototype.toString.call($)==="[object RegExp]"}v7.exports=new qJ("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:JJ,construct:HJ,predicate:DJ,represent:UJ})});var y7=f((CB,h7)=>{var G6;try{z5=w0,G6=z5("esprima")}catch($){if(typeof window<"u")G6=window.esprima}var z5,RJ=A1();function MJ($){if($===null)return!1;try{var G="("+$+")",X=G6.parse(G,{range:!0});if(X.type!=="Program"||X.body.length!==1||X.body[0].type!=="ExpressionStatement"||X.body[0].expression.type!=="ArrowFunctionExpression"&&X.body[0].expression.type!=="FunctionExpression")return!1;return!0}catch(Y){return!1}}function QJ($){var G="("+$+")",X=G6.parse(G,{range:!0}),Y=[],W;if(X.type!=="Program"||X.body.length!==1||X.body[0].type!=="ExpressionStatement"||X.body[0].expression.type!=="ArrowFunctionExpression"&&X.body[0].expression.type!=="FunctionExpression")throw Error("Failed to resolve function");if(X.body[0].expression.params.forEach(function(V){Y.push(V.name)}),W=X.body[0].expression.body.range,X.body[0].expression.body.type==="BlockStatement")return Function(Y,G.slice(W[0]+1,W[1]-1));return Function(Y,"return "+G.slice(W[0],W[1]))}function KJ($){return $.toString()}function FJ($){return Object.prototype.toString.call($)==="[object Function]"}h7.exports=new RJ("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:MJ,construct:QJ,predicate:FJ,represent:KJ})});var K4=f((IB,m7)=>{var f7=o0();m7.exports=f7.DEFAULT=new f7({include:[Z2()],explicit:[b7(),g7(),y7()]})});var q$=f((fJ,F4)=>{var B0=n0(),i7=P2(),AJ=o8(),n7=Z2(),wJ=K4(),E0=Object.prototype.hasOwnProperty,X6=1,o7=2,s7=3,Y6=4,_5=1,BJ=2,u7=3,OJ=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PJ=/[\x85\u2028\u2029]/,NJ=/[,\[\]\{\}]/,a7=/^(?:!|!!|![a-z\-]+!)$/i,t7=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function p7($){return Object.prototype.toString.call($)}function V0($){return $===10||$===13}function a0($){return $===9||$===32}function h1($){return $===9||$===32||$===10||$===13}function z2($){return $===44||$===91||$===93||$===123||$===125}function ZJ($){var G;if(48<=$&&$<=57)return $-48;if(G=$|32,97<=G&&G<=102)return G-97+10;return-1}function zJ($){if($===120)return 2;if($===117)return 4;if($===85)return 8;return 0}function _J($){if(48<=$&&$<=57)return $-48;return-1}function l7($){return $===48?"\x00":$===97?"\x07":$===98?"\b":$===116?"\t":$===9?"\t":$===110?`
|
|
18
18
|
`:$===118?"\v":$===102?"\f":$===114?"\r":$===101?"\x1B":$===32?" ":$===34?'"':$===47?"/":$===92?"\\":$===78?"\x85":$===95?"\xA0":$===76?"\u2028":$===80?"\u2029":""}function LJ($){if($<=65535)return String.fromCharCode($);return String.fromCharCode(($-65536>>10)+55296,($-65536&1023)+56320)}function e7($,G,X){if(G==="__proto__")Object.defineProperty($,G,{configurable:!0,enumerable:!0,writable:!0,value:X});else $[G]=X}var $$=Array(256),G$=Array(256);for(_0=0;_0<256;_0++)$$[_0]=l7(_0)?1:0,G$[_0]=l7(_0);var _0;function EJ($,G){this.input=$,this.filename=G.filename||null,this.schema=G.schema||wJ,this.onWarning=G.onWarning||null,this.legacy=G.legacy||!1,this.json=G.json||!1,this.listener=G.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=$.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function X$($,G){return new i7(G,new AJ($.filename,$.input,$.position,$.line,$.position-$.lineStart))}function m($,G){throw X$($,G)}function W6($,G){if($.onWarning)$.onWarning.call(null,X$($,G))}var r7={YAML:function(G,X,Y){var W,V,q;if(G.version!==null)m(G,"duplication of %YAML directive");if(Y.length!==1)m(G,"YAML directive accepts exactly one argument");if(W=/^([0-9]+)\.([0-9]+)$/.exec(Y[0]),W===null)m(G,"ill-formed argument of the YAML directive");if(V=parseInt(W[1],10),q=parseInt(W[2],10),V!==1)m(G,"unacceptable YAML version of the document");if(G.version=Y[0],G.checkLineBreaks=q<2,q!==1&&q!==2)W6(G,"unsupported YAML version of the document")},TAG:function(G,X,Y){var W,V;if(Y.length!==2)m(G,"TAG directive accepts exactly two arguments");if(W=Y[0],V=Y[1],!a7.test(W))m(G,"ill-formed tag handle (first argument) of the TAG directive");if(E0.call(G.tagMap,W))m(G,'there is a previously declared suffix for "'+W+'" tag handle');if(!t7.test(V))m(G,"ill-formed tag prefix (second argument) of the TAG directive");G.tagMap[W]=V}};function L0($,G,X,Y){var W,V,q,J;if(G<X){if(J=$.input.slice(G,X),Y){for(W=0,V=J.length;W<V;W+=1)if(q=J.charCodeAt(W),!(q===9||32<=q&&q<=1114111))m($,"expected valid JSON character")}else if(OJ.test(J))m($,"the stream contains non-printable characters");$.result+=J}}function d7($,G,X,Y){var W,V,q,J;if(!B0.isObject(X))m($,"cannot merge mappings; the provided source object is unacceptable");W=Object.keys(X);for(q=0,J=W.length;q<J;q+=1)if(V=W[q],!E0.call(G,V))e7(G,V,X[V]),Y[V]=!0}function _2($,G,X,Y,W,V,q,J){var H,D;if(Array.isArray(W)){W=Array.prototype.slice.call(W);for(H=0,D=W.length;H<D;H+=1){if(Array.isArray(W[H]))m($,"nested arrays are not supported inside keys");if(typeof W==="object"&&p7(W[H])==="[object Object]")W[H]="[object Object]"}}if(typeof W==="object"&&p7(W)==="[object Object]")W="[object Object]";if(W=String(W),G===null)G={};if(Y==="tag:yaml.org,2002:merge")if(Array.isArray(V))for(H=0,D=V.length;H<D;H+=1)d7($,G,V[H],X);else d7($,G,V,X);else{if(!$.json&&!E0.call(X,W)&&E0.call(G,W))$.line=q||$.line,$.position=J||$.position,m($,"duplicated mapping key");e7(G,W,V),delete X[W]}return G}function L5($){var G=$.input.charCodeAt($.position);if(G===10)$.position++;else if(G===13){if($.position++,$.input.charCodeAt($.position)===10)$.position++}else m($,"a line break is expected");$.line+=1,$.lineStart=$.position}function D1($,G,X){var Y=0,W=$.input.charCodeAt($.position);while(W!==0){while(a0(W))W=$.input.charCodeAt(++$.position);if(G&&W===35)do W=$.input.charCodeAt(++$.position);while(W!==10&&W!==13&&W!==0);if(V0(W)){L5($),W=$.input.charCodeAt($.position),Y++,$.lineIndent=0;while(W===32)$.lineIndent++,W=$.input.charCodeAt(++$.position)}else break}if(X!==-1&&Y!==0&&$.lineIndent<X)W6($,"deficient indentation");return Y}function V6($){var G=$.position,X;if(X=$.input.charCodeAt(G),(X===45||X===46)&&X===$.input.charCodeAt(G+1)&&X===$.input.charCodeAt(G+2)){if(G+=3,X=$.input.charCodeAt(G),X===0||h1(X))return!0}return!1}function E5($,G){if(G===1)$.result+=" ";else if(G>1)$.result+=B0.repeat(`
|
|
19
19
|
`,G-1)}function jJ($,G,X){var Y,W,V,q,J,H,D,R,M=$.kind,A=$.result,F;if(F=$.input.charCodeAt($.position),h1(F)||z2(F)||F===35||F===38||F===42||F===33||F===124||F===62||F===39||F===34||F===37||F===64||F===96)return!1;if(F===63||F===45){if(W=$.input.charCodeAt($.position+1),h1(W)||X&&z2(W))return!1}$.kind="scalar",$.result="",V=q=$.position,J=!1;while(F!==0){if(F===58){if(W=$.input.charCodeAt($.position+1),h1(W)||X&&z2(W))break}else if(F===35){if(Y=$.input.charCodeAt($.position-1),h1(Y))break}else if($.position===$.lineStart&&V6($)||X&&z2(F))break;else if(V0(F))if(H=$.line,D=$.lineStart,R=$.lineIndent,D1($,!1,-1),$.lineIndent>=G){J=!0,F=$.input.charCodeAt($.position);continue}else{$.position=q,$.line=H,$.lineStart=D,$.lineIndent=R;break}if(J)L0($,V,q,!1),E5($,$.line-H),V=q=$.position,J=!1;if(!a0(F))q=$.position+1;F=$.input.charCodeAt(++$.position)}if(L0($,V,q,!1),$.result)return!0;return $.kind=M,$.result=A,!1}function TJ($,G){var X,Y,W;if(X=$.input.charCodeAt($.position),X!==39)return!1;$.kind="scalar",$.result="",$.position++,Y=W=$.position;while((X=$.input.charCodeAt($.position))!==0)if(X===39)if(L0($,Y,$.position,!0),X=$.input.charCodeAt(++$.position),X===39)Y=$.position,$.position++,W=$.position;else return!0;else if(V0(X))L0($,Y,W,!0),E5($,D1($,!1,G)),Y=W=$.position;else if($.position===$.lineStart&&V6($))m($,"unexpected end of the document within a single quoted scalar");else $.position++,W=$.position;m($,"unexpected end of the stream within a single quoted scalar")}function CJ($,G){var X,Y,W,V,q,J;if(J=$.input.charCodeAt($.position),J!==34)return!1;$.kind="scalar",$.result="",$.position++,X=Y=$.position;while((J=$.input.charCodeAt($.position))!==0)if(J===34)return L0($,X,$.position,!0),$.position++,!0;else if(J===92){if(L0($,X,$.position,!0),J=$.input.charCodeAt(++$.position),V0(J))D1($,!1,G);else if(J<256&&$$[J])$.result+=G$[J],$.position++;else if((q=zJ(J))>0){W=q,V=0;for(;W>0;W--)if(J=$.input.charCodeAt(++$.position),(q=ZJ(J))>=0)V=(V<<4)+q;else m($,"expected hexadecimal character");$.result+=LJ(V),$.position++}else m($,"unknown escape sequence");X=Y=$.position}else if(V0(J))L0($,X,Y,!0),E5($,D1($,!1,G)),X=Y=$.position;else if($.position===$.lineStart&&V6($))m($,"unexpected end of the document within a double quoted scalar");else $.position++,Y=$.position;m($,"unexpected end of the stream within a double quoted scalar")}function SJ($,G){var X=!0,Y,W=$.tag,V,q=$.anchor,J,H,D,R,M,A={},F,Z,z,E;if(E=$.input.charCodeAt($.position),E===91)H=93,M=!1,V=[];else if(E===123)H=125,M=!0,V={};else return!1;if($.anchor!==null)$.anchorMap[$.anchor]=V;E=$.input.charCodeAt(++$.position);while(E!==0){if(D1($,!0,G),E=$.input.charCodeAt($.position),E===H)return $.position++,$.tag=W,$.anchor=q,$.kind=M?"mapping":"sequence",$.result=V,!0;else if(!X)m($,"missed comma between flow collection entries");if(Z=F=z=null,D=R=!1,E===63){if(J=$.input.charCodeAt($.position+1),h1(J))D=R=!0,$.position++,D1($,!0,G)}if(Y=$.line,L2($,G,X6,!1,!0),Z=$.tag,F=$.result,D1($,!0,G),E=$.input.charCodeAt($.position),(R||$.line===Y)&&E===58)D=!0,E=$.input.charCodeAt(++$.position),D1($,!0,G),L2($,G,X6,!1,!0),z=$.result;if(M)_2($,V,A,Z,F,z);else if(D)V.push(_2($,null,A,Z,F,z));else V.push(F);if(D1($,!0,G),E=$.input.charCodeAt($.position),E===44)X=!0,E=$.input.charCodeAt(++$.position);else X=!1}m($,"unexpected end of the stream within a flow collection")}function IJ($,G){var X,Y,W=_5,V=!1,q=!1,J=G,H=0,D=!1,R,M;if(M=$.input.charCodeAt($.position),M===124)Y=!1;else if(M===62)Y=!0;else return!1;$.kind="scalar",$.result="";while(M!==0)if(M=$.input.charCodeAt(++$.position),M===43||M===45)if(_5===W)W=M===43?u7:BJ;else m($,"repeat of a chomping mode identifier");else if((R=_J(M))>=0)if(R===0)m($,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!q)J=G+R-1,q=!0;else m($,"repeat of an indentation width identifier");else break;if(a0(M)){do M=$.input.charCodeAt(++$.position);while(a0(M));if(M===35)do M=$.input.charCodeAt(++$.position);while(!V0(M)&&M!==0)}while(M!==0){L5($),$.lineIndent=0,M=$.input.charCodeAt($.position);while((!q||$.lineIndent<J)&&M===32)$.lineIndent++,M=$.input.charCodeAt(++$.position);if(!q&&$.lineIndent>J)J=$.lineIndent;if(V0(M)){H++;continue}if($.lineIndent<J){if(W===u7)$.result+=B0.repeat(`
|
|
20
20
|
`,V?1+H:H);else if(W===_5){if(V)$.result+=`
|
|
@@ -38,22 +38,22 @@ var JV=Object.create;var{getPrototypeOf:HV,defineProperty:A5,getOwnPropertyNames
|
|
|
38
38
|
`+$.slice(W,V),W=V+1;q=J}if(H+=`
|
|
39
39
|
`,$.length-W>G&&q>W)H+=$.slice(W,q)+`
|
|
40
40
|
`+$.slice(q+1);else H+=$.slice(W);return H.slice(1)}function wH($){var G="",X,Y,W;for(var V=0;V<$.length;V++){if(X=$.charCodeAt(V),X>=55296&&X<=56319){if(Y=$.charCodeAt(V+1),Y>=56320&&Y<=57343){G+=J$((X-55296)*1024+Y-56320+65536),V++;continue}}W=L1[X],G+=!W&&E2(X)?$[V]:W||J$(X)}return G}function BH($,G,X){var Y="",W=$.tag,V,q;for(V=0,q=X.length;V<q;V+=1)if(t0($,G,X[V],!1,!1)){if(V!==0)Y+=","+(!$.condenseFlow?" ":"");Y+=$.dump}$.tag=W,$.dump="["+Y+"]"}function OH($,G,X,Y){var W="",V=$.tag,q,J;for(q=0,J=X.length;q<J;q+=1)if(t0($,G+1,X[q],!0,!0)){if(!Y||q!==0)W+=j5($,G);if($.dump&&A4===$.dump.charCodeAt(0))W+="-";else W+="- ";W+=$.dump}$.tag=V,$.dump=W||"[]"}function PH($,G,X){var Y="",W=$.tag,V=Object.keys(X),q,J,H,D,R;for(q=0,J=V.length;q<J;q+=1){if(R="",q!==0)R+=", ";if($.condenseFlow)R+='"';if(H=V[q],D=X[H],!t0($,G,H,!1,!1))continue;if($.dump.length>1024)R+="? ";if(R+=$.dump+($.condenseFlow?'"':"")+":"+($.condenseFlow?"":" "),!t0($,G,D,!1,!1))continue;R+=$.dump,Y+=R}$.tag=W,$.dump="{"+Y+"}"}function NH($,G,X,Y){var W="",V=$.tag,q=Object.keys(X),J,H,D,R,M,A;if($.sortKeys===!0)q.sort();else if(typeof $.sortKeys==="function")q.sort($.sortKeys);else if($.sortKeys)throw new B4("sortKeys must be a boolean or a function");for(J=0,H=q.length;J<H;J+=1){if(A="",!Y||J!==0)A+=j5($,G);if(D=q[J],R=X[D],!t0($,G+1,D,!0,!0,!0))continue;if(M=$.tag!==null&&$.tag!=="?"||$.dump&&$.dump.length>1024,M)if($.dump&&A4===$.dump.charCodeAt(0))A+="?";else A+="? ";if(A+=$.dump,M)A+=j5($,G);if(!t0($,G+1,R,!0,M))continue;if($.dump&&A4===$.dump.charCodeAt(0))A+=":";else A+=": ";A+=$.dump,W+=A}$.tag=V,$.dump=W||"{}"}function Q$($,G,X){var Y,W,V,q,J,H;W=X?$.explicitTypes:$.implicitTypes;for(V=0,q=W.length;V<q;V+=1)if(J=W[V],(J.instanceOf||J.predicate)&&(!J.instanceOf||typeof G==="object"&&G instanceof J.instanceOf)&&(!J.predicate||J.predicate(G))){if($.tag=X?J.tag:"?",J.represent){if(H=$.styleMap[J.tag]||J.defaultStyle,K$.call(J.represent)==="[object Function]")Y=J.represent(G,H);else if(F$.call(J.represent,H))Y=J.represent[H](G,H);else throw new B4("!<"+J.tag+'> tag resolver accepts not "'+H+'" style');$.dump=Y}return!0}return!1}function t0($,G,X,Y,W,V){if($.tag=null,$.dump=X,!Q$($,X,!1))Q$($,X,!0);var q=K$.call($.dump);if(Y)Y=$.flowLevel<0||$.flowLevel>G;var J=q==="[object Object]"||q==="[object Array]",H,D;if(J)H=$.duplicates.indexOf(X),D=H!==-1;if($.tag!==null&&$.tag!=="?"||D||$.indent!==2&&G>0)W=!1;if(D&&$.usedDuplicates[H])$.dump="*ref_"+H;else{if(J&&D&&!$.usedDuplicates[H])$.usedDuplicates[H]=!0;if(q==="[object Object]"){if(Y&&Object.keys($.dump).length!==0){if(NH($,G,$.dump,W),D)$.dump="&ref_"+H+$.dump}else if(PH($,G,$.dump),D)$.dump="&ref_"+H+" "+$.dump}else if(q==="[object Array]"){var R=$.noArrayIndent&&G>0?G-1:G;if(Y&&$.dump.length!==0){if(OH($,R,$.dump,W),D)$.dump="&ref_"+H+$.dump}else if(BH($,R,$.dump),D)$.dump="&ref_"+H+" "+$.dump}else if(q==="[object String]"){if($.tag!=="?")FH($,$.dump,G,V)}else{if($.skipInvalid)return!1;throw new B4("unacceptable kind of an object to dump "+q)}if($.tag!==null&&$.tag!=="?")$.dump="!<"+$.tag+"> "+$.dump}return!0}function ZH($,G){var X=[],Y=[],W,V;T5($,X,Y);for(W=0,V=Y.length;W<V;W+=1)G.duplicates.push(X[Y[W]]);G.usedDuplicates=Array(V)}function T5($,G,X){var Y,W,V;if($!==null&&typeof $==="object")if(W=G.indexOf($),W!==-1){if(X.indexOf(W)===-1)X.push(W)}else if(G.push($),Array.isArray($))for(W=0,V=$.length;W<V;W+=1)T5($[W],G,X);else{Y=Object.keys($);for(W=0,V=Y.length;W<V;W+=1)T5($[Y[W]],G,X)}}function T$($,G){G=G||{};var X=new DH(G);if(!X.noRefs)ZH($,X);if(t0(X,0,$,!0,!0))return X.dump+`
|
|
41
|
-
`;return""}function zH($,G){return T$($,w4.extend({schema:dJ},G))}_H.dump=T$;_H.safeDump=zH});var I$=f((jH,H1)=>{var J6=q$(),S$=C$();function H6($){return function(){throw Error("Function "+$+" is deprecated and cannot be used.")}}jH.Type=A1();jH.Schema=o0();jH.FAILSAFE_SCHEMA=$6();jH.JSON_SCHEMA=O5();jH.CORE_SCHEMA=P5();jH.DEFAULT_SAFE_SCHEMA=Z2();jH.DEFAULT_FULL_SCHEMA=K4();jH.load=J6.load;jH.loadAll=J6.loadAll;jH.safeLoad=J6.safeLoad;jH.safeLoadAll=J6.safeLoadAll;jH.dump=S$.dump;jH.safeDump=S$.safeDump;jH.YAMLException=P2();jH.MINIMAL_SCHEMA=$6();jH.SAFE_SCHEMA=Z2();jH.DEFAULT_SCHEMA=K4();jH.scan=H6("scan");jH.parse=H6("parse");jH.compose=H6("compose");jH.addConstructor=H6("addConstructor")});var k$=f((
|
|
41
|
+
`;return""}function zH($,G){return T$($,w4.extend({schema:dJ},G))}_H.dump=T$;_H.safeDump=zH});var I$=f((jH,H1)=>{var J6=q$(),S$=C$();function H6($){return function(){throw Error("Function "+$+" is deprecated and cannot be used.")}}jH.Type=A1();jH.Schema=o0();jH.FAILSAFE_SCHEMA=$6();jH.JSON_SCHEMA=O5();jH.CORE_SCHEMA=P5();jH.DEFAULT_SAFE_SCHEMA=Z2();jH.DEFAULT_FULL_SCHEMA=K4();jH.load=J6.load;jH.loadAll=J6.loadAll;jH.safeLoad=J6.safeLoad;jH.safeLoadAll=J6.safeLoadAll;jH.dump=S$.dump;jH.safeDump=S$.safeDump;jH.YAMLException=P2();jH.MINIMAL_SCHEMA=$6();jH.SAFE_SCHEMA=Z2();jH.DEFAULT_SCHEMA=K4();jH.scan=H6("scan");jH.parse=H6("parse");jH.compose=H6("compose");jH.addConstructor=H6("addConstructor")});var k$=f((xB,x$)=>{var oH=I$();x$.exports=oH});var b5=f((x5,k5)=>{var U6=k$(),I5=x5=k5.exports;I5.yaml={parse:U6.safeLoad.bind(U6),stringify:U6.safeDump.bind(U6)};I5.json={parse:JSON.parse.bind(JSON),stringify:function($,G){let X=Object.assign({replacer:null,space:2},G);return JSON.stringify($,X.replacer,X.space)}};I5.javascript={parse:function parse(str,options,wrap){try{if(wrap!==!1)str=`(function() {
|
|
42
42
|
return `+str.trim()+`;
|
|
43
|
-
}());`;return eval(str)||{}}catch($){if(wrap!==!1&&/(unexpected|identifier)/i.test($.message))return parse(str,options,!1);throw SyntaxError($)}},stringify:function(){throw Error("stringifying JavaScript is not supported")}}});var v$=f((
|
|
43
|
+
}());`;return eval(str)||{}}catch($){if(wrap!==!1&&/(unexpected|identifier)/i.test($.message))return parse(str,options,!1);throw SyntaxError($)}},stringify:function(){throw Error("stringifying JavaScript is not supported")}}});var v$=f((kB,b$)=>{/*!
|
|
44
44
|
* strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
|
|
45
45
|
*
|
|
46
46
|
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
|
47
47
|
* Released under the MIT License.
|
|
48
|
-
*/b$.exports=function($){if(typeof $==="string"&&$.charAt(0)==="\uFEFF")return $.slice(1);return $}});var D6=f((sH)=>{var g$=v$(),h$=M4();sH.define=function($,G,X){Reflect.defineProperty($,G,{enumerable:!1,configurable:!0,writable:!0,value:X})};sH.isBuffer=function($){return h$($)==="buffer"};sH.isObject=function($){return h$($)==="object"};sH.toBuffer=function($){return typeof $==="string"?Buffer.from($):$};sH.toString=function($){if(sH.isBuffer($))return g$(String($));if(typeof $!=="string")throw TypeError("expected input to be a string or buffer");return g$($)};sH.arrayify=function($){return $?Array.isArray($)?$:[$]:[]};sH.startsWith=function($,G,X){if(typeof X!=="number")X=G.length;return $.slice(0,X)===G}});var O4=f((
|
|
48
|
+
*/b$.exports=function($){if(typeof $==="string"&&$.charAt(0)==="\uFEFF")return $.slice(1);return $}});var D6=f((sH)=>{var g$=v$(),h$=M4();sH.define=function($,G,X){Reflect.defineProperty($,G,{enumerable:!1,configurable:!0,writable:!0,value:X})};sH.isBuffer=function($){return h$($)==="buffer"};sH.isObject=function($){return h$($)==="object"};sH.toBuffer=function($){return typeof $==="string"?Buffer.from($):$};sH.toString=function($){if(sH.isBuffer($))return g$(String($));if(typeof $!=="string")throw TypeError("expected input to be a string or buffer");return g$($)};sH.arrayify=function($){return $?Array.isArray($)?$:[$]:[]};sH.startsWith=function($,G,X){if(typeof X!=="number")X=G.length;return $.slice(0,X)===G}});var O4=f((vB,f$)=>{var YU=b5(),WU=D6();f$.exports=function($){let G=Object.assign({},$);if(G.delimiters=WU.arrayify(G.delims||G.delimiters||"---"),G.delimiters.length===1)G.delimiters.push(G.delimiters[0]);return G.language=(G.language||G.lang||"yaml").toLowerCase(),G.engines=Object.assign({},YU,G.parsers,G.engines),G}});var v5=f((gB,m$)=>{m$.exports=function($,G){let X=G.engines[$]||G.engines[VU($)];if(typeof X>"u")throw Error('gray-matter engine "'+$+'" is not registered');if(typeof X==="function")X={parse:X};return X};function VU($){switch($.toLowerCase()){case"js":case"javascript":return"javascript";case"coffee":case"coffeescript":case"cson":return"coffee";case"yaml":case"yml":return"yaml";default:return $}}});var g5=f((hB,u$)=>{var qU=M4(),JU=v5(),HU=O4();u$.exports=function($,G,X){if(G==null&&X==null)switch(qU($)){case"object":G=$.data,X={};break;case"string":return $;default:throw TypeError("expected file to be a string or object")}let Y=$.content,W=HU(X);if(G==null){if(!W.data)return $;G=W.data}let V=$.language||W.language,q=JU(V,W);if(typeof q.stringify!=="function")throw TypeError('expected "'+V+'.stringify" to be a function');G=Object.assign({},$.data,G);let J=W.delimiters[0],H=W.delimiters[1],D=q.stringify(G,X).trim(),R="";if(D!=="{}")R=j2(J)+j2(D)+j2(H);if(typeof $.excerpt==="string"&&$.excerpt!==""){if(Y.indexOf($.excerpt.trim())===-1)R+=j2($.excerpt)+j2(H)}return R+j2(Y)};function j2($){return $.slice(-1)!==`
|
|
49
49
|
`?$+`
|
|
50
|
-
`:$}});var l$=f((
|
|
50
|
+
`:$}});var l$=f((yB,p$)=>{var UU=O4();p$.exports=function($,G){let X=UU(G);if($.data==null)$.data={};if(typeof X.excerpt==="function")return X.excerpt($,X);let Y=$.data.excerpt_separator||X.excerpt_separator;if(Y==null&&(X.excerpt===!1||X.excerpt==null))return $;let W=typeof X.excerpt==="string"?X.excerpt:Y||X.delimiters[0],V=$.content.indexOf(W);if(V!==-1)$.excerpt=$.content.slice(0,V);return $}});var c$=f((fB,d$)=>{var r$=M4(),DU=g5(),T2=D6();d$.exports=function($){if(r$($)!=="object")$={content:$};if(r$($.data)!=="object")$.data={};if($.contents&&$.content==null)$.content=$.contents;return T2.define($,"orig",T2.toBuffer($.content)),T2.define($,"language",$.language||""),T2.define($,"matter",$.matter||""),T2.define($,"stringify",function(G,X){if(X&&X.language)$.language=X.language;return DU($,G,X)}),$.content=T2.toString($.content),$.isEmpty=!1,$.excerpt="",$}});var n$=f((mB,i$)=>{var RU=v5(),MU=O4();i$.exports=function($,G,X){let Y=MU(X),W=RU($,Y);if(typeof W.parse!=="function")throw TypeError('expected "'+$+'.parse" to be a function');return W.parse(G,Y)}});var y5=f((uB,a$)=>{var QU=w0("fs"),KU=r8(),h5=O4(),FU=g5(),o$=l$(),AU=b5(),wU=c$(),BU=n$(),s$=D6();function I1($,G){if($==="")return{data:{},content:$,excerpt:"",orig:$};let X=wU($),Y=I1.cache[X.content];if(!G){if(Y)return X=Object.assign({},Y),X.orig=Y.orig,X;I1.cache[X.content]=X}return OU(X,G)}function OU($,G){let X=h5(G),Y=X.delimiters[0],W=`
|
|
51
51
|
`+X.delimiters[1],V=$.content;if(X.language)$.language=X.language;let q=Y.length;if(!s$.startsWith(V,Y,q))return o$($,X),$;if(V.charAt(q)===Y.slice(-1))return $;V=V.slice(q);let J=V.length,H=I1.language(V,X);if(H.name)$.language=H.name,V=V.slice(H.raw.length);let D=V.indexOf(W);if(D===-1)D=J;if($.matter=V.slice(0,D),$.matter.replace(/^\s*#[^\n]+/gm,"").trim()==="")$.isEmpty=!0,$.empty=$.content,$.data={};else $.data=BU($.language,$.matter,X);if(D===J)$.content="";else{if($.content=V.slice(D+W.length),$.content[0]==="\r")$.content=$.content.slice(1);if($.content[0]===`
|
|
52
|
-
`)$.content=$.content.slice(1)}if(o$($,X),X.sections===!0||typeof X.section==="function")KU($,X.section);return $}I1.engines=AU;I1.stringify=function($,G,X){if(typeof $==="string")$=I1($,X);return FU($,G,X)};I1.read=function($,G){let X=QU.readFileSync($,"utf8"),Y=I1(X,G);return Y.path=$,Y};I1.test=function($,G){return s$.startsWith($,h5(G).delimiters[0])};I1.language=function($,G){let Y=h5(G).delimiters[0];if(I1.test($))$=$.slice(Y.length);let W=$.slice(0,$.search(/\r?\n/));return{raw:W,name:W?W.trim():""}};I1.cache={};I1.clearCache=function(){I1.cache={}};a$.exports=I1});var ZG=f((
|
|
52
|
+
`)$.content=$.content.slice(1)}if(o$($,X),X.sections===!0||typeof X.section==="function")KU($,X.section);return $}I1.engines=AU;I1.stringify=function($,G,X){if(typeof $==="string")$=I1($,X);return FU($,G,X)};I1.read=function($,G){let X=QU.readFileSync($,"utf8"),Y=I1(X,G);return Y.path=$,Y};I1.test=function($,G){return s$.startsWith($,h5(G).delimiters[0])};I1.language=function($,G){let Y=h5(G).delimiters[0];if(I1.test($))$=$.slice(Y.length);let W=$.slice(0,$.search(/\r?\n/));return{raw:W,name:W?W.trim():""}};I1.cache={};I1.clearCache=function(){I1.cache={}};a$.exports=I1});var ZG=f((sZ,NG)=>{var x2=1000,k2=x2*60,b2=k2*60,Y2=b2*24,pD=Y2*7,lD=Y2*365.25;NG.exports=function($,G){G=G||{};var X=typeof $;if(X==="string"&&$.length>0)return rD($);else if(X==="number"&&isFinite($))return G.long?cD($):dD($);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify($))};function rD($){if($=String($),$.length>100)return;var G=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec($);if(!G)return;var X=parseFloat(G[1]),Y=(G[2]||"ms").toLowerCase();switch(Y){case"years":case"year":case"yrs":case"yr":case"y":return X*lD;case"weeks":case"week":case"w":return X*pD;case"days":case"day":case"d":return X*Y2;case"hours":case"hour":case"hrs":case"hr":case"h":return X*b2;case"minutes":case"minute":case"mins":case"min":case"m":return X*k2;case"seconds":case"second":case"secs":case"sec":case"s":return X*x2;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function dD($){var G=Math.abs($);if(G>=Y2)return Math.round($/Y2)+"d";if(G>=b2)return Math.round($/b2)+"h";if(G>=k2)return Math.round($/k2)+"m";if(G>=x2)return Math.round($/x2)+"s";return $+"ms"}function cD($){var G=Math.abs($);if(G>=Y2)return N6($,G,Y2,"day");if(G>=b2)return N6($,G,b2,"hour");if(G>=k2)return N6($,G,k2,"minute");if(G>=x2)return N6($,G,x2,"second");return $+" ms"}function N6($,G,X,Y){var W=G>=X*1.5;return Math.round($/X)+" "+Y+(W?"s":"")}});var e5=f((aZ,zG)=>{function iD($){X.debug=X,X.default=X,X.coerce=H,X.disable=q,X.enable=W,X.enabled=J,X.humanize=ZG(),X.destroy=D,Object.keys($).forEach((R)=>{X[R]=$[R]}),X.names=[],X.skips=[],X.formatters={};function G(R){let M=0;for(let A=0;A<R.length;A++)M=(M<<5)-M+R.charCodeAt(A),M|=0;return X.colors[Math.abs(M)%X.colors.length]}X.selectColor=G;function X(R){let M,A=null,F,Z;function z(...E){if(!z.enabled)return;let L=z,v=Number(new Date),h=v-(M||v);if(L.diff=h,L.prev=M,L.curr=v,M=v,E[0]=X.coerce(E[0]),typeof E[0]!=="string")E.unshift("%O");let e=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(_,G1)=>{if(_==="%%")return"%";e++;let V1=X.formatters[G1];if(typeof V1==="function"){let t=E[e];_=V1.call(L,t),E.splice(e,1),e--}return _}),X.formatArgs.call(L,E),(L.log||X.log).apply(L,E)}if(z.namespace=R,z.useColors=X.useColors(),z.color=X.selectColor(R),z.extend=Y,z.destroy=X.destroy,Object.defineProperty(z,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(A!==null)return A;if(F!==X.namespaces)F=X.namespaces,Z=X.enabled(R);return Z},set:(E)=>{A=E}}),typeof X.init==="function")X.init(z);return z}function Y(R,M){let A=X(this.namespace+(typeof M>"u"?":":M)+R);return A.log=this.log,A}function W(R){X.save(R),X.namespaces=R,X.names=[],X.skips=[];let M=(typeof R==="string"?R:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let A of M)if(A[0]==="-")X.skips.push(A.slice(1));else X.names.push(A)}function V(R,M){let A=0,F=0,Z=-1,z=0;while(A<R.length)if(F<M.length&&(M[F]===R[A]||M[F]==="*"))if(M[F]==="*")Z=F,z=A,F++;else A++,F++;else if(Z!==-1)F=Z+1,z++,A=z;else return!1;while(F<M.length&&M[F]==="*")F++;return F===M.length}function q(){let R=[...X.names,...X.skips.map((M)=>"-"+M)].join(",");return X.enable(""),R}function J(R){for(let M of X.skips)if(V(R,M))return!1;for(let M of X.names)if(V(R,M))return!0;return!1}function H(R){if(R instanceof Error)return R.stack||R.message;return R}function D(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}zG.exports=iD});var LG=f((_G,Z6)=>{_G.formatArgs=oD;_G.save=sD;_G.load=aD;_G.useColors=nD;_G.storage=tD();_G.destroy=(()=>{let $=!1;return()=>{if(!$)$=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();_G.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function nD(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let $;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&($=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt($[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function oD($){if($[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+$[0]+(this.useColors?"%c ":" ")+"+"+Z6.exports.humanize(this.diff),!this.useColors)return;let G="color: "+this.color;$.splice(1,0,G,"color: inherit");let X=0,Y=0;$[0].replace(/%[a-zA-Z%]/g,(W)=>{if(W==="%%")return;if(X++,W==="%c")Y=X}),$.splice(Y,0,G)}_G.log=console.debug||console.log||(()=>{});function sD($){try{if($)_G.storage.setItem("debug",$);else _G.storage.removeItem("debug")}catch(G){}}function aD(){let $;try{$=_G.storage.getItem("debug")||_G.storage.getItem("DEBUG")}catch(G){}if(!$&&typeof process<"u"&&"env"in process)$=process.env.DEBUG;return $}function tD(){try{return localStorage}catch($){}}Z6.exports=e5()(_G);var{formatters:eD}=Z6.exports;eD.j=function($){try{return JSON.stringify($)}catch(G){return"[UnexpectedJSONParseError]: "+G.message}}});var jG=f((eZ,EG)=>{EG.exports=($,G=process.argv)=>{let X=$.startsWith("-")?"":$.length===1?"-":"--",Y=G.indexOf(X+$),W=G.indexOf("--");return Y!==-1&&(W===-1||Y<W)}});var SG=f(($z,CG)=>{var JR=w0("os"),TG=w0("tty"),n1=jG(),{env:B1}=process,C0;if(n1("no-color")||n1("no-colors")||n1("color=false")||n1("color=never"))C0=0;else if(n1("color")||n1("colors")||n1("color=true")||n1("color=always"))C0=1;if("FORCE_COLOR"in B1)if(B1.FORCE_COLOR==="true")C0=1;else if(B1.FORCE_COLOR==="false")C0=0;else C0=B1.FORCE_COLOR.length===0?1:Math.min(parseInt(B1.FORCE_COLOR,10),3);function $9($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function G9($,G){if(C0===0)return 0;if(n1("color=16m")||n1("color=full")||n1("color=truecolor"))return 3;if(n1("color=256"))return 2;if($&&!G&&C0===void 0)return 0;let X=C0||0;if(B1.TERM==="dumb")return X;if(process.platform==="win32"){let Y=JR.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in B1){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((Y)=>(Y in B1))||B1.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in B1)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(B1.TEAMCITY_VERSION)?1:0;if(B1.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in B1){let Y=parseInt((B1.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(B1.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(B1.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(B1.TERM))return 1;if("COLORTERM"in B1)return 1;return X}function HR($){let G=G9($,$&&$.isTTY);return $9(G)}CG.exports={supportsColor:HR,stdout:$9(G9(!0,TG.isatty(1))),stderr:$9(G9(!0,TG.isatty(2)))}});var bG=f((xG,_6)=>{var UR=w0("tty"),z6=w0("util");xG.init=AR;xG.log=QR;xG.formatArgs=RR;xG.save=KR;xG.load=FR;xG.useColors=DR;xG.destroy=z6.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");xG.colors=[6,2,3,4,5,1];try{let $=SG();if($&&($.stderr||$).level>=2)xG.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch($){}xG.inspectOpts=Object.keys(process.env).filter(($)=>{return/^debug_/i.test($)}).reduce(($,G)=>{let X=G.substring(6).toLowerCase().replace(/_([a-z])/g,(W,V)=>{return V.toUpperCase()}),Y=process.env[G];if(/^(yes|on|true|enabled)$/i.test(Y))Y=!0;else if(/^(no|off|false|disabled)$/i.test(Y))Y=!1;else if(Y==="null")Y=null;else Y=Number(Y);return $[X]=Y,$},{});function DR(){return"colors"in xG.inspectOpts?Boolean(xG.inspectOpts.colors):UR.isatty(process.stderr.fd)}function RR($){let{namespace:G,useColors:X}=this;if(X){let Y=this.color,W="\x1B[3"+(Y<8?Y:"8;5;"+Y),V=` ${W};1m${G} \x1B[0m`;$[0]=V+$[0].split(`
|
|
53
53
|
`).join(`
|
|
54
54
|
`+V),$.push(W+"m+"+_6.exports.humanize(this.diff)+"\x1B[0m")}else $[0]=MR()+G+" "+$[0]}function MR(){if(xG.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function QR(...$){return process.stderr.write(z6.formatWithOptions(xG.inspectOpts,...$)+`
|
|
55
55
|
`)}function KR($){if($)process.env.DEBUG=$;else delete process.env.DEBUG}function FR(){return process.env.DEBUG}function AR($){$.inspectOpts={};let G=Object.keys(xG.inspectOpts);for(let X=0;X<G.length;X++)$.inspectOpts[G[X]]=xG.inspectOpts[G[X]]}_6.exports=e5()(xG);var{formatters:IG}=_6.exports;IG.o=function($){return this.inspectOpts.colors=this.useColors,z6.inspect($,this.inspectOpts).split(`
|
|
56
|
-
`).map((G)=>G.trim()).join(" ")};IG.O=function($){return this.inspectOpts.colors=this.useColors,z6.inspect($,this.inspectOpts)}});var vG=f((
|
|
56
|
+
`).map((G)=>G.trim()).join(" ")};IG.O=function($){return this.inspectOpts.colors=this.useColors,z6.inspect($,this.inspectOpts)}});var vG=f((Xz,X9)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)X9.exports=LG();else X9.exports=bG()});var k3=f((CE,x3)=>{var b6=Object.prototype.hasOwnProperty,I3=Object.prototype.toString,L3=Object.defineProperty,E3=Object.getOwnPropertyDescriptor,j3=function(G){if(typeof Array.isArray==="function")return Array.isArray(G);return I3.call(G)==="[object Array]"},T3=function(G){if(!G||I3.call(G)!=="[object Object]")return!1;var X=b6.call(G,"constructor"),Y=G.constructor&&G.constructor.prototype&&b6.call(G.constructor.prototype,"isPrototypeOf");if(G.constructor&&!X&&!Y)return!1;var W;for(W in G);return typeof W>"u"||b6.call(G,W)},C3=function(G,X){if(L3&&X.name==="__proto__")L3(G,X.name,{enumerable:!0,configurable:!0,value:X.newValue,writable:!0});else G[X.name]=X.newValue},S3=function(G,X){if(X==="__proto__"){if(!b6.call(G,X))return;else if(E3)return E3(G,X).value}return G[X]};x3.exports=function $(){var G,X,Y,W,V,q,J=arguments[0],H=1,D=arguments.length,R=!1;if(typeof J==="boolean")R=J,J=arguments[1]||{},H=2;if(J==null||typeof J!=="object"&&typeof J!=="function")J={};for(;H<D;++H)if(G=arguments[H],G!=null){for(X in G)if(Y=S3(J,X),W=S3(G,X),J!==W){if(R&&W&&(T3(W)||(V=j3(W)))){if(V)V=!1,q=Y&&j3(Y)?Y:[];else q=Y&&T3(Y)?Y:{};C3(J,{name:X,newValue:$(R,q,W)})}else if(typeof W<"u")C3(J,{name:X,newValue:W})}}return J}});import{openSync as AV,writeSync as wV}from"fs";class N1{static instance=null;level;context;useStderr;format;logFile;fileHandle;constructor($={},G){if(this.level=$.level??3,this.context=$.context??void 0,this.useStderr=$.useStderr??!1,this.format=$.format??"text",this.logFile=$.logFile,G!==void 0)this.fileHandle=G;else if(this.logFile)try{this.fileHandle=AV(this.logFile,"a")}catch{}}static getInstance($){if(!N1.instance)N1.instance=new N1($);else if($?.useStderr!==void 0)N1.instance.useStderr=$.useStderr;return N1.instance}static resetInstance(){N1.instance=null}static createFresh($){return new N1($)}formatEntry($,G,X){let Y=new Date().toISOString();if(this.format==="json"){let W={ts:Y,level:$,msg:G};if(this.context)W.ctx=this.context;if(X.length>0)W.data=X;return JSON.stringify(W)}return this.context?`[${Y}] [${this.context}] ${G}`:`[${Y}] ${G}`}write($,G,X,Y){if(this.format==="json")$(this.formatEntry(G,X,Y));else if(Y.length>0)$(this.formatEntry(G,X,[]),...Y);else $(this.formatEntry(G,X,[]));if(this.fileHandle!==void 0){let W=this.formatJsonEntry(G,X,Y);try{wV(this.fileHandle,W+`
|
|
57
57
|
`)}catch{}}}formatJsonEntry($,G,X){let Y={ts:new Date().toISOString(),level:$,msg:G};if(this.context)Y.ctx=this.context;if(X.length>0)Y.data=X;return JSON.stringify(Y)}silly($,...G){if(this.level<=0)this.write(console.debug.bind(console),"silly",$,G)}verbose($,...G){if(this.level<=1)this.write(console.debug.bind(console),"verbose",$,G)}debug($,...G){if(this.level<=2)this.write(console.debug.bind(console),"debug",$,G)}info($,...G){if(this.level<=3){let X=this.useStderr?console.error.bind(console):console.info.bind(console);this.write(X,"info",$,G)}}warn($,...G){if(this.level<=4)this.write(console.warn.bind(console),"warn",$,G)}error($,...G){if(this.level<=5)this.write(console.error.bind(console),"error",$,G)}child($){return new N1({level:this.level,context:$,useStderr:this.useStderr,format:this.format},this.fileHandle)}setUseStderr($){this.useStderr=$}}var BV=N1.getInstance();var UM=t4(y5(),1);class t$ extends Error{name="Assertion";code="ERR_ASSERTION";constructor($,G,X,Y,W){super($);if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);this.actual=G,this.expected=X,this.generated=W,this.operator=Y}}function w($,G){PU(Boolean($),!1,!0,"ok","Expected value to be truthy",G)}function PU($,G,X,Y,W,V){if(!$)throw V instanceof Error?V:new t$(V||W,G,X,Y,!V)}var NU={};function e0($,G){let X=G||NU,Y=typeof X.includeImageAlt==="boolean"?X.includeImageAlt:!0,W=typeof X.includeHtml==="boolean"?X.includeHtml:!0;return $G($,Y,W)}function $G($,G,X){if(ZU($)){if("value"in $)return $.type==="html"&&!X?"":$.value;if(G&&"alt"in $&&$.alt)return $.alt;if("children"in $)return e$($.children,G,X)}if(Array.isArray($))return e$($,G,X);return""}function e$($,G,X){let Y=[],W=-1;while(++W<$.length)Y[W]=$G($[W],G,X);return Y.join("")}function ZU($){return Boolean($&&typeof $==="object")}var f5={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\uD835\uDD04",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\uD835\uDD38",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\uD835\uDC9C",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\uD835\uDC9E",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\uD835\uDD3B",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\uD835\uDC9F",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\uD835\uDD08",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\uD835\uDD3C",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\uD835\uDD09",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\uD835\uDD3D",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\uD835\uDD0A",Gg:"\u22D9",Gopf:"\uD835\uDD3E",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\uD835\uDCA2",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\uD835\uDD40",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\uD835\uDD0F",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\uD835\uDD43",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\uD835\uDD10",MinusPlus:"\u2213",Mopf:"\uD835\uDD44",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
58
58
|
`,Nfr:"\uD835\uDD11",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\uD835\uDCA9",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\uD835\uDD12",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\uD835\uDCAA",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\uD835\uDD13",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\uD835\uDCAB",Psi:"\u03A8",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"\u211A",Qscr:"\uD835\uDCAC",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\uD835\uDD16",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\uD835\uDD4A",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\uD835\uDCAE",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:"\t",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\uD835\uDD17",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\uD835\uDD4B",TripleDot:"\u20DB",Tscr:"\uD835\uDCAF",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\uD835\uDD18",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\uD835\uDD4C",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\uD835\uDCB0",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"\u039E",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\uD835\uDCB5",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\uD835\uDD1E",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\uD835\uDD52",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\uD835\uDCB6",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\uD835\uDD1F",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\uD835\uDD53",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\uD835\uDCB7",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\uD835\uDD20",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\uD835\uDD54",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\uD835\uDCB8",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\uD835\uDD21",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\uD835\uDD55",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\uD835\uDCB9",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\uD835\uDD22",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\uD835\uDD56",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\uD835\uDD23",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\uD835\uDD57",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\uD835\uDCBB",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\uD835\uDD24",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\uD835\uDD58",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\uD835\uDD25",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\uD835\uDD59",horbar:"\u2015",hscr:"\uD835\uDCBD",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\uD835\uDD26",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\uD835\uDD5A",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\uD835\uDCBE",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\uD835\uDD27",jmath:"\u0237",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\uD835\uDD28",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\uD835\uDD29",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\uD835\uDD5D",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\uD835\uDCC1",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\uD835\uDD2A",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\uD835\uDD5E",mp:"\u2213",mscr:"\uD835\uDCC2",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\uD835\uDD2B",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\uD835\uDD5F",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\uD835\uDCC3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\uD835\uDD2C",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\uD835\uDD60",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\uD835\uDD2D",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\uD835\uDD61",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\uD835\uDCC5",psi:"\u03C8",puncsp:"\u2008",qfr:"\uD835\uDD2E",qint:"\u2A0C",qopf:"\uD835\uDD62",qprime:"\u2057",qscr:"\uD835\uDCC6",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\uD835\uDD2F",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\uD835\uDD63",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\uD835\uDCC7",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\uD835\uDD30",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\uD835\uDD64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\uD835\uDCC8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\uD835\uDD31",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\uD835\uDD65",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\uD835\uDCC9",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\uD835\uDD32",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\uD835\uDD66",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\uD835\uDCCA",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\uD835\uDD67",vprop:"\u221D",vrtri:"\u22B3",vscr:"\uD835\uDCCB",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\uD835\uDCCC",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\uD835\uDD35",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\uD835\uDD69",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\uD835\uDCCD",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\uD835\uDD36",yicy:"\u0457",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\uD835\uDD37",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"\u200D",zwnj:"\u200C"};var zU={}.hasOwnProperty;function C2($){return zU.call(f5,$)?f5[$]:!1}var K={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533};var j={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:"content",contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};var Q={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"};var p1={ht:"\t",lf:`
|
|
59
59
|
`,cr:"\r",space:" ",exclamationMark:"!",quotationMark:'"',numberSign:"#",dollarSign:"$",percentSign:"%",ampersand:"&",apostrophe:"'",leftParenthesis:"(",rightParenthesis:")",asterisk:"*",plusSign:"+",comma:",",dash:"-",dot:".",slash:"/",digit0:"0",digit1:"1",digit2:"2",digit3:"3",digit4:"4",digit5:"5",digit6:"6",digit7:"7",digit8:"8",digit9:"9",colon:":",semicolon:";",lessThan:"<",equalsTo:"=",greaterThan:">",questionMark:"?",atSign:"@",uppercaseA:"A",uppercaseB:"B",uppercaseC:"C",uppercaseD:"D",uppercaseE:"E",uppercaseF:"F",uppercaseG:"G",uppercaseH:"H",uppercaseI:"I",uppercaseJ:"J",uppercaseK:"K",uppercaseL:"L",uppercaseM:"M",uppercaseN:"N",uppercaseO:"O",uppercaseP:"P",uppercaseQ:"Q",uppercaseR:"R",uppercaseS:"S",uppercaseT:"T",uppercaseU:"U",uppercaseV:"V",uppercaseW:"W",uppercaseX:"X",uppercaseY:"Y",uppercaseZ:"Z",leftSquareBracket:"[",backslash:"\\",rightSquareBracket:"]",caret:"^",underscore:"_",graveAccent:"`",lowercaseA:"a",lowercaseB:"b",lowercaseC:"c",lowercaseD:"d",lowercaseE:"e",lowercaseF:"f",lowercaseG:"g",lowercaseH:"h",lowercaseI:"i",lowercaseJ:"j",lowercaseK:"k",lowercaseL:"l",lowercaseM:"m",lowercaseN:"n",lowercaseO:"o",lowercaseP:"p",lowercaseQ:"q",lowercaseR:"r",lowercaseS:"s",lowercaseT:"t",lowercaseU:"u",lowercaseV:"v",lowercaseW:"w",lowercaseX:"x",lowercaseY:"y",lowercaseZ:"z",leftCurlyBrace:"{",verticalBar:"|",rightCurlyBrace:"}",tilde:"~",replacementCharacter:"\uFFFD"};function Z1($,G,X,Y){let W=$.length,V=0,q;if(G<0)G=-G>W?0:W+G;else G=G>W?W:G;if(X=X>0?X:0,Y.length<j.v8MaxSafeChunkSize)q=Array.from(Y),q.unshift(G,X),$.splice(...q);else{if(X)$.splice(G,X);while(V<Y.length)q=Y.slice(V,V+j.v8MaxSafeChunkSize),q.unshift(G,0),$.splice(...q),V+=j.v8MaxSafeChunkSize,G+=j.v8MaxSafeChunkSize}}function x1($,G){if($.length>0)return Z1($,$.length,0,G),$;return G}var GG={}.hasOwnProperty;function XG($){let G={},X=-1;while(++X<$.length)_U(G,$[X]);return G}function _U($,G){let X;for(X in G){let W=(GG.call($,X)?$[X]:void 0)||($[X]={}),V=G[X],q;if(V)for(q in V){if(!GG.call(W,q))W[q]=[];let J=V[q];LU(W[q],Array.isArray(J)?J:J?[J]:[])}}}function LU($,G){let X=-1,Y=[];while(++X<G.length)(G[X].add==="after"?$:Y).push(G[X]);Z1($,0,0,Y)}function R6($,G){let X=Number.parseInt($,G);if(X<K.ht||X===K.vt||X>K.cr&&X<K.space||X>K.tilde&&X<160||X>55295&&X<57344||X>64975&&X<65008||(X&65535)===65535||(X&65535)===65534||X>1114111)return p1.replacementCharacter;return String.fromCodePoint(X)}function O0($){return $.replace(/[\t\n\r ]+/g,p1.space).replace(/^ | $/g,"").toLowerCase().toUpperCase()}var l1=j0(/[A-Za-z]/),k1=j0(/[\dA-Za-z]/),YG=j0(/[#-'*+\--9=?A-Z^-~]/);function P4($){return $!==null&&($<K.space||$===K.del)}var N4=j0(/\d/),WG=j0(/[\dA-Fa-f]/),VG=j0(/[!-/:-@[-`{-~]/);function S($){return $!==null&&$<K.horizontalTab}function U1($){return $!==null&&($<K.nul||$===K.space)}function l($){return $===K.horizontalTab||$===K.virtualSpace||$===K.space}var qG=j0(/\p{P}|\p{S}/u),JG=j0(/\s/);function j0($){return G;function G(X){return X!==null&&X>-1&&$.test(String.fromCharCode(X))}}function d($,G,X,Y){let W=Y?Y-1:Number.POSITIVE_INFINITY,V=0;return q;function q(H){if(l(H))return $.enter(X),J(H);return G(H)}function J(H){if(l(H)&&V++<W)return $.consume(H),J;return $.exit(X),G(H)}}var HG={tokenize:EU};function EU($){let G=$.attempt(this.parser.constructs.contentInitial,Y,W),X;return G;function Y(J){if(w(J===K.eof||S(J),"expected eol or eof"),J===K.eof){$.consume(J);return}return $.enter(Q.lineEnding),$.consume(J),$.exit(Q.lineEnding),d($,G,Q.linePrefix)}function W(J){return w(J!==K.eof&&!S(J),"expected anything other than a line ending or EOF"),$.enter(Q.paragraph),V(J)}function V(J){let H=$.enter(Q.chunkText,{contentType:j.contentTypeText,previous:X});if(X)X.next=H;return X=H,q(J)}function q(J){if(J===K.eof){$.exit(Q.chunkText),$.exit(Q.paragraph),$.consume(J);return}if(S(J))return $.consume(J),$.exit(Q.chunkText),V;return $.consume(J),q}}var DG={tokenize:jU},UG={tokenize:TU};function jU($){let G=this,X=[],Y=0,W,V,q;return J;function J(h){if(Y<X.length){let e=X[Y];return G.containerState=e[1],w(e[0].continuation,"expected `continuation` to be defined on container construct"),$.attempt(e[0].continuation,H,D)(h)}return D(h)}function H(h){if(w(G.containerState,"expected `containerState` to be defined after continuation"),Y++,G.containerState._closeFlow){if(G.containerState._closeFlow=void 0,W)v();let e=G.events.length,Y1=e,_;while(Y1--)if(G.events[Y1][0]==="exit"&&G.events[Y1][1].type===Q.chunkFlow){_=G.events[Y1][1].end;break}w(_,"could not find previous flow chunk"),L(Y);let G1=e;while(G1<G.events.length)G.events[G1][1].end={..._},G1++;return Z1(G.events,Y1+1,0,G.events.slice(e)),G.events.length=G1,D(h)}return J(h)}function D(h){if(Y===X.length){if(!W)return A(h);if(W.currentConstruct&&W.currentConstruct.concrete)return Z(h);G.interrupt=Boolean(W.currentConstruct&&!W._gfmTableDynamicInterruptHack)}return G.containerState={},$.check(UG,R,M)(h)}function R(h){if(W)v();return L(Y),A(h)}function M(h){return G.parser.lazy[G.now().line]=Y!==X.length,q=G.now().offset,Z(h)}function A(h){return G.containerState={},$.attempt(UG,F,Z)(h)}function F(h){return w(G.currentConstruct,"expected `currentConstruct` to be defined on tokenizer"),w(G.containerState,"expected `containerState` to be defined on tokenizer"),Y++,X.push([G.currentConstruct,G.containerState]),A(h)}function Z(h){if(h===K.eof){if(W)v();L(0),$.consume(h);return}return W=W||G.parser.flow(G.now()),$.enter(Q.chunkFlow,{_tokenizer:W,contentType:j.contentTypeFlow,previous:V}),z(h)}function z(h){if(h===K.eof){E($.exit(Q.chunkFlow),!0),L(0),$.consume(h);return}if(S(h))return $.consume(h),E($.exit(Q.chunkFlow)),Y=0,G.interrupt=void 0,J;return $.consume(h),z}function E(h,e){w(W,"expected `childFlow` to be defined when continuing");let Y1=G.sliceStream(h);if(e)Y1.push(null);if(h.previous=V,V)V.next=h;if(V=h,W.defineSkip(h.start),W.write(Y1),G.parser.lazy[h.start.line]){let _=W.events.length;while(_--)if(W.events[_][1].start.offset<q&&(!W.events[_][1].end||W.events[_][1].end.offset>q))return;let G1=G.events.length,V1=G1,t,W1;while(V1--)if(G.events[V1][0]==="exit"&&G.events[V1][1].type===Q.chunkFlow){if(t){W1=G.events[V1][1].end;break}t=!0}w(W1,"could not find previous flow chunk"),L(Y),_=G1;while(_<G.events.length)G.events[_][1].end={...W1},_++;Z1(G.events,V1+1,0,G.events.slice(G1)),G.events.length=_}}function L(h){let e=X.length;while(e-- >h){let Y1=X[e];G.containerState=Y1[1],w(Y1[0].exit,"expected `exit` to be defined on container construct"),Y1[0].exit.call(G,$)}X.length=h}function v(){w(G.containerState,"expected `containerState` to be defined when closing flow"),w(W,"expected `childFlow` to be defined when closing it"),W.write([K.eof]),V=void 0,W=void 0,G.containerState._closeFlow=void 0}}function TU($,G,X){return w(this.parser.constructs.disable.null,"expected `disable.null` to be populated"),d($,$.attempt(this.parser.constructs.document,G,X),Q.linePrefix,this.parser.constructs.disable.null.includes("codeIndented")?void 0:j.tabSize)}function S2($){if($===K.eof||U1($)||JG($))return j.characterGroupWhitespace;if(qG($))return j.characterGroupPunctuation}function I2($,G,X){let Y=[],W=-1;while(++W<$.length){let V=$[W].resolveAll;if(V&&!Y.includes(V))G=V(G,X),Y.push(V)}return G}var Z4={name:"attention",resolveAll:CU,tokenize:SU};function CU($,G){let X=-1,Y,W,V,q,J,H,D,R;while(++X<$.length)if($[X][0]==="enter"&&$[X][1].type==="attentionSequence"&&$[X][1]._close){Y=X;while(Y--)if($[Y][0]==="exit"&&$[Y][1].type==="attentionSequence"&&$[Y][1]._open&&G.sliceSerialize($[Y][1]).charCodeAt(0)===G.sliceSerialize($[X][1]).charCodeAt(0)){if(($[Y][1]._close||$[X][1]._open)&&($[X][1].end.offset-$[X][1].start.offset)%3&&!(($[Y][1].end.offset-$[Y][1].start.offset+$[X][1].end.offset-$[X][1].start.offset)%3))continue;H=$[Y][1].end.offset-$[Y][1].start.offset>1&&$[X][1].end.offset-$[X][1].start.offset>1?2:1;let M={...$[Y][1].end},A={...$[X][1].start};if(RG(M,-H),RG(A,H),q={type:H>1?Q.strongSequence:Q.emphasisSequence,start:M,end:{...$[Y][1].end}},J={type:H>1?Q.strongSequence:Q.emphasisSequence,start:{...$[X][1].start},end:A},V={type:H>1?Q.strongText:Q.emphasisText,start:{...$[Y][1].end},end:{...$[X][1].start}},W={type:H>1?Q.strong:Q.emphasis,start:{...q.start},end:{...J.end}},$[Y][1].end={...q.start},$[X][1].start={...J.end},D=[],$[Y][1].end.offset-$[Y][1].start.offset)D=x1(D,[["enter",$[Y][1],G],["exit",$[Y][1],G]]);if(D=x1(D,[["enter",W,G],["enter",q,G],["exit",q,G],["enter",V,G]]),w(G.parser.constructs.insideSpan.null,"expected `insideSpan` to be populated"),D=x1(D,I2(G.parser.constructs.insideSpan.null,$.slice(Y+1,X),G)),D=x1(D,[["exit",V,G],["enter",J,G],["exit",J,G],["exit",W,G]]),$[X][1].end.offset-$[X][1].start.offset)R=2,D=x1(D,[["enter",$[X][1],G],["exit",$[X][1],G]]);else R=0;Z1($,Y-1,X-Y+3,D),X=Y+D.length-R-2;break}}X=-1;while(++X<$.length)if($[X][1].type==="attentionSequence")$[X][1].type="data";return $}function SU($,G){let X=this.parser.constructs.attentionMarkers.null,Y=this.previous,W=S2(Y),V;return q;function q(H){return w(H===K.asterisk||H===K.underscore,"expected asterisk or underscore"),V=H,$.enter("attentionSequence"),J(H)}function J(H){if(H===V)return $.consume(H),J;let D=$.exit("attentionSequence"),R=S2(H);w(X,"expected `attentionMarkers` to be populated");let M=!R||R===j.characterGroupPunctuation&&W||X.includes(H),A=!W||W===j.characterGroupPunctuation&&R||X.includes(Y);return D._open=Boolean(V===K.asterisk?M:M&&(W||!A)),D._close=Boolean(V===K.asterisk?A:A&&(R||!M)),G(H)}}function RG($,G){$.column+=G,$.offset+=G,$._bufferIndex+=G}var m5={name:"autolink",tokenize:IU};function IU($,G,X){let Y=0;return W;function W(F){return w(F===K.lessThan,"expected `<`"),$.enter(Q.autolink),$.enter(Q.autolinkMarker),$.consume(F),$.exit(Q.autolinkMarker),$.enter(Q.autolinkProtocol),V}function V(F){if(l1(F))return $.consume(F),q;if(F===K.atSign)return X(F);return D(F)}function q(F){if(F===K.plusSign||F===K.dash||F===K.dot||k1(F))return Y=1,J(F);return D(F)}function J(F){if(F===K.colon)return $.consume(F),Y=0,H;if((F===K.plusSign||F===K.dash||F===K.dot||k1(F))&&Y++<j.autolinkSchemeSizeMax)return $.consume(F),J;return Y=0,D(F)}function H(F){if(F===K.greaterThan)return $.exit(Q.autolinkProtocol),$.enter(Q.autolinkMarker),$.consume(F),$.exit(Q.autolinkMarker),$.exit(Q.autolink),G;if(F===K.eof||F===K.space||F===K.lessThan||P4(F))return X(F);return $.consume(F),H}function D(F){if(F===K.atSign)return $.consume(F),R;if(YG(F))return $.consume(F),D;return X(F)}function R(F){return k1(F)?M(F):X(F)}function M(F){if(F===K.dot)return $.consume(F),Y=0,R;if(F===K.greaterThan)return $.exit(Q.autolinkProtocol).type=Q.autolinkEmail,$.enter(Q.autolinkMarker),$.consume(F),$.exit(Q.autolinkMarker),$.exit(Q.autolink),G;return A(F)}function A(F){if((F===K.dash||k1(F))&&Y++<j.autolinkDomainSizeMax){let Z=F===K.dash?A:M;return $.consume(F),Z}return X(F)}}var T0={partial:!0,tokenize:xU};function xU($,G,X){return Y;function Y(V){return l(V)?d($,W,Q.linePrefix)(V):W(V)}function W(V){return V===K.eof||S(V)?G(V):X(V)}}var M6={continuation:{tokenize:bU},exit:vU,name:"blockQuote",tokenize:kU};function kU($,G,X){let Y=this;return W;function W(q){if(q===K.greaterThan){let J=Y.containerState;if(w(J,"expected `containerState` to be defined in container"),!J.open)$.enter(Q.blockQuote,{_container:!0}),J.open=!0;return $.enter(Q.blockQuotePrefix),$.enter(Q.blockQuoteMarker),$.consume(q),$.exit(Q.blockQuoteMarker),V}return X(q)}function V(q){if(l(q))return $.enter(Q.blockQuotePrefixWhitespace),$.consume(q),$.exit(Q.blockQuotePrefixWhitespace),$.exit(Q.blockQuotePrefix),G;return $.exit(Q.blockQuotePrefix),G(q)}}function bU($,G,X){let Y=this;return W;function W(q){if(l(q))return w(Y.parser.constructs.disable.null,"expected `disable.null` to be populated"),d($,V,Q.linePrefix,Y.parser.constructs.disable.null.includes("codeIndented")?void 0:j.tabSize)(q);return V(q)}function V(q){return $.attempt(M6,G,X)(q)}}function vU($){$.exit(Q.blockQuote)}var Q6={name:"characterEscape",tokenize:gU};function gU($,G,X){return Y;function Y(V){return w(V===K.backslash,"expected `\\`"),$.enter(Q.characterEscape),$.enter(Q.escapeMarker),$.consume(V),$.exit(Q.escapeMarker),W}function W(V){if(VG(V))return $.enter(Q.characterEscapeValue),$.consume(V),$.exit(Q.characterEscapeValue),$.exit(Q.characterEscape),G;return X(V)}}var K6={name:"characterReference",tokenize:hU};function hU($,G,X){let Y=this,W=0,V,q;return J;function J(M){return w(M===K.ampersand,"expected `&`"),$.enter(Q.characterReference),$.enter(Q.characterReferenceMarker),$.consume(M),$.exit(Q.characterReferenceMarker),H}function H(M){if(M===K.numberSign)return $.enter(Q.characterReferenceMarkerNumeric),$.consume(M),$.exit(Q.characterReferenceMarkerNumeric),D;return $.enter(Q.characterReferenceValue),V=j.characterReferenceNamedSizeMax,q=k1,R(M)}function D(M){if(M===K.uppercaseX||M===K.lowercaseX)return $.enter(Q.characterReferenceMarkerHexadecimal),$.consume(M),$.exit(Q.characterReferenceMarkerHexadecimal),$.enter(Q.characterReferenceValue),V=j.characterReferenceHexadecimalSizeMax,q=WG,R;return $.enter(Q.characterReferenceValue),V=j.characterReferenceDecimalSizeMax,q=N4,R(M)}function R(M){if(M===K.semicolon&&W){let A=$.exit(Q.characterReferenceValue);if(q===k1&&!C2(Y.sliceSerialize(A)))return X(M);return $.enter(Q.characterReferenceMarker),$.consume(M),$.exit(Q.characterReferenceMarker),$.exit(Q.characterReference),G}if(q(M)&&W++<V)return $.consume(M),R;return X(M)}}var MG={partial:!0,tokenize:fU},F6={concrete:!0,name:"codeFenced",tokenize:yU};function yU($,G,X){let Y=this,W={partial:!0,tokenize:Y1},V=0,q=0,J;return H;function H(_){return D(_)}function D(_){w(_===K.graveAccent||_===K.tilde,"expected `` ` `` or `~`");let G1=Y.events[Y.events.length-1];return V=G1&&G1[1].type===Q.linePrefix?G1[2].sliceSerialize(G1[1],!0).length:0,J=_,$.enter(Q.codeFenced),$.enter(Q.codeFencedFence),$.enter(Q.codeFencedFenceSequence),R(_)}function R(_){if(_===J)return q++,$.consume(_),R;if(q<j.codeFencedSequenceSizeMin)return X(_);return $.exit(Q.codeFencedFenceSequence),l(_)?d($,M,Q.whitespace)(_):M(_)}function M(_){if(_===K.eof||S(_))return $.exit(Q.codeFencedFence),Y.interrupt?G(_):$.check(MG,z,e)(_);return $.enter(Q.codeFencedFenceInfo),$.enter(Q.chunkString,{contentType:j.contentTypeString}),A(_)}function A(_){if(_===K.eof||S(_))return $.exit(Q.chunkString),$.exit(Q.codeFencedFenceInfo),M(_);if(l(_))return $.exit(Q.chunkString),$.exit(Q.codeFencedFenceInfo),d($,F,Q.whitespace)(_);if(_===K.graveAccent&&_===J)return X(_);return $.consume(_),A}function F(_){if(_===K.eof||S(_))return M(_);return $.enter(Q.codeFencedFenceMeta),$.enter(Q.chunkString,{contentType:j.contentTypeString}),Z(_)}function Z(_){if(_===K.eof||S(_))return $.exit(Q.chunkString),$.exit(Q.codeFencedFenceMeta),M(_);if(_===K.graveAccent&&_===J)return X(_);return $.consume(_),Z}function z(_){return w(S(_),"expected eol"),$.attempt(W,e,E)(_)}function E(_){return w(S(_),"expected eol"),$.enter(Q.lineEnding),$.consume(_),$.exit(Q.lineEnding),L}function L(_){return V>0&&l(_)?d($,v,Q.linePrefix,V+1)(_):v(_)}function v(_){if(_===K.eof||S(_))return $.check(MG,z,e)(_);return $.enter(Q.codeFlowValue),h(_)}function h(_){if(_===K.eof||S(_))return $.exit(Q.codeFlowValue),v(_);return $.consume(_),h}function e(_){return $.exit(Q.codeFenced),G(_)}function Y1(_,G1,V1){let t=0;return W1;function W1(n){return w(S(n),"expected eol"),_.enter(Q.lineEnding),_.consume(n),_.exit(Q.lineEnding),d1}function d1(n){return w(Y.parser.constructs.disable.null,"expected `disable.null` to be populated"),_.enter(Q.codeFencedFence),l(n)?d(_,X1,Q.linePrefix,Y.parser.constructs.disable.null.includes("codeIndented")?void 0:j.tabSize)(n):X1(n)}function X1(n){if(n===J)return _.enter(Q.codeFencedFenceSequence),k(n);return V1(n)}function k(n){if(n===J)return t++,_.consume(n),k;if(t>=q)return _.exit(Q.codeFencedFenceSequence),l(n)?d(_,r,Q.whitespace)(n):r(n);return V1(n)}function r(n){if(n===K.eof||S(n))return _.exit(Q.codeFencedFence),G1(n);return V1(n)}}}function fU($,G,X){let Y=this;return W;function W(q){if(q===K.eof)return X(q);return w(S(q),"expected eol"),$.enter(Q.lineEnding),$.consume(q),$.exit(Q.lineEnding),V}function V(q){return Y.parser.lazy[Y.now().line]?X(q):G(q)}}var z4={name:"codeIndented",tokenize:uU},mU={partial:!0,tokenize:pU};function uU($,G,X){let Y=this;return W;function W(D){return w(l(D)),$.enter(Q.codeIndented),d($,V,Q.linePrefix,j.tabSize+1)(D)}function V(D){let R=Y.events[Y.events.length-1];return R&&R[1].type===Q.linePrefix&&R[2].sliceSerialize(R[1],!0).length>=j.tabSize?q(D):X(D)}function q(D){if(D===K.eof)return H(D);if(S(D))return $.attempt(mU,q,H)(D);return $.enter(Q.codeFlowValue),J(D)}function J(D){if(D===K.eof||S(D))return $.exit(Q.codeFlowValue),q(D);return $.consume(D),J}function H(D){return $.exit(Q.codeIndented),G(D)}}function pU($,G,X){let Y=this;return W;function W(q){if(Y.parser.lazy[Y.now().line])return X(q);if(S(q))return $.enter(Q.lineEnding),$.consume(q),$.exit(Q.lineEnding),W;return d($,V,Q.linePrefix,j.tabSize+1)(q)}function V(q){let J=Y.events[Y.events.length-1];return J&&J[1].type===Q.linePrefix&&J[2].sliceSerialize(J[1],!0).length>=j.tabSize?G(q):S(q)?W(q):X(q)}}var u5={name:"codeText",previous:QG,resolve:lU,tokenize:rU};function lU($){let G=$.length-4,X=3,Y,W;if(($[X][1].type===Q.lineEnding||$[X][1].type==="space")&&($[G][1].type===Q.lineEnding||$[G][1].type==="space")){Y=X;while(++Y<G)if($[Y][1].type===Q.codeTextData){$[X][1].type=Q.codeTextPadding,$[G][1].type=Q.codeTextPadding,X+=2,G-=2;break}}Y=X-1,G++;while(++Y<=G)if(W===void 0){if(Y!==G&&$[Y][1].type!==Q.lineEnding)W=Y}else if(Y===G||$[Y][1].type===Q.lineEnding){if($[W][1].type=Q.codeTextData,Y!==W+2)$[W][1].end=$[Y-1][1].end,$.splice(W+2,Y-W-2),G-=Y-W-2,Y=W+2;W=void 0}return $}function QG($){return $!==K.graveAccent||this.events[this.events.length-1][1].type===Q.characterEscape}function rU($,G,X){let Y=this,W=0,V,q;return J;function J(A){return w(A===K.graveAccent,"expected `` ` ``"),w(QG.call(Y,Y.previous),"expected correct previous"),$.enter(Q.codeText),$.enter(Q.codeTextSequence),H(A)}function H(A){if(A===K.graveAccent)return $.consume(A),W++,H;return $.exit(Q.codeTextSequence),D(A)}function D(A){if(A===K.eof)return X(A);if(A===K.space)return $.enter("space"),$.consume(A),$.exit("space"),D;if(A===K.graveAccent)return q=$.enter(Q.codeTextSequence),V=0,M(A);if(S(A))return $.enter(Q.lineEnding),$.consume(A),$.exit(Q.lineEnding),D;return $.enter(Q.codeTextData),R(A)}function R(A){if(A===K.eof||A===K.space||A===K.graveAccent||S(A))return $.exit(Q.codeTextData),D(A);return $.consume(A),R}function M(A){if(A===K.graveAccent)return $.consume(A),V++,M;if(V===W)return $.exit(Q.codeTextSequence),$.exit(Q.codeText),G(A);return q.type=Q.codeTextData,R(A)}}class p5{constructor($){this.left=$?[...$]:[],this.right=[]}get($){if($<0||$>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+$+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if($<this.left.length)return this.left[$];return this.right[this.right.length-$+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice($,G){let X=G===null||G===void 0?Number.POSITIVE_INFINITY:G;if(X<this.left.length)return this.left.slice($,X);if($>this.left.length)return this.right.slice(this.right.length-X+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-X+this.left.length).reverse())}splice($,G,X){let Y=G||0;this.setCursor(Math.trunc($));let W=this.right.splice(this.right.length-Y,Number.POSITIVE_INFINITY);if(X)_4(this.left,X);return W.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push($){this.setCursor(Number.POSITIVE_INFINITY),this.left.push($)}pushMany($){this.setCursor(Number.POSITIVE_INFINITY),_4(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),_4(this.right,$.reverse())}setCursor($){if($===this.left.length||$>this.left.length&&this.right.length===0||$<0&&this.left.length===0)return;if($<this.left.length){let G=this.left.splice($,Number.POSITIVE_INFINITY);_4(this.right,G.reverse())}else{let G=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);_4(this.left,G.reverse())}}}function _4($,G){let X=0;if(G.length<j.v8MaxSafeChunkSize)$.push(...G);else while(X<G.length)$.push(...G.slice(X,X+j.v8MaxSafeChunkSize)),X+=j.v8MaxSafeChunkSize}function A6($){let G={},X=-1,Y,W,V,q,J,H,D,R=new p5($);while(++X<R.length){while(X in G)X=G[X];if(Y=R.get(X),X&&Y[1].type===Q.chunkFlow&&R.get(X-1)[1].type===Q.listItemPrefix){if(w(Y[1]._tokenizer,"expected `_tokenizer` on subtokens"),H=Y[1]._tokenizer.events,V=0,V<H.length&&H[V][1].type===Q.lineEndingBlank)V+=2;if(V<H.length&&H[V][1].type===Q.content)while(++V<H.length){if(H[V][1].type===Q.content)break;if(H[V][1].type===Q.chunkText)H[V][1]._isInFirstContentOfListItem=!0,V++}}if(Y[0]==="enter"){if(Y[1].contentType)Object.assign(G,dU(R,X)),X=G[X],D=!0}else if(Y[1]._container){V=X,W=void 0;while(V--)if(q=R.get(V),q[1].type===Q.lineEnding||q[1].type===Q.lineEndingBlank){if(q[0]==="enter"){if(W)R.get(W)[1].type=Q.lineEndingBlank;q[1].type=Q.lineEnding,W=V}}else if(q[1].type===Q.linePrefix||q[1].type===Q.listItemIndent);else break;if(W)Y[1].end={...R.get(W)[1].start},J=R.slice(W,X),J.unshift(Y),R.splice(W,X-W+1,J)}}return Z1($,0,Number.POSITIVE_INFINITY,R.slice(0)),!D}function dU($,G){let X=$.get(G)[1],Y=$.get(G)[2],W=G-1,V=[];w(X.contentType,"expected `contentType` on subtokens");let q=X._tokenizer;if(!q){if(q=Y.parser[X.contentType](X.start),X._contentTypeTextTrailing)q._contentTypeTextTrailing=!0}let J=q.events,H=[],D={},R,M,A=-1,F=X,Z=0,z=0,E=[z];while(F){while($.get(++W)[1]!==F);if(w(!M||F.previous===M,"expected previous to match"),w(!M||M.next===F,"expected next to match"),V.push(W),!F._tokenizer){if(R=Y.sliceStream(F),!F.next)R.push(K.eof);if(M)q.defineSkip(F.start);if(F._isInFirstContentOfListItem)q._gfmTasklistFirstContentOfListItem=!0;if(q.write(R),F._isInFirstContentOfListItem)q._gfmTasklistFirstContentOfListItem=void 0}M=F,F=F.next}F=X;while(++A<J.length)if(J[A][0]==="exit"&&J[A-1][0]==="enter"&&J[A][1].type===J[A-1][1].type&&J[A][1].start.line!==J[A][1].end.line)w(F,"expected a current token"),z=A+1,E.push(z),F._tokenizer=void 0,F.previous=void 0,F=F.next;if(q.events=[],F)F._tokenizer=void 0,F.previous=void 0,w(!F.next,"expected no next token");else E.pop();A=E.length;while(A--){let L=J.slice(E[A],E[A+1]),v=V.pop();w(v!==void 0,"expected a start position when splicing"),H.push([v,v+L.length-1]),$.splice(v,2,L)}H.reverse(),A=-1;while(++A<H.length)D[Z+H[A][0]]=Z+H[A][1],Z+=H[A][1]-H[A][0]-1;return D}var l5={resolve:iU,tokenize:nU},cU={partial:!0,tokenize:oU};function iU($){return A6($),$}function nU($,G){let X;return Y;function Y(J){return w(J!==K.eof&&!S(J),"expected no eof or eol"),$.enter(Q.content),X=$.enter(Q.chunkContent,{contentType:j.contentTypeContent}),W(J)}function W(J){if(J===K.eof)return V(J);if(S(J))return $.check(cU,q,V)(J);return $.consume(J),W}function V(J){return $.exit(Q.chunkContent),$.exit(Q.content),G(J)}function q(J){return w(S(J),"expected eol"),$.consume(J),$.exit(Q.chunkContent),w(X,"expected previous token"),X.next=$.enter(Q.chunkContent,{contentType:j.contentTypeContent,previous:X}),X=X.next,W}}function oU($,G,X){let Y=this;return W;function W(q){return w(S(q),"expected a line ending"),$.exit(Q.chunkContent),$.enter(Q.lineEnding),$.consume(q),$.exit(Q.lineEnding),d($,V,Q.linePrefix)}function V(q){if(q===K.eof||S(q))return X(q);w(Y.parser.constructs.disable.null,"expected `disable.null` to be populated");let J=Y.events[Y.events.length-1];if(!Y.parser.constructs.disable.null.includes("codeIndented")&&J&&J[1].type===Q.linePrefix&&J[2].sliceSerialize(J[1],!0).length>=j.tabSize)return G(q);return $.interrupt(Y.parser.constructs.flow,X,G)(q)}}function w6($,G,X,Y,W,V,q,J,H){let D=H||Number.POSITIVE_INFINITY,R=0;return M;function M(L){if(L===K.lessThan)return $.enter(Y),$.enter(W),$.enter(V),$.consume(L),$.exit(V),A;if(L===K.eof||L===K.space||L===K.rightParenthesis||P4(L))return X(L);return $.enter(Y),$.enter(q),$.enter(J),$.enter(Q.chunkString,{contentType:j.contentTypeString}),z(L)}function A(L){if(L===K.greaterThan)return $.enter(V),$.consume(L),$.exit(V),$.exit(W),$.exit(Y),G;return $.enter(J),$.enter(Q.chunkString,{contentType:j.contentTypeString}),F(L)}function F(L){if(L===K.greaterThan)return $.exit(Q.chunkString),$.exit(J),A(L);if(L===K.eof||L===K.lessThan||S(L))return X(L);return $.consume(L),L===K.backslash?Z:F}function Z(L){if(L===K.lessThan||L===K.greaterThan||L===K.backslash)return $.consume(L),F;return F(L)}function z(L){if(!R&&(L===K.eof||L===K.rightParenthesis||U1(L)))return $.exit(Q.chunkString),$.exit(J),$.exit(q),$.exit(Y),G(L);if(R<D&&L===K.leftParenthesis)return $.consume(L),R++,z;if(L===K.rightParenthesis)return $.consume(L),R--,z;if(L===K.eof||L===K.space||L===K.leftParenthesis||P4(L))return X(L);return $.consume(L),L===K.backslash?E:z}function E(L){if(L===K.leftParenthesis||L===K.rightParenthesis||L===K.backslash)return $.consume(L),z;return z(L)}}function B6($,G,X,Y,W,V){let q=this,J=0,H;return D;function D(F){return w(F===K.leftSquareBracket,"expected `[`"),$.enter(Y),$.enter(W),$.consume(F),$.exit(W),$.enter(V),R}function R(F){if(J>j.linkReferenceSizeMax||F===K.eof||F===K.leftSquareBracket||F===K.rightSquareBracket&&!H||F===K.caret&&!J&&"_hiddenFootnoteSupport"in q.parser.constructs)return X(F);if(F===K.rightSquareBracket)return $.exit(V),$.enter(W),$.consume(F),$.exit(W),$.exit(Y),G;if(S(F))return $.enter(Q.lineEnding),$.consume(F),$.exit(Q.lineEnding),R;return $.enter(Q.chunkString,{contentType:j.contentTypeString}),M(F)}function M(F){if(F===K.eof||F===K.leftSquareBracket||F===K.rightSquareBracket||S(F)||J++>j.linkReferenceSizeMax)return $.exit(Q.chunkString),R(F);if($.consume(F),!H)H=!l(F);return F===K.backslash?A:M}function A(F){if(F===K.leftSquareBracket||F===K.backslash||F===K.rightSquareBracket)return $.consume(F),J++,M;return M(F)}}function O6($,G,X,Y,W,V){let q;return J;function J(A){if(A===K.quotationMark||A===K.apostrophe||A===K.leftParenthesis)return $.enter(Y),$.enter(W),$.consume(A),$.exit(W),q=A===K.leftParenthesis?K.rightParenthesis:A,H;return X(A)}function H(A){if(A===q)return $.enter(W),$.consume(A),$.exit(W),$.exit(Y),G;return $.enter(V),D(A)}function D(A){if(A===q)return $.exit(V),H(q);if(A===K.eof)return X(A);if(S(A))return $.enter(Q.lineEnding),$.consume(A),$.exit(Q.lineEnding),d($,D,Q.linePrefix);return $.enter(Q.chunkString,{contentType:j.contentTypeString}),R(A)}function R(A){if(A===q||A===K.eof||S(A))return $.exit(Q.chunkString),D(A);return $.consume(A),A===K.backslash?M:R}function M(A){if(A===q||A===K.backslash)return $.consume(A),R;return R(A)}}function $2($,G){let X;return Y;function Y(W){if(S(W))return $.enter(Q.lineEnding),$.consume(W),$.exit(Q.lineEnding),X=!0,Y;if(l(W))return d($,Y,X?Q.linePrefix:Q.lineSuffix)(W);return G(W)}}var r5={name:"definition",tokenize:aU},sU={partial:!0,tokenize:tU};function aU($,G,X){let Y=this,W;return V;function V(F){return $.enter(Q.definition),q(F)}function q(F){return w(F===K.leftSquareBracket,"expected `[`"),B6.call(Y,$,J,X,Q.definitionLabel,Q.definitionLabelMarker,Q.definitionLabelString)(F)}function J(F){if(W=O0(Y.sliceSerialize(Y.events[Y.events.length-1][1]).slice(1,-1)),F===K.colon)return $.enter(Q.definitionMarker),$.consume(F),$.exit(Q.definitionMarker),H;return X(F)}function H(F){return U1(F)?$2($,D)(F):D(F)}function D(F){return w6($,R,X,Q.definitionDestination,Q.definitionDestinationLiteral,Q.definitionDestinationLiteralMarker,Q.definitionDestinationRaw,Q.definitionDestinationString)(F)}function R(F){return $.attempt(sU,M,M)(F)}function M(F){return l(F)?d($,A,Q.whitespace)(F):A(F)}function A(F){if(F===K.eof||S(F))return $.exit(Q.definition),Y.parser.defined.push(W),G(F);return X(F)}}function tU($,G,X){return Y;function Y(J){return U1(J)?$2($,W)(J):X(J)}function W(J){return O6($,V,X,Q.definitionTitle,Q.definitionTitleMarker,Q.definitionTitleString)(J)}function V(J){return l(J)?d($,q,Q.whitespace)(J):q(J)}function q(J){return J===K.eof||S(J)?G(J):X(J)}}var d5={name:"hardBreakEscape",tokenize:eU};function eU($,G,X){return Y;function Y(V){return w(V===K.backslash,"expected `\\`"),$.enter(Q.hardBreakEscape),$.consume(V),W}function W(V){if(S(V))return $.exit(Q.hardBreakEscape),G(V);return X(V)}}var c5={name:"headingAtx",resolve:$D,tokenize:GD};function $D($,G){let X=$.length-2,Y=3,W,V;if($[Y][1].type===Q.whitespace)Y+=2;if(X-2>Y&&$[X][1].type===Q.whitespace)X-=2;if($[X][1].type===Q.atxHeadingSequence&&(Y===X-1||X-4>Y&&$[X-2][1].type===Q.whitespace))X-=Y+1===X?2:4;if(X>Y)W={type:Q.atxHeadingText,start:$[Y][1].start,end:$[X][1].end},V={type:Q.chunkText,start:$[Y][1].start,end:$[X][1].end,contentType:j.contentTypeText},Z1($,Y,X-Y+1,[["enter",W,G],["enter",V,G],["exit",V,G],["exit",W,G]]);return $}function GD($,G,X){let Y=0;return W;function W(R){return $.enter(Q.atxHeading),V(R)}function V(R){return w(R===K.numberSign,"expected `#`"),$.enter(Q.atxHeadingSequence),q(R)}function q(R){if(R===K.numberSign&&Y++<j.atxHeadingOpeningFenceSizeMax)return $.consume(R),q;if(R===K.eof||U1(R))return $.exit(Q.atxHeadingSequence),J(R);return X(R)}function J(R){if(R===K.numberSign)return $.enter(Q.atxHeadingSequence),H(R);if(R===K.eof||S(R))return $.exit(Q.atxHeading),G(R);if(l(R))return d($,J,Q.whitespace)(R);return $.enter(Q.atxHeadingText),D(R)}function H(R){if(R===K.numberSign)return $.consume(R),H;return $.exit(Q.atxHeadingSequence),J(R)}function D(R){if(R===K.eof||R===K.numberSign||U1(R))return $.exit(Q.atxHeadingText),J(R);return $.consume(R),D}}var KG=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],i5=["pre","script","style","textarea"];var n5={concrete:!0,name:"htmlFlow",resolveTo:WD,tokenize:VD},XD={partial:!0,tokenize:JD},YD={partial:!0,tokenize:qD};function WD($){let G=$.length;while(G--)if($[G][0]==="enter"&&$[G][1].type===Q.htmlFlow)break;if(G>1&&$[G-2][1].type===Q.linePrefix)$[G][1].start=$[G-2][1].start,$[G+1][1].start=$[G-2][1].start,$.splice(G-2,2);return $}function VD($,G,X){let Y=this,W,V,q,J,H;return D;function D(O){return R(O)}function R(O){return w(O===K.lessThan,"expected `<`"),$.enter(Q.htmlFlow),$.enter(Q.htmlFlowData),$.consume(O),M}function M(O){if(O===K.exclamationMark)return $.consume(O),A;if(O===K.slash)return $.consume(O),V=!0,z;if(O===K.questionMark)return $.consume(O),W=j.htmlInstruction,Y.interrupt?G:B;if(l1(O))return w(O!==null),$.consume(O),q=String.fromCharCode(O),E;return X(O)}function A(O){if(O===K.dash)return $.consume(O),W=j.htmlComment,F;if(O===K.leftSquareBracket)return $.consume(O),W=j.htmlCdata,J=0,Z;if(l1(O))return $.consume(O),W=j.htmlDeclaration,Y.interrupt?G:B;return X(O)}function F(O){if(O===K.dash)return $.consume(O),Y.interrupt?G:B;return X(O)}function Z(O){let m1=j.cdataOpeningString;if(O===m1.charCodeAt(J++)){if($.consume(O),J===m1.length)return Y.interrupt?G:X1;return Z}return X(O)}function z(O){if(l1(O))return w(O!==null),$.consume(O),q=String.fromCharCode(O),E;return X(O)}function E(O){if(O===K.eof||O===K.slash||O===K.greaterThan||U1(O)){let m1=O===K.slash,r0=q.toLowerCase();if(!m1&&!V&&i5.includes(r0))return W=j.htmlRaw,Y.interrupt?G(O):X1(O);if(KG.includes(q.toLowerCase())){if(W=j.htmlBasic,m1)return $.consume(O),L;return Y.interrupt?G(O):X1(O)}return W=j.htmlComplete,Y.interrupt&&!Y.parser.lazy[Y.now().line]?X(O):V?v(O):h(O)}if(O===K.dash||k1(O))return $.consume(O),q+=String.fromCharCode(O),E;return X(O)}function L(O){if(O===K.greaterThan)return $.consume(O),Y.interrupt?G:X1;return X(O)}function v(O){if(l(O))return $.consume(O),v;return W1(O)}function h(O){if(O===K.slash)return $.consume(O),W1;if(O===K.colon||O===K.underscore||l1(O))return $.consume(O),e;if(l(O))return $.consume(O),h;return W1(O)}function e(O){if(O===K.dash||O===K.dot||O===K.colon||O===K.underscore||k1(O))return $.consume(O),e;return Y1(O)}function Y1(O){if(O===K.equalsTo)return $.consume(O),_;if(l(O))return $.consume(O),Y1;return h(O)}function _(O){if(O===K.eof||O===K.lessThan||O===K.equalsTo||O===K.greaterThan||O===K.graveAccent)return X(O);if(O===K.quotationMark||O===K.apostrophe)return $.consume(O),H=O,G1;if(l(O))return $.consume(O),_;return V1(O)}function G1(O){if(O===H)return $.consume(O),H=null,t;if(O===K.eof||S(O))return X(O);return $.consume(O),G1}function V1(O){if(O===K.eof||O===K.quotationMark||O===K.apostrophe||O===K.slash||O===K.lessThan||O===K.equalsTo||O===K.greaterThan||O===K.graveAccent||U1(O))return Y1(O);return $.consume(O),V1}function t(O){if(O===K.slash||O===K.greaterThan||l(O))return h(O);return X(O)}function W1(O){if(O===K.greaterThan)return $.consume(O),d1;return X(O)}function d1(O){if(O===K.eof||S(O))return X1(O);if(l(O))return $.consume(O),d1;return X(O)}function X1(O){if(O===K.dash&&W===j.htmlComment)return $.consume(O),J1;if(O===K.lessThan&&W===j.htmlRaw)return $.consume(O),K1;if(O===K.greaterThan&&W===j.htmlDeclaration)return $.consume(O),i1;if(O===K.questionMark&&W===j.htmlInstruction)return $.consume(O),B;if(O===K.rightSquareBracket&&W===j.htmlCdata)return $.consume(O),W0;if(S(O)&&(W===j.htmlBasic||W===j.htmlComplete))return $.exit(Q.htmlFlowData),$.check(XD,Q0,k)(O);if(O===K.eof||S(O))return $.exit(Q.htmlFlowData),k(O);return $.consume(O),X1}function k(O){return $.check(YD,r,Q0)(O)}function r(O){return w(S(O)),$.enter(Q.lineEnding),$.consume(O),$.exit(Q.lineEnding),n}function n(O){if(O===K.eof||S(O))return k(O);return $.enter(Q.htmlFlowData),X1(O)}function J1(O){if(O===K.dash)return $.consume(O),B;return X1(O)}function K1(O){if(O===K.slash)return $.consume(O),q="",c1;return X1(O)}function c1(O){if(O===K.greaterThan){let m1=q.toLowerCase();if(i5.includes(m1))return $.consume(O),i1;return X1(O)}if(l1(O)&&q.length<j.htmlRawSizeMax)return w(O!==null),$.consume(O),q+=String.fromCharCode(O),c1;return X1(O)}function W0(O){if(O===K.rightSquareBracket)return $.consume(O),B;return X1(O)}function B(O){if(O===K.greaterThan)return $.consume(O),i1;if(O===K.dash&&W===j.htmlComment)return $.consume(O),B;return X1(O)}function i1(O){if(O===K.eof||S(O))return $.exit(Q.htmlFlowData),Q0(O);return $.consume(O),i1}function Q0(O){return $.exit(Q.htmlFlow),G(O)}}function qD($,G,X){let Y=this;return W;function W(q){if(S(q))return $.enter(Q.lineEnding),$.consume(q),$.exit(Q.lineEnding),V;return X(q)}function V(q){return Y.parser.lazy[Y.now().line]?X(q):G(q)}}function JD($,G,X){return Y;function Y(W){return w(S(W),"expected a line ending"),$.enter(Q.lineEnding),$.consume(W),$.exit(Q.lineEnding),$.attempt(T0,G,X)}}var o5={name:"htmlText",tokenize:HD};function HD($,G,X){let Y=this,W,V,q;return J;function J(B){return w(B===K.lessThan,"expected `<`"),$.enter(Q.htmlText),$.enter(Q.htmlTextData),$.consume(B),H}function H(B){if(B===K.exclamationMark)return $.consume(B),D;if(B===K.slash)return $.consume(B),Y1;if(B===K.questionMark)return $.consume(B),h;if(l1(B))return $.consume(B),V1;return X(B)}function D(B){if(B===K.dash)return $.consume(B),R;if(B===K.leftSquareBracket)return $.consume(B),V=0,Z;if(l1(B))return $.consume(B),v;return X(B)}function R(B){if(B===K.dash)return $.consume(B),F;return X(B)}function M(B){if(B===K.eof)return X(B);if(B===K.dash)return $.consume(B),A;if(S(B))return q=M,K1(B);return $.consume(B),M}function A(B){if(B===K.dash)return $.consume(B),F;return M(B)}function F(B){return B===K.greaterThan?J1(B):B===K.dash?A(B):M(B)}function Z(B){let i1=j.cdataOpeningString;if(B===i1.charCodeAt(V++))return $.consume(B),V===i1.length?z:Z;return X(B)}function z(B){if(B===K.eof)return X(B);if(B===K.rightSquareBracket)return $.consume(B),E;if(S(B))return q=z,K1(B);return $.consume(B),z}function E(B){if(B===K.rightSquareBracket)return $.consume(B),L;return z(B)}function L(B){if(B===K.greaterThan)return J1(B);if(B===K.rightSquareBracket)return $.consume(B),L;return z(B)}function v(B){if(B===K.eof||B===K.greaterThan)return J1(B);if(S(B))return q=v,K1(B);return $.consume(B),v}function h(B){if(B===K.eof)return X(B);if(B===K.questionMark)return $.consume(B),e;if(S(B))return q=h,K1(B);return $.consume(B),h}function e(B){return B===K.greaterThan?J1(B):h(B)}function Y1(B){if(l1(B))return $.consume(B),_;return X(B)}function _(B){if(B===K.dash||k1(B))return $.consume(B),_;return G1(B)}function G1(B){if(S(B))return q=G1,K1(B);if(l(B))return $.consume(B),G1;return J1(B)}function V1(B){if(B===K.dash||k1(B))return $.consume(B),V1;if(B===K.slash||B===K.greaterThan||U1(B))return t(B);return X(B)}function t(B){if(B===K.slash)return $.consume(B),J1;if(B===K.colon||B===K.underscore||l1(B))return $.consume(B),W1;if(S(B))return q=t,K1(B);if(l(B))return $.consume(B),t;return J1(B)}function W1(B){if(B===K.dash||B===K.dot||B===K.colon||B===K.underscore||k1(B))return $.consume(B),W1;return d1(B)}function d1(B){if(B===K.equalsTo)return $.consume(B),X1;if(S(B))return q=d1,K1(B);if(l(B))return $.consume(B),d1;return t(B)}function X1(B){if(B===K.eof||B===K.lessThan||B===K.equalsTo||B===K.greaterThan||B===K.graveAccent)return X(B);if(B===K.quotationMark||B===K.apostrophe)return $.consume(B),W=B,k;if(S(B))return q=X1,K1(B);if(l(B))return $.consume(B),X1;return $.consume(B),r}function k(B){if(B===W)return $.consume(B),W=void 0,n;if(B===K.eof)return X(B);if(S(B))return q=k,K1(B);return $.consume(B),k}function r(B){if(B===K.eof||B===K.quotationMark||B===K.apostrophe||B===K.lessThan||B===K.equalsTo||B===K.graveAccent)return X(B);if(B===K.slash||B===K.greaterThan||U1(B))return t(B);return $.consume(B),r}function n(B){if(B===K.slash||B===K.greaterThan||U1(B))return t(B);return X(B)}function J1(B){if(B===K.greaterThan)return $.consume(B),$.exit(Q.htmlTextData),$.exit(Q.htmlText),G;return X(B)}function K1(B){return w(q,"expected return state"),w(S(B),"expected eol"),$.exit(Q.htmlTextData),$.enter(Q.lineEnding),$.consume(B),$.exit(Q.lineEnding),c1}function c1(B){return w(Y.parser.constructs.disable.null,"expected `disable.null` to be populated"),l(B)?d($,W0,Q.linePrefix,Y.parser.constructs.disable.null.includes("codeIndented")?void 0:j.tabSize)(B):W0(B)}function W0(B){return $.enter(Q.htmlTextData),q(B)}}var G2={name:"labelEnd",resolveAll:MD,resolveTo:QD,tokenize:KD},UD={tokenize:FD},DD={tokenize:AD},RD={tokenize:wD};function MD($){let G=-1,X=[];while(++G<$.length){let Y=$[G][1];if(X.push($[G]),Y.type===Q.labelImage||Y.type===Q.labelLink||Y.type===Q.labelEnd){let W=Y.type===Q.labelImage?4:2;Y.type=Q.data,G+=W}}if($.length!==X.length)Z1($,0,$.length,X);return $}function QD($,G){let X=$.length,Y=0,W,V,q,J;while(X--)if(W=$[X][1],V){if(W.type===Q.link||W.type===Q.labelLink&&W._inactive)break;if($[X][0]==="enter"&&W.type===Q.labelLink)W._inactive=!0}else if(q){if($[X][0]==="enter"&&(W.type===Q.labelImage||W.type===Q.labelLink)&&!W._balanced){if(V=X,W.type!==Q.labelLink){Y=2;break}}}else if(W.type===Q.labelEnd)q=X;w(V!==void 0,"`open` is supposed to be found"),w(q!==void 0,"`close` is supposed to be found");let H={type:$[V][1].type===Q.labelLink?Q.link:Q.image,start:{...$[V][1].start},end:{...$[$.length-1][1].end}},D={type:Q.label,start:{...$[V][1].start},end:{...$[q][1].end}},R={type:Q.labelText,start:{...$[V+Y+2][1].end},end:{...$[q-2][1].start}};return J=[["enter",H,G],["enter",D,G]],J=x1(J,$.slice(V+1,V+Y+3)),J=x1(J,[["enter",R,G]]),w(G.parser.constructs.insideSpan.null,"expected `insideSpan.null` to be populated"),J=x1(J,I2(G.parser.constructs.insideSpan.null,$.slice(V+Y+4,q-3),G)),J=x1(J,[["exit",R,G],$[q-2],$[q-1],["exit",D,G]]),J=x1(J,$.slice(q+1)),J=x1(J,[["exit",H,G]]),Z1($,V,$.length,J),$}function KD($,G,X){let Y=this,W=Y.events.length,V,q;while(W--)if((Y.events[W][1].type===Q.labelImage||Y.events[W][1].type===Q.labelLink)&&!Y.events[W][1]._balanced){V=Y.events[W][1];break}return J;function J(A){if(w(A===K.rightSquareBracket,"expected `]`"),!V)return X(A);if(V._inactive)return M(A);return q=Y.parser.defined.includes(O0(Y.sliceSerialize({start:V.end,end:Y.now()}))),$.enter(Q.labelEnd),$.enter(Q.labelMarker),$.consume(A),$.exit(Q.labelMarker),$.exit(Q.labelEnd),H}function H(A){if(A===K.leftParenthesis)return $.attempt(UD,R,q?R:M)(A);if(A===K.leftSquareBracket)return $.attempt(DD,R,q?D:M)(A);return q?R(A):M(A)}function D(A){return $.attempt(RD,R,M)(A)}function R(A){return G(A)}function M(A){return V._balanced=!0,X(A)}}function FD($,G,X){return Y;function Y(M){return w(M===K.leftParenthesis,"expected left paren"),$.enter(Q.resource),$.enter(Q.resourceMarker),$.consume(M),$.exit(Q.resourceMarker),W}function W(M){return U1(M)?$2($,V)(M):V(M)}function V(M){if(M===K.rightParenthesis)return R(M);return w6($,q,J,Q.resourceDestination,Q.resourceDestinationLiteral,Q.resourceDestinationLiteralMarker,Q.resourceDestinationRaw,Q.resourceDestinationString,j.linkResourceDestinationBalanceMax)(M)}function q(M){return U1(M)?$2($,H)(M):R(M)}function J(M){return X(M)}function H(M){if(M===K.quotationMark||M===K.apostrophe||M===K.leftParenthesis)return O6($,D,X,Q.resourceTitle,Q.resourceTitleMarker,Q.resourceTitleString)(M);return R(M)}function D(M){return U1(M)?$2($,R)(M):R(M)}function R(M){if(M===K.rightParenthesis)return $.enter(Q.resourceMarker),$.consume(M),$.exit(Q.resourceMarker),$.exit(Q.resource),G;return X(M)}}function AD($,G,X){let Y=this;return W;function W(J){return w(J===K.leftSquareBracket,"expected left bracket"),B6.call(Y,$,V,q,Q.reference,Q.referenceMarker,Q.referenceString)(J)}function V(J){return Y.parser.defined.includes(O0(Y.sliceSerialize(Y.events[Y.events.length-1][1]).slice(1,-1)))?G(J):X(J)}function q(J){return X(J)}}function wD($,G,X){return Y;function Y(V){return w(V===K.leftSquareBracket,"expected left bracket"),$.enter(Q.reference),$.enter(Q.referenceMarker),$.consume(V),$.exit(Q.referenceMarker),W}function W(V){if(V===K.rightSquareBracket)return $.enter(Q.referenceMarker),$.consume(V),$.exit(Q.referenceMarker),$.exit(Q.reference),G;return X(V)}}var s5={name:"labelStartImage",resolveAll:G2.resolveAll,tokenize:BD};function BD($,G,X){let Y=this;return W;function W(J){return w(J===K.exclamationMark,"expected `!`"),$.enter(Q.labelImage),$.enter(Q.labelImageMarker),$.consume(J),$.exit(Q.labelImageMarker),V}function V(J){if(J===K.leftSquareBracket)return $.enter(Q.labelMarker),$.consume(J),$.exit(Q.labelMarker),$.exit(Q.labelImage),q;return X(J)}function q(J){return J===K.caret&&"_hiddenFootnoteSupport"in Y.parser.constructs?X(J):G(J)}}var a5={name:"labelStartLink",resolveAll:G2.resolveAll,tokenize:OD};function OD($,G,X){let Y=this;return W;function W(q){return w(q===K.leftSquareBracket,"expected `[`"),$.enter(Q.labelLink),$.enter(Q.labelMarker),$.consume(q),$.exit(Q.labelMarker),$.exit(Q.labelLink),V}function V(q){return q===K.caret&&"_hiddenFootnoteSupport"in Y.parser.constructs?X(q):G(q)}}var L4={name:"lineEnding",tokenize:PD};function PD($,G){return X;function X(Y){return w(S(Y),"expected eol"),$.enter(Q.lineEnding),$.consume(Y),$.exit(Q.lineEnding),d($,G,Q.linePrefix)}}var X2={name:"thematicBreak",tokenize:ND};function ND($,G,X){let Y=0,W;return V;function V(D){return $.enter(Q.thematicBreak),q(D)}function q(D){return w(D===K.asterisk||D===K.dash||D===K.underscore,"expected `*`, `-`, or `_`"),W=D,J(D)}function J(D){if(D===W)return $.enter(Q.thematicBreakSequence),H(D);if(Y>=j.thematicBreakMarkerCountMin&&(D===K.eof||S(D)))return $.exit(Q.thematicBreak),G(D);return X(D)}function H(D){if(D===W)return $.consume(D),Y++,H;return $.exit(Q.thematicBreakSequence),l(D)?d($,J,Q.whitespace)(D):J(D)}}var E1={continuation:{tokenize:LD},exit:jD,name:"list",tokenize:_D},ZD={partial:!0,tokenize:TD},zD={partial:!0,tokenize:ED};function _D($,G,X){let Y=this,W=Y.events[Y.events.length-1],V=W&&W[1].type===Q.linePrefix?W[2].sliceSerialize(W[1],!0).length:0,q=0;return J;function J(F){w(Y.containerState,"expected state");let Z=Y.containerState.type||(F===K.asterisk||F===K.plusSign||F===K.dash?Q.listUnordered:Q.listOrdered);if(Z===Q.listUnordered?!Y.containerState.marker||F===Y.containerState.marker:N4(F)){if(!Y.containerState.type)Y.containerState.type=Z,$.enter(Z,{_container:!0});if(Z===Q.listUnordered)return $.enter(Q.listItemPrefix),F===K.asterisk||F===K.dash?$.check(X2,X,D)(F):D(F);if(!Y.interrupt||F===K.digit1)return $.enter(Q.listItemPrefix),$.enter(Q.listItemValue),H(F)}return X(F)}function H(F){if(w(Y.containerState,"expected state"),N4(F)&&++q<j.listItemValueSizeMax)return $.consume(F),H;if((!Y.interrupt||q<2)&&(Y.containerState.marker?F===Y.containerState.marker:F===K.rightParenthesis||F===K.dot))return $.exit(Q.listItemValue),D(F);return X(F)}function D(F){return w(Y.containerState,"expected state"),w(F!==K.eof,"eof (`null`) is not a marker"),$.enter(Q.listItemMarker),$.consume(F),$.exit(Q.listItemMarker),Y.containerState.marker=Y.containerState.marker||F,$.check(T0,Y.interrupt?X:R,$.attempt(ZD,A,M))}function R(F){return w(Y.containerState,"expected state"),Y.containerState.initialBlankLine=!0,V++,A(F)}function M(F){if(l(F))return $.enter(Q.listItemPrefixWhitespace),$.consume(F),$.exit(Q.listItemPrefixWhitespace),A;return X(F)}function A(F){return w(Y.containerState,"expected state"),Y.containerState.size=V+Y.sliceSerialize($.exit(Q.listItemPrefix),!0).length,G(F)}}function LD($,G,X){let Y=this;return w(Y.containerState,"expected state"),Y.containerState._closeFlow=void 0,$.check(T0,W,V);function W(J){return w(Y.containerState,"expected state"),w(typeof Y.containerState.size==="number","expected size"),Y.containerState.furtherBlankLines=Y.containerState.furtherBlankLines||Y.containerState.initialBlankLine,d($,G,Q.listItemIndent,Y.containerState.size+1)(J)}function V(J){if(w(Y.containerState,"expected state"),Y.containerState.furtherBlankLines||!l(J))return Y.containerState.furtherBlankLines=void 0,Y.containerState.initialBlankLine=void 0,q(J);return Y.containerState.furtherBlankLines=void 0,Y.containerState.initialBlankLine=void 0,$.attempt(zD,G,q)(J)}function q(J){return w(Y.containerState,"expected state"),Y.containerState._closeFlow=!0,Y.interrupt=void 0,w(Y.parser.constructs.disable.null,"expected `disable.null` to be populated"),d($,$.attempt(E1,G,X),Q.linePrefix,Y.parser.constructs.disable.null.includes("codeIndented")?void 0:j.tabSize)(J)}}function ED($,G,X){let Y=this;return w(Y.containerState,"expected state"),w(typeof Y.containerState.size==="number","expected size"),d($,W,Q.listItemIndent,Y.containerState.size+1);function W(V){w(Y.containerState,"expected state");let q=Y.events[Y.events.length-1];return q&&q[1].type===Q.listItemIndent&&q[2].sliceSerialize(q[1],!0).length===Y.containerState.size?G(V):X(V)}}function jD($){w(this.containerState,"expected state"),w(typeof this.containerState.type==="string","expected type"),$.exit(this.containerState.type)}function TD($,G,X){let Y=this;return w(Y.parser.constructs.disable.null,"expected `disable.null` to be populated"),d($,W,Q.listItemPrefixWhitespace,Y.parser.constructs.disable.null.includes("codeIndented")?void 0:j.tabSize+1);function W(V){let q=Y.events[Y.events.length-1];return!l(V)&&q&&q[1].type===Q.listItemPrefixWhitespace?G(V):X(V)}}var P6={name:"setextUnderline",resolveTo:CD,tokenize:SD};function CD($,G){let X=$.length,Y,W,V;while(X--)if($[X][0]==="enter"){if($[X][1].type===Q.content){Y=X;break}if($[X][1].type===Q.paragraph)W=X}else{if($[X][1].type===Q.content)$.splice(X,1);if(!V&&$[X][1].type===Q.definition)V=X}w(W!==void 0,"expected a `text` index to be found"),w(Y!==void 0,"expected a `text` index to be found"),w($[Y][2]===G,"enter context should be same"),w($[$.length-1][2]===G,"enter context should be same");let q={type:Q.setextHeading,start:{...$[Y][1].start},end:{...$[$.length-1][1].end}};if($[W][1].type=Q.setextHeadingText,V)$.splice(W,0,["enter",q,G]),$.splice(V+1,0,["exit",$[Y][1],G]),$[Y][1].end={...$[V][1].end};else $[Y][1]=q;return $.push(["exit",q,G]),$}function SD($,G,X){let Y=this,W;return V;function V(D){let R=Y.events.length,M;w(D===K.dash||D===K.equalsTo,"expected `=` or `-`");while(R--)if(Y.events[R][1].type!==Q.lineEnding&&Y.events[R][1].type!==Q.linePrefix&&Y.events[R][1].type!==Q.content){M=Y.events[R][1].type===Q.paragraph;break}if(!Y.parser.lazy[Y.now().line]&&(Y.interrupt||M))return $.enter(Q.setextHeadingLine),W=D,q(D);return X(D)}function q(D){return $.enter(Q.setextHeadingLineSequence),J(D)}function J(D){if(D===W)return $.consume(D),J;return $.exit(Q.setextHeadingLineSequence),l(D)?d($,H,Q.lineSuffix)(D):H(D)}function H(D){if(D===K.eof||S(D))return $.exit(Q.setextHeadingLine),G(D);return X(D)}}var FG={tokenize:ID};function ID($){let G=this,X=$.attempt(T0,Y,$.attempt(this.parser.constructs.flowInitial,W,d($,$.attempt(this.parser.constructs.flow,W,$.attempt(l5,W)),Q.linePrefix)));return X;function Y(V){if(w(V===K.eof||S(V),"expected eol or eof"),V===K.eof){$.consume(V);return}return $.enter(Q.lineEndingBlank),$.consume(V),$.exit(Q.lineEndingBlank),G.currentConstruct=void 0,X}function W(V){if(w(V===K.eof||S(V),"expected eol or eof"),V===K.eof){$.consume(V);return}return $.enter(Q.lineEnding),$.consume(V),$.exit(Q.lineEnding),G.currentConstruct=void 0,X}}var AG={resolveAll:PG()},wG=OG("string"),BG=OG("text");function OG($){return{resolveAll:PG($==="text"?xD:void 0),tokenize:G};function G(X){let Y=this,W=this.parser.constructs[$],V=X.attempt(W,q,J);return q;function q(R){return D(R)?V(R):J(R)}function J(R){if(R===K.eof){X.consume(R);return}return X.enter(Q.data),X.consume(R),H}function H(R){if(D(R))return X.exit(Q.data),V(R);return X.consume(R),H}function D(R){if(R===K.eof)return!0;let M=W[R],A=-1;if(M){w(Array.isArray(M),"expected `disable.null` to be populated");while(++A<M.length){let F=M[A];if(!F.previous||F.previous.call(Y,Y.previous))return!0}}return!1}}}function PG($){return G;function G(X,Y){let W=-1,V;while(++W<=X.length)if(V===void 0){if(X[W]&&X[W][1].type===Q.data)V=W,W++}else if(!X[W]||X[W][1].type!==Q.data){if(W!==V+2)X[V][1].end=X[W-1][1].end,X.splice(V+2,W-V-2),W=V+2;V=void 0}return $?$(X,Y):X}}function xD($,G){let X=0;while(++X<=$.length)if((X===$.length||$[X][1].type===Q.lineEnding)&&$[X-1][1].type===Q.data){let Y=$[X-1][1],W=G.sliceStream(Y),V=W.length,q=-1,J=0,H;while(V--){let D=W[V];if(typeof D==="string"){q=D.length;while(D.charCodeAt(q-1)===K.space)J++,q--;if(q)break;q=-1}else if(D===K.horizontalTab)H=!0,J++;else if(D===K.virtualSpace);else{V++;break}}if(G._contentTypeTextTrailing&&X===$.length)J=0;if(J){let D={type:X===$.length||H||J<j.hardBreakPrefixSizeMin?Q.lineSuffix:Q.hardBreakTrailing,start:{_bufferIndex:V?q:Y.start._bufferIndex+q,_index:Y.start._index+V,line:Y.end.line,column:Y.end.column-J,offset:Y.end.offset-J},end:{...Y.end}};if(Y.end={...D.start},Y.start.offset===Y.end.offset)Object.assign(Y,D);else $.splice(X,0,["enter",D,G],["exit",D,G]),X+=2}X++}return $}var t5={};b8(t5,{text:()=>yD,string:()=>hD,insideSpan:()=>fD,flowInitial:()=>vD,flow:()=>gD,document:()=>kD,disable:()=>uD,contentInitial:()=>bD,attentionMarkers:()=>mD});var kD={[K.asterisk]:E1,[K.plusSign]:E1,[K.dash]:E1,[K.digit0]:E1,[K.digit1]:E1,[K.digit2]:E1,[K.digit3]:E1,[K.digit4]:E1,[K.digit5]:E1,[K.digit6]:E1,[K.digit7]:E1,[K.digit8]:E1,[K.digit9]:E1,[K.greaterThan]:M6},bD={[K.leftSquareBracket]:r5},vD={[K.horizontalTab]:z4,[K.virtualSpace]:z4,[K.space]:z4},gD={[K.numberSign]:c5,[K.asterisk]:X2,[K.dash]:[P6,X2],[K.lessThan]:n5,[K.equalsTo]:P6,[K.underscore]:X2,[K.graveAccent]:F6,[K.tilde]:F6},hD={[K.ampersand]:K6,[K.backslash]:Q6},yD={[K.carriageReturn]:L4,[K.lineFeed]:L4,[K.carriageReturnLineFeed]:L4,[K.exclamationMark]:s5,[K.ampersand]:K6,[K.asterisk]:Z4,[K.lessThan]:[m5,o5],[K.leftSquareBracket]:a5,[K.backslash]:[d5,Q6],[K.rightSquareBracket]:G2,[K.underscore]:Z4,[K.graveAccent]:u5},fD={null:[Z4,AG]},mD={null:[K.asterisk,K.underscore]},uD={null:[]};var gG=t4(vG(),1);var V2=gG.default("micromark");function hG($,G,X){let Y={_bufferIndex:-1,_index:0,line:X&&X.line||1,column:X&&X.column||1,offset:X&&X.offset||0},W={},V=[],q=[],J=[],H=!0,D={attempt:t(G1),check:t(V1),consume:e,enter:Y1,exit:_,interrupt:t(V1,{interrupt:!0})},R={code:K.eof,containerState:{},defineSkip:L,events:[],now:E,parser:$,previous:K.eof,sliceSerialize:Z,sliceStream:z,write:F},M=G.tokenize.call(R,D),A;if(G.resolveAll)V.push(G);return R;function F(k){if(q=x1(q,k),v(),q[q.length-1]!==K.eof)return[];return W1(G,0),R.events=I2(V,R.events,R),R.events}function Z(k,r){return LR(z(k),r)}function z(k){return _R(q,k)}function E(){let{_bufferIndex:k,_index:r,line:n,column:J1,offset:K1}=Y;return{_bufferIndex:k,_index:r,line:n,column:J1,offset:K1}}function L(k){W[k.line]=k.column,X1(),V2("position: define skip: `%j`",Y)}function v(){let k;while(Y._index<q.length){let r=q[Y._index];if(typeof r==="string"){if(k=Y._index,Y._bufferIndex<0)Y._bufferIndex=0;while(Y._index===k&&Y._bufferIndex<r.length)h(r.charCodeAt(Y._bufferIndex))}else h(r)}}function h(k){w(H===!0,"expected character to be consumed"),H=void 0,V2("main: passing `%s` to %s",k,M&&M.name),A=k,w(typeof M==="function","expected state"),M=M(k)}function e(k){if(w(k===A,"expected given code to equal expected code"),V2("consume: `%s`",k),w(H===void 0,"expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used"),w(k===null?R.events.length===0||R.events[R.events.length-1][0]==="exit":R.events[R.events.length-1][0]==="enter","expected last token to be open"),S(k))Y.line++,Y.column=1,Y.offset+=k===K.carriageReturnLineFeed?2:1,X1(),V2("position: after eol: `%j`",Y);else if(k!==K.virtualSpace)Y.column++,Y.offset++;if(Y._bufferIndex<0)Y._index++;else if(Y._bufferIndex++,Y._bufferIndex===q[Y._index].length)Y._bufferIndex=-1,Y._index++;R.previous=k,H=!0}function Y1(k,r){let n=r||{};return n.type=k,n.start=E(),w(typeof k==="string","expected string type"),w(k.length>0,"expected non-empty string"),V2("enter: `%s`",k),R.events.push(["enter",n,R]),J.push(n),n}function _(k){w(typeof k==="string","expected string type"),w(k.length>0,"expected non-empty string");let r=J.pop();return w(r,"cannot close w/o open tokens"),r.end=E(),w(k===r.type,"expected exit token to match current token"),w(!(r.start._index===r.end._index&&r.start._bufferIndex===r.end._bufferIndex),"expected non-empty token (`"+k+"`)"),V2("exit: `%s`",r.type),R.events.push(["exit",r,R]),r}function G1(k,r){W1(k,r.from)}function V1(k,r){r.restore()}function t(k,r){return n;function n(J1,K1,c1){let W0,B,i1,Q0;return Array.isArray(J1)?m1(J1):("tokenize"in J1)?m1([J1]):O(J1);function O(F1){return U4;function U4(K0){let d0=K0!==null&&F1[K0],B2=K0!==null&&F1.null,F5=[...Array.isArray(d0)?d0:d0?[d0]:[],...Array.isArray(B2)?B2:B2?[B2]:[]];return m1(F5)(K0)}}function m1(F1){if(W0=F1,B=0,F1.length===0)return w(c1,"expected `bogusState` to be given"),c1;return r0(F1[B])}function r0(F1){return U4;function U4(K0){if(Q0=d1(),i1=F1,!F1.partial)R.currentConstruct=F1;if(w(R.parser.constructs.disable.null,"expected `disable.null` to be populated"),F1.name&&R.parser.constructs.disable.null.includes(F1.name))return a4(K0);return F1.tokenize.call(r?Object.assign(Object.create(R),r):R,D,K5,a4)(K0)}}function K5(F1){return w(F1===A,"expected code"),H=!0,k(i1,Q0),K1}function a4(F1){if(w(F1===A,"expected code"),H=!0,Q0.restore(),++B<W0.length)return r0(W0[B]);return c1}}}function W1(k,r){if(k.resolveAll&&!V.includes(k))V.push(k);if(k.resolve)Z1(R.events,r,R.events.length-r,k.resolve(R.events.slice(r),R));if(k.resolveTo)R.events=k.resolveTo(R.events,R);w(k.partial||R.events.length===0||R.events[R.events.length-1][0]==="exit","expected last token to end")}function d1(){let k=E(),r=R.previous,n=R.currentConstruct,J1=R.events.length,K1=Array.from(J);return{from:J1,restore:c1};function c1(){Y=k,R.previous=r,R.currentConstruct=n,R.events.length=J1,J=K1,X1(),V2("position: restore: `%j`",Y)}}function X1(){if(Y.line in W&&Y.column<2)Y.column=W[Y.line],Y.offset+=W[Y.line]-1}}function _R($,G){let X=G.start._index,Y=G.start._bufferIndex,W=G.end._index,V=G.end._bufferIndex,q;if(X===W)w(V>-1,"expected non-negative end buffer index"),w(Y>-1,"expected non-negative start buffer index"),q=[$[X].slice(Y,V)];else{if(q=$.slice(X,W),Y>-1){let J=q[0];if(typeof J==="string")q[0]=J.slice(Y);else w(Y===0,"expected `startBufferIndex` to be `0`"),q.shift()}if(V>0)q.push($[W].slice(0,V))}return q}function LR($,G){let X=-1,Y=[],W;while(++X<$.length){let V=$[X],q;if(typeof V==="string")q=V;else switch(V){case K.carriageReturn:{q=p1.cr;break}case K.lineFeed:{q=p1.lf;break}case K.carriageReturnLineFeed:{q=p1.cr+p1.lf;break}case K.horizontalTab:{q=G?p1.space:p1.ht;break}case K.virtualSpace:{if(!G&&W)continue;q=p1.space;break}default:w(typeof V==="number","expected number"),q=String.fromCharCode(V)}W=V===K.horizontalTab,Y.push(q)}return Y.join("")}function Y9($){let Y={constructs:XG([t5,...($||{}).extensions||[]]),content:W(HG),defined:[],document:W(DG),flow:W(FG),lazy:{},string:W(wG),text:W(BG)};return Y;function W(V){return q;function q(J){return hG(Y,V,J)}}}function W9($){while(!A6($));return $}var yG=/[\0\t\n\r]/g;function V9(){let $=1,G="",X=!0,Y;return W;function W(V,q,J){let H=[],D,R,M,A,F;if(V=G+(typeof V==="string"?V.toString():new TextDecoder(q||void 0).decode(V)),M=0,G="",X){if(V.charCodeAt(0)===K.byteOrderMarker)M++;X=void 0}while(M<V.length){if(yG.lastIndex=M,D=yG.exec(V),A=D&&D.index!==void 0?D.index:V.length,F=V.charCodeAt(A),!D){G=V.slice(M);break}if(F===K.lf&&M===A&&Y)H.push(K.carriageReturnLineFeed),Y=void 0;else{if(Y)H.push(K.carriageReturn),Y=void 0;if(M<A)H.push(V.slice(M,A)),$+=A-M;switch(F){case K.nul:{H.push(K.replacementCharacter),$++;break}case K.ht:{R=Math.ceil($/j.tabSize)*j.tabSize,H.push(K.horizontalTab);while($++<R)H.push(K.virtualSpace);break}case K.lf:{H.push(K.lineFeed),$=1;break}default:Y=!0,$=1}}M=A+1}if(J){if(Y)H.push(K.carriageReturn);if(G)H.push(G);H.push(K.eof)}return H}}var ER=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function L6($){return $.replace(ER,jR)}function jR($,G,X){if(G)return G;if(X.charCodeAt(0)===K.numberSign){let W=X.charCodeAt(1),V=W===K.lowercaseX||W===K.uppercaseX;return R6(X.slice(V?2:1),V?j.numericBaseHexadecimal:j.numericBaseDecimal)}return C2(X)||$}function S0($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return fG($.position);if("start"in $||"end"in $)return fG($);if("line"in $||"column"in $)return q9($);return""}function q9($){return mG($&&$.line)+":"+mG($&&$.column)}function fG($){return q9($&&$.start)+"-"+q9($&&$.end)}function mG($){return $&&typeof $==="number"?$:1}var pG={}.hasOwnProperty;function J9($,G,X){if(G&&typeof G==="object")X=G,G=void 0;return TR(X)(W9(Y9(X).document().write(V9()($,G,!0))))}function TR($){let G={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:V(x8),autolinkProtocol:t,autolinkEmail:t,atxHeading:V(C8),blockQuote:V(K0),characterEscape:t,characterReference:t,codeFenced:V(d0),codeFencedFenceInfo:q,codeFencedFenceMeta:q,codeIndented:V(d0,q),codeText:V(B2,q),codeTextData:t,data:t,codeFlowValue:t,definition:V(F5),definitionDestinationString:q,definitionLabelString:q,definitionTitleString:q,emphasis:V($V),hardBreakEscape:V(S8),hardBreakTrailing:V(S8),htmlFlow:V(I8,q),htmlFlowData:t,htmlText:V(I8,q),htmlTextData:t,image:V(GV),label:q,link:V(x8),listItem:V(XV),listItemValue:A,listOrdered:V(k8,M),listUnordered:V(k8),paragraph:V(YV),reference:O,referenceString:q,resourceDestinationString:q,resourceTitleString:q,setextHeading:V(C8),strong:V(WV),thematicBreak:V(qV)},exit:{atxHeading:H(),atxHeadingSequence:Y1,autolink:H(),autolinkEmail:U4,autolinkProtocol:F1,blockQuote:H(),characterEscapeValue:W1,characterReferenceMarkerHexadecimal:r0,characterReferenceMarkerNumeric:r0,characterReferenceValue:K5,characterReference:a4,codeFenced:H(E),codeFencedFence:z,codeFencedFenceInfo:F,codeFencedFenceMeta:Z,codeFlowValue:W1,codeIndented:H(L),codeText:H(n),codeTextData:W1,data:W1,definition:H(),definitionDestinationString:e,definitionLabelString:v,definitionTitleString:h,emphasis:H(),hardBreakEscape:H(X1),hardBreakTrailing:H(X1),htmlFlow:H(k),htmlFlowData:W1,htmlText:H(r),htmlTextData:W1,image:H(K1),label:W0,labelText:c1,lineEnding:d1,link:H(J1),listItem:H(),listOrdered:H(),listUnordered:H(),paragraph:H(),referenceString:m1,resourceDestinationString:B,resourceTitleString:i1,resource:Q0,setextHeading:H(V1),setextHeadingLineSequence:G1,setextHeadingText:_,strong:H(),thematicBreak:H()}};lG(G,($||{}).mdastExtensions||[]);let X={};return Y;function Y(P){let N={type:"root",children:[]},b={stack:[N],tokenStack:[],config:G,enter:J,exit:D,buffer:q,resume:R,data:X},s=[],$1=-1;while(++$1<P.length)if(P[$1][1].type===Q.listOrdered||P[$1][1].type===Q.listUnordered)if(P[$1][0]==="enter")s.push($1);else{let g1=s.pop();w(typeof g1==="number","expected list to be open"),$1=W(P,g1,$1)}$1=-1;while(++$1<P.length){let g1=G[P[$1][0]];if(pG.call(g1,P[$1][1].type))g1[P[$1][1].type].call(Object.assign({sliceSerialize:P[$1][2].sliceSerialize},b),P[$1][1])}if(b.tokenStack.length>0){let g1=b.tokenStack[b.tokenStack.length-1];(g1[1]||uG).call(b,void 0,g1[0])}N.position={start:I0(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:I0(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},$1=-1;while(++$1<G.transforms.length)N=G.transforms[$1](N)||N;return N}function W(P,N,b){let s=N-1,$1=-1,g1=!1,c0,F0,D4,R4;while(++s<=b){let u1=P[s];switch(u1[1].type){case Q.listUnordered:case Q.listOrdered:case Q.blockQuote:{if(u1[0]==="enter")$1++;else $1--;R4=void 0;break}case Q.lineEndingBlank:{if(u1[0]==="enter"){if(c0&&!R4&&!$1&&!D4)D4=s;R4=void 0}break}case Q.linePrefix:case Q.listItemValue:case Q.listItemMarker:case Q.listItemPrefix:case Q.listItemPrefixWhitespace:break;default:R4=void 0}if(!$1&&u1[0]==="enter"&&u1[1].type===Q.listItemPrefix||$1===-1&&u1[0]==="exit"&&(u1[1].type===Q.listUnordered||u1[1].type===Q.listOrdered)){if(c0){let O2=s;F0=void 0;while(O2--){let A0=P[O2];if(A0[1].type===Q.lineEnding||A0[1].type===Q.lineEndingBlank){if(A0[0]==="exit")continue;if(F0)P[F0][1].type=Q.lineEndingBlank,g1=!0;A0[1].type=Q.lineEnding,F0=O2}else if(A0[1].type===Q.linePrefix||A0[1].type===Q.blockQuotePrefix||A0[1].type===Q.blockQuotePrefixWhitespace||A0[1].type===Q.blockQuoteMarker||A0[1].type===Q.listItemIndent);else break}if(D4&&(!F0||D4<F0))c0._spread=!0;c0.end=Object.assign({},F0?P[F0][1].start:u1[1].end),P.splice(F0||s,0,["exit",c0,u1[2]]),s++,b++}if(u1[1].type===Q.listItemPrefix){let O2={type:"listItem",_spread:!1,start:Object.assign({},u1[1].start),end:void 0};c0=O2,P.splice(s,0,["enter",O2,u1[2]]),s++,b++,D4=void 0,R4=!0}}}return P[N][1]._spread=g1,b}function V(P,N){return b;function b(s){if(J.call(this,P(s),s),N)N.call(this,s)}}function q(){this.stack.push({type:"fragment",children:[]})}function J(P,N,b){let s=this.stack[this.stack.length-1];w(s,"expected `parent`"),w("children"in s,"expected `parent`"),s.children.push(P),this.stack.push(P),this.tokenStack.push([N,b||void 0]),P.position={start:I0(N.start),end:void 0}}function H(P){return N;function N(b){if(P)P.call(this,b);D.call(this,b)}}function D(P,N){let b=this.stack.pop();w(b,"expected `node`");let s=this.tokenStack.pop();if(!s)throw Error("Cannot close `"+P.type+"` ("+S0({start:P.start,end:P.end})+"): it\u2019s not open");else if(s[0].type!==P.type)if(N)N.call(this,P,s[0]);else(s[1]||uG).call(this,P,s[0]);w(b.type!=="fragment","unexpected fragment `exit`ed"),w(b.position,"expected `position` to be defined"),b.position.end=I0(P.end)}function R(){return e0(this.stack.pop())}function M(){this.data.expectingFirstListItemValue=!0}function A(P){if(this.data.expectingFirstListItemValue){let N=this.stack[this.stack.length-2];w(N,"expected nodes on stack"),w(N.type==="list","expected list on stack"),N.start=Number.parseInt(this.sliceSerialize(P),j.numericBaseDecimal),this.data.expectingFirstListItemValue=void 0}}function F(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="code","expected code on stack"),N.lang=P}function Z(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="code","expected code on stack"),N.meta=P}function z(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function E(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="code","expected code on stack"),N.value=P.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="code","expected code on stack"),N.value=P.replace(/(\r?\n|\r)$/g,"")}function v(P){let N=this.resume(),b=this.stack[this.stack.length-1];w(b,"expected node on stack"),w(b.type==="definition","expected definition on stack"),b.label=N,b.identifier=O0(this.sliceSerialize(P)).toLowerCase()}function h(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="definition","expected definition on stack"),N.title=P}function e(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="definition","expected definition on stack"),N.url=P}function Y1(P){let N=this.stack[this.stack.length-1];if(w(N,"expected node on stack"),w(N.type==="heading","expected heading on stack"),!N.depth){let b=this.sliceSerialize(P).length;w(b===1||b===2||b===3||b===4||b===5||b===6,"expected `depth` between `1` and `6`"),N.depth=b}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function G1(P){let N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="heading","expected heading on stack"),N.depth=this.sliceSerialize(P).codePointAt(0)===K.equalsTo?1:2}function V1(){this.data.setextHeadingSlurpLineEnding=void 0}function t(P){let N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w("children"in N,"expected parent on stack");let b=N.children,s=b[b.length-1];if(!s||s.type!=="text")s=VV(),s.position={start:I0(P.start),end:void 0},b.push(s);this.stack.push(s)}function W1(P){let N=this.stack.pop();w(N,"expected a `node` to be on the stack"),w("value"in N,"expected a `literal` to be on the stack"),w(N.position,"expected `node` to have an open position"),N.value+=this.sliceSerialize(P),N.position.end=I0(P.end)}function d1(P){let N=this.stack[this.stack.length-1];if(w(N,"expected `node`"),this.data.atHardBreak){w("children"in N,"expected `parent`");let b=N.children[N.children.length-1];w(b.position,"expected tail to have a starting position"),b.position.end=I0(P.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&G.canContainEols.includes(N.type))t.call(this,P),W1.call(this,P)}function X1(){this.data.atHardBreak=!0}function k(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="html","expected html on stack"),N.value=P}function r(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="html","expected html on stack"),N.value=P}function n(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="inlineCode","expected inline code on stack"),N.value=P}function J1(){let P=this.stack[this.stack.length-1];if(w(P,"expected node on stack"),w(P.type==="link","expected link on stack"),this.data.inReference){let N=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=N,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function K1(){let P=this.stack[this.stack.length-1];if(w(P,"expected node on stack"),w(P.type==="image","expected image on stack"),this.data.inReference){let N=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=N,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function c1(P){let N=this.sliceSerialize(P),b=this.stack[this.stack.length-2];w(b,"expected ancestor on stack"),w(b.type==="image"||b.type==="link","expected image or link on stack"),b.label=L6(N),b.identifier=O0(N).toLowerCase()}function W0(){let P=this.stack[this.stack.length-1];w(P,"expected node on stack"),w(P.type==="fragment","expected fragment on stack");let N=this.resume(),b=this.stack[this.stack.length-1];if(w(b,"expected node on stack"),w(b.type==="image"||b.type==="link","expected image or link on stack"),this.data.inReference=!0,b.type==="link"){let s=P.children;b.children=s}else b.alt=N}function B(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="image"||N.type==="link","expected image or link on stack"),N.url=P}function i1(){let P=this.resume(),N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="image"||N.type==="link","expected image or link on stack"),N.title=P}function Q0(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function m1(P){let N=this.resume(),b=this.stack[this.stack.length-1];w(b,"expected node on stack"),w(b.type==="image"||b.type==="link","expected image reference or link reference on stack"),b.label=N,b.identifier=O0(this.sliceSerialize(P)).toLowerCase(),this.data.referenceType="full"}function r0(P){w(P.type==="characterReferenceMarkerNumeric"||P.type==="characterReferenceMarkerHexadecimal"),this.data.characterReferenceType=P.type}function K5(P){let N=this.sliceSerialize(P),b=this.data.characterReferenceType,s;if(b)s=R6(N,b===Q.characterReferenceMarkerNumeric?j.numericBaseDecimal:j.numericBaseHexadecimal),this.data.characterReferenceType=void 0;else{let g1=C2(N);w(g1!==!1,"expected reference to decode"),s=g1}let $1=this.stack[this.stack.length-1];w($1,"expected `node`"),w("value"in $1,"expected `node.value`"),$1.value+=s}function a4(P){let N=this.stack.pop();w(N,"expected `node`"),w(N.position,"expected `node.position`"),N.position.end=I0(P.end)}function F1(P){W1.call(this,P);let N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="link","expected link on stack"),N.url=this.sliceSerialize(P)}function U4(P){W1.call(this,P);let N=this.stack[this.stack.length-1];w(N,"expected node on stack"),w(N.type==="link","expected link on stack"),N.url="mailto:"+this.sliceSerialize(P)}function K0(){return{type:"blockquote",children:[]}}function d0(){return{type:"code",lang:null,meta:null,value:""}}function B2(){return{type:"inlineCode",value:""}}function F5(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $V(){return{type:"emphasis",children:[]}}function C8(){return{type:"heading",depth:0,children:[]}}function S8(){return{type:"break"}}function I8(){return{type:"html",value:""}}function GV(){return{type:"image",title:null,url:"",alt:null}}function x8(){return{type:"link",title:null,url:"",children:[]}}function k8(P){return{type:"list",ordered:P.type==="listOrdered",start:null,spread:P._spread,children:[]}}function XV(P){return{type:"listItem",spread:P._spread,checked:null,children:[]}}function YV(){return{type:"paragraph",children:[]}}function WV(){return{type:"strong",children:[]}}function VV(){return{type:"text",value:""}}function qV(){return{type:"thematicBreak"}}}function I0($){return{line:$.line,column:$.column,offset:$.offset}}function lG($,G){let X=-1;while(++X<G.length){let Y=G[X];if(Array.isArray(Y))lG($,Y);else CR($,Y)}}function CR($,G){let X;for(X in G)if(pG.call(G,X))switch(X){case"canContainEols":{let Y=G[X];if(Y)$[X].push(...Y);break}case"transforms":{let Y=G[X];if(Y)$[X].push(...Y);break}case"enter":case"exit":{let Y=G[X];if(Y)Object.assign($[X],Y);break}}}function uG($,G){if($)throw Error("Cannot close `"+$.type+"` ("+S0({start:$.start,end:$.end})+"): a different token (`"+G.type+"`, "+S0({start:G.start,end:G.end})+") is open");else throw Error("Cannot close document, a token (`"+G.type+"`, "+S0({start:G.start,end:G.end})+") is still open")}function E6($){let G=this;G.parser=X;function X(Y){return J9(Y,{...G.data("settings"),...$,extensions:G.data("micromarkExtensions")||[],mdastExtensions:G.data("fromMarkdownExtensions")||[]})}}var rG={}.hasOwnProperty;function dG($,G){let X=G||{};function Y(W,...V){let{invalid:q,handlers:J}=Y;if(W&&rG.call(W,$)){let H=String(W[$]);q=rG.call(J,H)?J[H]:Y.unknown}if(q)return q.call(this,W,...V)}return Y.handlers=X.handlers||{},Y.invalid=X.invalid,Y.unknown=X.unknown,Y}var SR={}.hasOwnProperty;function H9($,G){let X=-1,Y;if(G.extensions)while(++X<G.extensions.length)H9($,G.extensions[X]);for(Y in G)if(SR.call(G,Y))switch(Y){case"extensions":break;case"unsafe":{cG($[Y],G[Y]);break}case"join":{cG($[Y],G[Y]);break}case"handlers":{IR($[Y],G[Y]);break}default:$.options[Y]=G[Y]}return $}function cG($,G){if(G)$.push(...G)}function IR($,G){if(G)Object.assign($,G)}function iG($,G,X,Y){let W=X.enter("blockquote"),V=X.createTracker(Y);V.move("> "),V.shift(2);let q=X.indentLines(X.containerFlow($,V.current()),xR);return W(),q}function xR($,G,X){return">"+(X?"":" ")+$}function j6($,G){return nG($,G.inConstruct,!0)&&!nG($,G.notInConstruct,!1)}function nG($,G,X){if(typeof G==="string")G=[G];if(!G||G.length===0)return X;let Y=-1;while(++Y<G.length)if($.includes(G[Y]))return!0;return!1}function U9($,G,X,Y){let W=-1;while(++W<X.unsafe.length)if(X.unsafe[W].character===`
|
|
@@ -85,7 +85,7 @@ return `+str.trim()+`;
|
|
|
85
85
|
`}var sR=/\r?\n|\r/g;function N3($,G){let X=[],Y=0,W=0,V;while(V=sR.exec($))q($.slice(Y,V.index)),X.push(V[0]),Y=V.index+V[0].length,W++;return q($.slice(Y)),X.join("");function q(J){X.push(G(J,W,!J))}}function z3($,G,X){let Y=(X.before||"")+(G||"")+(X.after||""),W=[],V=[],q={},J=-1;while(++J<$.unsafe.length){let R=$.unsafe[J];if(!j6($.stack,R))continue;let M=$.compilePattern(R),A;while(A=M.exec(Y)){let F="before"in R||Boolean(R.atBreak),Z="after"in R,z=A.index+(F?A[1].length:0);if(W.includes(z)){if(q[z].before&&!F)q[z].before=!1;if(q[z].after&&!Z)q[z].after=!1}else W.push(z),q[z]={before:F,after:Z}}}W.sort(aR);let H=X.before?X.before.length:0,D=Y.length-(X.after?X.after.length:0);J=-1;while(++J<W.length){let R=W[J];if(R<H||R>=D)continue;if(R+1<D&&W[J+1]===R+1&&q[R].after&&!q[R+1].before&&!q[R+1].after||W[J-1]===R-1&&q[R].before&&!q[R-1].before&&!q[R-1].after)continue;if(H!==R)V.push(Z3(Y.slice(H,R),"\\"));if(H=R,/[!-/:-@[-`{-~]/.test(Y.charAt(R))&&(!X.encode||!X.encode.includes(Y.charAt(R))))V.push("\\");else V.push(r1(Y.charCodeAt(R))),H++}return V.push(Z3(Y.slice(H,D),X.after)),V.join("")}function aR($,G){return $-G}function Z3($,G){let X=/\\(?=[!-/:-@[-`{-~])/g,Y=[],W=[],V=$+G,q=-1,J=0,H;while(H=X.exec(V))Y.push(H.index);while(++q<Y.length){if(J!==Y[q])W.push($.slice(J,Y[q]));W.push("\\"),J=Y[q]}return W.push($.slice(J)),W.join("")}function _3($){let G=$||{},X=G.now||{},Y=G.lineShift||0,W=X.line||1,V=X.column||1;return{move:H,current:q,shift:J};function q(){return{now:{line:W,column:V},lineShift:Y}}function J(D){Y+=D}function H(D){let R=D||"",M=R.split(/\r?\n|\r/g),A=M[M.length-1];return W+=M.length-1,V=M.length===1?V+A.length:1+A.length+Y,R}}function Z9($,G){let X=G||{},Y={associationId:w3,containerPhrasing:GM,containerFlow:XM,createTracker:_3,compilePattern:B3,enter:V,handlers:{...K3},handle:void 0,indentLines:N3,indexStack:[],join:[...F3],options:{},safe:YM,stack:[],unsafe:[...A3]};if(H9(Y,X),Y.options.tightDefinitions)Y.join.push($M);Y.handle=dG("type",{invalid:tR,unknown:eR,handlers:Y.handlers});let W=Y.handle($,void 0,Y,{before:`
|
|
86
86
|
`,after:`
|
|
87
87
|
`,now:{line:1,column:1},lineShift:0});if(W&&W.charCodeAt(W.length-1)!==10&&W.charCodeAt(W.length-1)!==13)W+=`
|
|
88
|
-
`;return W;function V(q){return Y.stack.push(q),J;function J(){Y.stack.pop()}}}function tR($){throw Error("Cannot handle value `"+$+"`, expected node")}function eR($){throw Error("Cannot handle unknown node `"+$.type+"`")}function $M($,G){if($.type==="definition"&&$.type===G.type)return 0}function GM($,G){return O3($,this,G)}function XM($,G){return P3($,this,G)}function YM($,G){return z3(this,$,G)}function k6($){let G=this;G.compiler=X;function X(Y){return Z9(Y,{...G.data("settings"),...$,extensions:G.data("toMarkdownExtensions")||[]})}}function z9($){if($)throw $}var y6=t4(k3(),1);function T4($){if(typeof $!=="object"||$===null)return!1;let G=Object.getPrototypeOf($);return(G===null||G===Object.prototype||Object.getPrototypeOf(G)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function _9(){let $=[],G={run:X,use:Y};return G;function X(...W){let V=-1,q=W.pop();if(typeof q!=="function")throw TypeError("Expected function as last argument, not "+q);J(null,...W);function J(H,...D){let R=$[++V],M=-1;if(H){q(H);return}while(++M<W.length)if(D[M]===null||D[M]===void 0)D[M]=W[M];if(W=D,R)b3(R,J)(...D);else q(null,...D)}}function Y(W){if(typeof W!=="function")throw TypeError("Expected `middelware` to be a function, not "+W);return $.push(W),G}}function b3($,G){let X;return Y;function Y(...q){let J=$.length>q.length,H;if(J)q.push(W);try{H=$.apply(this,q)}catch(D){let R=D;if(J&&X)throw R;return W(R)}if(!J)if(H&&H.then&&typeof H.then==="function")H.then(V,W);else if(H instanceof Error)W(H);else V(H)}function W(q,...J){if(!X)X=!0,G(q,...J)}function V(q){W(null,q)}}class z1 extends Error{constructor($,G,X){super();if(typeof G==="string")X=G,G=void 0;let Y="",W={},V=!1;if(G)if("line"in G&&"column"in G)W={place:G};else if("start"in G&&"end"in G)W={place:G};else if("type"in G)W={ancestors:[G],place:G.position};else W={...G};if(typeof $==="string")Y=$;else if(!W.cause&&$)V=!0,Y=$.message,W.cause=$;if(!W.ruleId&&!W.source&&typeof X==="string"){let J=X.indexOf(":");if(J===-1)W.ruleId=X;else W.source=X.slice(0,J),W.ruleId=X.slice(J+1)}if(!W.place&&W.ancestors&&W.ancestors){let J=W.ancestors[W.ancestors.length-1];if(J)W.place=J.position}let q=W.place&&"start"in W.place?W.place.start:W.place;this.ancestors=W.ancestors||void 0,this.cause=W.cause||void 0,this.column=q?q.column:void 0,this.fatal=void 0,this.file="",this.message=Y,this.line=q?q.line:void 0,this.name=S0(W.place)||"1:1",this.place=W.place||void 0,this.reason=this.message,this.ruleId=W.ruleId||void 0,this.source=W.source||void 0,this.stack=V&&W.cause&&typeof W.cause.stack==="string"?W.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}z1.prototype.file="";z1.prototype.name="";z1.prototype.reason="";z1.prototype.message="";z1.prototype.stack="";z1.prototype.column=void 0;z1.prototype.line=void 0;z1.prototype.ancestors=void 0;z1.prototype.cause=void 0;z1.prototype.fatal=void 0;z1.prototype.place=void 0;z1.prototype.ruleId=void 0;z1.prototype.source=void 0;import{default as s1}from"path";import{default as v3}from"process";import{fileURLToPath as g3}from"url";function v6($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}var L9=["history","path","basename","stem","extname","dirname"];class g6{constructor($){let G;if(!$)G={};else if(v6($))G={path:$};else if(typeof $==="string"||WM($))G={value:$};else G=$;this.cwd="cwd"in G?"":v3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let X=-1;while(++X<L9.length){let W=L9[X];if(W in G&&G[W]!==void 0&&G[W]!==null)this[W]=W==="history"?[...G[W]]:G[W]}let Y;for(Y in G)if(!L9.includes(Y))this[Y]=G[Y]}get basename(){return typeof this.path==="string"?s1.basename(this.path):void 0}set basename($){j9($,"basename"),E9($,"basename"),this.path=s1.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?s1.dirname(this.path):void 0}set dirname($){h3(this.basename,"dirname"),this.path=s1.join($||"",this.basename)}get extname(){return typeof this.path==="string"?s1.extname(this.path):void 0}set extname($){if(E9($,"extname"),h3(this.dirname,"extname"),$){if($.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if($.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=s1.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(v6($))$=g3($);if(j9($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?s1.basename(this.path,this.extname):void 0}set stem($){j9($,"stem"),E9($,"stem"),this.path=s1.join(this.dirname||"",$+(this.extname||""))}fail($,G,X){let Y=this.message($,G,X);throw Y.fatal=!0,Y}info($,G,X){let Y=this.message($,G,X);return Y.fatal=void 0,Y}message($,G,X){let Y=new z1($,G,X);if(this.path)Y.name=this.path+":"+Y.name,Y.file=this.path;return Y.fatal=!1,this.messages.push(Y),Y}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function E9($,G){if($&&$.includes(s1.sep))throw Error("`"+G+"` cannot be a path: did not expect `"+s1.sep+"`")}function j9($,G){if(!$)throw Error("`"+G+"` cannot be empty")}function h3($,G){if(!$)throw Error("Setting `"+G+"` requires `path` to be set too")}function WM($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var y3=function($){let Y=this.constructor.prototype,W=Y[$],V=function(){return W.apply(V,arguments)};return Object.setPrototypeOf(V,Y),V};var VM={}.hasOwnProperty;class I9 extends y3{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_9()}copy(){let $=new I9,G=-1;while(++G<this.attachers.length){let X=this.attachers[G];$.use(...X)}return $.data(y6.default(!0,{},this.namespace)),$}data($,G){if(typeof $==="string"){if(arguments.length===2)return S9("data",this.frozen),this.namespace[$]=G,this;return VM.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return S9("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[G,...X]=this.attachers[this.freezeIndex];if(X[0]===!1)continue;if(X[0]===!0)X[0]=void 0;let Y=G.call($,...X);if(typeof Y==="function")this.transformers.use(Y)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let G=h6($),X=this.parser||this.Parser;return T9("parse",X),X(String(G),G)}process($,G){let X=this;return this.freeze(),T9("process",this.parser||this.Parser),C9("process",this.compiler||this.Compiler),G?Y(void 0,G):new Promise(Y);function Y(W,V){let q=h6($),J=X.parse(q);X.run(J,q,function(D,R,M){if(D||!R||!M)return H(D);let A=R,F=X.stringify(A,M);if(JM(F))M.value=F;else M.result=F;H(D,M)});function H(D,R){if(D||!R)V(D);else if(W)W(R);else w(G,"`done` is defined if `resolve` is not"),G(void 0,R)}}}processSync($){let G=!1,X;return this.freeze(),T9("processSync",this.parser||this.Parser),C9("processSync",this.compiler||this.Compiler),this.process($,Y),m3("processSync","process",G),w(X,"we either bailed on an error or have a tree"),X;function Y(W,V){G=!0,z9(W),X=V}}run($,G,X){f3($),this.freeze();let Y=this.transformers;if(!X&&typeof G==="function")X=G,G=void 0;return X?W(void 0,X):new Promise(W);function W(V,q){w(typeof G!=="function","`file` can\u2019t be a `done` anymore, we checked");let J=h6(G);Y.run($,J,H);function H(D,R,M){let A=R||$;if(D)q(D);else if(V)V(A);else w(X,"`done` is defined if `resolve` is not"),X(void 0,A,M)}}}runSync($,G){let X=!1,Y;return this.run($,G,W),m3("runSync","run",X),w(Y,"we either bailed on an error or have a tree"),Y;function W(V,q){z9(V),Y=q,X=!0}}stringify($,G){this.freeze();let X=h6(G),Y=this.compiler||this.Compiler;return C9("stringify",Y),f3($),Y($,X)}use($,...G){let X=this.attachers,Y=this.namespace;if(S9("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")J($,G);else if(typeof $==="object")if(Array.isArray($))q($);else V($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function W(H){if(typeof H==="function")J(H,[]);else if(typeof H==="object")if(Array.isArray(H)){let[D,...R]=H;J(D,R)}else V(H);else throw TypeError("Expected usable value, not `"+H+"`")}function V(H){if(!("plugins"in H)&&!("settings"in H))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(q(H.plugins),H.settings)Y.settings=y6.default(!0,Y.settings,H.settings)}function q(H){let D=-1;if(H===null||H===void 0);else if(Array.isArray(H))while(++D<H.length){let R=H[D];W(R)}else throw TypeError("Expected a list of plugins, not `"+H+"`")}function J(H,D){let R=-1,M=-1;while(++R<X.length)if(X[R][0]===H){M=R;break}if(M===-1)X.push([H,...D]);else if(D.length>0){let[A,...F]=D,Z=X[M][1];if(T4(Z)&&T4(A))A=y6.default(!0,Z,A);X[M]=[H,A,...F]}}}}var x9=new I9().freeze();function T9($,G){if(typeof G!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function C9($,G){if(typeof G!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function S9($,G){if(G)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function f3($){if(!T4($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function m3($,G,X){if(!X)throw Error("`"+$+"` finished async. Use `"+G+"` instead")}function h6($){return qM($)?$:new g6($)}function qM($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function JM($){return typeof $==="string"||HM($)}function HM($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var u3=x9().use(E6).use(k6).freeze();var Qj=u3();class x0{callback;heartbeatInterval;constructor($){this.callback=$}static from($){if(!$)return;return new x0($)}createSub($){let{scale:G}=$??{};if(G){let{start:X,end:Y}=G,W=Y-X;return new x0(async(V)=>{let q=X+V.progress/(V.total??100)*W;await this.callback({...V,progress:q,total:100})})}return new x0(this.callback)}async report($){await this.callback($)}startHeartbeat($,G=5000){this.stopHeartbeat(),this.heartbeatInterval=setInterval(()=>{this.report({message:$,progress:0}).catch(()=>{})},G)}stopHeartbeat(){if(this.heartbeatInterval)clearInterval(this.heartbeatInterval),this.heartbeatInterval=void 0}toCallback(){return this.callback}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function YX($){return typeof $>"u"||$===null}function DM($){return typeof $==="object"&&$!==null}function RM($){if(Array.isArray($))return $;else if(YX($))return[];return[$]}function MM($,G){var X,Y,W,V;if(G){V=Object.keys(G);for(X=0,Y=V.length;X<Y;X+=1)W=V[X],$[W]=G[W]}return $}function QM($,G){var X="",Y;for(Y=0;Y<G;Y+=1)X+=$;return X}function KM($){return $===0&&Number.NEGATIVE_INFINITY===1/$}var FM=YX,AM=DM,wM=RM,BM=QM,OM=KM,PM=MM,w1={isNothing:FM,isObject:AM,toArray:wM,repeat:BM,isNegativeZero:OM,extend:PM};function WX($,G){var X="",Y=$.reason||"(unknown reason)";if(!$.mark)return Y;if($.mark.name)X+='in "'+$.mark.name+'" ';if(X+="("+($.mark.line+1)+":"+($.mark.column+1)+")",!G&&$.mark.snippet)X+=`
|
|
88
|
+
`;return W;function V(q){return Y.stack.push(q),J;function J(){Y.stack.pop()}}}function tR($){throw Error("Cannot handle value `"+$+"`, expected node")}function eR($){throw Error("Cannot handle unknown node `"+$.type+"`")}function $M($,G){if($.type==="definition"&&$.type===G.type)return 0}function GM($,G){return O3($,this,G)}function XM($,G){return P3($,this,G)}function YM($,G){return z3(this,$,G)}function k6($){let G=this;G.compiler=X;function X(Y){return Z9(Y,{...G.data("settings"),...$,extensions:G.data("toMarkdownExtensions")||[]})}}function z9($){if($)throw $}var y6=t4(k3(),1);function T4($){if(typeof $!=="object"||$===null)return!1;let G=Object.getPrototypeOf($);return(G===null||G===Object.prototype||Object.getPrototypeOf(G)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function _9(){let $=[],G={run:X,use:Y};return G;function X(...W){let V=-1,q=W.pop();if(typeof q!=="function")throw TypeError("Expected function as last argument, not "+q);J(null,...W);function J(H,...D){let R=$[++V],M=-1;if(H){q(H);return}while(++M<W.length)if(D[M]===null||D[M]===void 0)D[M]=W[M];if(W=D,R)b3(R,J)(...D);else q(null,...D)}}function Y(W){if(typeof W!=="function")throw TypeError("Expected `middelware` to be a function, not "+W);return $.push(W),G}}function b3($,G){let X;return Y;function Y(...q){let J=$.length>q.length,H;if(J)q.push(W);try{H=$.apply(this,q)}catch(D){let R=D;if(J&&X)throw R;return W(R)}if(!J)if(H&&H.then&&typeof H.then==="function")H.then(V,W);else if(H instanceof Error)W(H);else V(H)}function W(q,...J){if(!X)X=!0,G(q,...J)}function V(q){W(null,q)}}class z1 extends Error{constructor($,G,X){super();if(typeof G==="string")X=G,G=void 0;let Y="",W={},V=!1;if(G)if("line"in G&&"column"in G)W={place:G};else if("start"in G&&"end"in G)W={place:G};else if("type"in G)W={ancestors:[G],place:G.position};else W={...G};if(typeof $==="string")Y=$;else if(!W.cause&&$)V=!0,Y=$.message,W.cause=$;if(!W.ruleId&&!W.source&&typeof X==="string"){let J=X.indexOf(":");if(J===-1)W.ruleId=X;else W.source=X.slice(0,J),W.ruleId=X.slice(J+1)}if(!W.place&&W.ancestors&&W.ancestors){let J=W.ancestors[W.ancestors.length-1];if(J)W.place=J.position}let q=W.place&&"start"in W.place?W.place.start:W.place;this.ancestors=W.ancestors||void 0,this.cause=W.cause||void 0,this.column=q?q.column:void 0,this.fatal=void 0,this.file="",this.message=Y,this.line=q?q.line:void 0,this.name=S0(W.place)||"1:1",this.place=W.place||void 0,this.reason=this.message,this.ruleId=W.ruleId||void 0,this.source=W.source||void 0,this.stack=V&&W.cause&&typeof W.cause.stack==="string"?W.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}z1.prototype.file="";z1.prototype.name="";z1.prototype.reason="";z1.prototype.message="";z1.prototype.stack="";z1.prototype.column=void 0;z1.prototype.line=void 0;z1.prototype.ancestors=void 0;z1.prototype.cause=void 0;z1.prototype.fatal=void 0;z1.prototype.place=void 0;z1.prototype.ruleId=void 0;z1.prototype.source=void 0;import{default as s1}from"path";import{default as v3}from"process";import{fileURLToPath as g3}from"url";function v6($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}var L9=["history","path","basename","stem","extname","dirname"];class g6{constructor($){let G;if(!$)G={};else if(v6($))G={path:$};else if(typeof $==="string"||WM($))G={value:$};else G=$;this.cwd="cwd"in G?"":v3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let X=-1;while(++X<L9.length){let W=L9[X];if(W in G&&G[W]!==void 0&&G[W]!==null)this[W]=W==="history"?[...G[W]]:G[W]}let Y;for(Y in G)if(!L9.includes(Y))this[Y]=G[Y]}get basename(){return typeof this.path==="string"?s1.basename(this.path):void 0}set basename($){j9($,"basename"),E9($,"basename"),this.path=s1.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?s1.dirname(this.path):void 0}set dirname($){h3(this.basename,"dirname"),this.path=s1.join($||"",this.basename)}get extname(){return typeof this.path==="string"?s1.extname(this.path):void 0}set extname($){if(E9($,"extname"),h3(this.dirname,"extname"),$){if($.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if($.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=s1.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(v6($))$=g3($);if(j9($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?s1.basename(this.path,this.extname):void 0}set stem($){j9($,"stem"),E9($,"stem"),this.path=s1.join(this.dirname||"",$+(this.extname||""))}fail($,G,X){let Y=this.message($,G,X);throw Y.fatal=!0,Y}info($,G,X){let Y=this.message($,G,X);return Y.fatal=void 0,Y}message($,G,X){let Y=new z1($,G,X);if(this.path)Y.name=this.path+":"+Y.name,Y.file=this.path;return Y.fatal=!1,this.messages.push(Y),Y}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function E9($,G){if($&&$.includes(s1.sep))throw Error("`"+G+"` cannot be a path: did not expect `"+s1.sep+"`")}function j9($,G){if(!$)throw Error("`"+G+"` cannot be empty")}function h3($,G){if(!$)throw Error("Setting `"+G+"` requires `path` to be set too")}function WM($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var y3=function($){let Y=this.constructor.prototype,W=Y[$],V=function(){return W.apply(V,arguments)};return Object.setPrototypeOf(V,Y),V};var VM={}.hasOwnProperty;class I9 extends y3{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_9()}copy(){let $=new I9,G=-1;while(++G<this.attachers.length){let X=this.attachers[G];$.use(...X)}return $.data(y6.default(!0,{},this.namespace)),$}data($,G){if(typeof $==="string"){if(arguments.length===2)return S9("data",this.frozen),this.namespace[$]=G,this;return VM.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return S9("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[G,...X]=this.attachers[this.freezeIndex];if(X[0]===!1)continue;if(X[0]===!0)X[0]=void 0;let Y=G.call($,...X);if(typeof Y==="function")this.transformers.use(Y)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let G=h6($),X=this.parser||this.Parser;return T9("parse",X),X(String(G),G)}process($,G){let X=this;return this.freeze(),T9("process",this.parser||this.Parser),C9("process",this.compiler||this.Compiler),G?Y(void 0,G):new Promise(Y);function Y(W,V){let q=h6($),J=X.parse(q);X.run(J,q,function(D,R,M){if(D||!R||!M)return H(D);let A=R,F=X.stringify(A,M);if(JM(F))M.value=F;else M.result=F;H(D,M)});function H(D,R){if(D||!R)V(D);else if(W)W(R);else w(G,"`done` is defined if `resolve` is not"),G(void 0,R)}}}processSync($){let G=!1,X;return this.freeze(),T9("processSync",this.parser||this.Parser),C9("processSync",this.compiler||this.Compiler),this.process($,Y),m3("processSync","process",G),w(X,"we either bailed on an error or have a tree"),X;function Y(W,V){G=!0,z9(W),X=V}}run($,G,X){f3($),this.freeze();let Y=this.transformers;if(!X&&typeof G==="function")X=G,G=void 0;return X?W(void 0,X):new Promise(W);function W(V,q){w(typeof G!=="function","`file` can\u2019t be a `done` anymore, we checked");let J=h6(G);Y.run($,J,H);function H(D,R,M){let A=R||$;if(D)q(D);else if(V)V(A);else w(X,"`done` is defined if `resolve` is not"),X(void 0,A,M)}}}runSync($,G){let X=!1,Y;return this.run($,G,W),m3("runSync","run",X),w(Y,"we either bailed on an error or have a tree"),Y;function W(V,q){z9(V),Y=q,X=!0}}stringify($,G){this.freeze();let X=h6(G),Y=this.compiler||this.Compiler;return C9("stringify",Y),f3($),Y($,X)}use($,...G){let X=this.attachers,Y=this.namespace;if(S9("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")J($,G);else if(typeof $==="object")if(Array.isArray($))q($);else V($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function W(H){if(typeof H==="function")J(H,[]);else if(typeof H==="object")if(Array.isArray(H)){let[D,...R]=H;J(D,R)}else V(H);else throw TypeError("Expected usable value, not `"+H+"`")}function V(H){if(!("plugins"in H)&&!("settings"in H))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(q(H.plugins),H.settings)Y.settings=y6.default(!0,Y.settings,H.settings)}function q(H){let D=-1;if(H===null||H===void 0);else if(Array.isArray(H))while(++D<H.length){let R=H[D];W(R)}else throw TypeError("Expected a list of plugins, not `"+H+"`")}function J(H,D){let R=-1,M=-1;while(++R<X.length)if(X[R][0]===H){M=R;break}if(M===-1)X.push([H,...D]);else if(D.length>0){let[A,...F]=D,Z=X[M][1];if(T4(Z)&&T4(A))A=y6.default(!0,Z,A);X[M]=[H,A,...F]}}}}var x9=new I9().freeze();function T9($,G){if(typeof G!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function C9($,G){if(typeof G!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function S9($,G){if(G)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function f3($){if(!T4($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function m3($,G,X){if(!X)throw Error("`"+$+"` finished async. Use `"+G+"` instead")}function h6($){return qM($)?$:new g6($)}function qM($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function JM($){return typeof $==="string"||HM($)}function HM($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var u3=x9().use(E6).use(k6).freeze();var Kj=u3();class x0{callback;heartbeatInterval;constructor($){this.callback=$}static from($){if(!$)return;return new x0($)}createSub($){let{scale:G}=$??{};if(G){let{start:X,end:Y}=G,W=Y-X;return new x0(async(V)=>{let q=X+V.progress/(V.total??100)*W;await this.callback({...V,progress:q,total:100})})}return new x0(this.callback)}async report($){await this.callback($)}startHeartbeat($,G=5000){this.stopHeartbeat(),this.heartbeatInterval=setInterval(()=>{this.report({message:$,progress:0}).catch(()=>{})},G)}stopHeartbeat(){if(this.heartbeatInterval)clearInterval(this.heartbeatInterval),this.heartbeatInterval=void 0}toCallback(){return this.callback}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function YX($){return typeof $>"u"||$===null}function DM($){return typeof $==="object"&&$!==null}function RM($){if(Array.isArray($))return $;else if(YX($))return[];return[$]}function MM($,G){var X,Y,W,V;if(G){V=Object.keys(G);for(X=0,Y=V.length;X<Y;X+=1)W=V[X],$[W]=G[W]}return $}function QM($,G){var X="",Y;for(Y=0;Y<G;Y+=1)X+=$;return X}function KM($){return $===0&&Number.NEGATIVE_INFINITY===1/$}var FM=YX,AM=DM,wM=RM,BM=QM,OM=KM,PM=MM,w1={isNothing:FM,isObject:AM,toArray:wM,repeat:BM,isNegativeZero:OM,extend:PM};function WX($,G){var X="",Y=$.reason||"(unknown reason)";if(!$.mark)return Y;if($.mark.name)X+='in "'+$.mark.name+'" ';if(X+="("+($.mark.line+1)+":"+($.mark.column+1)+")",!G&&$.mark.snippet)X+=`
|
|
89
89
|
|
|
90
90
|
`+$.mark.snippet;return Y+" "+X}function S4($,G){if(Error.call(this),this.name="YAMLException",this.reason=$,this.mark=G,this.message=WX(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}S4.prototype=Object.create(Error.prototype);S4.prototype.constructor=S4;S4.prototype.toString=function(G){return this.name+": "+WX(this,G)};var y1=S4;function k9($,G,X,Y,W){var V="",q="",J=Math.floor(W/2)-1;if(Y-G>J)V=" ... ",G=Y-J+V.length;if(X-Y>J)q=" ...",X=Y+J-q.length;return{str:V+$.slice(G,X).replace(/\t/g,"\u2192")+q,pos:Y-G+V.length}}function b9($,G){return w1.repeat(" ",G-$.length)+$}function NM($,G){if(G=Object.create(G||null),!$.buffer)return null;if(!G.maxLength)G.maxLength=79;if(typeof G.indent!=="number")G.indent=1;if(typeof G.linesBefore!=="number")G.linesBefore=3;if(typeof G.linesAfter!=="number")G.linesAfter=2;var X=/\r?\n|\r|\0/g,Y=[0],W=[],V,q=-1;while(V=X.exec($.buffer))if(W.push(V.index),Y.push(V.index+V[0].length),$.position<=V.index&&q<0)q=Y.length-2;if(q<0)q=Y.length-1;var J="",H,D,R=Math.min($.line+G.linesAfter,W.length).toString().length,M=G.maxLength-(G.indent+R+3);for(H=1;H<=G.linesBefore;H++){if(q-H<0)break;D=k9($.buffer,Y[q-H],W[q-H],$.position-(Y[q]-Y[q-H]),M),J=w1.repeat(" ",G.indent)+b9(($.line-H+1).toString(),R)+" | "+D.str+`
|
|
91
91
|
`+J}D=k9($.buffer,Y[q],W[q],$.position,M),J+=w1.repeat(" ",G.indent)+b9(($.line+1).toString(),R)+" | "+D.str+`
|
|
@@ -116,13 +116,13 @@ return `+str.trim()+`;
|
|
|
116
116
|
`+$.slice(W,V),W=V+1;q=J}if(H+=`
|
|
117
117
|
`,$.length-W>G&&q>W)H+=$.slice(W,q)+`
|
|
118
118
|
`+$.slice(q+1);else H+=$.slice(W);return H.slice(1)}function _K($){var G="",X=0,Y;for(var W=0;W<$.length;X>=65536?W+=2:W++)if(X=C4($,W),Y=T1[X],!Y&&k4(X)){if(G+=$[W],X>=65536)G+=$[W+1]}else G+=Y||FK(X);return G}function LK($,G,X){var Y="",W=$.tag,V,q,J;for(V=0,q=X.length;V<q;V+=1){if(J=X[V],$.replacer)J=$.replacer.call(X,String(V),J);if(P0($,G,J,!1,!1)||typeof J>"u"&&P0($,G,null,!1,!1)){if(Y!=="")Y+=","+(!$.condenseFlow?" ":"");Y+=$.dump}}$.tag=W,$.dump="["+Y+"]"}function GX($,G,X,Y){var W="",V=$.tag,q,J,H;for(q=0,J=X.length;q<J;q+=1){if(H=X[q],$.replacer)H=$.replacer.call(X,String(q),H);if(P0($,G+1,H,!0,!0,!1,!0)||typeof H>"u"&&P0($,G+1,null,!0,!0,!1,!0)){if(!Y||W!=="")W+=y9($,G);if($.dump&&I4===$.dump.charCodeAt(0))W+="-";else W+="- ";W+=$.dump}}$.tag=V,$.dump=W||"[]"}function EK($,G,X){var Y="",W=$.tag,V=Object.keys(X),q,J,H,D,R;for(q=0,J=V.length;q<J;q+=1){if(R="",Y!=="")R+=", ";if($.condenseFlow)R+='"';if(H=V[q],D=X[H],$.replacer)D=$.replacer.call(X,H,D);if(!P0($,G,H,!1,!1))continue;if($.dump.length>1024)R+="? ";if(R+=$.dump+($.condenseFlow?'"':"")+":"+($.condenseFlow?"":" "),!P0($,G,D,!1,!1))continue;R+=$.dump,Y+=R}$.tag=W,$.dump="{"+Y+"}"}function jK($,G,X,Y){var W="",V=$.tag,q=Object.keys(X),J,H,D,R,M,A;if($.sortKeys===!0)q.sort();else if(typeof $.sortKeys==="function")q.sort($.sortKeys);else if($.sortKeys)throw new y1("sortKeys must be a boolean or a function");for(J=0,H=q.length;J<H;J+=1){if(A="",!Y||W!=="")A+=y9($,G);if(D=q[J],R=X[D],$.replacer)R=$.replacer.call(X,D,R);if(!P0($,G+1,D,!0,!0,!0))continue;if(M=$.tag!==null&&$.tag!=="?"||$.dump&&$.dump.length>1024,M)if($.dump&&I4===$.dump.charCodeAt(0))A+="?";else A+="? ";if(A+=$.dump,M)A+=y9($,G);if(!P0($,G+1,R,!0,M))continue;if($.dump&&I4===$.dump.charCodeAt(0))A+=":";else A+=": ";A+=$.dump,W+=A}$.tag=V,$.dump=W||"{}"}function XX($,G,X){var Y,W,V,q,J,H;W=X?$.explicitTypes:$.implicitTypes;for(V=0,q=W.length;V<q;V+=1)if(J=W[V],(J.instanceOf||J.predicate)&&(!J.instanceOf||typeof G==="object"&&G instanceof J.instanceOf)&&(!J.predicate||J.predicate(G))){if(X)if(J.multi&&J.representName)$.tag=J.representName(G);else $.tag=J.tag;else $.tag="?";if(J.represent){if(H=$.styleMap[J.tag]||J.defaultStyle,BX.call(J.represent)==="[object Function]")Y=J.represent(G,H);else if(OX.call(J.represent,H))Y=J.represent[H](G,H);else throw new y1("!<"+J.tag+'> tag resolver accepts not "'+H+'" style');$.dump=Y}return!0}return!1}function P0($,G,X,Y,W,V,q){if($.tag=null,$.dump=X,!XX($,X,!1))XX($,X,!0);var J=BX.call($.dump),H=Y,D;if(Y)Y=$.flowLevel<0||$.flowLevel>G;var R=J==="[object Object]"||J==="[object Array]",M,A;if(R)M=$.duplicates.indexOf(X),A=M!==-1;if($.tag!==null&&$.tag!=="?"||A||$.indent!==2&&G>0)W=!1;if(A&&$.usedDuplicates[M])$.dump="*ref_"+M;else{if(R&&A&&!$.usedDuplicates[M])$.usedDuplicates[M]=!0;if(J==="[object Object]"){if(Y&&Object.keys($.dump).length!==0){if(jK($,G,$.dump,W),A)$.dump="&ref_"+M+$.dump}else if(EK($,G,$.dump),A)$.dump="&ref_"+M+" "+$.dump}else if(J==="[object Array]"){if(Y&&$.dump.length!==0){if($.noArrayIndent&&!q&&G>0)GX($,G-1,$.dump,W);else GX($,G,$.dump,W);if(A)$.dump="&ref_"+M+$.dump}else if(LK($,G,$.dump),A)$.dump="&ref_"+M+" "+$.dump}else if(J==="[object String]"){if($.tag!=="?")ZK($,$.dump,G,V,H)}else if(J==="[object Undefined]")return!1;else{if($.skipInvalid)return!1;throw new y1("unacceptable kind of an object to dump "+J)}if($.tag!==null&&$.tag!=="?"){if(D=encodeURI($.tag[0]==="!"?$.tag.slice(1):$.tag).replace(/!/g,"%21"),$.tag[0]==="!")D="!"+D;else if(D.slice(0,18)==="tag:yaml.org,2002:")D="!!"+D.slice(18);else D="!<"+D+">";$.dump=D+" "+$.dump}}return!0}function TK($,G){var X=[],Y=[],W,V;m9($,X,Y);for(W=0,V=Y.length;W<V;W+=1)G.duplicates.push(X[Y[W]]);G.usedDuplicates=Array(V)}function m9($,G,X){var Y,W,V;if($!==null&&typeof $==="object")if(W=G.indexOf($),W!==-1){if(X.indexOf(W)===-1)X.push(W)}else if(G.push($),Array.isArray($))for(W=0,V=$.length;W<V;W+=1)m9($[W],G,X);else{Y=Object.keys($);for(W=0,V=Y.length;W<V;W+=1)m9($[Y[W]],G,X)}}function CK($,G){G=G||{};var X=new wK(G);if(!X.noRefs)TK($,X);var Y=$;if(X.replacer)Y=X.replacer.call({"":Y},"",Y);if(P0(X,0,Y,!0,!0))return X.dump+`
|
|
119
|
-
`;return""}var SK=CK,IK={dump:SK};function d9($,G){return function(){throw Error("Function yaml."+$+" is removed in js-yaml 4. Use yaml."+G+" instead, which is now safe by default.")}}var{load:xK,loadAll:Aj}=wX,kK=IK.dump;var wj=d9("safeLoad","load"),Bj=d9("safeLoadAll","loadAll"),Oj=d9("safeDump","dump");import{webcrypto as SX}from"crypto";var CX="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var vK=128,U2,l2;function gK($){if($<0||$>1024)throw RangeError("Wrong ID size");if(!U2||U2.length<$)U2=Buffer.allocUnsafe($*vK),SX.getRandomValues(U2),l2=0;else if(l2+$>U2.length)SX.getRandomValues(U2),l2=0;l2+=$}function IX($=21){gK($|=0);let G="";for(let X=l2-$;X<l2;X++)G+=CX[U2[X]&63];return G}function g0($=12){return IX($)}var U={};b8(U,{void:()=>PF,util:()=>a,unknown:()=>BF,union:()=>_F,undefined:()=>FF,tuple:()=>jF,transformer:()=>hF,symbol:()=>KF,string:()=>mX,strictObject:()=>zF,setErrorMap:()=>fK,set:()=>SF,record:()=>TF,quotelessJson:()=>hK,promise:()=>gF,preprocess:()=>mF,pipeline:()=>uF,ostring:()=>pF,optional:()=>yF,onumber:()=>lF,oboolean:()=>rF,objectUtil:()=>c9,object:()=>ZF,number:()=>uX,nullable:()=>fF,null:()=>AF,never:()=>OF,nativeEnum:()=>vF,nan:()=>RF,map:()=>CF,makeIssue:()=>b4,literal:()=>kF,lazy:()=>xF,late:()=>UF,isValid:()=>h0,isDirty:()=>c6,isAsync:()=>d2,isAborted:()=>d6,intersection:()=>EF,instanceof:()=>DF,getParsedType:()=>J0,getErrorMap:()=>r2,function:()=>IF,enum:()=>bF,effect:()=>hF,discriminatedUnion:()=>LF,defaultErrorMap:()=>N0,datetimeRegex:()=>hX,date:()=>QF,custom:()=>fX,coerce:()=>dF,boolean:()=>pX,bigint:()=>MF,array:()=>NF,any:()=>wF,addIssueToContext:()=>x,ZodVoid:()=>g4,ZodUnknown:()=>y0,ZodUnion:()=>a2,ZodUndefined:()=>o2,ZodType:()=>o,ZodTuple:()=>U0,ZodTransformer:()=>G0,ZodSymbol:()=>v4,ZodString:()=>a1,ZodSet:()=>Q2,ZodSchema:()=>o,ZodRecord:()=>h4,ZodReadonly:()=>W4,ZodPromise:()=>K2,ZodPipeline:()=>m4,ZodParsedType:()=>C,ZodOptional:()=>e1,ZodObject:()=>q1,ZodNumber:()=>f0,ZodNullable:()=>z0,ZodNull:()=>s2,ZodNever:()=>H0,ZodNativeEnum:()=>G4,ZodNaN:()=>f4,ZodMap:()=>y4,ZodLiteral:()=>$4,ZodLazy:()=>e2,ZodIssueCode:()=>T,ZodIntersection:()=>t2,ZodFunction:()=>i2,ZodFirstPartyTypeKind:()=>p,ZodError:()=>C1,ZodEnum:()=>u0,ZodEffects:()=>G0,ZodDiscriminatedUnion:()=>i6,ZodDefault:()=>X4,ZodDate:()=>R2,ZodCatch:()=>Y4,ZodBranded:()=>n6,ZodBoolean:()=>n2,ZodBigInt:()=>m0,ZodArray:()=>t1,ZodAny:()=>M2,Schema:()=>o,ParseStatus:()=>_1,OK:()=>S1,NEVER:()=>cF,INVALID:()=>u,EMPTY_PATH:()=>mK,DIRTY:()=>D2,BRAND:()=>HF});var a;(function($){$.assertEqual=(W)=>{};function G(W){}$.assertIs=G;function X(W){throw Error()}$.assertNever=X,$.arrayToEnum=(W)=>{let V={};for(let q of W)V[q]=q;return V},$.getValidEnumValues=(W)=>{let V=$.objectKeys(W).filter((J)=>typeof W[W[J]]!=="number"),q={};for(let J of V)q[J]=W[J];return $.objectValues(q)},$.objectValues=(W)=>{return $.objectKeys(W).map(function(V){return W[V]})},$.objectKeys=typeof Object.keys==="function"?(W)=>Object.keys(W):(W)=>{let V=[];for(let q in W)if(Object.prototype.hasOwnProperty.call(W,q))V.push(q);return V},$.find=(W,V)=>{for(let q of W)if(V(q))return q;return},$.isInteger=typeof Number.isInteger==="function"?(W)=>Number.isInteger(W):(W)=>typeof W==="number"&&Number.isFinite(W)&&Math.floor(W)===W;function Y(W,V=" | "){return W.map((q)=>typeof q==="string"?`'${q}'`:q).join(V)}$.joinValues=Y,$.jsonStringifyReplacer=(W,V)=>{if(typeof V==="bigint")return V.toString();return V}})(a||(a={}));var c9;(function($){$.mergeShapes=(G,X)=>{return{...G,...X}}})(c9||(c9={}));var C=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J0=($)=>{switch(typeof $){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN($)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":if(Array.isArray($))return C.array;if($===null)return C.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return C.promise;if(typeof Map<"u"&&$ instanceof Map)return C.map;if(typeof Set<"u"&&$ instanceof Set)return C.set;if(typeof Date<"u"&&$ instanceof Date)return C.date;return C.object;default:return C.unknown}};var T=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hK=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class C1 extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(X)=>{this.issues=[...this.issues,X]},this.addIssues=(X=[])=>{this.issues=[...this.issues,...X]};let G=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,G);else this.__proto__=G;this.name="ZodError",this.issues=$}format($){let G=$||function(W){return W.message},X={_errors:[]},Y=(W)=>{for(let V of W.issues)if(V.code==="invalid_union")V.unionErrors.map(Y);else if(V.code==="invalid_return_type")Y(V.returnTypeError);else if(V.code==="invalid_arguments")Y(V.argumentsError);else if(V.path.length===0)X._errors.push(G(V));else{let q=X,J=0;while(J<V.path.length){let H=V.path[J];if(J!==V.path.length-1)q[H]=q[H]||{_errors:[]};else q[H]=q[H]||{_errors:[]},q[H]._errors.push(G(V));q=q[H],J++}}};return Y(this),X}static assert($){if(!($ instanceof C1))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(G)=>G.message){let G={},X=[];for(let Y of this.issues)if(Y.path.length>0){let W=Y.path[0];G[W]=G[W]||[],G[W].push($(Y))}else X.push($(Y));return{formErrors:X,fieldErrors:G}}get formErrors(){return this.flatten()}}C1.create=($)=>{return new C1($)};var yK=($,G)=>{let X;switch($.code){case T.invalid_type:if($.received===C.undefined)X="Required";else X=`Expected ${$.expected}, received ${$.received}`;break;case T.invalid_literal:X=`Invalid literal value, expected ${JSON.stringify($.expected,a.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:X=`Unrecognized key(s) in object: ${a.joinValues($.keys,", ")}`;break;case T.invalid_union:X="Invalid input";break;case T.invalid_union_discriminator:X=`Invalid discriminator value. Expected ${a.joinValues($.options)}`;break;case T.invalid_enum_value:X=`Invalid enum value. Expected ${a.joinValues($.options)}, received '${$.received}'`;break;case T.invalid_arguments:X="Invalid function arguments";break;case T.invalid_return_type:X="Invalid function return type";break;case T.invalid_date:X="Invalid date";break;case T.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(X=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")X=`${X} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)X=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)X=`Invalid input: must end with "${$.validation.endsWith}"`;else a.assertNever($.validation);else if($.validation!=="regex")X=`Invalid ${$.validation}`;else X="Invalid";break;case T.too_small:if($.type==="array")X=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")X=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")X=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")X=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")X=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else X="Invalid input";break;case T.too_big:if($.type==="array")X=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")X=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")X=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")X=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")X=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else X="Invalid input";break;case T.custom:X="Invalid input";break;case T.invalid_intersection_types:X="Intersection results could not be merged";break;case T.not_multiple_of:X=`Number must be a multiple of ${$.multipleOf}`;break;case T.not_finite:X="Number must be finite";break;default:X=G.defaultError,a.assertNever($)}return{message:X}},N0=yK;var xX=N0;function fK($){xX=$}function r2(){return xX}var b4=($)=>{let{data:G,path:X,errorMaps:Y,issueData:W}=$,V=[...X,...W.path||[]],q={...W,path:V};if(W.message!==void 0)return{...W,path:V,message:W.message};let J="",H=Y.filter((D)=>!!D).slice().reverse();for(let D of H)J=D(q,{data:G,defaultError:J}).message;return{...W,path:V,message:J}},mK=[];function x($,G){let X=r2(),Y=b4({issueData:G,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,X,X===N0?void 0:N0].filter((W)=>!!W)});$.common.issues.push(Y)}class _1{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,G){let X=[];for(let Y of G){if(Y.status==="aborted")return u;if(Y.status==="dirty")$.dirty();X.push(Y.value)}return{status:$.value,value:X}}static async mergeObjectAsync($,G){let X=[];for(let Y of G){let W=await Y.key,V=await Y.value;X.push({key:W,value:V})}return _1.mergeObjectSync($,X)}static mergeObjectSync($,G){let X={};for(let Y of G){let{key:W,value:V}=Y;if(W.status==="aborted")return u;if(V.status==="aborted")return u;if(W.status==="dirty")$.dirty();if(V.status==="dirty")$.dirty();if(W.value!=="__proto__"&&(typeof V.value<"u"||Y.alwaysSet))X[W.value]=V.value}return{status:$.value,value:X}}}var u=Object.freeze({status:"aborted"}),D2=($)=>({status:"dirty",value:$}),S1=($)=>({status:"valid",value:$}),d6=($)=>$.status==="aborted",c6=($)=>$.status==="dirty",h0=($)=>$.status==="valid",d2=($)=>typeof Promise<"u"&&$ instanceof Promise;var g;(function($){$.errToObj=(G)=>typeof G==="string"?{message:G}:G||{},$.toString=(G)=>typeof G==="string"?G:G?.message})(g||(g={}));class $0{constructor($,G,X,Y){this._cachedPath=[],this.parent=$,this.data=G,this._path=X,this._key=Y}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var kX=($,G)=>{if(h0(G))return{success:!0,data:G.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let X=new C1($.common.issues);return this._error=X,this._error}}}};function c($){if(!$)return{};let{errorMap:G,invalid_type_error:X,required_error:Y,description:W}=$;if(G&&(X||Y))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(G)return{errorMap:G,description:W};return{errorMap:(q,J)=>{let{message:H}=$;if(q.code==="invalid_enum_value")return{message:H??J.defaultError};if(typeof J.data>"u")return{message:H??Y??J.defaultError};if(q.code!=="invalid_type")return{message:J.defaultError};return{message:H??X??J.defaultError}},description:W}}class o{get description(){return this._def.description}_getType($){return J0($.data)}_getOrReturnCtx($,G){return G||{common:$.parent.common,data:$.data,parsedType:J0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new _1,ctx:{common:$.parent.common,data:$.data,parsedType:J0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let G=this._parse($);if(d2(G))throw Error("Synchronous parse encountered promise.");return G}_parseAsync($){let G=this._parse($);return Promise.resolve(G)}parse($,G){let X=this.safeParse($,G);if(X.success)return X.data;throw X.error}safeParse($,G){let X={common:{issues:[],async:G?.async??!1,contextualErrorMap:G?.errorMap},path:G?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J0($)},Y=this._parseSync({data:$,path:X.path,parent:X});return kX(X,Y)}"~validate"($){let G={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J0($)};if(!this["~standard"].async)try{let X=this._parseSync({data:$,path:[],parent:G});return h0(X)?{value:X.value}:{issues:G.common.issues}}catch(X){if(X?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;G.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:G}).then((X)=>h0(X)?{value:X.value}:{issues:G.common.issues})}async parseAsync($,G){let X=await this.safeParseAsync($,G);if(X.success)return X.data;throw X.error}async safeParseAsync($,G){let X={common:{issues:[],contextualErrorMap:G?.errorMap,async:!0},path:G?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J0($)},Y=this._parse({data:$,path:X.path,parent:X}),W=await(d2(Y)?Y:Promise.resolve(Y));return kX(X,W)}refine($,G){let X=(Y)=>{if(typeof G==="string"||typeof G>"u")return{message:G};else if(typeof G==="function")return G(Y);else return G};return this._refinement((Y,W)=>{let V=$(Y),q=()=>W.addIssue({code:T.custom,...X(Y)});if(typeof Promise<"u"&&V instanceof Promise)return V.then((J)=>{if(!J)return q(),!1;else return!0});if(!V)return q(),!1;else return!0})}refinement($,G){return this._refinement((X,Y)=>{if(!$(X))return Y.addIssue(typeof G==="function"?G(X,Y):G),!1;else return!0})}_refinement($){return new G0({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(G)=>this["~validate"](G)}}optional(){return e1.create(this,this._def)}nullable(){return z0.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return t1.create(this)}promise(){return K2.create(this,this._def)}or($){return a2.create([this,$],this._def)}and($){return t2.create(this,$,this._def)}transform($){return new G0({...c(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:$}})}default($){let G=typeof $==="function"?$:()=>$;return new X4({...c(this._def),innerType:this,defaultValue:G,typeName:p.ZodDefault})}brand(){return new n6({typeName:p.ZodBranded,type:this,...c(this._def)})}catch($){let G=typeof $==="function"?$:()=>$;return new Y4({...c(this._def),innerType:this,catchValue:G,typeName:p.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return m4.create(this,$)}readonly(){return W4.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var uK=/^c[^\s-]{8,}$/i,pK=/^[0-9a-z]+$/,lK=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rK=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dK=/^[a-z0-9_-]{21}$/i,cK=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,iK=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nK=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",i9,sK=/^(?:(?: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])$/,aK=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,tK=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eK=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$F=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,GF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vX="((\\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])))",XF=new RegExp(`^${vX}$`);function gX($){let G="[0-5]\\d";if($.precision)G=`${G}\\.\\d{${$.precision}}`;else if($.precision==null)G=`${G}(\\.\\d+)?`;let X=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${G})${X}`}function YF($){return new RegExp(`^${gX($)}$`)}function hX($){let G=`${vX}T${gX($)}`,X=[];if(X.push($.local?"Z?":"Z"),$.offset)X.push("([+-]\\d{2}:?\\d{2})");return G=`${G}(${X.join("|")})`,new RegExp(`^${G}$`)}function WF($,G){if((G==="v4"||!G)&&sK.test($))return!0;if((G==="v6"||!G)&&tK.test($))return!0;return!1}function VF($,G){if(!cK.test($))return!1;try{let[X]=$.split(".");if(!X)return!1;let Y=X.replace(/-/g,"+").replace(/_/g,"/").padEnd(X.length+(4-X.length%4)%4,"="),W=JSON.parse(atob(Y));if(typeof W!=="object"||W===null)return!1;if("typ"in W&&W?.typ!=="JWT")return!1;if(!W.alg)return!1;if(G&&W.alg!==G)return!1;return!0}catch{return!1}}function qF($,G){if((G==="v4"||!G)&&aK.test($))return!0;if((G==="v6"||!G)&&eK.test($))return!0;return!1}class a1 extends o{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==C.string){let W=this._getOrReturnCtx($);return x(W,{code:T.invalid_type,expected:C.string,received:W.parsedType}),u}let X=new _1,Y=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.length<W.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:T.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),X.dirty()}else if(W.kind==="max"){if($.data.length>W.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:T.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),X.dirty()}else if(W.kind==="length"){let V=$.data.length>W.value,q=$.data.length<W.value;if(V||q){if(Y=this._getOrReturnCtx($,Y),V)x(Y,{code:T.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});else if(q)x(Y,{code:T.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});X.dirty()}}else if(W.kind==="email"){if(!nK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"email",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="emoji"){if(!i9)i9=new RegExp(oK,"u");if(!i9.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"emoji",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="uuid"){if(!rK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"uuid",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="nanoid"){if(!dK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"nanoid",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="cuid"){if(!uK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cuid",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="cuid2"){if(!pK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cuid2",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="ulid"){if(!lK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"ulid",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="url")try{new URL($.data)}catch{Y=this._getOrReturnCtx($,Y),x(Y,{validation:"url",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="regex"){if(W.regex.lastIndex=0,!W.regex.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"regex",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="trim")$.data=$.data.trim();else if(W.kind==="includes"){if(!$.data.includes(W.value,W.position))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:{includes:W.value,position:W.position},message:W.message}),X.dirty()}else if(W.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(W.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(W.kind==="startsWith"){if(!$.data.startsWith(W.value))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:{startsWith:W.value},message:W.message}),X.dirty()}else if(W.kind==="endsWith"){if(!$.data.endsWith(W.value))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:{endsWith:W.value},message:W.message}),X.dirty()}else if(W.kind==="datetime"){if(!hX(W).test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:"datetime",message:W.message}),X.dirty()}else if(W.kind==="date"){if(!XF.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:"date",message:W.message}),X.dirty()}else if(W.kind==="time"){if(!YF(W).test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:"time",message:W.message}),X.dirty()}else if(W.kind==="duration"){if(!iK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"duration",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="ip"){if(!WF($.data,W.version))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"ip",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="jwt"){if(!VF($.data,W.alg))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"jwt",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="cidr"){if(!qF($.data,W.version))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cidr",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="base64"){if(!$F.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"base64",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="base64url"){if(!GF.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"base64url",code:T.invalid_string,message:W.message}),X.dirty()}else a.assertNever(W);return{status:X.value,value:$.data}}_regex($,G,X){return this.refinement((Y)=>$.test(Y),{validation:G,code:T.invalid_string,...g.errToObj(X)})}_addCheck($){return new a1({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...g.errToObj($)})}url($){return this._addCheck({kind:"url",...g.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...g.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...g.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...g.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...g.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...g.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...g.errToObj($)})}base64($){return this._addCheck({kind:"base64",...g.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...g.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...g.errToObj($)})}ip($){return this._addCheck({kind:"ip",...g.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...g.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...g.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...g.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...g.errToObj($)})}regex($,G){return this._addCheck({kind:"regex",regex:$,...g.errToObj(G)})}includes($,G){return this._addCheck({kind:"includes",value:$,position:G?.position,...g.errToObj(G?.message)})}startsWith($,G){return this._addCheck({kind:"startsWith",value:$,...g.errToObj(G)})}endsWith($,G){return this._addCheck({kind:"endsWith",value:$,...g.errToObj(G)})}min($,G){return this._addCheck({kind:"min",value:$,...g.errToObj(G)})}max($,G){return this._addCheck({kind:"max",value:$,...g.errToObj(G)})}length($,G){return this._addCheck({kind:"length",value:$,...g.errToObj(G)})}nonempty($){return this.min(1,g.errToObj($))}trim(){return new a1({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a1({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a1({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let G of this._def.checks)if(G.kind==="min"){if($===null||G.value>$)$=G.value}return $}get maxLength(){let $=null;for(let G of this._def.checks)if(G.kind==="max"){if($===null||G.value<$)$=G.value}return $}}a1.create=($)=>{return new a1({checks:[],typeName:p.ZodString,coerce:$?.coerce??!1,...c($)})};function JF($,G){let X=($.toString().split(".")[1]||"").length,Y=(G.toString().split(".")[1]||"").length,W=X>Y?X:Y,V=Number.parseInt($.toFixed(W).replace(".","")),q=Number.parseInt(G.toFixed(W).replace(".",""));return V%q/10**W}class f0 extends o{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==C.number){let W=this._getOrReturnCtx($);return x(W,{code:T.invalid_type,expected:C.number,received:W.parsedType}),u}let X=void 0,Y=new _1;for(let W of this._def.checks)if(W.kind==="int"){if(!a.isInteger($.data))X=this._getOrReturnCtx($,X),x(X,{code:T.invalid_type,expected:"integer",received:"float",message:W.message}),Y.dirty()}else if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)X=this._getOrReturnCtx($,X),x(X,{code:T.too_small,minimum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),Y.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)X=this._getOrReturnCtx($,X),x(X,{code:T.too_big,maximum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),Y.dirty()}else if(W.kind==="multipleOf"){if(JF($.data,W.value)!==0)X=this._getOrReturnCtx($,X),x(X,{code:T.not_multiple_of,multipleOf:W.value,message:W.message}),Y.dirty()}else if(W.kind==="finite"){if(!Number.isFinite($.data))X=this._getOrReturnCtx($,X),x(X,{code:T.not_finite,message:W.message}),Y.dirty()}else a.assertNever(W);return{status:Y.value,value:$.data}}gte($,G){return this.setLimit("min",$,!0,g.toString(G))}gt($,G){return this.setLimit("min",$,!1,g.toString(G))}lte($,G){return this.setLimit("max",$,!0,g.toString(G))}lt($,G){return this.setLimit("max",$,!1,g.toString(G))}setLimit($,G,X,Y){return new f0({...this._def,checks:[...this._def.checks,{kind:$,value:G,inclusive:X,message:g.toString(Y)}]})}_addCheck($){return new f0({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:g.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString($)})}multipleOf($,G){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(G)})}finite($){return this._addCheck({kind:"finite",message:g.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString($)})}get minValue(){let $=null;for(let G of this._def.checks)if(G.kind==="min"){if($===null||G.value>$)$=G.value}return $}get maxValue(){let $=null;for(let G of this._def.checks)if(G.kind==="max"){if($===null||G.value<$)$=G.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&a.isInteger($.value))}get isFinite(){let $=null,G=null;for(let X of this._def.checks)if(X.kind==="finite"||X.kind==="int"||X.kind==="multipleOf")return!0;else if(X.kind==="min"){if(G===null||X.value>G)G=X.value}else if(X.kind==="max"){if($===null||X.value<$)$=X.value}return Number.isFinite(G)&&Number.isFinite($)}}f0.create=($)=>{return new f0({checks:[],typeName:p.ZodNumber,coerce:$?.coerce||!1,...c($)})};class m0 extends o{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==C.bigint)return this._getInvalidInput($);let X=void 0,Y=new _1;for(let W of this._def.checks)if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)X=this._getOrReturnCtx($,X),x(X,{code:T.too_small,type:"bigint",minimum:W.value,inclusive:W.inclusive,message:W.message}),Y.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)X=this._getOrReturnCtx($,X),x(X,{code:T.too_big,type:"bigint",maximum:W.value,inclusive:W.inclusive,message:W.message}),Y.dirty()}else if(W.kind==="multipleOf"){if($.data%W.value!==BigInt(0))X=this._getOrReturnCtx($,X),x(X,{code:T.not_multiple_of,multipleOf:W.value,message:W.message}),Y.dirty()}else a.assertNever(W);return{status:Y.value,value:$.data}}_getInvalidInput($){let G=this._getOrReturnCtx($);return x(G,{code:T.invalid_type,expected:C.bigint,received:G.parsedType}),u}gte($,G){return this.setLimit("min",$,!0,g.toString(G))}gt($,G){return this.setLimit("min",$,!1,g.toString(G))}lte($,G){return this.setLimit("max",$,!0,g.toString(G))}lt($,G){return this.setLimit("max",$,!1,g.toString(G))}setLimit($,G,X,Y){return new m0({...this._def,checks:[...this._def.checks,{kind:$,value:G,inclusive:X,message:g.toString(Y)}]})}_addCheck($){return new m0({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString($)})}multipleOf($,G){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(G)})}get minValue(){let $=null;for(let G of this._def.checks)if(G.kind==="min"){if($===null||G.value>$)$=G.value}return $}get maxValue(){let $=null;for(let G of this._def.checks)if(G.kind==="max"){if($===null||G.value<$)$=G.value}return $}}m0.create=($)=>{return new m0({checks:[],typeName:p.ZodBigInt,coerce:$?.coerce??!1,...c($)})};class n2 extends o{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==C.boolean){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.boolean,received:X.parsedType}),u}return S1($.data)}}n2.create=($)=>{return new n2({typeName:p.ZodBoolean,coerce:$?.coerce||!1,...c($)})};class R2 extends o{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==C.date){let W=this._getOrReturnCtx($);return x(W,{code:T.invalid_type,expected:C.date,received:W.parsedType}),u}if(Number.isNaN($.data.getTime())){let W=this._getOrReturnCtx($);return x(W,{code:T.invalid_date}),u}let X=new _1,Y=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.getTime()<W.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:T.too_small,message:W.message,inclusive:!0,exact:!1,minimum:W.value,type:"date"}),X.dirty()}else if(W.kind==="max"){if($.data.getTime()>W.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:T.too_big,message:W.message,inclusive:!0,exact:!1,maximum:W.value,type:"date"}),X.dirty()}else a.assertNever(W);return{status:X.value,value:new Date($.data.getTime())}}_addCheck($){return new R2({...this._def,checks:[...this._def.checks,$]})}min($,G){return this._addCheck({kind:"min",value:$.getTime(),message:g.toString(G)})}max($,G){return this._addCheck({kind:"max",value:$.getTime(),message:g.toString(G)})}get minDate(){let $=null;for(let G of this._def.checks)if(G.kind==="min"){if($===null||G.value>$)$=G.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let G of this._def.checks)if(G.kind==="max"){if($===null||G.value<$)$=G.value}return $!=null?new Date($):null}}R2.create=($)=>{return new R2({checks:[],coerce:$?.coerce||!1,typeName:p.ZodDate,...c($)})};class v4 extends o{_parse($){if(this._getType($)!==C.symbol){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.symbol,received:X.parsedType}),u}return S1($.data)}}v4.create=($)=>{return new v4({typeName:p.ZodSymbol,...c($)})};class o2 extends o{_parse($){if(this._getType($)!==C.undefined){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.undefined,received:X.parsedType}),u}return S1($.data)}}o2.create=($)=>{return new o2({typeName:p.ZodUndefined,...c($)})};class s2 extends o{_parse($){if(this._getType($)!==C.null){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.null,received:X.parsedType}),u}return S1($.data)}}s2.create=($)=>{return new s2({typeName:p.ZodNull,...c($)})};class M2 extends o{constructor(){super(...arguments);this._any=!0}_parse($){return S1($.data)}}M2.create=($)=>{return new M2({typeName:p.ZodAny,...c($)})};class y0 extends o{constructor(){super(...arguments);this._unknown=!0}_parse($){return S1($.data)}}y0.create=($)=>{return new y0({typeName:p.ZodUnknown,...c($)})};class H0 extends o{_parse($){let G=this._getOrReturnCtx($);return x(G,{code:T.invalid_type,expected:C.never,received:G.parsedType}),u}}H0.create=($)=>{return new H0({typeName:p.ZodNever,...c($)})};class g4 extends o{_parse($){if(this._getType($)!==C.undefined){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.void,received:X.parsedType}),u}return S1($.data)}}g4.create=($)=>{return new g4({typeName:p.ZodVoid,...c($)})};class t1 extends o{_parse($){let{ctx:G,status:X}=this._processInputParams($),Y=this._def;if(G.parsedType!==C.array)return x(G,{code:T.invalid_type,expected:C.array,received:G.parsedType}),u;if(Y.exactLength!==null){let V=G.data.length>Y.exactLength.value,q=G.data.length<Y.exactLength.value;if(V||q)x(G,{code:V?T.too_big:T.too_small,minimum:q?Y.exactLength.value:void 0,maximum:V?Y.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Y.exactLength.message}),X.dirty()}if(Y.minLength!==null){if(G.data.length<Y.minLength.value)x(G,{code:T.too_small,minimum:Y.minLength.value,type:"array",inclusive:!0,exact:!1,message:Y.minLength.message}),X.dirty()}if(Y.maxLength!==null){if(G.data.length>Y.maxLength.value)x(G,{code:T.too_big,maximum:Y.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Y.maxLength.message}),X.dirty()}if(G.common.async)return Promise.all([...G.data].map((V,q)=>{return Y.type._parseAsync(new $0(G,V,G.path,q))})).then((V)=>{return _1.mergeArray(X,V)});let W=[...G.data].map((V,q)=>{return Y.type._parseSync(new $0(G,V,G.path,q))});return _1.mergeArray(X,W)}get element(){return this._def.type}min($,G){return new t1({...this._def,minLength:{value:$,message:g.toString(G)}})}max($,G){return new t1({...this._def,maxLength:{value:$,message:g.toString(G)}})}length($,G){return new t1({...this._def,exactLength:{value:$,message:g.toString(G)}})}nonempty($){return this.min(1,$)}}t1.create=($,G)=>{return new t1({type:$,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...c(G)})};function c2($){if($ instanceof q1){let G={};for(let X in $.shape){let Y=$.shape[X];G[X]=e1.create(c2(Y))}return new q1({...$._def,shape:()=>G})}else if($ instanceof t1)return new t1({...$._def,type:c2($.element)});else if($ instanceof e1)return e1.create(c2($.unwrap()));else if($ instanceof z0)return z0.create(c2($.unwrap()));else if($ instanceof U0)return U0.create($.items.map((G)=>c2(G)));else return $}class q1 extends o{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),G=a.objectKeys($);return this._cached={shape:$,keys:G},this._cached}_parse($){if(this._getType($)!==C.object){let H=this._getOrReturnCtx($);return x(H,{code:T.invalid_type,expected:C.object,received:H.parsedType}),u}let{status:X,ctx:Y}=this._processInputParams($),{shape:W,keys:V}=this._getCached(),q=[];if(!(this._def.catchall instanceof H0&&this._def.unknownKeys==="strip")){for(let H in Y.data)if(!V.includes(H))q.push(H)}let J=[];for(let H of V){let D=W[H],R=Y.data[H];J.push({key:{status:"valid",value:H},value:D._parse(new $0(Y,R,Y.path,H)),alwaysSet:H in Y.data})}if(this._def.catchall instanceof H0){let H=this._def.unknownKeys;if(H==="passthrough")for(let D of q)J.push({key:{status:"valid",value:D},value:{status:"valid",value:Y.data[D]}});else if(H==="strict"){if(q.length>0)x(Y,{code:T.unrecognized_keys,keys:q}),X.dirty()}else if(H==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let H=this._def.catchall;for(let D of q){let R=Y.data[D];J.push({key:{status:"valid",value:D},value:H._parse(new $0(Y,R,Y.path,D)),alwaysSet:D in Y.data})}}if(Y.common.async)return Promise.resolve().then(async()=>{let H=[];for(let D of J){let R=await D.key,M=await D.value;H.push({key:R,value:M,alwaysSet:D.alwaysSet})}return H}).then((H)=>{return _1.mergeObjectSync(X,H)});else return _1.mergeObjectSync(X,J)}get shape(){return this._def.shape()}strict($){return g.errToObj,new q1({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(G,X)=>{let Y=this._def.errorMap?.(G,X).message??X.defaultError;if(G.code==="unrecognized_keys")return{message:g.errToObj($).message??Y};return{message:Y}}}:{}})}strip(){return new q1({...this._def,unknownKeys:"strip"})}passthrough(){return new q1({...this._def,unknownKeys:"passthrough"})}extend($){return new q1({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new q1({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:p.ZodObject})}setKey($,G){return this.augment({[$]:G})}catchall($){return new q1({...this._def,catchall:$})}pick($){let G={};for(let X of a.objectKeys($))if($[X]&&this.shape[X])G[X]=this.shape[X];return new q1({...this._def,shape:()=>G})}omit($){let G={};for(let X of a.objectKeys(this.shape))if(!$[X])G[X]=this.shape[X];return new q1({...this._def,shape:()=>G})}deepPartial(){return c2(this)}partial($){let G={};for(let X of a.objectKeys(this.shape)){let Y=this.shape[X];if($&&!$[X])G[X]=Y;else G[X]=Y.optional()}return new q1({...this._def,shape:()=>G})}required($){let G={};for(let X of a.objectKeys(this.shape))if($&&!$[X])G[X]=this.shape[X];else{let W=this.shape[X];while(W instanceof e1)W=W._def.innerType;G[X]=W}return new q1({...this._def,shape:()=>G})}keyof(){return yX(a.objectKeys(this.shape))}}q1.create=($,G)=>{return new q1({shape:()=>$,unknownKeys:"strip",catchall:H0.create(),typeName:p.ZodObject,...c(G)})};q1.strictCreate=($,G)=>{return new q1({shape:()=>$,unknownKeys:"strict",catchall:H0.create(),typeName:p.ZodObject,...c(G)})};q1.lazycreate=($,G)=>{return new q1({shape:$,unknownKeys:"strip",catchall:H0.create(),typeName:p.ZodObject,...c(G)})};class a2 extends o{_parse($){let{ctx:G}=this._processInputParams($),X=this._def.options;function Y(W){for(let q of W)if(q.result.status==="valid")return q.result;for(let q of W)if(q.result.status==="dirty")return G.common.issues.push(...q.ctx.common.issues),q.result;let V=W.map((q)=>new C1(q.ctx.common.issues));return x(G,{code:T.invalid_union,unionErrors:V}),u}if(G.common.async)return Promise.all(X.map(async(W)=>{let V={...G,common:{...G.common,issues:[]},parent:null};return{result:await W._parseAsync({data:G.data,path:G.path,parent:V}),ctx:V}})).then(Y);else{let W=void 0,V=[];for(let J of X){let H={...G,common:{...G.common,issues:[]},parent:null},D=J._parseSync({data:G.data,path:G.path,parent:H});if(D.status==="valid")return D;else if(D.status==="dirty"&&!W)W={result:D,ctx:H};if(H.common.issues.length)V.push(H.common.issues)}if(W)return G.common.issues.push(...W.ctx.common.issues),W.result;let q=V.map((J)=>new C1(J));return x(G,{code:T.invalid_union,unionErrors:q}),u}}get options(){return this._def.options}}a2.create=($,G)=>{return new a2({options:$,typeName:p.ZodUnion,...c(G)})};var Z0=($)=>{if($ instanceof e2)return Z0($.schema);else if($ instanceof G0)return Z0($.innerType());else if($ instanceof $4)return[$.value];else if($ instanceof u0)return $.options;else if($ instanceof G4)return a.objectValues($.enum);else if($ instanceof X4)return Z0($._def.innerType);else if($ instanceof o2)return[void 0];else if($ instanceof s2)return[null];else if($ instanceof e1)return[void 0,...Z0($.unwrap())];else if($ instanceof z0)return[null,...Z0($.unwrap())];else if($ instanceof n6)return Z0($.unwrap());else if($ instanceof W4)return Z0($.unwrap());else if($ instanceof Y4)return Z0($._def.innerType);else return[]};class i6 extends o{_parse($){let{ctx:G}=this._processInputParams($);if(G.parsedType!==C.object)return x(G,{code:T.invalid_type,expected:C.object,received:G.parsedType}),u;let X=this.discriminator,Y=G.data[X],W=this.optionsMap.get(Y);if(!W)return x(G,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[X]}),u;if(G.common.async)return W._parseAsync({data:G.data,path:G.path,parent:G});else return W._parseSync({data:G.data,path:G.path,parent:G})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,G,X){let Y=new Map;for(let W of G){let V=Z0(W.shape[$]);if(!V.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let q of V){if(Y.has(q))throw Error(`Discriminator property ${String($)} has duplicate value ${String(q)}`);Y.set(q,W)}}return new i6({typeName:p.ZodDiscriminatedUnion,discriminator:$,options:G,optionsMap:Y,...c(X)})}}function n9($,G){let X=J0($),Y=J0(G);if($===G)return{valid:!0,data:$};else if(X===C.object&&Y===C.object){let W=a.objectKeys(G),V=a.objectKeys($).filter((J)=>W.indexOf(J)!==-1),q={...$,...G};for(let J of V){let H=n9($[J],G[J]);if(!H.valid)return{valid:!1};q[J]=H.data}return{valid:!0,data:q}}else if(X===C.array&&Y===C.array){if($.length!==G.length)return{valid:!1};let W=[];for(let V=0;V<$.length;V++){let q=$[V],J=G[V],H=n9(q,J);if(!H.valid)return{valid:!1};W.push(H.data)}return{valid:!0,data:W}}else if(X===C.date&&Y===C.date&&+$===+G)return{valid:!0,data:$};else return{valid:!1}}class t2 extends o{_parse($){let{status:G,ctx:X}=this._processInputParams($),Y=(W,V)=>{if(d6(W)||d6(V))return u;let q=n9(W.value,V.value);if(!q.valid)return x(X,{code:T.invalid_intersection_types}),u;if(c6(W)||c6(V))G.dirty();return{status:G.value,value:q.data}};if(X.common.async)return Promise.all([this._def.left._parseAsync({data:X.data,path:X.path,parent:X}),this._def.right._parseAsync({data:X.data,path:X.path,parent:X})]).then(([W,V])=>Y(W,V));else return Y(this._def.left._parseSync({data:X.data,path:X.path,parent:X}),this._def.right._parseSync({data:X.data,path:X.path,parent:X}))}}t2.create=($,G,X)=>{return new t2({left:$,right:G,typeName:p.ZodIntersection,...c(X)})};class U0 extends o{_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.parsedType!==C.array)return x(X,{code:T.invalid_type,expected:C.array,received:X.parsedType}),u;if(X.data.length<this._def.items.length)return x(X,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u;if(!this._def.rest&&X.data.length>this._def.items.length)x(X,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G.dirty();let W=[...X.data].map((V,q)=>{let J=this._def.items[q]||this._def.rest;if(!J)return null;return J._parse(new $0(X,V,X.path,q))}).filter((V)=>!!V);if(X.common.async)return Promise.all(W).then((V)=>{return _1.mergeArray(G,V)});else return _1.mergeArray(G,W)}get items(){return this._def.items}rest($){return new U0({...this._def,rest:$})}}U0.create=($,G)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new U0({items:$,typeName:p.ZodTuple,rest:null,...c(G)})};class h4 extends o{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.parsedType!==C.object)return x(X,{code:T.invalid_type,expected:C.object,received:X.parsedType}),u;let Y=[],W=this._def.keyType,V=this._def.valueType;for(let q in X.data)Y.push({key:W._parse(new $0(X,q,X.path,q)),value:V._parse(new $0(X,X.data[q],X.path,q)),alwaysSet:q in X.data});if(X.common.async)return _1.mergeObjectAsync(G,Y);else return _1.mergeObjectSync(G,Y)}get element(){return this._def.valueType}static create($,G,X){if(G instanceof o)return new h4({keyType:$,valueType:G,typeName:p.ZodRecord,...c(X)});return new h4({keyType:a1.create(),valueType:$,typeName:p.ZodRecord,...c(G)})}}class y4 extends o{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.parsedType!==C.map)return x(X,{code:T.invalid_type,expected:C.map,received:X.parsedType}),u;let Y=this._def.keyType,W=this._def.valueType,V=[...X.data.entries()].map(([q,J],H)=>{return{key:Y._parse(new $0(X,q,X.path,[H,"key"])),value:W._parse(new $0(X,J,X.path,[H,"value"]))}});if(X.common.async){let q=new Map;return Promise.resolve().then(async()=>{for(let J of V){let H=await J.key,D=await J.value;if(H.status==="aborted"||D.status==="aborted")return u;if(H.status==="dirty"||D.status==="dirty")G.dirty();q.set(H.value,D.value)}return{status:G.value,value:q}})}else{let q=new Map;for(let J of V){let{key:H,value:D}=J;if(H.status==="aborted"||D.status==="aborted")return u;if(H.status==="dirty"||D.status==="dirty")G.dirty();q.set(H.value,D.value)}return{status:G.value,value:q}}}}y4.create=($,G,X)=>{return new y4({valueType:G,keyType:$,typeName:p.ZodMap,...c(X)})};class Q2 extends o{_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.parsedType!==C.set)return x(X,{code:T.invalid_type,expected:C.set,received:X.parsedType}),u;let Y=this._def;if(Y.minSize!==null){if(X.data.size<Y.minSize.value)x(X,{code:T.too_small,minimum:Y.minSize.value,type:"set",inclusive:!0,exact:!1,message:Y.minSize.message}),G.dirty()}if(Y.maxSize!==null){if(X.data.size>Y.maxSize.value)x(X,{code:T.too_big,maximum:Y.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Y.maxSize.message}),G.dirty()}let W=this._def.valueType;function V(J){let H=new Set;for(let D of J){if(D.status==="aborted")return u;if(D.status==="dirty")G.dirty();H.add(D.value)}return{status:G.value,value:H}}let q=[...X.data.values()].map((J,H)=>W._parse(new $0(X,J,X.path,H)));if(X.common.async)return Promise.all(q).then((J)=>V(J));else return V(q)}min($,G){return new Q2({...this._def,minSize:{value:$,message:g.toString(G)}})}max($,G){return new Q2({...this._def,maxSize:{value:$,message:g.toString(G)}})}size($,G){return this.min($,G).max($,G)}nonempty($){return this.min(1,$)}}Q2.create=($,G)=>{return new Q2({valueType:$,minSize:null,maxSize:null,typeName:p.ZodSet,...c(G)})};class i2 extends o{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:G}=this._processInputParams($);if(G.parsedType!==C.function)return x(G,{code:T.invalid_type,expected:C.function,received:G.parsedType}),u;function X(q,J){return b4({data:q,path:G.path,errorMaps:[G.common.contextualErrorMap,G.schemaErrorMap,r2(),N0].filter((H)=>!!H),issueData:{code:T.invalid_arguments,argumentsError:J}})}function Y(q,J){return b4({data:q,path:G.path,errorMaps:[G.common.contextualErrorMap,G.schemaErrorMap,r2(),N0].filter((H)=>!!H),issueData:{code:T.invalid_return_type,returnTypeError:J}})}let W={errorMap:G.common.contextualErrorMap},V=G.data;if(this._def.returns instanceof K2){let q=this;return S1(async function(...J){let H=new C1([]),D=await q._def.args.parseAsync(J,W).catch((A)=>{throw H.addIssue(X(J,A)),H}),R=await Reflect.apply(V,this,D);return await q._def.returns._def.type.parseAsync(R,W).catch((A)=>{throw H.addIssue(Y(R,A)),H})})}else{let q=this;return S1(function(...J){let H=q._def.args.safeParse(J,W);if(!H.success)throw new C1([X(J,H.error)]);let D=Reflect.apply(V,this,H.data),R=q._def.returns.safeParse(D,W);if(!R.success)throw new C1([Y(D,R.error)]);return R.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new i2({...this._def,args:U0.create($).rest(y0.create())})}returns($){return new i2({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,G,X){return new i2({args:$?$:U0.create([]).rest(y0.create()),returns:G||y0.create(),typeName:p.ZodFunction,...c(X)})}}class e2 extends o{get schema(){return this._def.getter()}_parse($){let{ctx:G}=this._processInputParams($);return this._def.getter()._parse({data:G.data,path:G.path,parent:G})}}e2.create=($,G)=>{return new e2({getter:$,typeName:p.ZodLazy,...c(G)})};class $4 extends o{_parse($){if($.data!==this._def.value){let G=this._getOrReturnCtx($);return x(G,{received:G.data,code:T.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:$.data}}get value(){return this._def.value}}$4.create=($,G)=>{return new $4({value:$,typeName:p.ZodLiteral,...c(G)})};function yX($,G){return new u0({values:$,typeName:p.ZodEnum,...c(G)})}class u0 extends o{_parse($){if(typeof $.data!=="string"){let G=this._getOrReturnCtx($),X=this._def.values;return x(G,{expected:a.joinValues(X),received:G.parsedType,code:T.invalid_type}),u}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let G=this._getOrReturnCtx($),X=this._def.values;return x(G,{received:G.data,code:T.invalid_enum_value,options:X}),u}return S1($.data)}get options(){return this._def.values}get enum(){let $={};for(let G of this._def.values)$[G]=G;return $}get Values(){let $={};for(let G of this._def.values)$[G]=G;return $}get Enum(){let $={};for(let G of this._def.values)$[G]=G;return $}extract($,G=this._def){return u0.create($,{...this._def,...G})}exclude($,G=this._def){return u0.create(this.options.filter((X)=>!$.includes(X)),{...this._def,...G})}}u0.create=yX;class G4 extends o{_parse($){let G=a.getValidEnumValues(this._def.values),X=this._getOrReturnCtx($);if(X.parsedType!==C.string&&X.parsedType!==C.number){let Y=a.objectValues(G);return x(X,{expected:a.joinValues(Y),received:X.parsedType,code:T.invalid_type}),u}if(!this._cache)this._cache=new Set(a.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let Y=a.objectValues(G);return x(X,{received:X.data,code:T.invalid_enum_value,options:Y}),u}return S1($.data)}get enum(){return this._def.values}}G4.create=($,G)=>{return new G4({values:$,typeName:p.ZodNativeEnum,...c(G)})};class K2 extends o{unwrap(){return this._def.type}_parse($){let{ctx:G}=this._processInputParams($);if(G.parsedType!==C.promise&&G.common.async===!1)return x(G,{code:T.invalid_type,expected:C.promise,received:G.parsedType}),u;let X=G.parsedType===C.promise?G.data:Promise.resolve(G.data);return S1(X.then((Y)=>{return this._def.type.parseAsync(Y,{path:G.path,errorMap:G.common.contextualErrorMap})}))}}K2.create=($,G)=>{return new K2({type:$,typeName:p.ZodPromise,...c(G)})};class G0 extends o{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:G,ctx:X}=this._processInputParams($),Y=this._def.effect||null,W={addIssue:(V)=>{if(x(X,V),V.fatal)G.abort();else G.dirty()},get path(){return X.path}};if(W.addIssue=W.addIssue.bind(W),Y.type==="preprocess"){let V=Y.transform(X.data,W);if(X.common.async)return Promise.resolve(V).then(async(q)=>{if(G.value==="aborted")return u;let J=await this._def.schema._parseAsync({data:q,path:X.path,parent:X});if(J.status==="aborted")return u;if(J.status==="dirty")return D2(J.value);if(G.value==="dirty")return D2(J.value);return J});else{if(G.value==="aborted")return u;let q=this._def.schema._parseSync({data:V,path:X.path,parent:X});if(q.status==="aborted")return u;if(q.status==="dirty")return D2(q.value);if(G.value==="dirty")return D2(q.value);return q}}if(Y.type==="refinement"){let V=(q)=>{let J=Y.refinement(q,W);if(X.common.async)return Promise.resolve(J);if(J instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return q};if(X.common.async===!1){let q=this._def.schema._parseSync({data:X.data,path:X.path,parent:X});if(q.status==="aborted")return u;if(q.status==="dirty")G.dirty();return V(q.value),{status:G.value,value:q.value}}else return this._def.schema._parseAsync({data:X.data,path:X.path,parent:X}).then((q)=>{if(q.status==="aborted")return u;if(q.status==="dirty")G.dirty();return V(q.value).then(()=>{return{status:G.value,value:q.value}})})}if(Y.type==="transform")if(X.common.async===!1){let V=this._def.schema._parseSync({data:X.data,path:X.path,parent:X});if(!h0(V))return u;let q=Y.transform(V.value,W);if(q instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:G.value,value:q}}else return this._def.schema._parseAsync({data:X.data,path:X.path,parent:X}).then((V)=>{if(!h0(V))return u;return Promise.resolve(Y.transform(V.value,W)).then((q)=>({status:G.value,value:q}))});a.assertNever(Y)}}G0.create=($,G,X)=>{return new G0({schema:$,typeName:p.ZodEffects,effect:G,...c(X)})};G0.createWithPreprocess=($,G,X)=>{return new G0({schema:G,effect:{type:"preprocess",transform:$},typeName:p.ZodEffects,...c(X)})};class e1 extends o{_parse($){if(this._getType($)===C.undefined)return S1(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}e1.create=($,G)=>{return new e1({innerType:$,typeName:p.ZodOptional,...c(G)})};class z0 extends o{_parse($){if(this._getType($)===C.null)return S1(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}z0.create=($,G)=>{return new z0({innerType:$,typeName:p.ZodNullable,...c(G)})};class X4 extends o{_parse($){let{ctx:G}=this._processInputParams($),X=G.data;if(G.parsedType===C.undefined)X=this._def.defaultValue();return this._def.innerType._parse({data:X,path:G.path,parent:G})}removeDefault(){return this._def.innerType}}X4.create=($,G)=>{return new X4({innerType:$,typeName:p.ZodDefault,defaultValue:typeof G.default==="function"?G.default:()=>G.default,...c(G)})};class Y4 extends o{_parse($){let{ctx:G}=this._processInputParams($),X={...G,common:{...G.common,issues:[]}},Y=this._def.innerType._parse({data:X.data,path:X.path,parent:{...X}});if(d2(Y))return Y.then((W)=>{return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new C1(X.common.issues)},input:X.data})}});else return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new C1(X.common.issues)},input:X.data})}}removeCatch(){return this._def.innerType}}Y4.create=($,G)=>{return new Y4({innerType:$,typeName:p.ZodCatch,catchValue:typeof G.catch==="function"?G.catch:()=>G.catch,...c(G)})};class f4 extends o{_parse($){if(this._getType($)!==C.nan){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.nan,received:X.parsedType}),u}return{status:"valid",value:$.data}}}f4.create=($)=>{return new f4({typeName:p.ZodNaN,...c($)})};var HF=Symbol("zod_brand");class n6 extends o{_parse($){let{ctx:G}=this._processInputParams($),X=G.data;return this._def.type._parse({data:X,path:G.path,parent:G})}unwrap(){return this._def.type}}class m4 extends o{_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.common.async)return(async()=>{let W=await this._def.in._parseAsync({data:X.data,path:X.path,parent:X});if(W.status==="aborted")return u;if(W.status==="dirty")return G.dirty(),D2(W.value);else return this._def.out._parseAsync({data:W.value,path:X.path,parent:X})})();else{let Y=this._def.in._parseSync({data:X.data,path:X.path,parent:X});if(Y.status==="aborted")return u;if(Y.status==="dirty")return G.dirty(),{status:"dirty",value:Y.value};else return this._def.out._parseSync({data:Y.value,path:X.path,parent:X})}}static create($,G){return new m4({in:$,out:G,typeName:p.ZodPipeline})}}class W4 extends o{_parse($){let G=this._def.innerType._parse($),X=(Y)=>{if(h0(Y))Y.value=Object.freeze(Y.value);return Y};return d2(G)?G.then((Y)=>X(Y)):X(G)}unwrap(){return this._def.innerType}}W4.create=($,G)=>{return new W4({innerType:$,typeName:p.ZodReadonly,...c(G)})};function bX($,G){let X=typeof $==="function"?$(G):typeof $==="string"?{message:$}:$;return typeof X==="string"?{message:X}:X}function fX($,G={},X){if($)return M2.create().superRefine((Y,W)=>{let V=$(Y);if(V instanceof Promise)return V.then((q)=>{if(!q){let J=bX(G,Y),H=J.fatal??X??!0;W.addIssue({code:"custom",...J,fatal:H})}});if(!V){let q=bX(G,Y),J=q.fatal??X??!0;W.addIssue({code:"custom",...q,fatal:J})}return});return M2.create()}var UF={object:q1.lazycreate},p;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(p||(p={}));var DF=($,G={message:`Input not instance of ${$.name}`})=>fX((X)=>X instanceof $,G),mX=a1.create,uX=f0.create,RF=f4.create,MF=m0.create,pX=n2.create,QF=R2.create,KF=v4.create,FF=o2.create,AF=s2.create,wF=M2.create,BF=y0.create,OF=H0.create,PF=g4.create,NF=t1.create,ZF=q1.create,zF=q1.strictCreate,_F=a2.create,LF=i6.create,EF=t2.create,jF=U0.create,TF=h4.create,CF=y4.create,SF=Q2.create,IF=i2.create,xF=e2.create,kF=$4.create,bF=u0.create,vF=G4.create,gF=K2.create,hF=G0.create,yF=e1.create,fF=z0.create,mF=G0.createWithPreprocess,uF=m4.create,pF=()=>mX().optional(),lF=()=>uX().optional(),rF=()=>pX().optional(),dF={string:($)=>a1.create({...$,coerce:!0}),number:($)=>f0.create({...$,coerce:!0}),boolean:($)=>n2.create({...$,coerce:!0}),bigint:($)=>m0.create({...$,coerce:!0}),date:($)=>R2.create({...$,coerce:!0})};var cF=u;function D0($){return $ instanceof Error?$.message:String($)}function sF($){return $}function aF($){return $}function tF($){return $===void 0?{success:!0}:{success:!0,data:$}}function eF($){return{success:!1,error:$}}var $A=U.object({captureUrls:U.boolean().default(!1),blockedUrlDomains:U.array(U.string()).default(["meet.google.com","zoom.us","teams.microsoft.com","whereby.com","gather.town","calendly.com","cal.com","discord.com","discord.gg","cdn.discordapp.com","media.discordapp.net","giphy.com","tenor.com","wetransfer.com","file.io"])});function GA($,G){return{name:$,schema:G}}var p0=U.enum(["anchor","trusted","public"]),YA=U.enum(["create","update","delete","extract","publish"]),V4=U.enum(["never","anchor","trusted","public"]),lX=U.object({create:V4.optional(),update:V4.optional(),delete:V4.optional(),extract:V4.optional(),publish:V4.optional()}).strict(),WA=U.record(U.string(),lX);var VA=U.object({name:U.string(),description:U.string(),schema:U.any(),basePrompt:U.string().optional(),useKnowledgeContext:U.boolean().optional(),requiredPermission:p0,formatter:U.any().optional(),layout:U.object({component:U.any(),fullscreen:U.boolean().optional()}).optional(),dataSourceId:U.string().optional()});class u4{static canGenerate($){return!!$.basePrompt&&!!$.dataSourceId&&$.dataSourceId.includes("ai-content")}static canFetch($){return!!$.dataSourceId&&!this.canGenerate($)}static canRender($){return!!$.layout?.component}static isStaticOnly($){return!this.canGenerate($)&&!this.canFetch($)}static getCapabilities($){return{canGenerate:this.canGenerate($),canFetch:this.canFetch($),canRender:this.canRender($),isStaticOnly:this.isStaticOnly($)}}static validate($){let G=[];if($.dataSourceId?.includes("ai-content")&&!$.basePrompt)G.push(`Template "${$.name}" has AI-content dataSourceId but no basePrompt. AI generation requires a basePrompt.`);if($.basePrompt&&(!$.dataSourceId||!$.dataSourceId.includes("ai-content")))G.push(`Template "${$.name}" has basePrompt but no AI-content dataSourceId. The basePrompt won't be used.`);return G}static logCapabilities($,G){let X=this.getCapabilities($),Y=this.validate($);if(G)G.debug(`Template capabilities for "${$.name}":`,{...X,errors:Y.length>0?Y:void 0})}}var qA=U.enum(["site-content-preview","site-content-production"]),JA=U.enum(["web","image","pdf"]),HA=U.object({name:U.string(),schema:U.any(),description:U.string().optional(),pluginId:U.string(),renderers:U.object({web:U.union([U.function(),U.string()]).optional(),image:U.union([U.function(),U.string()]).optional(),pdf:U.union([U.function(),U.string()]).optional()})}),UA=U.object({enableContentGeneration:U.boolean().default(!1),outputDir:U.string(),workingDir:U.string().optional(),environment:U.enum(["preview","production"]).default("preview"),siteConfig:U.object({title:U.string(),description:U.string(),url:U.string().optional()}).optional()}),DA=U.object({success:U.boolean(),routesBuilt:U.number(),errors:U.array(U.string()).optional(),warnings:U.array(U.string()).optional()});var rX=U.enum(["anchor","trusted","public"]),MA=U.object({conversationId:U.string().min(1),message:U.string(),interfaceType:U.string().min(1),channelId:U.string().optional(),channelName:U.string().optional(),userPermissionLevel:rX}),dX=U.object({id:U.string().min(1),source:U.string().min(1),title:U.string().optional(),content:U.string().min(1),provenance:U.record(U.string(),U.unknown()).optional()}),QA=U.object({items:U.array(dX).default([])});var KA=U.object({url:U.string(),authToken:U.string().optional()});var FA=U.object({success:U.boolean(),entityId:U.string().optional(),error:U.string().optional()});var F2=U.enum(["user","assistant"]);var cX=U.object({message:U.string().describe("Natural language response to the query"),summary:U.string().optional().describe("Brief summary if applicable"),topics:U.array(U.string()).optional().describe("Related topics mentioned"),sources:U.array(U.object({id:U.string(),type:U.string(),excerpt:U.string().optional(),relevance:U.number().min(0).max(1).optional()})).optional().describe("Source entities used to answer the query"),metadata:U.record(U.string(),U.unknown()).optional()}).describe("defaultQueryResponse"),iX=U.object({message:U.string()}).describe("simpleTextResponse"),nX=U.object({success:U.boolean(),entityId:U.string().optional(),message:U.string()}).describe("createEntityResponse"),oX=U.object({success:U.boolean(),entityId:U.string(),changes:U.array(U.string()).optional(),message:U.string()}).describe("updateEntityResponse");var AA=U.object({status:U.enum(["healthy","warning","error","unknown"]),message:U.string().optional(),lastCheck:U.date().optional(),details:U.record(U.string(),U.unknown()).optional()}),sX=U.object({name:U.string(),pluginId:U.string(),status:U.string(),health:AA.optional()});import{McpServer as wS,ResourceTemplate as BS}from"@modelcontextprotocol/sdk/server/mcp.js";var o6=U.object({interfaceType:U.string(),userId:U.string(),channelId:U.string().optional(),channelName:U.string().optional(),userPermissionLevel:U.enum(["anchor","trusted","public"]).optional()}),aX=U.object({success:U.literal(!0),data:U.unknown(),message:U.string().optional()}).strict().superRefine(($,G)=>{if(!Object.prototype.hasOwnProperty.call($,"data"))G.addIssue({code:U.ZodIssueCode.custom,path:["data"],message:"Required"})}),tX=U.object({success:U.literal(!1),error:U.string(),code:U.string().optional()}).strict(),eX=U.object({needsConfirmation:U.literal(!0),toolName:U.string(),summary:U.string(),preview:U.string().optional(),args:U.unknown()}).strict(),o9=U.union([aX,tX,eX]);var RS=U.union([U.object({success:U.literal(!0),data:U.unknown()}).superRefine(($,G)=>{if(!Object.prototype.hasOwnProperty.call($,"data"))G.addIssue({code:U.ZodIssueCode.custom,path:["data"],message:"Required"})}),U.object({success:U.literal(!1),error:U.string()})]);var wA=U.union([U.object({success:U.literal(!0),data:U.unknown(),message:U.string().optional()}),U.object({success:U.literal(!1),error:U.string(),code:U.string().optional()})]);var $I=U.object({id:U.string(),type:U.string(),version:U.string(),status:U.string()}),GI=U.object({name:U.string(),description:U.string()}),s9=U.object({label:U.string(),url:U.string(),pluginId:U.string(),priority:U.number().default(100),visibility:p0.default("public")}),BA=U.enum(["human","agent","admin","protocol"]),OA=U.enum(["available","coming-soon","disabled"]),a9=U.object({id:U.string(),label:U.string(),description:U.string().optional(),href:U.string(),kind:BA,pluginId:U.string(),priority:U.number().default(100),visibility:p0.default("public"),status:OA.default("available")}),t9=U.object({entityType:U.string(),count:U.number()}),XI=U.object({model:U.string(),version:U.string(),uptime:U.number(),entities:U.number(),entityCounts:U.array(t9),embeddings:U.number(),ai:U.object({model:U.string(),embeddingModel:U.string()}),daemons:U.array(sX),endpoints:U.array(s9),interactions:U.array(a9)});var YI=U.object({id:U.string(),version:U.string(),type:U.enum(["core","entity","service","interface"]),description:U.string().optional(),dependencies:U.array(U.string()).optional(),packageName:U.string()});var PA=U.object({toolName:U.string(),args:U.unknown(),progressToken:U.union([U.string(),U.number()]).optional(),hasProgress:U.boolean().optional(),...o6.shape}),NA=U.object({resourceUri:U.string()});class A2{id;version;description;packageName;config;context;get logger(){return this.context?.logger??N1.createFresh({context:this.id})}constructor($,G,X,Y){this.id=$,this.packageName=G.name,this.version=G.version,this.description=G.description??`${G.name} plugin`,this.config=Y.parse(X)}setupMessageHandlers($){$.messaging.subscribe(`plugin:${this.id}:tool:execute`,async(G)=>{try{let{toolName:X,args:Y,progressToken:W,hasProgress:V,interfaceType:q,userId:J,channelId:H,userPermissionLevel:D}=PA.parse(G.payload),M=(await this.getTools()).find((Z)=>Z.name===X);if(!M)return{success:!1,error:`Tool not found: ${X}`};let A={interfaceType:q,userId:J,...H&&{channelId:H},...D&&{userPermissionLevel:D},...V&&W!==void 0&&{progressToken:W,sendProgress:async(Z)=>{await $.messaging.send({type:`plugin:${this.id}:progress`,payload:{progressToken:W,notification:Z}})}}};return{success:!0,data:await M.handler(Y,A)}}catch(X){if(X instanceof U.ZodError)return{success:!1,error:"Invalid tool execution request format"};return this.logger.error("Tool execution error",X),{success:!1,error:D0(X)}}}),$.messaging.subscribe(`plugin:${this.id}:resource:get`,async(G)=>{try{let{resourceUri:X}=NA.parse(G.payload),W=(await this.getResources()).find((q)=>q.uri===X);if(!W)return{success:!1,error:`Resource not found: ${X}`};return{success:!0,data:await W.handler()}}catch(X){if(X instanceof U.ZodError)return{success:!1,error:"Invalid resource get request format"};return this.logger.error("Resource fetch error",X),{success:!1,error:D0(X)}}})}async onRegister($){}async onReady($){}async ready(){await this.onReady(this.getContext())}async getCapabilities(){let $=await this.getInstructions();return{tools:await this.getTools(),resources:await this.getResources(),...$&&{instructions:$}}}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}async shutdown(){await this.onShutdown()}async onShutdown(){}getContext(){if(!this.context)throw Error(`Plugin ${this.id}: Plugin not registered yet`);return this.context}determineUserPermissionLevel($){return"public"}createProgressBridge($){if(!$)return;let G=this.context;if(!G)return;let X=this.id;return x0.from(async(Y)=>{await G.messaging.send({type:`plugin:${X}:progress`,payload:{progressToken:$,notification:{progress:Y.progress,total:Y.total,message:Y.message}}})})}}var $Y=U.object({id:U.string(),template:U.string(),content:U.unknown().optional(),dataQuery:U.object({entityType:U.string().optional(),template:U.string().optional(),query:U.object({id:U.string().optional(),limit:U.number().optional(),offset:U.number().optional()}).passthrough().optional()}).passthrough().optional(),order:U.number().optional()}),GY=["primary","secondary"],XY=U.object({show:U.boolean().default(!1),label:U.string().optional(),slot:U.enum(GY).default("primary"),priority:U.number().min(0).max(100).default(50)}).optional(),YY=U.object({id:U.string(),path:U.string(),title:U.string().default(""),pageLabel:U.string().optional(),description:U.string().default(""),sections:U.array($Y).default([]),layout:U.string().default("default"),fullscreen:U.boolean().optional(),pluginId:U.string().optional(),sourceEntityType:U.string().optional(),external:U.boolean().optional(),navigation:XY}),ZA=U.object({routes:U.array(YY),pluginId:U.string()}),zA=U.object({paths:U.array(U.string()).optional(),pluginId:U.string().optional()}),_A=U.object({pluginId:U.string().optional()}),LA=U.object({path:U.string()}),s6=U.object({label:U.string(),href:U.string(),priority:U.number()});var WY=U.object({heading:U.string().describe("Main CTA heading text"),buttonText:U.string().describe("Call-to-action button text"),buttonLink:U.string().describe("URL or anchor for the CTA button")}),VY=U.object({blurb:U.string().optional().describe("Short italic subtitle under the section title")}),qY=U.object({title:U.string().describe("The site's title"),description:U.string().describe("The site's description"),url:U.string().optional().describe("Canonical site URL"),copyright:U.string().optional().describe("Copyright notice text"),logo:U.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:U.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:U.string().optional().describe("Analytics script HTML"),cta:WY.optional().describe("Call-to-action configuration"),sections:U.record(U.string(),VY).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers.")}),EA=U.object({platform:U.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:U.string().describe("Profile or contact URL"),label:U.string().optional().describe("Optional display label")}),jA=qY.extend({navigation:U.object({primary:U.array(s6),secondary:U.array(s6)}),copyright:U.string(),socialLinks:U.array(EA).optional().describe("Social media links from profile metadata")});function e9($){return`preview.${$.trim().replace(/^https?:\/\//,"")}`}var TA=U.string(),CA=U.object({id:U.string().min(1)}).passthrough(),SA=U.object({label:U.string().min(1)}).passthrough(),IA=U.object({layouts:U.record(U.unknown()),plugin:U.function(),routes:U.array(CA),entityDisplay:U.record(SA),staticAssets:U.record(U.string()).optional()}).passthrough(),xA=U.custom(($)=>IA.safeParse($).success);var JY=U.enum(["file_operations","content_operations","data_processing","batch_processing"]),HY=U.object({pluginId:U.string().optional(),progressToken:U.union([U.string(),U.number()]).optional(),operationType:JY,operationTarget:U.string().optional(),interfaceType:U.string().optional(),channelId:U.string().optional()}),p4=HY.extend({rootJobId:U.string()}),II=U.enum(["none","skip","replace","coalesce"]);var $8=U.enum(["pending","processing","completed","failed"]),UY=U.enum(["completed","failed"]);var kA=U.object({id:U.string(),type:U.string(),status:$8,data:U.unknown(),result:U.unknown().optional(),lastError:U.string().optional().nullable(),attempts:U.number(),maxRetries:U.number(),priority:U.number(),createdAt:U.date(),updatedAt:U.date(),processedAt:U.date().optional().nullable(),completedAt:U.date().optional().nullable(),failedAt:U.date().optional().nullable()}),bA=U.object({jobId:U.string(),type:U.string(),status:UY,result:U.unknown().optional(),error:U.string().optional()}),DY=U.object({success:U.literal(!1),error:U.string().optional()}),G8=U.object({id:U.string(),type:U.enum(["job","batch"]),status:$8,message:U.string().optional(),progress:U.object({current:U.number(),total:U.number(),percentage:U.number()}).optional(),aggregationKey:U.string().optional(),batchDetails:U.object({totalOperations:U.number(),completedOperations:U.number(),failedOperations:U.number(),currentOperation:U.string().optional(),errors:U.array(U.string()).optional()}).optional(),jobDetails:U.object({jobType:U.string(),priority:U.number(),retryCount:U.number()}).optional(),metadata:p4});import{createClient as Zk}from"@libsql/client";var I=Symbol.for("drizzle:entityKind");function b1($,G){if(!$||typeof $!=="object")return!1;if($ instanceof G)return!0;if(!Object.prototype.hasOwnProperty.call(G,I))throw Error(`Class "${G.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let X=Object.getPrototypeOf($).constructor;if(X)while(X){if(I in X&&X[I]===G[I])return!0;X=Object.getPrototypeOf(X)}return!1}class l0{constructor($,G){this.table=$,this.config=G,this.name=G.name,this.keyAsName=G.keyAsName,this.notNull=G.notNull,this.default=G.default,this.defaultFn=G.defaultFn,this.onUpdateFn=G.onUpdateFn,this.hasDefault=G.hasDefault,this.primary=G.primaryKey,this.isUnique=G.isUnique,this.uniqueName=G.uniqueName,this.uniqueType=G.uniqueType,this.dataType=G.dataType,this.columnType=G.columnType,this.generated=G.generated,this.generatedIdentity=G.generatedIdentity}static[I]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue($){return $}mapToDriverValue($){return $}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class X8{static[I]="ColumnBuilder";config;constructor($,G,X){this.config={name:$,keyAsName:$==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:G,columnType:X,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default($){return this.config.default=$,this.config.hasDefault=!0,this}$defaultFn($){return this.config.defaultFn=$,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn($){return this.config.onUpdateFn=$,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName($){if(this.config.name!=="")return;this.config.name=$}}var X0=Symbol.for("drizzle:Name");function RY($,...G){return $(...G)}function MY($,G){return`${$[X0]}_${G.join("_")}_unique`}class l4 extends l0{constructor($,G){if(!G.uniqueName)G.uniqueName=MY($,[G.name]);super($,G);this.table=$}static[I]="PgColumn"}class vA extends l4{static[I]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op($){return this.indexConfig.opClass=$,this}}class gA extends l4{static[I]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor($,G){super($,G);this.enum=G.enum}getSQLType(){return this.enum.enumName}}var QY=Symbol.for("drizzle:isPgEnum");function KY($){return!!$&&typeof $==="function"&&QY in $&&$[QY]===!0}class hA extends l4{static[I]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor($,G){super($,G);this.enum=G.enum}getSQLType(){return this.enum.enumName}}class a6{static[I]="Subquery";constructor($,G,X,Y=!1,W=[]){this._={brand:"Subquery",sql:$,selectedFields:G,alias:X,isWith:Y,usedTables:W}}}var FY="0.44.7";var Y8,W8,AY={startActiveSpan($,G){if(!Y8)return G();if(!W8)W8=Y8.trace.getTracer("drizzle-orm",FY);return RY((X,Y)=>Y.startActiveSpan($,(W)=>{try{return G(W)}catch(V){throw W.setStatus({code:X.SpanStatusCode.ERROR,message:V instanceof Error?V.message:"Unknown error"}),V}finally{W.end()}}),Y8,W8)}};var q4=Symbol.for("drizzle:ViewBaseConfig");var V8=Symbol.for("drizzle:Schema"),wY=Symbol.for("drizzle:Columns"),BY=Symbol.for("drizzle:ExtraConfigColumns"),q8=Symbol.for("drizzle:OriginalName"),J8=Symbol.for("drizzle:BaseName"),r4=Symbol.for("drizzle:IsAlias"),OY=Symbol.for("drizzle:ExtraConfigBuilder"),yA=Symbol.for("drizzle:IsDrizzleTable");class M1{static[I]="Table";static Symbol={Name:X0,Schema:V8,OriginalName:q8,Columns:wY,ExtraConfigColumns:BY,BaseName:J8,IsAlias:r4,ExtraConfigBuilder:OY};[X0];[q8];[V8];[wY];[BY];[J8];[r4]=!1;[yA]=!0;[OY]=void 0;constructor($,G,X){this[X0]=this[q8]=$,this[V8]=G,this[J8]=X}}function fA($){return $!==null&&$!==void 0&&typeof $.getSQL==="function"}function mA($){let G={sql:"",params:[]};for(let X of $)if(G.sql+=X.sql,G.params.push(...X.params),X.typings?.length){if(!G.typings)G.typings=[];G.typings.push(...X.typings)}return G}class o1{static[I]="StringChunk";value;constructor($){this.value=Array.isArray($)?$:[$]}getSQL(){return new Q1([this])}}class Q1{constructor($){this.queryChunks=$;for(let G of $)if(b1(G,M1)){let X=G[M1.Symbol.Schema];this.usedTables.push(X===void 0?G[M1.Symbol.Name]:X+"."+G[M1.Symbol.Name])}}static[I]="SQL";decoder=PY;shouldInlineParams=!1;usedTables=[];append($){return this.queryChunks.push(...$.queryChunks),this}toQuery($){return AY.startActiveSpan("drizzle.buildSQL",(G)=>{let X=this.buildQueryFromSourceParams(this.queryChunks,$);return G?.setAttributes({"drizzle.query.text":X.sql,"drizzle.query.params":JSON.stringify(X.params)}),X})}buildQueryFromSourceParams($,G){let X=Object.assign({},G,{inlineParams:G.inlineParams||this.shouldInlineParams,paramStartIndex:G.paramStartIndex||{value:0}}),{casing:Y,escapeName:W,escapeParam:V,prepareTyping:q,inlineParams:J,paramStartIndex:H}=X;return mA($.map((D)=>{if(b1(D,o1))return{sql:D.value.join(""),params:[]};if(b1(D,t6))return{sql:W(D.value),params:[]};if(D===void 0)return{sql:"",params:[]};if(Array.isArray(D)){let R=[new o1("(")];for(let[M,A]of D.entries())if(R.push(A),M<D.length-1)R.push(new o1(", "));return R.push(new o1(")")),this.buildQueryFromSourceParams(R,X)}if(b1(D,Q1))return this.buildQueryFromSourceParams(D.queryChunks,{...X,inlineParams:J||D.shouldInlineParams});if(b1(D,M1)){let R=D[M1.Symbol.Schema],M=D[M1.Symbol.Name];return{sql:R===void 0||D[r4]?W(M):W(R)+"."+W(M),params:[]}}if(b1(D,l0)){let R=Y.getColumnCasing(D);if(G.invokeSource==="indexes")return{sql:W(R),params:[]};let M=D.table[M1.Symbol.Schema];return{sql:D.table[r4]||M===void 0?W(D.table[M1.Symbol.Name])+"."+W(R):W(M)+"."+W(D.table[M1.Symbol.Name])+"."+W(R),params:[]}}if(b1(D,ZY)){let R=D[q4].schema,M=D[q4].name;return{sql:R===void 0||D[q4].isAlias?W(M):W(R)+"."+W(M),params:[]}}if(b1(D,H8)){if(b1(D.value,e6))return{sql:V(H.value++,D),params:[D],typings:["none"]};let R=D.value===null?null:D.encoder.mapToDriverValue(D.value);if(b1(R,Q1))return this.buildQueryFromSourceParams([R],X);if(J)return{sql:this.mapInlineParam(R,X),params:[]};let M=["none"];if(q)M=[q(D.encoder)];return{sql:V(H.value++,R),params:[R],typings:M}}if(b1(D,e6))return{sql:V(H.value++,D),params:[D],typings:["none"]};if(b1(D,Q1.Aliased)&&D.fieldAlias!==void 0)return{sql:W(D.fieldAlias),params:[]};if(b1(D,a6)){if(D._.isWith)return{sql:W(D._.alias),params:[]};return this.buildQueryFromSourceParams([new o1("("),D._.sql,new o1(") "),new t6(D._.alias)],X)}if(KY(D)){if(D.schema)return{sql:W(D.schema)+"."+W(D.enumName),params:[]};return{sql:W(D.enumName),params:[]}}if(fA(D)){if(D.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([D.getSQL()],X);return this.buildQueryFromSourceParams([new o1("("),D.getSQL(),new o1(")")],X)}if(J)return{sql:this.mapInlineParam(D,X),params:[]};return{sql:V(H.value++,D),params:[D],typings:["none"]}}))}mapInlineParam($,{escapeString:G}){if($===null)return"null";if(typeof $==="number"||typeof $==="boolean")return $.toString();if(typeof $==="string")return G($);if(typeof $==="object"){let X=$.toString();if(X==="[object Object]")return G(JSON.stringify($));return G(X)}throw Error("Unexpected param value: "+$)}getSQL(){return this}as($){if($===void 0)return this;return new Q1.Aliased(this,$)}mapWith($){return this.decoder=typeof $==="function"?{mapFromDriverValue:$}:$,this}inlineParams(){return this.shouldInlineParams=!0,this}if($){return $?this:void 0}}class t6{constructor($){this.value=$}static[I]="Name";brand;getSQL(){return new Q1([this])}}var PY={mapFromDriverValue:($)=>$},NY={mapToDriverValue:($)=>$},Ax={...PY,...NY};class H8{constructor($,G=NY){this.value=$,this.encoder=G}static[I]="Param";brand;getSQL(){return new Q1([this])}}function w2($,...G){let X=[];if(G.length>0||$.length>0&&$[0]!=="")X.push(new o1($[0]));for(let[Y,W]of G.entries())X.push(W,new o1($[Y+1]));return new Q1(X)}(($)=>{function G(){return new Q1([])}$.empty=G;function X(H){return new Q1(H)}$.fromList=X;function Y(H){return new Q1([new o1(H)])}$.raw=Y;function W(H,D){let R=[];for(let[M,A]of H.entries()){if(M>0&&D!==void 0)R.push(D);R.push(A)}return new Q1(R)}$.join=W;function V(H){return new t6(H)}$.identifier=V;function q(H){return new e6(H)}$.placeholder=q;function J(H,D){return new H8(H,D)}$.param=J})(w2||(w2={}));(($)=>{class G{constructor(X,Y){this.sql=X,this.fieldAlias=Y}static[I]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new G(this.sql,this.fieldAlias)}}$.Aliased=G})(Q1||(Q1={}));class e6{constructor($){this.name=$}static[I]="Placeholder";getSQL(){return new Q1([this])}}var uA=Symbol.for("drizzle:IsDrizzleView");class ZY{static[I]="View";[q4];[uA]=!0;constructor({name:$,schema:G,selectedFields:X,query:Y}){this[q4]={name:$,originalName:$,schema:G,selectedFields:X,query:Y,isExisting:!Y,isAlias:!1}}getSQL(){return new Q1([this])}}l0.prototype.getSQL=function(){return new Q1([this])};M1.prototype.getSQL=function(){return new Q1([this])};a6.prototype.getSQL=function(){return new Q1([this])};function R0($,G){return{name:typeof $==="string"&&$.length>0?$:"",config:typeof $==="object"?$:G}}var U8=typeof TextDecoder>"u"?null:new TextDecoder;class D8{static[I]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor($,G){if(this.reference=()=>{let{name:X,columns:Y,foreignColumns:W}=$();return{name:X,columns:Y,foreignTable:W[0].table,foreignColumns:W}},G)this._onUpdate=G.onUpdate,this._onDelete=G.onDelete}onUpdate($){return this._onUpdate=$,this}onDelete($){return this._onDelete=$,this}build($){return new zY($,this)}}class zY{constructor($,G){this.table=$,this.reference=G.reference,this.onUpdate=G._onUpdate,this.onDelete=G._onDelete}static[I]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:$,columns:G,foreignColumns:X}=this.reference(),Y=G.map((q)=>q.name),W=X.map((q)=>q.name),V=[this.table[X0],...Y,X[0].table[X0],...W];return $??`${V.join("_")}_fk`}}function _Y($,G){return`${$[X0]}_${G.join("_")}_unique`}class O1 extends X8{static[I]="SQLiteColumnBuilder";foreignKeyConfigs=[];references($,G={}){return this.foreignKeyConfigs.push({ref:$,actions:G}),this}unique($){return this.config.isUnique=!0,this.config.uniqueName=$,this}generatedAlwaysAs($,G){return this.config.generated={as:$,type:"always",mode:G?.mode??"virtual"},this}buildForeignKeys($,G){return this.foreignKeyConfigs.map(({ref:X,actions:Y})=>{return((W,V)=>{let q=new D8(()=>{let J=W();return{columns:[$],foreignColumns:[J]}});if(V.onUpdate)q.onUpdate(V.onUpdate);if(V.onDelete)q.onDelete(V.onDelete);return q.build(G)})(X,Y)})}}class P1 extends l0{constructor($,G){if(!G.uniqueName)G.uniqueName=_Y($,[G.name]);super($,G);this.table=$}static[I]="SQLiteColumn"}class LY extends O1{static[I]="SQLiteBigIntBuilder";constructor($){super($,"bigint","SQLiteBigInt")}build($){return new EY($,this.config)}}class EY extends P1{static[I]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue($){if(typeof Buffer<"u"&&Buffer.from){let G=Buffer.isBuffer($)?$:$ instanceof ArrayBuffer?Buffer.from($):$.buffer?Buffer.from($.buffer,$.byteOffset,$.byteLength):Buffer.from($);return BigInt(G.toString("utf8"))}return BigInt(U8.decode($))}mapToDriverValue($){return Buffer.from($.toString())}}class jY extends O1{static[I]="SQLiteBlobJsonBuilder";constructor($){super($,"json","SQLiteBlobJson")}build($){return new TY($,this.config)}}class TY extends P1{static[I]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue($){if(typeof Buffer<"u"&&Buffer.from){let G=Buffer.isBuffer($)?$:$ instanceof ArrayBuffer?Buffer.from($):$.buffer?Buffer.from($.buffer,$.byteOffset,$.byteLength):Buffer.from($);return JSON.parse(G.toString("utf8"))}return JSON.parse(U8.decode($))}mapToDriverValue($){return Buffer.from(JSON.stringify($))}}class CY extends O1{static[I]="SQLiteBlobBufferBuilder";constructor($){super($,"buffer","SQLiteBlobBuffer")}build($){return new SY($,this.config)}}class SY extends P1{static[I]="SQLiteBlobBuffer";mapFromDriverValue($){if(Buffer.isBuffer($))return $;return Buffer.from($)}getSQLType(){return"blob"}}function IY($,G){let{name:X,config:Y}=R0($,G);if(Y?.mode==="json")return new jY(X);if(Y?.mode==="bigint")return new LY(X);return new CY(X)}class xY extends O1{static[I]="SQLiteCustomColumnBuilder";constructor($,G,X){super($,"custom","SQLiteCustomColumn");this.config.fieldConfig=G,this.config.customTypeParams=X}build($){return new kY($,this.config)}}class kY extends P1{static[I]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor($,G){super($,G);this.sqlName=G.customTypeParams.dataType(G.fieldConfig),this.mapTo=G.customTypeParams.toDriver,this.mapFrom=G.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue($){return typeof this.mapFrom==="function"?this.mapFrom($):$}mapToDriverValue($){return typeof this.mapTo==="function"?this.mapTo($):$}}function $5($){return(G,X)=>{let{name:Y,config:W}=R0(G,X);return new xY(Y,W,$)}}class G5 extends O1{static[I]="SQLiteBaseIntegerBuilder";constructor($,G,X){super($,G,X);this.config.autoIncrement=!1}primaryKey($){if($?.autoIncrement)this.config.autoIncrement=!0;return this.config.hasDefault=!0,super.primaryKey()}}class X5 extends P1{static[I]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class bY extends G5{static[I]="SQLiteIntegerBuilder";constructor($){super($,"number","SQLiteInteger")}build($){return new vY($,this.config)}}class vY extends X5{static[I]="SQLiteInteger"}class gY extends G5{static[I]="SQLiteTimestampBuilder";constructor($,G){super($,"date","SQLiteTimestamp");this.config.mode=G}defaultNow(){return this.default(w2`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build($){return new hY($,this.config)}}class hY extends X5{static[I]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue($){if(this.config.mode==="timestamp")return new Date($*1000);return new Date($)}mapToDriverValue($){let G=$.getTime();if(this.config.mode==="timestamp")return Math.floor(G/1000);return G}}class yY extends G5{static[I]="SQLiteBooleanBuilder";constructor($,G){super($,"boolean","SQLiteBoolean");this.config.mode=G}build($){return new fY($,this.config)}}class fY extends X5{static[I]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue($){return Number($)===1}mapToDriverValue($){return $?1:0}}function v1($,G){let{name:X,config:Y}=R0($,G);if(Y?.mode==="timestamp"||Y?.mode==="timestamp_ms")return new gY(X,Y.mode);if(Y?.mode==="boolean")return new yY(X,Y.mode);return new bY(X)}class mY extends O1{static[I]="SQLiteNumericBuilder";constructor($){super($,"string","SQLiteNumeric")}build($){return new uY($,this.config)}}class uY extends P1{static[I]="SQLiteNumeric";mapFromDriverValue($){if(typeof $==="string")return $;return String($)}getSQLType(){return"numeric"}}class pY extends O1{static[I]="SQLiteNumericNumberBuilder";constructor($){super($,"number","SQLiteNumericNumber")}build($){return new lY($,this.config)}}class lY extends P1{static[I]="SQLiteNumericNumber";mapFromDriverValue($){if(typeof $==="number")return $;return Number($)}mapToDriverValue=String;getSQLType(){return"numeric"}}class rY extends O1{static[I]="SQLiteNumericBigIntBuilder";constructor($){super($,"bigint","SQLiteNumericBigInt")}build($){return new dY($,this.config)}}class dY extends P1{static[I]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function cY($,G){let{name:X,config:Y}=R0($,G),W=Y?.mode;return W==="number"?new pY(X):W==="bigint"?new rY(X):new mY(X)}class iY extends O1{static[I]="SQLiteRealBuilder";constructor($){super($,"number","SQLiteReal")}build($){return new nY($,this.config)}}class nY extends P1{static[I]="SQLiteReal";getSQLType(){return"real"}}function oY($){return new iY($??"")}class sY extends O1{static[I]="SQLiteTextBuilder";constructor($,G){super($,"string","SQLiteText");this.config.enumValues=G.enum,this.config.length=G.length}build($){return new aY($,this.config)}}class aY extends P1{static[I]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor($,G){super($,G)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class tY extends O1{static[I]="SQLiteTextJsonBuilder";constructor($){super($,"json","SQLiteTextJson")}build($){return new eY($,this.config)}}class eY extends P1{static[I]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue($){return JSON.parse($)}mapToDriverValue($){return JSON.stringify($)}}function i($,G={}){let{name:X,config:Y}=R0($,G);if(Y.mode==="json")return new tY(X);return new sY(X,Y)}function $W(){return{blob:IY,customType:$5,integer:v1,numeric:cY,real:oY,text:i}}var R8=Symbol.for("drizzle:SQLiteInlineForeignKeys");class d4 extends M1{static[I]="SQLiteTable";static Symbol=Object.assign({},M1.Symbol,{InlineForeignKeys:R8});[M1.Symbol.Columns];[R8]=[];[M1.Symbol.ExtraConfigBuilder]=void 0}function pA($,G,X,Y,W=$){let V=new d4($,Y,W),q=typeof G==="function"?G($W()):G,J=Object.fromEntries(Object.entries(q).map(([D,R])=>{let M=R;M.setName(D);let A=M.build(V);return V[R8].push(...M.buildForeignKeys(A,V)),[D,A]})),H=Object.assign(V,J);if(H[M1.Symbol.Columns]=J,H[M1.Symbol.ExtraConfigColumns]=J,X)H[d4.Symbol.ExtraConfigBuilder]=X;return H}var M0=($,G,X)=>{return pA($,G,X)};class GW{constructor($,G){this.name=$,this.value=G}static[I]="SQLiteCheckBuilder";brand;build($){return new XW($,this)}}class XW{constructor($,G){this.table=$,this.name=G.name,this.value=G.value}static[I]="SQLiteCheck";name;value}function YW($,G){return new GW($,G)}class WW{constructor($,G){this.name=$,this.unique=G}static[I]="SQLiteIndexBuilderOn";on(...$){return new VW(this.name,$,this.unique)}}class VW{static[I]="SQLiteIndexBuilder";config;constructor($,G,X){this.config={name:$,columns:G,unique:X,where:void 0}}where($){return this.config.where=$,this}build($){return new qW(this.config,$)}}class qW{static[I]="SQLiteIndex";config;constructor($,G){this.config={...$,table:G}}}function Y0($){return new WW($,!1)}function Y5(...$){if($[0].columns)return new M8($[0].columns,$[0].name);return new M8($)}class M8{static[I]="SQLitePrimaryKeyBuilder";columns;name;constructor($,G){this.columns=$,this.name=G}build($){return new JW($,this.columns,this.name)}}class JW{constructor($,G,X){this.table=$,this.columns=G,this.name=X}static[I]="SQLitePrimaryKey";columns;name;getName(){return this.name??`${this.table[d4.Symbol.Name]}_${this.columns.map(($)=>$.name).join("_")}_pk`}}var HW=M0("job_queue",{id:i("id").primaryKey().$defaultFn(()=>g0()),type:i("type").notNull(),data:i("data").notNull(),result:i("result",{mode:"json"}),source:i("source"),metadata:i("metadata",{mode:"json"}).$type().notNull(),status:i("status",{enum:["pending","processing","completed","failed"]}).notNull().default("pending"),priority:v1("priority").notNull().default(0),retryCount:v1("retryCount").notNull().default(0),maxRetries:v1("maxRetries").notNull().default(3),lastError:i("lastError"),createdAt:v1("createdAt").notNull().$defaultFn(()=>Date.now()),scheduledFor:v1("scheduledFor").notNull().$defaultFn(()=>Date.now()),startedAt:v1("startedAt"),completedAt:v1("completedAt")},($)=>({queueReadyIdx:Y0("idx_job_queue_ready").on($.status,$.priority,$.scheduledFor),jobTypeIdx:Y0("idx_job_queue_type").on($.type,$.status),jobSourceIdx:Y0("idx_job_queue_source").on($.source)}));var lA=U.object({id:U.string(),type:U.string(),data:U.string(),status:U.enum(["pending","processing","completed","failed"]),source:U.string().nullable(),priority:U.number(),retryCount:U.number(),maxRetries:U.number(),lastError:U.string().nullable(),createdAt:U.number(),scheduledFor:U.number(),startedAt:U.number().nullable(),completedAt:U.number().nullable(),metadata:p4,result:U.unknown().nullable().optional()});function Q8($,G,X){return async(Y)=>{let{type:W,data:V,toolContext:q=null,options:J}=Y,{metadata:H,...D}=J??{},R={source:G,...J?.rootJobId&&{rootJobId:J.rootJobId},...D,metadata:{operationType:"data_processing",pluginId:G,...q&&{interfaceType:q.interfaceType,channelId:q.channelId},...H}},M=X&&!W.includes(":")?`${G}:${W}`:W;return $.enqueue({type:M,data:V,options:R})}}function K8($,G){return async(X,Y)=>{let W=g0(),V=X.map((J)=>({...J,type:J.type.includes(":")?J.type:`${G}:${J.type}`})),q={...Y,source:G,rootJobId:W,metadata:{...Y?.metadata,operationType:"batch_processing",pluginId:G}};return await $.enqueueBatch(V,q,W,G),W}}function F8($,G){return(X,Y)=>{let W=X.includes(":")?X:`${G}:${X}`;$.registerHandler(W,Y,G)}}var rA=U.object({name:U.string(),schema:U.custom(($)=>$ instanceof U.ZodType)});function UW($){return rA.safeParse($).success}function dA($){if(!$)return;return{status:$.status,message:$.message,lastCheck:$.lastCheck?.toISOString(),details:$.details}}function DW($){return{model:$.model,version:$.version,uptime:$.uptime,entities:$.entities,entityCounts:$.entityCounts,embeddings:$.embeddings,ai:$.ai,daemons:$.daemons.map((G)=>({name:G.name,pluginId:G.pluginId,status:G.status,health:dA(G.health)})),endpoints:$.endpoints,interactions:$.interactions}}var J4=U.record(U.unknown());var cA=U.object({id:U.string(),sessionId:U.string(),interfaceType:U.string(),channelId:U.string(),channelName:U.string().optional(),startedAt:U.string(),lastActiveAt:U.string(),createdAt:U.string(),updatedAt:U.string(),metadata:J4}),iA=U.object({id:U.string(),conversationId:U.string(),role:F2,content:U.string(),timestamp:U.string(),metadata:J4});function RW($){if(!$)return{};try{let G=JSON.parse($);if(G&&typeof G==="object"&&!Array.isArray(G))return G}catch{}return{}}function nA($){let G=F2.safeParse($);return G.success?G.data:"user"}function W5($){let G=RW($.metadata),X=typeof G.channelName==="string"?G.channelName:void 0;return{id:$.id,sessionId:$.sessionId,interfaceType:$.interfaceType,channelId:$.channelId,channelName:X,startedAt:$.started,lastActiveAt:$.lastActive,createdAt:$.created,updatedAt:$.updated,metadata:G}}function MW($){return{id:$.id,conversationId:$.conversationId,role:nA($.role),content:$.content,timestamp:$.timestamp,metadata:RW($.metadata)}}var A8=U.object({name:U.string(),role:U.string(),purpose:U.string(),values:U.array(U.string())}),w8=U.object({name:U.string(),kind:U.enum(["professional","team","collective"]),organization:U.string().optional(),description:U.string().optional(),avatar:U.string().optional(),website:U.string().optional(),email:U.string().optional(),socialLinks:U.array(U.object({platform:U.enum(["github","instagram","linkedin","email","website"]),url:U.string(),label:U.string().optional()})).optional()});function QW($){return A8.parse($)}function KW($){return w8.parse($)}function FW($){return async()=>{return DW(await $.getAppInfo())}}function AW($,G){return{get:()=>QW($.getIdentity()),getProfile:()=>KW($.getProfile()),getAppInfo:G}}function wW($,G,X){let Y=$.getMessageBus();return{send:async(V)=>{return Y.send({...V,sender:G})},subscribe:(V,q)=>{if(UW(V)){let J=V,H=q,D=async(R)=>{let M=J.schema.safeParse(R.payload);if(!M.success)return X.warn(`Invalid payload for channel ${J.name}`,{error:M.error.message}),{noop:!0};let{payload:A,...F}=R;return H(M.data,F)};return Y.subscribe(J.name,D)}return Y.subscribe(V,q)}}}function BW($,G){let X=$.getJobQueueService();return{...$.jobs,enqueue:Q8(X,G,!0),enqueueBatch:K8($.jobs,G),registerHandler:F8(X,G)}}function OW($){let G=$.getPermissionService();return{assertEntityActionAllowed:(X,Y,W)=>{G.assertEntityActionAllowed(X,Y,W.userPermissionLevel)}}}function PW($){return{get:async(G)=>{let Y=await $.getConversationService().getConversation(G);return Y?W5(Y):null},search:async(G)=>{return(await $.getConversationService().searchConversations(G)).map(W5)},list:async(G)=>{return(await $.getConversationService().listConversations(G)).map(W5)},getMessages:async(G,X)=>{return(await $.getConversationService().getMessages(G,X)).map(MW)},countMessages:async(G)=>{return $.getConversationService().countMessages(G)}}}function NW($,G){return{registerHandler:(X,Y)=>{$.registerEvalHandler(G,X,Y)}}}function ZW($){return{register:(G,X)=>{$.getInsightsRegistry().register(G,X)}}}function zW($,G){return{register:(X)=>{$.registerEndpoint({...X,pluginId:G})}}}function _W($,G){return{register:(X)=>{$.registerInteraction({...X,pluginId:G})}}}function H4($,G,X){let Y=$.getEntityService(),W=$.getLogger().child(G),V=$.getDomain(),q=$.getLocalSiteUrl(),J=$.shouldPreferLocalUrls(),H=$.getThemeCSS(),D=FW($),R=$.getAttachmentRegistry();return{pluginId:G,logger:W,entityService:Y,identity:AW($,D),appInfo:D,domain:V,siteUrl:V?`https://${V}`:void 0,localSiteUrl:q,previewUrl:V?`https://${e9(V)}`:void 0,preferLocalUrls:J,themeCSS:H,entityDisplay:X?.entityDisplay,spaces:$.getSpaces(),permissions:OW($),messaging:wW($,G,W),jobs:BW($,G),attachments:R,conversations:PW($),dataDir:$.getDataDir(),eval:NW($,G),insights:ZW($),endpoints:zW($,G),interactions:_W($,G)}}import{createClient as ib}from"@libsql/client";var V5=M0("entities",{id:i("id").notNull(),entityType:i("entityType").notNull(),content:i("content").notNull(),contentHash:i("contentHash").notNull(),visibility:i("visibility",{enum:["public","shared","restricted"]}).notNull().default("public"),metadata:i("metadata",{mode:"json"}).$type().notNull().default(w2`'{}'`),created:v1("created").notNull().$defaultFn(()=>Date.now()),updated:v1("updated").notNull().$defaultFn(()=>Date.now())},($)=>{return{pk:Y5({columns:[$.id,$.entityType]}),visibilityCheck:YW("entities_visibility_check",w2`${$.visibility} IN ('public', 'shared', 'restricted')`)}});import{createClient as Xv}from"@libsql/client";var LW=$5({dataType(){return"F32_BLOB(1536)"},toDriver($){return Buffer.from($.buffer)},fromDriver($){return new Float32Array($.buffer,$.byteOffset,$.byteLength/4)}});var q5=M0("embeddings",{entityId:i("entity_id").notNull(),entityType:i("entity_type").notNull(),embedding:LW("embedding").notNull(),contentHash:i("content_hash").notNull()},($)=>{return{pk:Y5({columns:[$.entityId,$.entityType]})}});var oA=U.enum(["public","shared","restricted"]),i4=U.union([oA,U.literal("private")]).optional().transform(($)=>{if($===void 0)return"public";if($==="private")return"restricted";return $});var B8=U.object({id:U.string(),entityType:U.string(),content:U.string(),created:U.string().datetime(),updated:U.string().datetime(),visibility:i4,metadata:U.record(U.string(),U.unknown()),contentHash:U.string()});var Mv=U.object({id:U.string().min(1,"Entity ID is required"),entityType:U.string().min(1,"Entity type is required"),contentHash:U.string().min(1,"Content hash is required"),operation:U.enum(["create","update"])});var wv=U.object({limit:U.number().int().positive().optional().default(20),offset:U.number().int().min(0).optional().default(0),types:U.array(U.string()).optional().default([]),excludeTypes:U.array(U.string()).optional().default([]),weight:U.record(U.string(),U.number()).optional(),visibilityScope:U.enum(["public","shared","restricted"]).optional(),includeUngenerated:U.boolean().optional().default(!1)});var P8=t4(y5(),1);function J5($,G){if(Object.keys(G).length===0)return $;let X=Object.fromEntries(Object.entries(G).filter(([,Y])=>Y!==void 0));return P8.default.stringify($,X)}function O8($){if($ instanceof Date)return $.toISOString();if(Array.isArray($))return $.map(O8);if($!==null&&typeof $==="object"){let G={};for(let[X,Y]of Object.entries($))G[X]=O8(Y);return G}return $}function n4($,G){let{content:X,data:Y}=P8.default($),W=O8(Y);return{content:X.trim(),metadata:G.parse(W)}}var Nv=U.object({visibility:i4});var $w=U.object({field:U.string(),direction:U.enum(["asc","desc"]),nullsFirst:U.boolean().optional()}),bv=U.object({limit:U.number().int().positive().optional(),offset:U.number().int().min(0).optional().default(0),sortFields:U.array($w).optional(),filter:U.object({metadata:U.record(U.string(),U.unknown()).optional(),visibilityScope:U.enum(["public","shared","restricted"]).optional()}).optional(),publishedOnly:U.boolean().optional()});var Rw=U.object({currentPage:U.number(),totalPages:U.number(),totalItems:U.number(),pageSize:U.number(),hasNextPage:U.boolean(),hasPrevPage:U.boolean()});function Mw($){return $.replace(/:/g,"-")}function Qw($){return $.split(/[:.-]/).map((G)=>G.charAt(0).toUpperCase()+G.slice(1)).join(" ")}var N8=new Map;async function TW($,G,X){let Y=N8.get(G);if(Y!==void 0)return Y;let W=Mw(G),V;try{V=await $.getEntity({entityType:"prompt",id:W})}catch{return X}if(V?.content){let q=n4(V.content,U.record(U.unknown())).content;return N8.set(G,q),q}try{let q=Qw(G),J=J5(X,{title:q,target:G});await $.createEntity({entity:{id:W,entityType:"prompt",content:J,metadata:{title:q,target:G,slug:W}}})}catch{}return N8.set(G,X),X}function H5($){let G=$.getEntityService(),X=$.getEntityRegistry(),Y=$.getDataSourceRegistry();return{register:(W,V,q,J)=>{X.registerEntityType(W,V,q,J)},getAdapter:(W)=>{try{return X.getAdapter(W)}catch{return}},extendFrontmatterSchema:(W,V)=>{X.extendFrontmatterSchema(W,V)},getEffectiveFrontmatterSchema:(W)=>{return X.getEffectiveFrontmatterSchema(W)},registerCreateInterceptor:(W,V)=>{X.registerCreateInterceptor(W,V)},update:async(W)=>{return G.updateEntity({entity:W})},registerDataSource:(W)=>{Y.register(W)}}}function U5($){return{resolve:(G,X)=>{return TW($,G,X)}}}function CW($,G,X){let Y=H4($,G,X),W=$.getEntityService();return{...Y,entityService:W,entities:H5($),ai:{query:(V,q)=>$.query(V,q),generate:async(V)=>{return $.generateContent(V)},generateObject:async(V,q)=>{return $.generateObject(V,q)},generateImage:async(V,q)=>{return $.generateImage(V,q)},canGenerateImages:()=>{return $.canGenerateImages()}},prompts:U5(W),permissions:Y.permissions}}function IW($,G,X){let Y=!1,W=!1;if($.jobs.registerHandler(X.job.type,X.job.handler),X.initialSync){let V=X.initialSync;$.messaging.subscribe("sync:initial:completed",async()=>{if(Y)return{success:!0};if(Y=!0,!(await V.shouldEnqueue?.()??!0))return G.info("Skipping derived entity projection initial sync",{projectionId:X.id,targetType:X.targetType}),{success:!0};return W=await SW($,G,X,V.jobData,Fw(V.jobOptions),"initial-sync"),{success:!0}})}if(X.sourceChange){let V=X.sourceChange,q=new Set(V.sourceTypes),J=V.events??["entity:created","entity:updated"],H=async(D)=>{if(V.requireInitialSync&&!Y)return{success:!0};let R=D.payload,M=Kw(V,R);if(!M||!q.has("*")&&!q.has(M))return{success:!0};if(!(await V.shouldEnqueue?.(R)??!0))return{success:!0};let F=await V.jobData(R);if(!F)return{success:!0};return await SW($,G,X,F,V.jobOptions?.(R),"source-change"),{success:!0}};for(let D of J)$.messaging.subscribe(D,H)}return{hasObservedInitialSync:()=>Y,hasQueuedInitialSync:()=>W}}function Kw($,G){if($.sourceType)return $.sourceType;if($.sourceKind&&$.sourceKind!=="entity")return $.sourceKind;return G.entityType}async function SW($,G,X,Y,W,V){try{return await $.jobs.enqueue({type:X.job.type,data:Y,...W?{options:W}:{}}),G.info("Queued derived entity projection",{projectionId:X.id,targetType:X.targetType,reason:V}),!0}catch(q){return G.error("Failed to queue derived entity projection",{projectionId:X.id,targetType:X.targetType,reason:V,error:D0(q)}),!1}}function Fw($){return typeof $==="function"?$():$}var Aw=U.object({});class D5 extends A2{type="entity";entityActionPolicy;derivedEntityProjectionControllers=new Map;constructor($,G,X={},Y=Aw,W){super($,G,X,Y);if(W!==void 0)this.entityActionPolicy=W}async register($,G){let X=CW($,this.id,G);if(this.context=X,this.setupMessageHandlers(X),X.entities.register(this.entityType,this.schema,this.adapter,this.getEntityTypeConfig()),this.interceptCreate!==D5.prototype.interceptCreate)X.entities.registerCreateInterceptor(this.entityType,(H,D)=>this.interceptCreate(H,D,X));let Y=this.createGenerationHandler(X);if(Y)X.jobs.registerHandler(`${this.entityType}:generation`,Y);let W=this.getTemplates();if(W&&Object.keys(W).length>0)$.registerTemplates(W,this.id);let V=this.getDataSources();for(let H of V)X.entities.registerDataSource(H);let q=this.getDerivedEntityProjections(X);for(let H of q){let D=IW(X,this.logger,H);this.derivedEntityProjectionControllers.set(H.id,D)}await this.onRegister(this.context);let J=await this.getInstructions();return{tools:[],resources:[],...J&&{instructions:J}}}async interceptCreate($,G,X){return{kind:"continue",input:$}}createGenerationHandler($){return null}getTemplates(){return null}getDataSources(){return[]}getEntityTypeConfig(){return}getDerivedEntityProjections($){return[]}getDerivedEntityProjectionController($){return this.derivedEntityProjectionControllers.get($)}}class xW extends D5{hooks;constructor($,G,X,Y,W){super($,G,X,Y);this.hooks=W}get entityType(){return this.hooks.getEntityType()}get schema(){return this.hooks.getSchema()}get adapter(){return this.hooks.getAdapter()}onRegister($){return this.hooks.onRegister($)}onReady($){return this.hooks.onReady($)}onShutdown(){return this.hooks.onShutdown()}getEntityTypeConfig(){return this.hooks.getEntityTypeConfig()}getDataSources(){return this.hooks.getDataSources()}getInstructions(){return this.hooks.getInstructions()}interceptCreate($,G,X){return this.hooks.interceptCreate($,G,X)}}class Z8{type="entity";id;version;packageName;description;delegate;constructor($,G,X,Y){if(this.id=$,this.version=G.version,this.packageName=G.name,G.description!==void 0)this.description=G.description;this.delegate=new xW($,G,X,Y,{getEntityType:()=>this.entityType,getSchema:()=>this.schema,getAdapter:()=>this.adapter,onRegister:(W)=>this.onRegister(W),onReady:(W)=>this.onReady(W),onShutdown:()=>this.onShutdown(),getEntityTypeConfig:()=>this.getEntityTypeConfig(),getDataSources:()=>this.getDataSources(),getInstructions:()=>this.getInstructions(),interceptCreate:(W,V,q)=>this.interceptCreate(W,V,q)})}register($,G){return this.delegate.register($,G)}async onRegister($){}async onReady($){}async onShutdown(){}async getInstructions(){return}getEntityTypeConfig(){return}getDataSources(){return[]}async interceptCreate($,G,X){return{kind:"continue",input:$}}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}import{createClient as Eh}from"@libsql/client";var R5=M0("conversations",{id:i("id").primaryKey(),sessionId:i("session_id").notNull(),interfaceType:i("interface_type").notNull(),channelId:i("channel_id").notNull(),started:i("started").notNull(),lastActive:i("last_active").notNull(),metadata:i("metadata"),created:i("created").notNull(),updated:i("updated").notNull()},($)=>({sessionIdx:Y0("idx_conversations_session").on($.sessionId),channelIdx:Y0("idx_conversations_channel").on($.channelId),interfaceSessionIdx:Y0("idx_conversations_interface_session").on($.interfaceType,$.sessionId),interfaceChannelIdx:Y0("idx_conversations_interface_channel").on($.interfaceType,$.channelId)})),kW=M0("messages",{id:i("id").primaryKey(),conversationId:i("conversation_id").notNull().references(()=>R5.id,{onDelete:"cascade"}),role:i("role").notNull(),content:i("content").notNull(),timestamp:i("timestamp").notNull(),metadata:i("metadata")},($)=>({conversationIdx:Y0("idx_messages_conversation").on($.conversationId),timestampIdx:Y0("idx_messages_timestamp").on($.timestamp)})),bW=M0("summary_tracking",{conversationId:i("conversation_id").primaryKey().references(()=>R5.id,{onDelete:"cascade"}),lastSummarizedAt:i("last_summarized_at"),lastMessageId:i("last_message_id"),messagesSinceSummary:v1("messages_since_summary").default(0),updated:i("updated").notNull()});var Sh=U.preprocess(($)=>{if(typeof $!=="string")return $;try{return JSON.parse($)}catch{return}},U.record(U.unknown())).catch({});var M5=U.object({actorId:U.string(),canonicalId:U.string().optional(),interfaceType:U.string(),role:F2,displayName:U.string().optional(),username:U.string().optional(),isBot:U.boolean().optional()}),Q5=U.object({messageId:U.string().optional(),channelId:U.string().optional(),channelName:U.string().optional(),threadId:U.string().optional(),metadata:U.record(U.unknown()).optional()}),ww=U.object({actor:M5.optional(),source:Q5.optional()}).passthrough(),Bw=U.object({id:U.string(),conversationId:U.string(),role:U.string(),content:U.string(),timestamp:U.string(),metadata:U.string().nullable()}),Ow=U.object({conversationId:U.string(),messageCount:U.number(),messages:U.array(Bw),windowStart:U.number(),windowEnd:U.number(),windowSize:U.number(),timestamp:U.string()});var zw=U.object({kind:U.string().min(1),id:U.string().min(1)}),_w=U.object({kind:U.literal("text"),filename:U.string().min(1),mediaType:U.string().min(1),content:U.string(),sizeBytes:U.number().nonnegative().optional(),source:zw.optional()}),Lw=U.discriminatedUnion("kind",[_w]),Ew=U.object({userPermissionLevel:p0.optional(),interfaceType:U.string().optional(),channelId:U.string().optional(),channelName:U.string().optional(),actor:M5.optional(),source:Q5.optional(),attachments:U.array(Lw).optional()}),vW=U.object({id:U.string(),toolCallId:U.string().optional(),toolName:U.string(),summary:U.string(),preview:U.string().optional(),args:U.unknown()}),jw=U.enum(["approval-requested","approval-responded","output-available","output-denied","output-error"]),Tw=U.object({kind:U.literal("tool-approval"),id:U.string(),toolCallId:U.string().optional(),toolName:U.string(),input:U.record(U.unknown()).optional(),summary:U.string(),preview:U.string().optional(),state:jw,output:U.unknown().optional(),error:U.string().optional()}),Cw=U.object({entityType:U.string().optional(),entityId:U.string().optional(),attachmentType:U.string().optional()}),Sw=U.object({mediaType:U.string().min(1),url:U.string().min(1),downloadUrl:U.string().min(1).optional(),previewUrl:U.string().min(1).optional(),filename:U.string().min(1).optional(),sizeBytes:U.number().nonnegative().optional(),source:Cw.optional()}),Iw=U.object({kind:U.literal("attachment"),id:U.string(),jobId:U.string().optional(),title:U.string(),description:U.string().optional(),attachment:Sw}),xw=U.discriminatedUnion("kind",[Tw,Iw]);function gW($){let{attachment:G}=$,{source:X}=G;return{kind:"attachment",id:$.id,...$.jobId!==void 0&&{jobId:$.jobId},title:$.title,...$.description!==void 0&&{description:$.description},attachment:{mediaType:G.mediaType,url:G.url,...G.downloadUrl!==void 0&&{downloadUrl:G.downloadUrl},...G.previewUrl!==void 0&&{previewUrl:G.previewUrl},...G.filename!==void 0&&{filename:G.filename},...G.sizeBytes!==void 0&&{sizeBytes:G.sizeBytes},...X!==void 0&&{source:{...X.entityType!==void 0&&{entityType:X.entityType},...X.entityId!==void 0&&{entityId:X.entityId},...X.attachmentType!==void 0&&{attachmentType:X.attachmentType}}}}}}var hW=U.object({toolName:U.string(),args:U.record(U.unknown()).optional(),jobId:U.string().optional(),data:U.unknown().optional()}),kw=U.object({text:U.string(),toolResults:U.array(hW).optional(),cards:U.array(xw).optional(),pendingConfirmations:U.array(vW).optional(),usage:U.object({promptTokens:U.number(),completionTokens:U.number(),totalTokens:U.number()})});function yW($){return{text:$.text,...$.toolResults&&{toolResults:$.toolResults.map((G)=>({toolName:G.toolName,...G.args&&{args:G.args},...G.jobId!==void 0&&{jobId:G.jobId},...G.data!==void 0&&{data:G.data}}))},...$.cards&&{cards:$.cards.map(bw)},...$.pendingConfirmations&&{pendingConfirmations:$.pendingConfirmations.map((G)=>vw(G))},usage:$.usage}}function bw($){if($.kind==="attachment")return gW($);return{kind:$.kind,id:$.id,...$.toolCallId!==void 0&&{toolCallId:$.toolCallId},toolName:$.toolName,...$.input!==void 0&&{input:$.input},summary:$.summary,...$.preview!==void 0&&{preview:$.preview},state:$.state,...$.output!==void 0&&{output:$.output},...$.error!==void 0&&{error:$.error}}}function vw($){return{id:$.id,...$.toolCallId!==void 0&&{toolCallId:$.toolCallId},toolName:$.toolName,summary:$.summary,...$.preview!==void 0&&{preview:$.preview},args:$.args}}function gw($){if(!$)return;return{...$.userPermissionLevel&&{userPermissionLevel:$.userPermissionLevel},...$.interfaceType&&{interfaceType:$.interfaceType},...$.channelId&&{channelId:$.channelId},...$.channelName&&{channelName:$.channelName},...$.actor&&{actor:$.actor},...$.source&&{source:$.source},...$.attachments&&{attachments:$.attachments}}}function fW($){return{chat:async(G,X,Y)=>{return yW(await $.chat(G,X,gw(Y)))},confirmPendingAction:async(G,X,Y)=>{return yW(await $.confirmPendingAction(G,X,Y))},invalidate:()=>{$.invalidateAgent()}}}function mW($,G,X){let Y=H4($,G,X),W=$.getMCPService(),V=$.getPermissionService(),q=fW($.getAgentService());return{...Y,mcpTransport:W,agent:q,permissions:{...Y.permissions,getUserLevel:(J,H,D)=>{return V.determineUserLevel(J,H,D)}},daemons:{register:(J,H)=>{let D=`${G}:${J}`;$.registerDaemon(D,H,G),Y.logger.debug(`Registered daemon: ${D}`)}},conversations:{...Y.conversations,start:async(J)=>{return $.getConversationService().startConversation(J)},addMessage:async(J)=>{await $.getConversationService().addMessage(J)},updateMetadata:async(J)=>{return $.getConversationService().updateConversationMetadata(J)},delete:async(J)=>{return $.getConversationService().deleteConversation(J)}},tools:{listForPermissionLevel:(J)=>{return $.listToolsForPermissionLevel(J)}},apiRoutes:{getRoutes:()=>{return $.getPluginApiRoutes()},getMessageBus:()=>{return $.getMessageBus()}},webRoutes:{getRoutes:()=>{return $.getPluginWebRoutes()}},plugins:{has:(J)=>$.hasPlugin(J)}}}var hw=3600000;class o4 extends A2{type="interface";daemon;jobTrackingEntries=new Map;jobTrackingTtlMs=hw;async register($,G){let X=mW($,this.id,G);if(this.context=X,this.initializeDaemon(),this.daemon)await this.registerDaemon(X);return this.setupMessageHandlers(X),await this.onRegister(X),this.getCapabilities()}async onRegister($){}async registerDaemon($){if(!this.daemon)return;$.daemons.register(this.id,this.daemon),$.logger.debug(`Registered daemon for interface: ${this.id}`)}createDaemon(){return}requiresDaemonStartup(){return!1}getWebRoutes(){return[]}initializeDaemon(){let $=this.createDaemon();if($)this.daemon=$}async handleProgressEvent($,G){}cleanupExpiredEntries(){let $=Date.now(),G=[];for(let[X,Y]of this.jobTrackingEntries)if($-Y.createdAt>this.jobTrackingTtlMs)G.push(X);for(let X of G)this.jobTrackingEntries.delete(X)}ownsJob($,G){return this.jobTrackingEntries.has($)||G!==void 0&&this.jobTrackingEntries.has(G)}getJobTracking($,G){let X=this.jobTrackingEntries.get($);if(X)return X.info;if(G){let Y=this.jobTrackingEntries.get(G);if(Y)return Y.info}return}setJobTracking($,G){this.cleanupExpiredEntries(),this.jobTrackingEntries.set($,{info:G,createdAt:Date.now()})}removeJobTracking($){this.jobTrackingEntries.delete($)}async createJobWithTracking($,G){let Y=await this.getContext().jobs.enqueue($);return this.setJobTracking(Y,G),Y}async createBatchWithTracking($,G,X){let W=await this.getContext().jobs.enqueueBatch($,X);return this.setJobTracking(W,G),W}}class uW extends o4{hooks;constructor($,G,X,Y,W){super($,G,X,Y);this.hooks=W}onRegister($){return this.hooks.onRegister($)}onReady($){return this.hooks.onReady($)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}getWebRoutes(){return this.hooks.getWebRoutes()}requiresDaemonStartup(){return this.hooks.requiresDaemonStartup()}}class s4{type="interface";id;version;packageName;description;delegate;constructor($,G,X,Y){if(this.id=$,this.version=G.version,this.packageName=G.name,G.description!==void 0)this.description=G.description;this.delegate=new uW($,G,X,Y,{onRegister:(W)=>this.onRegister(W),onReady:(W)=>this.onReady(W),onShutdown:()=>this.onShutdown(),getTools:()=>this.getTools(),getResources:()=>this.getResources(),getInstructions:()=>this.getInstructions(),getWebRoutes:()=>this.getWebRoutes(),requiresDaemonStartup:()=>this.requiresDaemonStartup()})}register($,G){return this.delegate.register($,G)}async onRegister($){}async onReady($){}async onShutdown(){}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}getWebRoutes(){return[]}requiresDaemonStartup(){return!1}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}function pW($,G){$.messaging.subscribe("job-progress",async(X)=>{try{let Y=G8.safeParse(X.payload);if(!Y.success)return G.onInvalidSchema(),{success:!1};let W=Y.data;return await G.onProgress(W,W.metadata),{success:!0}}catch(Y){return G.onError(Y),{success:!1}}})}function lW($){let G=$.status==="completed"?"\u2705":"\u274C",X=$.status==="completed"?"completed":"failed",Y=$.metadata.operationType.replace(/_/g," "),W=$.metadata.operationTarget?`: ${$.metadata.operationTarget}`:"",V=`${G} **${Y}${W}** ${X}`;if($.message)V+=`
|
|
119
|
+
`;return""}var SK=CK,IK={dump:SK};function d9($,G){return function(){throw Error("Function yaml."+$+" is removed in js-yaml 4. Use yaml."+G+" instead, which is now safe by default.")}}var{load:xK,loadAll:wj}=wX,kK=IK.dump;var Bj=d9("safeLoad","load"),Oj=d9("safeLoadAll","loadAll"),Pj=d9("safeDump","dump");import{webcrypto as SX}from"crypto";var CX="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var vK=128,U2,l2;function gK($){if($<0||$>1024)throw RangeError("Wrong ID size");if(!U2||U2.length<$)U2=Buffer.allocUnsafe($*vK),SX.getRandomValues(U2),l2=0;else if(l2+$>U2.length)SX.getRandomValues(U2),l2=0;l2+=$}function IX($=21){gK($|=0);let G="";for(let X=l2-$;X<l2;X++)G+=CX[U2[X]&63];return G}function g0($=12){return IX($)}var U={};b8(U,{void:()=>PF,util:()=>a,unknown:()=>BF,union:()=>_F,undefined:()=>FF,tuple:()=>jF,transformer:()=>hF,symbol:()=>KF,string:()=>mX,strictObject:()=>zF,setErrorMap:()=>fK,set:()=>SF,record:()=>TF,quotelessJson:()=>hK,promise:()=>gF,preprocess:()=>mF,pipeline:()=>uF,ostring:()=>pF,optional:()=>yF,onumber:()=>lF,oboolean:()=>rF,objectUtil:()=>c9,object:()=>ZF,number:()=>uX,nullable:()=>fF,null:()=>AF,never:()=>OF,nativeEnum:()=>vF,nan:()=>RF,map:()=>CF,makeIssue:()=>b4,literal:()=>kF,lazy:()=>xF,late:()=>UF,isValid:()=>h0,isDirty:()=>c6,isAsync:()=>d2,isAborted:()=>d6,intersection:()=>EF,instanceof:()=>DF,getParsedType:()=>J0,getErrorMap:()=>r2,function:()=>IF,enum:()=>bF,effect:()=>hF,discriminatedUnion:()=>LF,defaultErrorMap:()=>N0,datetimeRegex:()=>hX,date:()=>QF,custom:()=>fX,coerce:()=>dF,boolean:()=>pX,bigint:()=>MF,array:()=>NF,any:()=>wF,addIssueToContext:()=>x,ZodVoid:()=>g4,ZodUnknown:()=>y0,ZodUnion:()=>a2,ZodUndefined:()=>o2,ZodType:()=>o,ZodTuple:()=>U0,ZodTransformer:()=>G0,ZodSymbol:()=>v4,ZodString:()=>a1,ZodSet:()=>Q2,ZodSchema:()=>o,ZodRecord:()=>h4,ZodReadonly:()=>W4,ZodPromise:()=>K2,ZodPipeline:()=>m4,ZodParsedType:()=>C,ZodOptional:()=>e1,ZodObject:()=>q1,ZodNumber:()=>f0,ZodNullable:()=>z0,ZodNull:()=>s2,ZodNever:()=>H0,ZodNativeEnum:()=>G4,ZodNaN:()=>f4,ZodMap:()=>y4,ZodLiteral:()=>$4,ZodLazy:()=>e2,ZodIssueCode:()=>T,ZodIntersection:()=>t2,ZodFunction:()=>i2,ZodFirstPartyTypeKind:()=>p,ZodError:()=>C1,ZodEnum:()=>u0,ZodEffects:()=>G0,ZodDiscriminatedUnion:()=>i6,ZodDefault:()=>X4,ZodDate:()=>R2,ZodCatch:()=>Y4,ZodBranded:()=>n6,ZodBoolean:()=>n2,ZodBigInt:()=>m0,ZodArray:()=>t1,ZodAny:()=>M2,Schema:()=>o,ParseStatus:()=>_1,OK:()=>S1,NEVER:()=>cF,INVALID:()=>u,EMPTY_PATH:()=>mK,DIRTY:()=>D2,BRAND:()=>HF});var a;(function($){$.assertEqual=(W)=>{};function G(W){}$.assertIs=G;function X(W){throw Error()}$.assertNever=X,$.arrayToEnum=(W)=>{let V={};for(let q of W)V[q]=q;return V},$.getValidEnumValues=(W)=>{let V=$.objectKeys(W).filter((J)=>typeof W[W[J]]!=="number"),q={};for(let J of V)q[J]=W[J];return $.objectValues(q)},$.objectValues=(W)=>{return $.objectKeys(W).map(function(V){return W[V]})},$.objectKeys=typeof Object.keys==="function"?(W)=>Object.keys(W):(W)=>{let V=[];for(let q in W)if(Object.prototype.hasOwnProperty.call(W,q))V.push(q);return V},$.find=(W,V)=>{for(let q of W)if(V(q))return q;return},$.isInteger=typeof Number.isInteger==="function"?(W)=>Number.isInteger(W):(W)=>typeof W==="number"&&Number.isFinite(W)&&Math.floor(W)===W;function Y(W,V=" | "){return W.map((q)=>typeof q==="string"?`'${q}'`:q).join(V)}$.joinValues=Y,$.jsonStringifyReplacer=(W,V)=>{if(typeof V==="bigint")return V.toString();return V}})(a||(a={}));var c9;(function($){$.mergeShapes=(G,X)=>{return{...G,...X}}})(c9||(c9={}));var C=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J0=($)=>{switch(typeof $){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN($)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":if(Array.isArray($))return C.array;if($===null)return C.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return C.promise;if(typeof Map<"u"&&$ instanceof Map)return C.map;if(typeof Set<"u"&&$ instanceof Set)return C.set;if(typeof Date<"u"&&$ instanceof Date)return C.date;return C.object;default:return C.unknown}};var T=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hK=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class C1 extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(X)=>{this.issues=[...this.issues,X]},this.addIssues=(X=[])=>{this.issues=[...this.issues,...X]};let G=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,G);else this.__proto__=G;this.name="ZodError",this.issues=$}format($){let G=$||function(W){return W.message},X={_errors:[]},Y=(W)=>{for(let V of W.issues)if(V.code==="invalid_union")V.unionErrors.map(Y);else if(V.code==="invalid_return_type")Y(V.returnTypeError);else if(V.code==="invalid_arguments")Y(V.argumentsError);else if(V.path.length===0)X._errors.push(G(V));else{let q=X,J=0;while(J<V.path.length){let H=V.path[J];if(J!==V.path.length-1)q[H]=q[H]||{_errors:[]};else q[H]=q[H]||{_errors:[]},q[H]._errors.push(G(V));q=q[H],J++}}};return Y(this),X}static assert($){if(!($ instanceof C1))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(G)=>G.message){let G={},X=[];for(let Y of this.issues)if(Y.path.length>0){let W=Y.path[0];G[W]=G[W]||[],G[W].push($(Y))}else X.push($(Y));return{formErrors:X,fieldErrors:G}}get formErrors(){return this.flatten()}}C1.create=($)=>{return new C1($)};var yK=($,G)=>{let X;switch($.code){case T.invalid_type:if($.received===C.undefined)X="Required";else X=`Expected ${$.expected}, received ${$.received}`;break;case T.invalid_literal:X=`Invalid literal value, expected ${JSON.stringify($.expected,a.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:X=`Unrecognized key(s) in object: ${a.joinValues($.keys,", ")}`;break;case T.invalid_union:X="Invalid input";break;case T.invalid_union_discriminator:X=`Invalid discriminator value. Expected ${a.joinValues($.options)}`;break;case T.invalid_enum_value:X=`Invalid enum value. Expected ${a.joinValues($.options)}, received '${$.received}'`;break;case T.invalid_arguments:X="Invalid function arguments";break;case T.invalid_return_type:X="Invalid function return type";break;case T.invalid_date:X="Invalid date";break;case T.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(X=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")X=`${X} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)X=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)X=`Invalid input: must end with "${$.validation.endsWith}"`;else a.assertNever($.validation);else if($.validation!=="regex")X=`Invalid ${$.validation}`;else X="Invalid";break;case T.too_small:if($.type==="array")X=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")X=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")X=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")X=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")X=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else X="Invalid input";break;case T.too_big:if($.type==="array")X=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")X=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")X=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")X=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")X=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else X="Invalid input";break;case T.custom:X="Invalid input";break;case T.invalid_intersection_types:X="Intersection results could not be merged";break;case T.not_multiple_of:X=`Number must be a multiple of ${$.multipleOf}`;break;case T.not_finite:X="Number must be finite";break;default:X=G.defaultError,a.assertNever($)}return{message:X}},N0=yK;var xX=N0;function fK($){xX=$}function r2(){return xX}var b4=($)=>{let{data:G,path:X,errorMaps:Y,issueData:W}=$,V=[...X,...W.path||[]],q={...W,path:V};if(W.message!==void 0)return{...W,path:V,message:W.message};let J="",H=Y.filter((D)=>!!D).slice().reverse();for(let D of H)J=D(q,{data:G,defaultError:J}).message;return{...W,path:V,message:J}},mK=[];function x($,G){let X=r2(),Y=b4({issueData:G,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,X,X===N0?void 0:N0].filter((W)=>!!W)});$.common.issues.push(Y)}class _1{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,G){let X=[];for(let Y of G){if(Y.status==="aborted")return u;if(Y.status==="dirty")$.dirty();X.push(Y.value)}return{status:$.value,value:X}}static async mergeObjectAsync($,G){let X=[];for(let Y of G){let W=await Y.key,V=await Y.value;X.push({key:W,value:V})}return _1.mergeObjectSync($,X)}static mergeObjectSync($,G){let X={};for(let Y of G){let{key:W,value:V}=Y;if(W.status==="aborted")return u;if(V.status==="aborted")return u;if(W.status==="dirty")$.dirty();if(V.status==="dirty")$.dirty();if(W.value!=="__proto__"&&(typeof V.value<"u"||Y.alwaysSet))X[W.value]=V.value}return{status:$.value,value:X}}}var u=Object.freeze({status:"aborted"}),D2=($)=>({status:"dirty",value:$}),S1=($)=>({status:"valid",value:$}),d6=($)=>$.status==="aborted",c6=($)=>$.status==="dirty",h0=($)=>$.status==="valid",d2=($)=>typeof Promise<"u"&&$ instanceof Promise;var g;(function($){$.errToObj=(G)=>typeof G==="string"?{message:G}:G||{},$.toString=(G)=>typeof G==="string"?G:G?.message})(g||(g={}));class $0{constructor($,G,X,Y){this._cachedPath=[],this.parent=$,this.data=G,this._path=X,this._key=Y}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var kX=($,G)=>{if(h0(G))return{success:!0,data:G.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let X=new C1($.common.issues);return this._error=X,this._error}}}};function c($){if(!$)return{};let{errorMap:G,invalid_type_error:X,required_error:Y,description:W}=$;if(G&&(X||Y))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(G)return{errorMap:G,description:W};return{errorMap:(q,J)=>{let{message:H}=$;if(q.code==="invalid_enum_value")return{message:H??J.defaultError};if(typeof J.data>"u")return{message:H??Y??J.defaultError};if(q.code!=="invalid_type")return{message:J.defaultError};return{message:H??X??J.defaultError}},description:W}}class o{get description(){return this._def.description}_getType($){return J0($.data)}_getOrReturnCtx($,G){return G||{common:$.parent.common,data:$.data,parsedType:J0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new _1,ctx:{common:$.parent.common,data:$.data,parsedType:J0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let G=this._parse($);if(d2(G))throw Error("Synchronous parse encountered promise.");return G}_parseAsync($){let G=this._parse($);return Promise.resolve(G)}parse($,G){let X=this.safeParse($,G);if(X.success)return X.data;throw X.error}safeParse($,G){let X={common:{issues:[],async:G?.async??!1,contextualErrorMap:G?.errorMap},path:G?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J0($)},Y=this._parseSync({data:$,path:X.path,parent:X});return kX(X,Y)}"~validate"($){let G={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J0($)};if(!this["~standard"].async)try{let X=this._parseSync({data:$,path:[],parent:G});return h0(X)?{value:X.value}:{issues:G.common.issues}}catch(X){if(X?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;G.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:G}).then((X)=>h0(X)?{value:X.value}:{issues:G.common.issues})}async parseAsync($,G){let X=await this.safeParseAsync($,G);if(X.success)return X.data;throw X.error}async safeParseAsync($,G){let X={common:{issues:[],contextualErrorMap:G?.errorMap,async:!0},path:G?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J0($)},Y=this._parse({data:$,path:X.path,parent:X}),W=await(d2(Y)?Y:Promise.resolve(Y));return kX(X,W)}refine($,G){let X=(Y)=>{if(typeof G==="string"||typeof G>"u")return{message:G};else if(typeof G==="function")return G(Y);else return G};return this._refinement((Y,W)=>{let V=$(Y),q=()=>W.addIssue({code:T.custom,...X(Y)});if(typeof Promise<"u"&&V instanceof Promise)return V.then((J)=>{if(!J)return q(),!1;else return!0});if(!V)return q(),!1;else return!0})}refinement($,G){return this._refinement((X,Y)=>{if(!$(X))return Y.addIssue(typeof G==="function"?G(X,Y):G),!1;else return!0})}_refinement($){return new G0({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(G)=>this["~validate"](G)}}optional(){return e1.create(this,this._def)}nullable(){return z0.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return t1.create(this)}promise(){return K2.create(this,this._def)}or($){return a2.create([this,$],this._def)}and($){return t2.create(this,$,this._def)}transform($){return new G0({...c(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:$}})}default($){let G=typeof $==="function"?$:()=>$;return new X4({...c(this._def),innerType:this,defaultValue:G,typeName:p.ZodDefault})}brand(){return new n6({typeName:p.ZodBranded,type:this,...c(this._def)})}catch($){let G=typeof $==="function"?$:()=>$;return new Y4({...c(this._def),innerType:this,catchValue:G,typeName:p.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return m4.create(this,$)}readonly(){return W4.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var uK=/^c[^\s-]{8,}$/i,pK=/^[0-9a-z]+$/,lK=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rK=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dK=/^[a-z0-9_-]{21}$/i,cK=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,iK=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nK=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",i9,sK=/^(?:(?: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])$/,aK=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,tK=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eK=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$F=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,GF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vX="((\\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])))",XF=new RegExp(`^${vX}$`);function gX($){let G="[0-5]\\d";if($.precision)G=`${G}\\.\\d{${$.precision}}`;else if($.precision==null)G=`${G}(\\.\\d+)?`;let X=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${G})${X}`}function YF($){return new RegExp(`^${gX($)}$`)}function hX($){let G=`${vX}T${gX($)}`,X=[];if(X.push($.local?"Z?":"Z"),$.offset)X.push("([+-]\\d{2}:?\\d{2})");return G=`${G}(${X.join("|")})`,new RegExp(`^${G}$`)}function WF($,G){if((G==="v4"||!G)&&sK.test($))return!0;if((G==="v6"||!G)&&tK.test($))return!0;return!1}function VF($,G){if(!cK.test($))return!1;try{let[X]=$.split(".");if(!X)return!1;let Y=X.replace(/-/g,"+").replace(/_/g,"/").padEnd(X.length+(4-X.length%4)%4,"="),W=JSON.parse(atob(Y));if(typeof W!=="object"||W===null)return!1;if("typ"in W&&W?.typ!=="JWT")return!1;if(!W.alg)return!1;if(G&&W.alg!==G)return!1;return!0}catch{return!1}}function qF($,G){if((G==="v4"||!G)&&aK.test($))return!0;if((G==="v6"||!G)&&eK.test($))return!0;return!1}class a1 extends o{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==C.string){let W=this._getOrReturnCtx($);return x(W,{code:T.invalid_type,expected:C.string,received:W.parsedType}),u}let X=new _1,Y=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.length<W.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:T.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),X.dirty()}else if(W.kind==="max"){if($.data.length>W.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:T.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),X.dirty()}else if(W.kind==="length"){let V=$.data.length>W.value,q=$.data.length<W.value;if(V||q){if(Y=this._getOrReturnCtx($,Y),V)x(Y,{code:T.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});else if(q)x(Y,{code:T.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});X.dirty()}}else if(W.kind==="email"){if(!nK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"email",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="emoji"){if(!i9)i9=new RegExp(oK,"u");if(!i9.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"emoji",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="uuid"){if(!rK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"uuid",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="nanoid"){if(!dK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"nanoid",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="cuid"){if(!uK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cuid",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="cuid2"){if(!pK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cuid2",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="ulid"){if(!lK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"ulid",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="url")try{new URL($.data)}catch{Y=this._getOrReturnCtx($,Y),x(Y,{validation:"url",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="regex"){if(W.regex.lastIndex=0,!W.regex.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"regex",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="trim")$.data=$.data.trim();else if(W.kind==="includes"){if(!$.data.includes(W.value,W.position))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:{includes:W.value,position:W.position},message:W.message}),X.dirty()}else if(W.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(W.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(W.kind==="startsWith"){if(!$.data.startsWith(W.value))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:{startsWith:W.value},message:W.message}),X.dirty()}else if(W.kind==="endsWith"){if(!$.data.endsWith(W.value))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:{endsWith:W.value},message:W.message}),X.dirty()}else if(W.kind==="datetime"){if(!hX(W).test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:"datetime",message:W.message}),X.dirty()}else if(W.kind==="date"){if(!XF.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:"date",message:W.message}),X.dirty()}else if(W.kind==="time"){if(!YF(W).test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:T.invalid_string,validation:"time",message:W.message}),X.dirty()}else if(W.kind==="duration"){if(!iK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"duration",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="ip"){if(!WF($.data,W.version))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"ip",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="jwt"){if(!VF($.data,W.alg))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"jwt",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="cidr"){if(!qF($.data,W.version))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cidr",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="base64"){if(!$F.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"base64",code:T.invalid_string,message:W.message}),X.dirty()}else if(W.kind==="base64url"){if(!GF.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"base64url",code:T.invalid_string,message:W.message}),X.dirty()}else a.assertNever(W);return{status:X.value,value:$.data}}_regex($,G,X){return this.refinement((Y)=>$.test(Y),{validation:G,code:T.invalid_string,...g.errToObj(X)})}_addCheck($){return new a1({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...g.errToObj($)})}url($){return this._addCheck({kind:"url",...g.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...g.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...g.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...g.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...g.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...g.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...g.errToObj($)})}base64($){return this._addCheck({kind:"base64",...g.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...g.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...g.errToObj($)})}ip($){return this._addCheck({kind:"ip",...g.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...g.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...g.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...g.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...g.errToObj($)})}regex($,G){return this._addCheck({kind:"regex",regex:$,...g.errToObj(G)})}includes($,G){return this._addCheck({kind:"includes",value:$,position:G?.position,...g.errToObj(G?.message)})}startsWith($,G){return this._addCheck({kind:"startsWith",value:$,...g.errToObj(G)})}endsWith($,G){return this._addCheck({kind:"endsWith",value:$,...g.errToObj(G)})}min($,G){return this._addCheck({kind:"min",value:$,...g.errToObj(G)})}max($,G){return this._addCheck({kind:"max",value:$,...g.errToObj(G)})}length($,G){return this._addCheck({kind:"length",value:$,...g.errToObj(G)})}nonempty($){return this.min(1,g.errToObj($))}trim(){return new a1({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a1({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a1({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let G of this._def.checks)if(G.kind==="min"){if($===null||G.value>$)$=G.value}return $}get maxLength(){let $=null;for(let G of this._def.checks)if(G.kind==="max"){if($===null||G.value<$)$=G.value}return $}}a1.create=($)=>{return new a1({checks:[],typeName:p.ZodString,coerce:$?.coerce??!1,...c($)})};function JF($,G){let X=($.toString().split(".")[1]||"").length,Y=(G.toString().split(".")[1]||"").length,W=X>Y?X:Y,V=Number.parseInt($.toFixed(W).replace(".","")),q=Number.parseInt(G.toFixed(W).replace(".",""));return V%q/10**W}class f0 extends o{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==C.number){let W=this._getOrReturnCtx($);return x(W,{code:T.invalid_type,expected:C.number,received:W.parsedType}),u}let X=void 0,Y=new _1;for(let W of this._def.checks)if(W.kind==="int"){if(!a.isInteger($.data))X=this._getOrReturnCtx($,X),x(X,{code:T.invalid_type,expected:"integer",received:"float",message:W.message}),Y.dirty()}else if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)X=this._getOrReturnCtx($,X),x(X,{code:T.too_small,minimum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),Y.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)X=this._getOrReturnCtx($,X),x(X,{code:T.too_big,maximum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),Y.dirty()}else if(W.kind==="multipleOf"){if(JF($.data,W.value)!==0)X=this._getOrReturnCtx($,X),x(X,{code:T.not_multiple_of,multipleOf:W.value,message:W.message}),Y.dirty()}else if(W.kind==="finite"){if(!Number.isFinite($.data))X=this._getOrReturnCtx($,X),x(X,{code:T.not_finite,message:W.message}),Y.dirty()}else a.assertNever(W);return{status:Y.value,value:$.data}}gte($,G){return this.setLimit("min",$,!0,g.toString(G))}gt($,G){return this.setLimit("min",$,!1,g.toString(G))}lte($,G){return this.setLimit("max",$,!0,g.toString(G))}lt($,G){return this.setLimit("max",$,!1,g.toString(G))}setLimit($,G,X,Y){return new f0({...this._def,checks:[...this._def.checks,{kind:$,value:G,inclusive:X,message:g.toString(Y)}]})}_addCheck($){return new f0({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:g.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString($)})}multipleOf($,G){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(G)})}finite($){return this._addCheck({kind:"finite",message:g.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString($)})}get minValue(){let $=null;for(let G of this._def.checks)if(G.kind==="min"){if($===null||G.value>$)$=G.value}return $}get maxValue(){let $=null;for(let G of this._def.checks)if(G.kind==="max"){if($===null||G.value<$)$=G.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&a.isInteger($.value))}get isFinite(){let $=null,G=null;for(let X of this._def.checks)if(X.kind==="finite"||X.kind==="int"||X.kind==="multipleOf")return!0;else if(X.kind==="min"){if(G===null||X.value>G)G=X.value}else if(X.kind==="max"){if($===null||X.value<$)$=X.value}return Number.isFinite(G)&&Number.isFinite($)}}f0.create=($)=>{return new f0({checks:[],typeName:p.ZodNumber,coerce:$?.coerce||!1,...c($)})};class m0 extends o{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==C.bigint)return this._getInvalidInput($);let X=void 0,Y=new _1;for(let W of this._def.checks)if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)X=this._getOrReturnCtx($,X),x(X,{code:T.too_small,type:"bigint",minimum:W.value,inclusive:W.inclusive,message:W.message}),Y.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)X=this._getOrReturnCtx($,X),x(X,{code:T.too_big,type:"bigint",maximum:W.value,inclusive:W.inclusive,message:W.message}),Y.dirty()}else if(W.kind==="multipleOf"){if($.data%W.value!==BigInt(0))X=this._getOrReturnCtx($,X),x(X,{code:T.not_multiple_of,multipleOf:W.value,message:W.message}),Y.dirty()}else a.assertNever(W);return{status:Y.value,value:$.data}}_getInvalidInput($){let G=this._getOrReturnCtx($);return x(G,{code:T.invalid_type,expected:C.bigint,received:G.parsedType}),u}gte($,G){return this.setLimit("min",$,!0,g.toString(G))}gt($,G){return this.setLimit("min",$,!1,g.toString(G))}lte($,G){return this.setLimit("max",$,!0,g.toString(G))}lt($,G){return this.setLimit("max",$,!1,g.toString(G))}setLimit($,G,X,Y){return new m0({...this._def,checks:[...this._def.checks,{kind:$,value:G,inclusive:X,message:g.toString(Y)}]})}_addCheck($){return new m0({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString($)})}multipleOf($,G){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(G)})}get minValue(){let $=null;for(let G of this._def.checks)if(G.kind==="min"){if($===null||G.value>$)$=G.value}return $}get maxValue(){let $=null;for(let G of this._def.checks)if(G.kind==="max"){if($===null||G.value<$)$=G.value}return $}}m0.create=($)=>{return new m0({checks:[],typeName:p.ZodBigInt,coerce:$?.coerce??!1,...c($)})};class n2 extends o{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==C.boolean){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.boolean,received:X.parsedType}),u}return S1($.data)}}n2.create=($)=>{return new n2({typeName:p.ZodBoolean,coerce:$?.coerce||!1,...c($)})};class R2 extends o{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==C.date){let W=this._getOrReturnCtx($);return x(W,{code:T.invalid_type,expected:C.date,received:W.parsedType}),u}if(Number.isNaN($.data.getTime())){let W=this._getOrReturnCtx($);return x(W,{code:T.invalid_date}),u}let X=new _1,Y=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.getTime()<W.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:T.too_small,message:W.message,inclusive:!0,exact:!1,minimum:W.value,type:"date"}),X.dirty()}else if(W.kind==="max"){if($.data.getTime()>W.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:T.too_big,message:W.message,inclusive:!0,exact:!1,maximum:W.value,type:"date"}),X.dirty()}else a.assertNever(W);return{status:X.value,value:new Date($.data.getTime())}}_addCheck($){return new R2({...this._def,checks:[...this._def.checks,$]})}min($,G){return this._addCheck({kind:"min",value:$.getTime(),message:g.toString(G)})}max($,G){return this._addCheck({kind:"max",value:$.getTime(),message:g.toString(G)})}get minDate(){let $=null;for(let G of this._def.checks)if(G.kind==="min"){if($===null||G.value>$)$=G.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let G of this._def.checks)if(G.kind==="max"){if($===null||G.value<$)$=G.value}return $!=null?new Date($):null}}R2.create=($)=>{return new R2({checks:[],coerce:$?.coerce||!1,typeName:p.ZodDate,...c($)})};class v4 extends o{_parse($){if(this._getType($)!==C.symbol){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.symbol,received:X.parsedType}),u}return S1($.data)}}v4.create=($)=>{return new v4({typeName:p.ZodSymbol,...c($)})};class o2 extends o{_parse($){if(this._getType($)!==C.undefined){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.undefined,received:X.parsedType}),u}return S1($.data)}}o2.create=($)=>{return new o2({typeName:p.ZodUndefined,...c($)})};class s2 extends o{_parse($){if(this._getType($)!==C.null){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.null,received:X.parsedType}),u}return S1($.data)}}s2.create=($)=>{return new s2({typeName:p.ZodNull,...c($)})};class M2 extends o{constructor(){super(...arguments);this._any=!0}_parse($){return S1($.data)}}M2.create=($)=>{return new M2({typeName:p.ZodAny,...c($)})};class y0 extends o{constructor(){super(...arguments);this._unknown=!0}_parse($){return S1($.data)}}y0.create=($)=>{return new y0({typeName:p.ZodUnknown,...c($)})};class H0 extends o{_parse($){let G=this._getOrReturnCtx($);return x(G,{code:T.invalid_type,expected:C.never,received:G.parsedType}),u}}H0.create=($)=>{return new H0({typeName:p.ZodNever,...c($)})};class g4 extends o{_parse($){if(this._getType($)!==C.undefined){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.void,received:X.parsedType}),u}return S1($.data)}}g4.create=($)=>{return new g4({typeName:p.ZodVoid,...c($)})};class t1 extends o{_parse($){let{ctx:G,status:X}=this._processInputParams($),Y=this._def;if(G.parsedType!==C.array)return x(G,{code:T.invalid_type,expected:C.array,received:G.parsedType}),u;if(Y.exactLength!==null){let V=G.data.length>Y.exactLength.value,q=G.data.length<Y.exactLength.value;if(V||q)x(G,{code:V?T.too_big:T.too_small,minimum:q?Y.exactLength.value:void 0,maximum:V?Y.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Y.exactLength.message}),X.dirty()}if(Y.minLength!==null){if(G.data.length<Y.minLength.value)x(G,{code:T.too_small,minimum:Y.minLength.value,type:"array",inclusive:!0,exact:!1,message:Y.minLength.message}),X.dirty()}if(Y.maxLength!==null){if(G.data.length>Y.maxLength.value)x(G,{code:T.too_big,maximum:Y.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Y.maxLength.message}),X.dirty()}if(G.common.async)return Promise.all([...G.data].map((V,q)=>{return Y.type._parseAsync(new $0(G,V,G.path,q))})).then((V)=>{return _1.mergeArray(X,V)});let W=[...G.data].map((V,q)=>{return Y.type._parseSync(new $0(G,V,G.path,q))});return _1.mergeArray(X,W)}get element(){return this._def.type}min($,G){return new t1({...this._def,minLength:{value:$,message:g.toString(G)}})}max($,G){return new t1({...this._def,maxLength:{value:$,message:g.toString(G)}})}length($,G){return new t1({...this._def,exactLength:{value:$,message:g.toString(G)}})}nonempty($){return this.min(1,$)}}t1.create=($,G)=>{return new t1({type:$,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...c(G)})};function c2($){if($ instanceof q1){let G={};for(let X in $.shape){let Y=$.shape[X];G[X]=e1.create(c2(Y))}return new q1({...$._def,shape:()=>G})}else if($ instanceof t1)return new t1({...$._def,type:c2($.element)});else if($ instanceof e1)return e1.create(c2($.unwrap()));else if($ instanceof z0)return z0.create(c2($.unwrap()));else if($ instanceof U0)return U0.create($.items.map((G)=>c2(G)));else return $}class q1 extends o{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),G=a.objectKeys($);return this._cached={shape:$,keys:G},this._cached}_parse($){if(this._getType($)!==C.object){let H=this._getOrReturnCtx($);return x(H,{code:T.invalid_type,expected:C.object,received:H.parsedType}),u}let{status:X,ctx:Y}=this._processInputParams($),{shape:W,keys:V}=this._getCached(),q=[];if(!(this._def.catchall instanceof H0&&this._def.unknownKeys==="strip")){for(let H in Y.data)if(!V.includes(H))q.push(H)}let J=[];for(let H of V){let D=W[H],R=Y.data[H];J.push({key:{status:"valid",value:H},value:D._parse(new $0(Y,R,Y.path,H)),alwaysSet:H in Y.data})}if(this._def.catchall instanceof H0){let H=this._def.unknownKeys;if(H==="passthrough")for(let D of q)J.push({key:{status:"valid",value:D},value:{status:"valid",value:Y.data[D]}});else if(H==="strict"){if(q.length>0)x(Y,{code:T.unrecognized_keys,keys:q}),X.dirty()}else if(H==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let H=this._def.catchall;for(let D of q){let R=Y.data[D];J.push({key:{status:"valid",value:D},value:H._parse(new $0(Y,R,Y.path,D)),alwaysSet:D in Y.data})}}if(Y.common.async)return Promise.resolve().then(async()=>{let H=[];for(let D of J){let R=await D.key,M=await D.value;H.push({key:R,value:M,alwaysSet:D.alwaysSet})}return H}).then((H)=>{return _1.mergeObjectSync(X,H)});else return _1.mergeObjectSync(X,J)}get shape(){return this._def.shape()}strict($){return g.errToObj,new q1({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(G,X)=>{let Y=this._def.errorMap?.(G,X).message??X.defaultError;if(G.code==="unrecognized_keys")return{message:g.errToObj($).message??Y};return{message:Y}}}:{}})}strip(){return new q1({...this._def,unknownKeys:"strip"})}passthrough(){return new q1({...this._def,unknownKeys:"passthrough"})}extend($){return new q1({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new q1({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:p.ZodObject})}setKey($,G){return this.augment({[$]:G})}catchall($){return new q1({...this._def,catchall:$})}pick($){let G={};for(let X of a.objectKeys($))if($[X]&&this.shape[X])G[X]=this.shape[X];return new q1({...this._def,shape:()=>G})}omit($){let G={};for(let X of a.objectKeys(this.shape))if(!$[X])G[X]=this.shape[X];return new q1({...this._def,shape:()=>G})}deepPartial(){return c2(this)}partial($){let G={};for(let X of a.objectKeys(this.shape)){let Y=this.shape[X];if($&&!$[X])G[X]=Y;else G[X]=Y.optional()}return new q1({...this._def,shape:()=>G})}required($){let G={};for(let X of a.objectKeys(this.shape))if($&&!$[X])G[X]=this.shape[X];else{let W=this.shape[X];while(W instanceof e1)W=W._def.innerType;G[X]=W}return new q1({...this._def,shape:()=>G})}keyof(){return yX(a.objectKeys(this.shape))}}q1.create=($,G)=>{return new q1({shape:()=>$,unknownKeys:"strip",catchall:H0.create(),typeName:p.ZodObject,...c(G)})};q1.strictCreate=($,G)=>{return new q1({shape:()=>$,unknownKeys:"strict",catchall:H0.create(),typeName:p.ZodObject,...c(G)})};q1.lazycreate=($,G)=>{return new q1({shape:$,unknownKeys:"strip",catchall:H0.create(),typeName:p.ZodObject,...c(G)})};class a2 extends o{_parse($){let{ctx:G}=this._processInputParams($),X=this._def.options;function Y(W){for(let q of W)if(q.result.status==="valid")return q.result;for(let q of W)if(q.result.status==="dirty")return G.common.issues.push(...q.ctx.common.issues),q.result;let V=W.map((q)=>new C1(q.ctx.common.issues));return x(G,{code:T.invalid_union,unionErrors:V}),u}if(G.common.async)return Promise.all(X.map(async(W)=>{let V={...G,common:{...G.common,issues:[]},parent:null};return{result:await W._parseAsync({data:G.data,path:G.path,parent:V}),ctx:V}})).then(Y);else{let W=void 0,V=[];for(let J of X){let H={...G,common:{...G.common,issues:[]},parent:null},D=J._parseSync({data:G.data,path:G.path,parent:H});if(D.status==="valid")return D;else if(D.status==="dirty"&&!W)W={result:D,ctx:H};if(H.common.issues.length)V.push(H.common.issues)}if(W)return G.common.issues.push(...W.ctx.common.issues),W.result;let q=V.map((J)=>new C1(J));return x(G,{code:T.invalid_union,unionErrors:q}),u}}get options(){return this._def.options}}a2.create=($,G)=>{return new a2({options:$,typeName:p.ZodUnion,...c(G)})};var Z0=($)=>{if($ instanceof e2)return Z0($.schema);else if($ instanceof G0)return Z0($.innerType());else if($ instanceof $4)return[$.value];else if($ instanceof u0)return $.options;else if($ instanceof G4)return a.objectValues($.enum);else if($ instanceof X4)return Z0($._def.innerType);else if($ instanceof o2)return[void 0];else if($ instanceof s2)return[null];else if($ instanceof e1)return[void 0,...Z0($.unwrap())];else if($ instanceof z0)return[null,...Z0($.unwrap())];else if($ instanceof n6)return Z0($.unwrap());else if($ instanceof W4)return Z0($.unwrap());else if($ instanceof Y4)return Z0($._def.innerType);else return[]};class i6 extends o{_parse($){let{ctx:G}=this._processInputParams($);if(G.parsedType!==C.object)return x(G,{code:T.invalid_type,expected:C.object,received:G.parsedType}),u;let X=this.discriminator,Y=G.data[X],W=this.optionsMap.get(Y);if(!W)return x(G,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[X]}),u;if(G.common.async)return W._parseAsync({data:G.data,path:G.path,parent:G});else return W._parseSync({data:G.data,path:G.path,parent:G})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,G,X){let Y=new Map;for(let W of G){let V=Z0(W.shape[$]);if(!V.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let q of V){if(Y.has(q))throw Error(`Discriminator property ${String($)} has duplicate value ${String(q)}`);Y.set(q,W)}}return new i6({typeName:p.ZodDiscriminatedUnion,discriminator:$,options:G,optionsMap:Y,...c(X)})}}function n9($,G){let X=J0($),Y=J0(G);if($===G)return{valid:!0,data:$};else if(X===C.object&&Y===C.object){let W=a.objectKeys(G),V=a.objectKeys($).filter((J)=>W.indexOf(J)!==-1),q={...$,...G};for(let J of V){let H=n9($[J],G[J]);if(!H.valid)return{valid:!1};q[J]=H.data}return{valid:!0,data:q}}else if(X===C.array&&Y===C.array){if($.length!==G.length)return{valid:!1};let W=[];for(let V=0;V<$.length;V++){let q=$[V],J=G[V],H=n9(q,J);if(!H.valid)return{valid:!1};W.push(H.data)}return{valid:!0,data:W}}else if(X===C.date&&Y===C.date&&+$===+G)return{valid:!0,data:$};else return{valid:!1}}class t2 extends o{_parse($){let{status:G,ctx:X}=this._processInputParams($),Y=(W,V)=>{if(d6(W)||d6(V))return u;let q=n9(W.value,V.value);if(!q.valid)return x(X,{code:T.invalid_intersection_types}),u;if(c6(W)||c6(V))G.dirty();return{status:G.value,value:q.data}};if(X.common.async)return Promise.all([this._def.left._parseAsync({data:X.data,path:X.path,parent:X}),this._def.right._parseAsync({data:X.data,path:X.path,parent:X})]).then(([W,V])=>Y(W,V));else return Y(this._def.left._parseSync({data:X.data,path:X.path,parent:X}),this._def.right._parseSync({data:X.data,path:X.path,parent:X}))}}t2.create=($,G,X)=>{return new t2({left:$,right:G,typeName:p.ZodIntersection,...c(X)})};class U0 extends o{_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.parsedType!==C.array)return x(X,{code:T.invalid_type,expected:C.array,received:X.parsedType}),u;if(X.data.length<this._def.items.length)return x(X,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u;if(!this._def.rest&&X.data.length>this._def.items.length)x(X,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G.dirty();let W=[...X.data].map((V,q)=>{let J=this._def.items[q]||this._def.rest;if(!J)return null;return J._parse(new $0(X,V,X.path,q))}).filter((V)=>!!V);if(X.common.async)return Promise.all(W).then((V)=>{return _1.mergeArray(G,V)});else return _1.mergeArray(G,W)}get items(){return this._def.items}rest($){return new U0({...this._def,rest:$})}}U0.create=($,G)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new U0({items:$,typeName:p.ZodTuple,rest:null,...c(G)})};class h4 extends o{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.parsedType!==C.object)return x(X,{code:T.invalid_type,expected:C.object,received:X.parsedType}),u;let Y=[],W=this._def.keyType,V=this._def.valueType;for(let q in X.data)Y.push({key:W._parse(new $0(X,q,X.path,q)),value:V._parse(new $0(X,X.data[q],X.path,q)),alwaysSet:q in X.data});if(X.common.async)return _1.mergeObjectAsync(G,Y);else return _1.mergeObjectSync(G,Y)}get element(){return this._def.valueType}static create($,G,X){if(G instanceof o)return new h4({keyType:$,valueType:G,typeName:p.ZodRecord,...c(X)});return new h4({keyType:a1.create(),valueType:$,typeName:p.ZodRecord,...c(G)})}}class y4 extends o{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.parsedType!==C.map)return x(X,{code:T.invalid_type,expected:C.map,received:X.parsedType}),u;let Y=this._def.keyType,W=this._def.valueType,V=[...X.data.entries()].map(([q,J],H)=>{return{key:Y._parse(new $0(X,q,X.path,[H,"key"])),value:W._parse(new $0(X,J,X.path,[H,"value"]))}});if(X.common.async){let q=new Map;return Promise.resolve().then(async()=>{for(let J of V){let H=await J.key,D=await J.value;if(H.status==="aborted"||D.status==="aborted")return u;if(H.status==="dirty"||D.status==="dirty")G.dirty();q.set(H.value,D.value)}return{status:G.value,value:q}})}else{let q=new Map;for(let J of V){let{key:H,value:D}=J;if(H.status==="aborted"||D.status==="aborted")return u;if(H.status==="dirty"||D.status==="dirty")G.dirty();q.set(H.value,D.value)}return{status:G.value,value:q}}}}y4.create=($,G,X)=>{return new y4({valueType:G,keyType:$,typeName:p.ZodMap,...c(X)})};class Q2 extends o{_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.parsedType!==C.set)return x(X,{code:T.invalid_type,expected:C.set,received:X.parsedType}),u;let Y=this._def;if(Y.minSize!==null){if(X.data.size<Y.minSize.value)x(X,{code:T.too_small,minimum:Y.minSize.value,type:"set",inclusive:!0,exact:!1,message:Y.minSize.message}),G.dirty()}if(Y.maxSize!==null){if(X.data.size>Y.maxSize.value)x(X,{code:T.too_big,maximum:Y.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Y.maxSize.message}),G.dirty()}let W=this._def.valueType;function V(J){let H=new Set;for(let D of J){if(D.status==="aborted")return u;if(D.status==="dirty")G.dirty();H.add(D.value)}return{status:G.value,value:H}}let q=[...X.data.values()].map((J,H)=>W._parse(new $0(X,J,X.path,H)));if(X.common.async)return Promise.all(q).then((J)=>V(J));else return V(q)}min($,G){return new Q2({...this._def,minSize:{value:$,message:g.toString(G)}})}max($,G){return new Q2({...this._def,maxSize:{value:$,message:g.toString(G)}})}size($,G){return this.min($,G).max($,G)}nonempty($){return this.min(1,$)}}Q2.create=($,G)=>{return new Q2({valueType:$,minSize:null,maxSize:null,typeName:p.ZodSet,...c(G)})};class i2 extends o{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:G}=this._processInputParams($);if(G.parsedType!==C.function)return x(G,{code:T.invalid_type,expected:C.function,received:G.parsedType}),u;function X(q,J){return b4({data:q,path:G.path,errorMaps:[G.common.contextualErrorMap,G.schemaErrorMap,r2(),N0].filter((H)=>!!H),issueData:{code:T.invalid_arguments,argumentsError:J}})}function Y(q,J){return b4({data:q,path:G.path,errorMaps:[G.common.contextualErrorMap,G.schemaErrorMap,r2(),N0].filter((H)=>!!H),issueData:{code:T.invalid_return_type,returnTypeError:J}})}let W={errorMap:G.common.contextualErrorMap},V=G.data;if(this._def.returns instanceof K2){let q=this;return S1(async function(...J){let H=new C1([]),D=await q._def.args.parseAsync(J,W).catch((A)=>{throw H.addIssue(X(J,A)),H}),R=await Reflect.apply(V,this,D);return await q._def.returns._def.type.parseAsync(R,W).catch((A)=>{throw H.addIssue(Y(R,A)),H})})}else{let q=this;return S1(function(...J){let H=q._def.args.safeParse(J,W);if(!H.success)throw new C1([X(J,H.error)]);let D=Reflect.apply(V,this,H.data),R=q._def.returns.safeParse(D,W);if(!R.success)throw new C1([Y(D,R.error)]);return R.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new i2({...this._def,args:U0.create($).rest(y0.create())})}returns($){return new i2({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,G,X){return new i2({args:$?$:U0.create([]).rest(y0.create()),returns:G||y0.create(),typeName:p.ZodFunction,...c(X)})}}class e2 extends o{get schema(){return this._def.getter()}_parse($){let{ctx:G}=this._processInputParams($);return this._def.getter()._parse({data:G.data,path:G.path,parent:G})}}e2.create=($,G)=>{return new e2({getter:$,typeName:p.ZodLazy,...c(G)})};class $4 extends o{_parse($){if($.data!==this._def.value){let G=this._getOrReturnCtx($);return x(G,{received:G.data,code:T.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:$.data}}get value(){return this._def.value}}$4.create=($,G)=>{return new $4({value:$,typeName:p.ZodLiteral,...c(G)})};function yX($,G){return new u0({values:$,typeName:p.ZodEnum,...c(G)})}class u0 extends o{_parse($){if(typeof $.data!=="string"){let G=this._getOrReturnCtx($),X=this._def.values;return x(G,{expected:a.joinValues(X),received:G.parsedType,code:T.invalid_type}),u}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let G=this._getOrReturnCtx($),X=this._def.values;return x(G,{received:G.data,code:T.invalid_enum_value,options:X}),u}return S1($.data)}get options(){return this._def.values}get enum(){let $={};for(let G of this._def.values)$[G]=G;return $}get Values(){let $={};for(let G of this._def.values)$[G]=G;return $}get Enum(){let $={};for(let G of this._def.values)$[G]=G;return $}extract($,G=this._def){return u0.create($,{...this._def,...G})}exclude($,G=this._def){return u0.create(this.options.filter((X)=>!$.includes(X)),{...this._def,...G})}}u0.create=yX;class G4 extends o{_parse($){let G=a.getValidEnumValues(this._def.values),X=this._getOrReturnCtx($);if(X.parsedType!==C.string&&X.parsedType!==C.number){let Y=a.objectValues(G);return x(X,{expected:a.joinValues(Y),received:X.parsedType,code:T.invalid_type}),u}if(!this._cache)this._cache=new Set(a.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let Y=a.objectValues(G);return x(X,{received:X.data,code:T.invalid_enum_value,options:Y}),u}return S1($.data)}get enum(){return this._def.values}}G4.create=($,G)=>{return new G4({values:$,typeName:p.ZodNativeEnum,...c(G)})};class K2 extends o{unwrap(){return this._def.type}_parse($){let{ctx:G}=this._processInputParams($);if(G.parsedType!==C.promise&&G.common.async===!1)return x(G,{code:T.invalid_type,expected:C.promise,received:G.parsedType}),u;let X=G.parsedType===C.promise?G.data:Promise.resolve(G.data);return S1(X.then((Y)=>{return this._def.type.parseAsync(Y,{path:G.path,errorMap:G.common.contextualErrorMap})}))}}K2.create=($,G)=>{return new K2({type:$,typeName:p.ZodPromise,...c(G)})};class G0 extends o{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:G,ctx:X}=this._processInputParams($),Y=this._def.effect||null,W={addIssue:(V)=>{if(x(X,V),V.fatal)G.abort();else G.dirty()},get path(){return X.path}};if(W.addIssue=W.addIssue.bind(W),Y.type==="preprocess"){let V=Y.transform(X.data,W);if(X.common.async)return Promise.resolve(V).then(async(q)=>{if(G.value==="aborted")return u;let J=await this._def.schema._parseAsync({data:q,path:X.path,parent:X});if(J.status==="aborted")return u;if(J.status==="dirty")return D2(J.value);if(G.value==="dirty")return D2(J.value);return J});else{if(G.value==="aborted")return u;let q=this._def.schema._parseSync({data:V,path:X.path,parent:X});if(q.status==="aborted")return u;if(q.status==="dirty")return D2(q.value);if(G.value==="dirty")return D2(q.value);return q}}if(Y.type==="refinement"){let V=(q)=>{let J=Y.refinement(q,W);if(X.common.async)return Promise.resolve(J);if(J instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return q};if(X.common.async===!1){let q=this._def.schema._parseSync({data:X.data,path:X.path,parent:X});if(q.status==="aborted")return u;if(q.status==="dirty")G.dirty();return V(q.value),{status:G.value,value:q.value}}else return this._def.schema._parseAsync({data:X.data,path:X.path,parent:X}).then((q)=>{if(q.status==="aborted")return u;if(q.status==="dirty")G.dirty();return V(q.value).then(()=>{return{status:G.value,value:q.value}})})}if(Y.type==="transform")if(X.common.async===!1){let V=this._def.schema._parseSync({data:X.data,path:X.path,parent:X});if(!h0(V))return u;let q=Y.transform(V.value,W);if(q instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:G.value,value:q}}else return this._def.schema._parseAsync({data:X.data,path:X.path,parent:X}).then((V)=>{if(!h0(V))return u;return Promise.resolve(Y.transform(V.value,W)).then((q)=>({status:G.value,value:q}))});a.assertNever(Y)}}G0.create=($,G,X)=>{return new G0({schema:$,typeName:p.ZodEffects,effect:G,...c(X)})};G0.createWithPreprocess=($,G,X)=>{return new G0({schema:G,effect:{type:"preprocess",transform:$},typeName:p.ZodEffects,...c(X)})};class e1 extends o{_parse($){if(this._getType($)===C.undefined)return S1(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}e1.create=($,G)=>{return new e1({innerType:$,typeName:p.ZodOptional,...c(G)})};class z0 extends o{_parse($){if(this._getType($)===C.null)return S1(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}z0.create=($,G)=>{return new z0({innerType:$,typeName:p.ZodNullable,...c(G)})};class X4 extends o{_parse($){let{ctx:G}=this._processInputParams($),X=G.data;if(G.parsedType===C.undefined)X=this._def.defaultValue();return this._def.innerType._parse({data:X,path:G.path,parent:G})}removeDefault(){return this._def.innerType}}X4.create=($,G)=>{return new X4({innerType:$,typeName:p.ZodDefault,defaultValue:typeof G.default==="function"?G.default:()=>G.default,...c(G)})};class Y4 extends o{_parse($){let{ctx:G}=this._processInputParams($),X={...G,common:{...G.common,issues:[]}},Y=this._def.innerType._parse({data:X.data,path:X.path,parent:{...X}});if(d2(Y))return Y.then((W)=>{return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new C1(X.common.issues)},input:X.data})}});else return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new C1(X.common.issues)},input:X.data})}}removeCatch(){return this._def.innerType}}Y4.create=($,G)=>{return new Y4({innerType:$,typeName:p.ZodCatch,catchValue:typeof G.catch==="function"?G.catch:()=>G.catch,...c(G)})};class f4 extends o{_parse($){if(this._getType($)!==C.nan){let X=this._getOrReturnCtx($);return x(X,{code:T.invalid_type,expected:C.nan,received:X.parsedType}),u}return{status:"valid",value:$.data}}}f4.create=($)=>{return new f4({typeName:p.ZodNaN,...c($)})};var HF=Symbol("zod_brand");class n6 extends o{_parse($){let{ctx:G}=this._processInputParams($),X=G.data;return this._def.type._parse({data:X,path:G.path,parent:G})}unwrap(){return this._def.type}}class m4 extends o{_parse($){let{status:G,ctx:X}=this._processInputParams($);if(X.common.async)return(async()=>{let W=await this._def.in._parseAsync({data:X.data,path:X.path,parent:X});if(W.status==="aborted")return u;if(W.status==="dirty")return G.dirty(),D2(W.value);else return this._def.out._parseAsync({data:W.value,path:X.path,parent:X})})();else{let Y=this._def.in._parseSync({data:X.data,path:X.path,parent:X});if(Y.status==="aborted")return u;if(Y.status==="dirty")return G.dirty(),{status:"dirty",value:Y.value};else return this._def.out._parseSync({data:Y.value,path:X.path,parent:X})}}static create($,G){return new m4({in:$,out:G,typeName:p.ZodPipeline})}}class W4 extends o{_parse($){let G=this._def.innerType._parse($),X=(Y)=>{if(h0(Y))Y.value=Object.freeze(Y.value);return Y};return d2(G)?G.then((Y)=>X(Y)):X(G)}unwrap(){return this._def.innerType}}W4.create=($,G)=>{return new W4({innerType:$,typeName:p.ZodReadonly,...c(G)})};function bX($,G){let X=typeof $==="function"?$(G):typeof $==="string"?{message:$}:$;return typeof X==="string"?{message:X}:X}function fX($,G={},X){if($)return M2.create().superRefine((Y,W)=>{let V=$(Y);if(V instanceof Promise)return V.then((q)=>{if(!q){let J=bX(G,Y),H=J.fatal??X??!0;W.addIssue({code:"custom",...J,fatal:H})}});if(!V){let q=bX(G,Y),J=q.fatal??X??!0;W.addIssue({code:"custom",...q,fatal:J})}return});return M2.create()}var UF={object:q1.lazycreate},p;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(p||(p={}));var DF=($,G={message:`Input not instance of ${$.name}`})=>fX((X)=>X instanceof $,G),mX=a1.create,uX=f0.create,RF=f4.create,MF=m0.create,pX=n2.create,QF=R2.create,KF=v4.create,FF=o2.create,AF=s2.create,wF=M2.create,BF=y0.create,OF=H0.create,PF=g4.create,NF=t1.create,ZF=q1.create,zF=q1.strictCreate,_F=a2.create,LF=i6.create,EF=t2.create,jF=U0.create,TF=h4.create,CF=y4.create,SF=Q2.create,IF=i2.create,xF=e2.create,kF=$4.create,bF=u0.create,vF=G4.create,gF=K2.create,hF=G0.create,yF=e1.create,fF=z0.create,mF=G0.createWithPreprocess,uF=m4.create,pF=()=>mX().optional(),lF=()=>uX().optional(),rF=()=>pX().optional(),dF={string:($)=>a1.create({...$,coerce:!0}),number:($)=>f0.create({...$,coerce:!0}),boolean:($)=>n2.create({...$,coerce:!0}),bigint:($)=>m0.create({...$,coerce:!0}),date:($)=>R2.create({...$,coerce:!0})};var cF=u;function D0($){return $ instanceof Error?$.message:String($)}function sF($){return $}function aF($){return $}function tF($){return $===void 0?{success:!0}:{success:!0,data:$}}function eF($){return{success:!1,error:$}}var $A=U.object({captureUrls:U.boolean().default(!1),blockedUrlDomains:U.array(U.string()).default(["meet.google.com","zoom.us","teams.microsoft.com","whereby.com","gather.town","calendly.com","cal.com","discord.com","discord.gg","cdn.discordapp.com","media.discordapp.net","giphy.com","tenor.com","wetransfer.com","file.io"])});function GA($,G){return{name:$,schema:G}}var p0=U.enum(["anchor","trusted","public"]),YA=U.enum(["create","update","delete","extract","publish"]),V4=U.enum(["never","anchor","trusted","public"]),lX=U.object({create:V4.optional(),update:V4.optional(),delete:V4.optional(),extract:V4.optional(),publish:V4.optional()}).strict(),WA=U.record(U.string(),lX);var VA=U.object({name:U.string(),description:U.string(),schema:U.any(),basePrompt:U.string().optional(),useKnowledgeContext:U.boolean().optional(),requiredPermission:p0,formatter:U.any().optional(),layout:U.object({component:U.any(),fullscreen:U.boolean().optional()}).optional(),dataSourceId:U.string().optional()});class u4{static canGenerate($){return!!$.basePrompt&&!!$.dataSourceId&&$.dataSourceId.includes("ai-content")}static canFetch($){return!!$.dataSourceId&&!this.canGenerate($)}static canRender($){return!!$.layout?.component}static isStaticOnly($){return!this.canGenerate($)&&!this.canFetch($)}static getCapabilities($){return{canGenerate:this.canGenerate($),canFetch:this.canFetch($),canRender:this.canRender($),isStaticOnly:this.isStaticOnly($)}}static validate($){let G=[];if($.dataSourceId?.includes("ai-content")&&!$.basePrompt)G.push(`Template "${$.name}" has AI-content dataSourceId but no basePrompt. AI generation requires a basePrompt.`);if($.basePrompt&&(!$.dataSourceId||!$.dataSourceId.includes("ai-content")))G.push(`Template "${$.name}" has basePrompt but no AI-content dataSourceId. The basePrompt won't be used.`);return G}static logCapabilities($,G){let X=this.getCapabilities($),Y=this.validate($);if(G)G.debug(`Template capabilities for "${$.name}":`,{...X,errors:Y.length>0?Y:void 0})}}var qA=U.enum(["site-content-preview","site-content-production"]),JA=U.enum(["web","image","pdf"]),HA=U.object({name:U.string(),schema:U.any(),description:U.string().optional(),pluginId:U.string(),renderers:U.object({web:U.union([U.function(),U.string()]).optional(),image:U.union([U.function(),U.string()]).optional(),pdf:U.union([U.function(),U.string()]).optional()})}),UA=U.object({enableContentGeneration:U.boolean().default(!1),outputDir:U.string(),workingDir:U.string().optional(),environment:U.enum(["preview","production"]).default("preview"),siteConfig:U.object({title:U.string(),description:U.string(),url:U.string().optional()}).optional()}),DA=U.object({success:U.boolean(),routesBuilt:U.number(),errors:U.array(U.string()).optional(),warnings:U.array(U.string()).optional()});var rX=U.enum(["anchor","trusted","public"]),MA=U.object({conversationId:U.string().min(1),message:U.string(),interfaceType:U.string().min(1),channelId:U.string().optional(),channelName:U.string().optional(),userPermissionLevel:rX}),dX=U.object({id:U.string().min(1),source:U.string().min(1),title:U.string().optional(),content:U.string().min(1),provenance:U.record(U.string(),U.unknown()).optional()}),QA=U.object({items:U.array(dX).default([])});var KA=U.object({url:U.string(),authToken:U.string().optional()});var FA=U.object({success:U.boolean(),entityId:U.string().optional(),error:U.string().optional()});var F2=U.enum(["user","assistant"]);var cX=U.object({message:U.string().describe("Natural language response to the query"),summary:U.string().optional().describe("Brief summary if applicable"),topics:U.array(U.string()).optional().describe("Related topics mentioned"),sources:U.array(U.object({id:U.string(),type:U.string(),excerpt:U.string().optional(),relevance:U.number().min(0).max(1).optional()})).optional().describe("Source entities used to answer the query"),metadata:U.record(U.string(),U.unknown()).optional()}).describe("defaultQueryResponse"),iX=U.object({message:U.string()}).describe("simpleTextResponse"),nX=U.object({success:U.boolean(),entityId:U.string().optional(),message:U.string()}).describe("createEntityResponse"),oX=U.object({success:U.boolean(),entityId:U.string(),changes:U.array(U.string()).optional(),message:U.string()}).describe("updateEntityResponse");var AA=U.object({status:U.enum(["healthy","warning","error","unknown"]),message:U.string().optional(),lastCheck:U.date().optional(),details:U.record(U.string(),U.unknown()).optional()}),sX=U.object({name:U.string(),pluginId:U.string(),status:U.string(),health:AA.optional()});import{McpServer as BS,ResourceTemplate as OS}from"@modelcontextprotocol/sdk/server/mcp.js";var o6=U.object({interfaceType:U.string(),userId:U.string(),channelId:U.string().optional(),channelName:U.string().optional(),userPermissionLevel:U.enum(["anchor","trusted","public"]).optional()}),aX=U.object({success:U.literal(!0),data:U.unknown(),message:U.string().optional()}).strict().superRefine(($,G)=>{if(!Object.prototype.hasOwnProperty.call($,"data"))G.addIssue({code:U.ZodIssueCode.custom,path:["data"],message:"Required"})}),tX=U.object({success:U.literal(!1),error:U.string(),code:U.string().optional()}).strict(),eX=U.object({needsConfirmation:U.literal(!0),toolName:U.string(),summary:U.string(),preview:U.string().optional(),args:U.unknown()}).strict(),o9=U.union([aX,tX,eX]);var MS=U.union([U.object({success:U.literal(!0),data:U.unknown()}).superRefine(($,G)=>{if(!Object.prototype.hasOwnProperty.call($,"data"))G.addIssue({code:U.ZodIssueCode.custom,path:["data"],message:"Required"})}),U.object({success:U.literal(!1),error:U.string()})]);var wA=U.union([U.object({success:U.literal(!0),data:U.unknown(),message:U.string().optional()}),U.object({success:U.literal(!1),error:U.string(),code:U.string().optional()})]);var GI=U.object({id:U.string(),type:U.string(),version:U.string(),status:U.string()}),XI=U.object({name:U.string(),description:U.string()}),s9=U.object({label:U.string(),url:U.string(),pluginId:U.string(),priority:U.number().default(100),visibility:p0.default("public")}),BA=U.enum(["human","agent","admin","protocol"]),OA=U.enum(["available","coming-soon","disabled"]),a9=U.object({id:U.string(),label:U.string(),description:U.string().optional(),href:U.string(),kind:BA,pluginId:U.string(),priority:U.number().default(100),visibility:p0.default("public"),status:OA.default("available")}),t9=U.object({entityType:U.string(),count:U.number()}),YI=U.object({model:U.string(),version:U.string(),uptime:U.number(),entities:U.number(),entityCounts:U.array(t9),embeddings:U.number(),ai:U.object({model:U.string(),embeddingModel:U.string()}),daemons:U.array(sX),endpoints:U.array(s9),interactions:U.array(a9)});var WI=U.object({id:U.string(),version:U.string(),type:U.enum(["core","entity","service","interface"]),description:U.string().optional(),dependencies:U.array(U.string()).optional(),packageName:U.string()});var PA=U.object({toolName:U.string(),args:U.unknown(),progressToken:U.union([U.string(),U.number()]).optional(),hasProgress:U.boolean().optional(),...o6.shape}),NA=U.object({resourceUri:U.string()});class A2{id;version;description;packageName;config;context;get logger(){return this.context?.logger??N1.createFresh({context:this.id})}constructor($,G,X,Y){this.id=$,this.packageName=G.name,this.version=G.version,this.description=G.description??`${G.name} plugin`,this.config=Y.parse(X)}setupMessageHandlers($){$.messaging.subscribe(`plugin:${this.id}:tool:execute`,async(G)=>{try{let{toolName:X,args:Y,progressToken:W,hasProgress:V,interfaceType:q,userId:J,channelId:H,userPermissionLevel:D}=PA.parse(G.payload),M=(await this.getTools()).find((Z)=>Z.name===X);if(!M)return{success:!1,error:`Tool not found: ${X}`};let A={interfaceType:q,userId:J,...H&&{channelId:H},...D&&{userPermissionLevel:D},...V&&W!==void 0&&{progressToken:W,sendProgress:async(Z)=>{await $.messaging.send({type:`plugin:${this.id}:progress`,payload:{progressToken:W,notification:Z}})}}};return{success:!0,data:await M.handler(Y,A)}}catch(X){if(X instanceof U.ZodError)return{success:!1,error:"Invalid tool execution request format"};return this.logger.error("Tool execution error",X),{success:!1,error:D0(X)}}}),$.messaging.subscribe(`plugin:${this.id}:resource:get`,async(G)=>{try{let{resourceUri:X}=NA.parse(G.payload),W=(await this.getResources()).find((q)=>q.uri===X);if(!W)return{success:!1,error:`Resource not found: ${X}`};return{success:!0,data:await W.handler()}}catch(X){if(X instanceof U.ZodError)return{success:!1,error:"Invalid resource get request format"};return this.logger.error("Resource fetch error",X),{success:!1,error:D0(X)}}})}async onRegister($){}async onReady($){}async ready(){await this.onReady(this.getContext())}async getCapabilities(){let $=await this.getInstructions();return{tools:await this.getTools(),resources:await this.getResources(),...$&&{instructions:$}}}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}async shutdown(){await this.onShutdown()}async onShutdown(){}getContext(){if(!this.context)throw Error(`Plugin ${this.id}: Plugin not registered yet`);return this.context}determineUserPermissionLevel($){return"public"}createProgressBridge($){if(!$)return;let G=this.context;if(!G)return;let X=this.id;return x0.from(async(Y)=>{await G.messaging.send({type:`plugin:${X}:progress`,payload:{progressToken:$,notification:{progress:Y.progress,total:Y.total,message:Y.message}}})})}}var $Y=U.object({id:U.string(),template:U.string(),content:U.unknown().optional(),dataQuery:U.object({entityType:U.string().optional(),template:U.string().optional(),query:U.object({id:U.string().optional(),limit:U.number().optional(),offset:U.number().optional()}).passthrough().optional()}).passthrough().optional(),order:U.number().optional()}),GY=["primary","secondary"],XY=U.object({show:U.boolean().default(!1),label:U.string().optional(),slot:U.enum(GY).default("primary"),priority:U.number().min(0).max(100).default(50)}).optional(),YY=U.object({id:U.string(),path:U.string(),title:U.string().default(""),pageLabel:U.string().optional(),description:U.string().default(""),sections:U.array($Y).default([]),layout:U.string().default("default"),fullscreen:U.boolean().optional(),pluginId:U.string().optional(),sourceEntityType:U.string().optional(),external:U.boolean().optional(),navigation:XY}),ZA=U.object({routes:U.array(YY),pluginId:U.string()}),zA=U.object({paths:U.array(U.string()).optional(),pluginId:U.string().optional()}),_A=U.object({pluginId:U.string().optional()}),LA=U.object({path:U.string()}),s6=U.object({label:U.string(),href:U.string(),priority:U.number()});var WY=U.object({heading:U.string().describe("Main CTA heading text"),buttonText:U.string().describe("Call-to-action button text"),buttonLink:U.string().describe("URL or anchor for the CTA button")}),VY=U.object({blurb:U.string().optional().describe("Short italic subtitle under the section title")}),qY=U.object({title:U.string().describe("The site's title"),description:U.string().describe("The site's description"),url:U.string().optional().describe("Canonical site URL"),copyright:U.string().optional().describe("Copyright notice text"),logo:U.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:U.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:U.string().optional().describe("Analytics script HTML"),cta:WY.optional().describe("Call-to-action configuration"),sections:U.record(U.string(),VY).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers.")}),EA=U.object({platform:U.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:U.string().describe("Profile or contact URL"),label:U.string().optional().describe("Optional display label")}),jA=qY.extend({navigation:U.object({primary:U.array(s6),secondary:U.array(s6)}),copyright:U.string(),socialLinks:U.array(EA).optional().describe("Social media links from profile metadata")});function e9($){return`preview.${$.trim().replace(/^https?:\/\//,"")}`}var TA=U.string(),CA=U.object({id:U.string().min(1)}).passthrough(),SA=U.object({label:U.string().min(1)}).passthrough(),IA=U.object({layouts:U.record(U.unknown()),plugin:U.function(),routes:U.array(CA),entityDisplay:U.record(SA),staticAssets:U.record(U.string()).optional()}).passthrough(),xA=U.custom(($)=>IA.safeParse($).success);var JY=U.enum(["file_operations","content_operations","data_processing","batch_processing"]),HY=U.object({pluginId:U.string().optional(),progressToken:U.union([U.string(),U.number()]).optional(),operationType:JY,operationTarget:U.string().optional(),interfaceType:U.string().optional(),channelId:U.string().optional()}),p4=HY.extend({rootJobId:U.string()}),xI=U.enum(["none","skip","replace","coalesce"]);var $8=U.enum(["pending","processing","completed","failed"]),UY=U.enum(["completed","failed"]);var kA=U.object({id:U.string(),type:U.string(),status:$8,data:U.unknown(),result:U.unknown().optional(),lastError:U.string().optional().nullable(),attempts:U.number(),maxRetries:U.number(),priority:U.number(),createdAt:U.date(),updatedAt:U.date(),processedAt:U.date().optional().nullable(),completedAt:U.date().optional().nullable(),failedAt:U.date().optional().nullable()}),bA=U.object({jobId:U.string(),type:U.string(),status:UY,result:U.unknown().optional(),error:U.string().optional()}),DY=U.object({success:U.literal(!1),error:U.string().optional()}),G8=U.object({id:U.string(),type:U.enum(["job","batch"]),status:$8,message:U.string().optional(),progress:U.object({current:U.number(),total:U.number(),percentage:U.number()}).optional(),aggregationKey:U.string().optional(),batchDetails:U.object({totalOperations:U.number(),completedOperations:U.number(),failedOperations:U.number(),currentOperation:U.string().optional(),errors:U.array(U.string()).optional()}).optional(),jobDetails:U.object({jobType:U.string(),priority:U.number(),retryCount:U.number()}).optional(),metadata:p4});import{createClient as zk}from"@libsql/client";var I=Symbol.for("drizzle:entityKind");function b1($,G){if(!$||typeof $!=="object")return!1;if($ instanceof G)return!0;if(!Object.prototype.hasOwnProperty.call(G,I))throw Error(`Class "${G.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let X=Object.getPrototypeOf($).constructor;if(X)while(X){if(I in X&&X[I]===G[I])return!0;X=Object.getPrototypeOf(X)}return!1}class l0{constructor($,G){this.table=$,this.config=G,this.name=G.name,this.keyAsName=G.keyAsName,this.notNull=G.notNull,this.default=G.default,this.defaultFn=G.defaultFn,this.onUpdateFn=G.onUpdateFn,this.hasDefault=G.hasDefault,this.primary=G.primaryKey,this.isUnique=G.isUnique,this.uniqueName=G.uniqueName,this.uniqueType=G.uniqueType,this.dataType=G.dataType,this.columnType=G.columnType,this.generated=G.generated,this.generatedIdentity=G.generatedIdentity}static[I]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue($){return $}mapToDriverValue($){return $}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class X8{static[I]="ColumnBuilder";config;constructor($,G,X){this.config={name:$,keyAsName:$==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:G,columnType:X,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default($){return this.config.default=$,this.config.hasDefault=!0,this}$defaultFn($){return this.config.defaultFn=$,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn($){return this.config.onUpdateFn=$,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName($){if(this.config.name!=="")return;this.config.name=$}}var X0=Symbol.for("drizzle:Name");function RY($,...G){return $(...G)}function MY($,G){return`${$[X0]}_${G.join("_")}_unique`}class l4 extends l0{constructor($,G){if(!G.uniqueName)G.uniqueName=MY($,[G.name]);super($,G);this.table=$}static[I]="PgColumn"}class vA extends l4{static[I]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op($){return this.indexConfig.opClass=$,this}}class gA extends l4{static[I]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor($,G){super($,G);this.enum=G.enum}getSQLType(){return this.enum.enumName}}var QY=Symbol.for("drizzle:isPgEnum");function KY($){return!!$&&typeof $==="function"&&QY in $&&$[QY]===!0}class hA extends l4{static[I]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor($,G){super($,G);this.enum=G.enum}getSQLType(){return this.enum.enumName}}class a6{static[I]="Subquery";constructor($,G,X,Y=!1,W=[]){this._={brand:"Subquery",sql:$,selectedFields:G,alias:X,isWith:Y,usedTables:W}}}var FY="0.44.7";var Y8,W8,AY={startActiveSpan($,G){if(!Y8)return G();if(!W8)W8=Y8.trace.getTracer("drizzle-orm",FY);return RY((X,Y)=>Y.startActiveSpan($,(W)=>{try{return G(W)}catch(V){throw W.setStatus({code:X.SpanStatusCode.ERROR,message:V instanceof Error?V.message:"Unknown error"}),V}finally{W.end()}}),Y8,W8)}};var q4=Symbol.for("drizzle:ViewBaseConfig");var V8=Symbol.for("drizzle:Schema"),wY=Symbol.for("drizzle:Columns"),BY=Symbol.for("drizzle:ExtraConfigColumns"),q8=Symbol.for("drizzle:OriginalName"),J8=Symbol.for("drizzle:BaseName"),r4=Symbol.for("drizzle:IsAlias"),OY=Symbol.for("drizzle:ExtraConfigBuilder"),yA=Symbol.for("drizzle:IsDrizzleTable");class M1{static[I]="Table";static Symbol={Name:X0,Schema:V8,OriginalName:q8,Columns:wY,ExtraConfigColumns:BY,BaseName:J8,IsAlias:r4,ExtraConfigBuilder:OY};[X0];[q8];[V8];[wY];[BY];[J8];[r4]=!1;[yA]=!0;[OY]=void 0;constructor($,G,X){this[X0]=this[q8]=$,this[V8]=G,this[J8]=X}}function fA($){return $!==null&&$!==void 0&&typeof $.getSQL==="function"}function mA($){let G={sql:"",params:[]};for(let X of $)if(G.sql+=X.sql,G.params.push(...X.params),X.typings?.length){if(!G.typings)G.typings=[];G.typings.push(...X.typings)}return G}class o1{static[I]="StringChunk";value;constructor($){this.value=Array.isArray($)?$:[$]}getSQL(){return new Q1([this])}}class Q1{constructor($){this.queryChunks=$;for(let G of $)if(b1(G,M1)){let X=G[M1.Symbol.Schema];this.usedTables.push(X===void 0?G[M1.Symbol.Name]:X+"."+G[M1.Symbol.Name])}}static[I]="SQL";decoder=PY;shouldInlineParams=!1;usedTables=[];append($){return this.queryChunks.push(...$.queryChunks),this}toQuery($){return AY.startActiveSpan("drizzle.buildSQL",(G)=>{let X=this.buildQueryFromSourceParams(this.queryChunks,$);return G?.setAttributes({"drizzle.query.text":X.sql,"drizzle.query.params":JSON.stringify(X.params)}),X})}buildQueryFromSourceParams($,G){let X=Object.assign({},G,{inlineParams:G.inlineParams||this.shouldInlineParams,paramStartIndex:G.paramStartIndex||{value:0}}),{casing:Y,escapeName:W,escapeParam:V,prepareTyping:q,inlineParams:J,paramStartIndex:H}=X;return mA($.map((D)=>{if(b1(D,o1))return{sql:D.value.join(""),params:[]};if(b1(D,t6))return{sql:W(D.value),params:[]};if(D===void 0)return{sql:"",params:[]};if(Array.isArray(D)){let R=[new o1("(")];for(let[M,A]of D.entries())if(R.push(A),M<D.length-1)R.push(new o1(", "));return R.push(new o1(")")),this.buildQueryFromSourceParams(R,X)}if(b1(D,Q1))return this.buildQueryFromSourceParams(D.queryChunks,{...X,inlineParams:J||D.shouldInlineParams});if(b1(D,M1)){let R=D[M1.Symbol.Schema],M=D[M1.Symbol.Name];return{sql:R===void 0||D[r4]?W(M):W(R)+"."+W(M),params:[]}}if(b1(D,l0)){let R=Y.getColumnCasing(D);if(G.invokeSource==="indexes")return{sql:W(R),params:[]};let M=D.table[M1.Symbol.Schema];return{sql:D.table[r4]||M===void 0?W(D.table[M1.Symbol.Name])+"."+W(R):W(M)+"."+W(D.table[M1.Symbol.Name])+"."+W(R),params:[]}}if(b1(D,ZY)){let R=D[q4].schema,M=D[q4].name;return{sql:R===void 0||D[q4].isAlias?W(M):W(R)+"."+W(M),params:[]}}if(b1(D,H8)){if(b1(D.value,e6))return{sql:V(H.value++,D),params:[D],typings:["none"]};let R=D.value===null?null:D.encoder.mapToDriverValue(D.value);if(b1(R,Q1))return this.buildQueryFromSourceParams([R],X);if(J)return{sql:this.mapInlineParam(R,X),params:[]};let M=["none"];if(q)M=[q(D.encoder)];return{sql:V(H.value++,R),params:[R],typings:M}}if(b1(D,e6))return{sql:V(H.value++,D),params:[D],typings:["none"]};if(b1(D,Q1.Aliased)&&D.fieldAlias!==void 0)return{sql:W(D.fieldAlias),params:[]};if(b1(D,a6)){if(D._.isWith)return{sql:W(D._.alias),params:[]};return this.buildQueryFromSourceParams([new o1("("),D._.sql,new o1(") "),new t6(D._.alias)],X)}if(KY(D)){if(D.schema)return{sql:W(D.schema)+"."+W(D.enumName),params:[]};return{sql:W(D.enumName),params:[]}}if(fA(D)){if(D.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([D.getSQL()],X);return this.buildQueryFromSourceParams([new o1("("),D.getSQL(),new o1(")")],X)}if(J)return{sql:this.mapInlineParam(D,X),params:[]};return{sql:V(H.value++,D),params:[D],typings:["none"]}}))}mapInlineParam($,{escapeString:G}){if($===null)return"null";if(typeof $==="number"||typeof $==="boolean")return $.toString();if(typeof $==="string")return G($);if(typeof $==="object"){let X=$.toString();if(X==="[object Object]")return G(JSON.stringify($));return G(X)}throw Error("Unexpected param value: "+$)}getSQL(){return this}as($){if($===void 0)return this;return new Q1.Aliased(this,$)}mapWith($){return this.decoder=typeof $==="function"?{mapFromDriverValue:$}:$,this}inlineParams(){return this.shouldInlineParams=!0,this}if($){return $?this:void 0}}class t6{constructor($){this.value=$}static[I]="Name";brand;getSQL(){return new Q1([this])}}var PY={mapFromDriverValue:($)=>$},NY={mapToDriverValue:($)=>$},wx={...PY,...NY};class H8{constructor($,G=NY){this.value=$,this.encoder=G}static[I]="Param";brand;getSQL(){return new Q1([this])}}function w2($,...G){let X=[];if(G.length>0||$.length>0&&$[0]!=="")X.push(new o1($[0]));for(let[Y,W]of G.entries())X.push(W,new o1($[Y+1]));return new Q1(X)}(($)=>{function G(){return new Q1([])}$.empty=G;function X(H){return new Q1(H)}$.fromList=X;function Y(H){return new Q1([new o1(H)])}$.raw=Y;function W(H,D){let R=[];for(let[M,A]of H.entries()){if(M>0&&D!==void 0)R.push(D);R.push(A)}return new Q1(R)}$.join=W;function V(H){return new t6(H)}$.identifier=V;function q(H){return new e6(H)}$.placeholder=q;function J(H,D){return new H8(H,D)}$.param=J})(w2||(w2={}));(($)=>{class G{constructor(X,Y){this.sql=X,this.fieldAlias=Y}static[I]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new G(this.sql,this.fieldAlias)}}$.Aliased=G})(Q1||(Q1={}));class e6{constructor($){this.name=$}static[I]="Placeholder";getSQL(){return new Q1([this])}}var uA=Symbol.for("drizzle:IsDrizzleView");class ZY{static[I]="View";[q4];[uA]=!0;constructor({name:$,schema:G,selectedFields:X,query:Y}){this[q4]={name:$,originalName:$,schema:G,selectedFields:X,query:Y,isExisting:!Y,isAlias:!1}}getSQL(){return new Q1([this])}}l0.prototype.getSQL=function(){return new Q1([this])};M1.prototype.getSQL=function(){return new Q1([this])};a6.prototype.getSQL=function(){return new Q1([this])};function R0($,G){return{name:typeof $==="string"&&$.length>0?$:"",config:typeof $==="object"?$:G}}var U8=typeof TextDecoder>"u"?null:new TextDecoder;class D8{static[I]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor($,G){if(this.reference=()=>{let{name:X,columns:Y,foreignColumns:W}=$();return{name:X,columns:Y,foreignTable:W[0].table,foreignColumns:W}},G)this._onUpdate=G.onUpdate,this._onDelete=G.onDelete}onUpdate($){return this._onUpdate=$,this}onDelete($){return this._onDelete=$,this}build($){return new zY($,this)}}class zY{constructor($,G){this.table=$,this.reference=G.reference,this.onUpdate=G._onUpdate,this.onDelete=G._onDelete}static[I]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:$,columns:G,foreignColumns:X}=this.reference(),Y=G.map((q)=>q.name),W=X.map((q)=>q.name),V=[this.table[X0],...Y,X[0].table[X0],...W];return $??`${V.join("_")}_fk`}}function _Y($,G){return`${$[X0]}_${G.join("_")}_unique`}class O1 extends X8{static[I]="SQLiteColumnBuilder";foreignKeyConfigs=[];references($,G={}){return this.foreignKeyConfigs.push({ref:$,actions:G}),this}unique($){return this.config.isUnique=!0,this.config.uniqueName=$,this}generatedAlwaysAs($,G){return this.config.generated={as:$,type:"always",mode:G?.mode??"virtual"},this}buildForeignKeys($,G){return this.foreignKeyConfigs.map(({ref:X,actions:Y})=>{return((W,V)=>{let q=new D8(()=>{let J=W();return{columns:[$],foreignColumns:[J]}});if(V.onUpdate)q.onUpdate(V.onUpdate);if(V.onDelete)q.onDelete(V.onDelete);return q.build(G)})(X,Y)})}}class P1 extends l0{constructor($,G){if(!G.uniqueName)G.uniqueName=_Y($,[G.name]);super($,G);this.table=$}static[I]="SQLiteColumn"}class LY extends O1{static[I]="SQLiteBigIntBuilder";constructor($){super($,"bigint","SQLiteBigInt")}build($){return new EY($,this.config)}}class EY extends P1{static[I]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue($){if(typeof Buffer<"u"&&Buffer.from){let G=Buffer.isBuffer($)?$:$ instanceof ArrayBuffer?Buffer.from($):$.buffer?Buffer.from($.buffer,$.byteOffset,$.byteLength):Buffer.from($);return BigInt(G.toString("utf8"))}return BigInt(U8.decode($))}mapToDriverValue($){return Buffer.from($.toString())}}class jY extends O1{static[I]="SQLiteBlobJsonBuilder";constructor($){super($,"json","SQLiteBlobJson")}build($){return new TY($,this.config)}}class TY extends P1{static[I]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue($){if(typeof Buffer<"u"&&Buffer.from){let G=Buffer.isBuffer($)?$:$ instanceof ArrayBuffer?Buffer.from($):$.buffer?Buffer.from($.buffer,$.byteOffset,$.byteLength):Buffer.from($);return JSON.parse(G.toString("utf8"))}return JSON.parse(U8.decode($))}mapToDriverValue($){return Buffer.from(JSON.stringify($))}}class CY extends O1{static[I]="SQLiteBlobBufferBuilder";constructor($){super($,"buffer","SQLiteBlobBuffer")}build($){return new SY($,this.config)}}class SY extends P1{static[I]="SQLiteBlobBuffer";mapFromDriverValue($){if(Buffer.isBuffer($))return $;return Buffer.from($)}getSQLType(){return"blob"}}function IY($,G){let{name:X,config:Y}=R0($,G);if(Y?.mode==="json")return new jY(X);if(Y?.mode==="bigint")return new LY(X);return new CY(X)}class xY extends O1{static[I]="SQLiteCustomColumnBuilder";constructor($,G,X){super($,"custom","SQLiteCustomColumn");this.config.fieldConfig=G,this.config.customTypeParams=X}build($){return new kY($,this.config)}}class kY extends P1{static[I]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor($,G){super($,G);this.sqlName=G.customTypeParams.dataType(G.fieldConfig),this.mapTo=G.customTypeParams.toDriver,this.mapFrom=G.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue($){return typeof this.mapFrom==="function"?this.mapFrom($):$}mapToDriverValue($){return typeof this.mapTo==="function"?this.mapTo($):$}}function $5($){return(G,X)=>{let{name:Y,config:W}=R0(G,X);return new xY(Y,W,$)}}class G5 extends O1{static[I]="SQLiteBaseIntegerBuilder";constructor($,G,X){super($,G,X);this.config.autoIncrement=!1}primaryKey($){if($?.autoIncrement)this.config.autoIncrement=!0;return this.config.hasDefault=!0,super.primaryKey()}}class X5 extends P1{static[I]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class bY extends G5{static[I]="SQLiteIntegerBuilder";constructor($){super($,"number","SQLiteInteger")}build($){return new vY($,this.config)}}class vY extends X5{static[I]="SQLiteInteger"}class gY extends G5{static[I]="SQLiteTimestampBuilder";constructor($,G){super($,"date","SQLiteTimestamp");this.config.mode=G}defaultNow(){return this.default(w2`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build($){return new hY($,this.config)}}class hY extends X5{static[I]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue($){if(this.config.mode==="timestamp")return new Date($*1000);return new Date($)}mapToDriverValue($){let G=$.getTime();if(this.config.mode==="timestamp")return Math.floor(G/1000);return G}}class yY extends G5{static[I]="SQLiteBooleanBuilder";constructor($,G){super($,"boolean","SQLiteBoolean");this.config.mode=G}build($){return new fY($,this.config)}}class fY extends X5{static[I]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue($){return Number($)===1}mapToDriverValue($){return $?1:0}}function v1($,G){let{name:X,config:Y}=R0($,G);if(Y?.mode==="timestamp"||Y?.mode==="timestamp_ms")return new gY(X,Y.mode);if(Y?.mode==="boolean")return new yY(X,Y.mode);return new bY(X)}class mY extends O1{static[I]="SQLiteNumericBuilder";constructor($){super($,"string","SQLiteNumeric")}build($){return new uY($,this.config)}}class uY extends P1{static[I]="SQLiteNumeric";mapFromDriverValue($){if(typeof $==="string")return $;return String($)}getSQLType(){return"numeric"}}class pY extends O1{static[I]="SQLiteNumericNumberBuilder";constructor($){super($,"number","SQLiteNumericNumber")}build($){return new lY($,this.config)}}class lY extends P1{static[I]="SQLiteNumericNumber";mapFromDriverValue($){if(typeof $==="number")return $;return Number($)}mapToDriverValue=String;getSQLType(){return"numeric"}}class rY extends O1{static[I]="SQLiteNumericBigIntBuilder";constructor($){super($,"bigint","SQLiteNumericBigInt")}build($){return new dY($,this.config)}}class dY extends P1{static[I]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function cY($,G){let{name:X,config:Y}=R0($,G),W=Y?.mode;return W==="number"?new pY(X):W==="bigint"?new rY(X):new mY(X)}class iY extends O1{static[I]="SQLiteRealBuilder";constructor($){super($,"number","SQLiteReal")}build($){return new nY($,this.config)}}class nY extends P1{static[I]="SQLiteReal";getSQLType(){return"real"}}function oY($){return new iY($??"")}class sY extends O1{static[I]="SQLiteTextBuilder";constructor($,G){super($,"string","SQLiteText");this.config.enumValues=G.enum,this.config.length=G.length}build($){return new aY($,this.config)}}class aY extends P1{static[I]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor($,G){super($,G)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class tY extends O1{static[I]="SQLiteTextJsonBuilder";constructor($){super($,"json","SQLiteTextJson")}build($){return new eY($,this.config)}}class eY extends P1{static[I]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue($){return JSON.parse($)}mapToDriverValue($){return JSON.stringify($)}}function i($,G={}){let{name:X,config:Y}=R0($,G);if(Y.mode==="json")return new tY(X);return new sY(X,Y)}function $W(){return{blob:IY,customType:$5,integer:v1,numeric:cY,real:oY,text:i}}var R8=Symbol.for("drizzle:SQLiteInlineForeignKeys");class d4 extends M1{static[I]="SQLiteTable";static Symbol=Object.assign({},M1.Symbol,{InlineForeignKeys:R8});[M1.Symbol.Columns];[R8]=[];[M1.Symbol.ExtraConfigBuilder]=void 0}function pA($,G,X,Y,W=$){let V=new d4($,Y,W),q=typeof G==="function"?G($W()):G,J=Object.fromEntries(Object.entries(q).map(([D,R])=>{let M=R;M.setName(D);let A=M.build(V);return V[R8].push(...M.buildForeignKeys(A,V)),[D,A]})),H=Object.assign(V,J);if(H[M1.Symbol.Columns]=J,H[M1.Symbol.ExtraConfigColumns]=J,X)H[d4.Symbol.ExtraConfigBuilder]=X;return H}var M0=($,G,X)=>{return pA($,G,X)};class GW{constructor($,G){this.name=$,this.value=G}static[I]="SQLiteCheckBuilder";brand;build($){return new XW($,this)}}class XW{constructor($,G){this.table=$,this.name=G.name,this.value=G.value}static[I]="SQLiteCheck";name;value}function YW($,G){return new GW($,G)}class WW{constructor($,G){this.name=$,this.unique=G}static[I]="SQLiteIndexBuilderOn";on(...$){return new VW(this.name,$,this.unique)}}class VW{static[I]="SQLiteIndexBuilder";config;constructor($,G,X){this.config={name:$,columns:G,unique:X,where:void 0}}where($){return this.config.where=$,this}build($){return new qW(this.config,$)}}class qW{static[I]="SQLiteIndex";config;constructor($,G){this.config={...$,table:G}}}function Y0($){return new WW($,!1)}function Y5(...$){if($[0].columns)return new M8($[0].columns,$[0].name);return new M8($)}class M8{static[I]="SQLitePrimaryKeyBuilder";columns;name;constructor($,G){this.columns=$,this.name=G}build($){return new JW($,this.columns,this.name)}}class JW{constructor($,G,X){this.table=$,this.columns=G,this.name=X}static[I]="SQLitePrimaryKey";columns;name;getName(){return this.name??`${this.table[d4.Symbol.Name]}_${this.columns.map(($)=>$.name).join("_")}_pk`}}var HW=M0("job_queue",{id:i("id").primaryKey().$defaultFn(()=>g0()),type:i("type").notNull(),data:i("data").notNull(),result:i("result",{mode:"json"}),source:i("source"),metadata:i("metadata",{mode:"json"}).$type().notNull(),status:i("status",{enum:["pending","processing","completed","failed"]}).notNull().default("pending"),priority:v1("priority").notNull().default(0),retryCount:v1("retryCount").notNull().default(0),maxRetries:v1("maxRetries").notNull().default(3),lastError:i("lastError"),createdAt:v1("createdAt").notNull().$defaultFn(()=>Date.now()),scheduledFor:v1("scheduledFor").notNull().$defaultFn(()=>Date.now()),startedAt:v1("startedAt"),completedAt:v1("completedAt")},($)=>({queueReadyIdx:Y0("idx_job_queue_ready").on($.status,$.priority,$.scheduledFor),jobTypeIdx:Y0("idx_job_queue_type").on($.type,$.status),jobSourceIdx:Y0("idx_job_queue_source").on($.source)}));var lA=U.object({id:U.string(),type:U.string(),data:U.string(),status:U.enum(["pending","processing","completed","failed"]),source:U.string().nullable(),priority:U.number(),retryCount:U.number(),maxRetries:U.number(),lastError:U.string().nullable(),createdAt:U.number(),scheduledFor:U.number(),startedAt:U.number().nullable(),completedAt:U.number().nullable(),metadata:p4,result:U.unknown().nullable().optional()});function Q8($,G,X){return async(Y)=>{let{type:W,data:V,toolContext:q=null,options:J}=Y,{metadata:H,...D}=J??{},R={source:G,...J?.rootJobId&&{rootJobId:J.rootJobId},...D,metadata:{operationType:"data_processing",pluginId:G,...q&&{interfaceType:q.interfaceType,channelId:q.channelId},...H}},M=X&&!W.includes(":")?`${G}:${W}`:W;return $.enqueue({type:M,data:V,options:R})}}function K8($,G){return async(X,Y)=>{let W=g0(),V=X.map((J)=>({...J,type:J.type.includes(":")?J.type:`${G}:${J.type}`})),q={...Y,source:G,rootJobId:W,metadata:{...Y?.metadata,operationType:"batch_processing",pluginId:G}};return await $.enqueueBatch(V,q,W,G),W}}function F8($,G){return(X,Y)=>{let W=X.includes(":")?X:`${G}:${X}`;$.registerHandler(W,Y,G)}}var rA=U.object({name:U.string(),schema:U.custom(($)=>$ instanceof U.ZodType)});function UW($){return rA.safeParse($).success}function dA($){if(!$)return;return{status:$.status,message:$.message,lastCheck:$.lastCheck?.toISOString(),details:$.details}}function DW($){return{model:$.model,version:$.version,uptime:$.uptime,entities:$.entities,entityCounts:$.entityCounts,embeddings:$.embeddings,ai:$.ai,daemons:$.daemons.map((G)=>({name:G.name,pluginId:G.pluginId,status:G.status,health:dA(G.health)})),endpoints:$.endpoints,interactions:$.interactions}}var J4=U.record(U.unknown());var cA=U.object({id:U.string(),sessionId:U.string(),interfaceType:U.string(),channelId:U.string(),channelName:U.string().optional(),startedAt:U.string(),lastActiveAt:U.string(),createdAt:U.string(),updatedAt:U.string(),metadata:J4}),iA=U.object({id:U.string(),conversationId:U.string(),role:F2,content:U.string(),timestamp:U.string(),metadata:J4});function RW($){if(!$)return{};try{let G=JSON.parse($);if(G&&typeof G==="object"&&!Array.isArray(G))return G}catch{}return{}}function nA($){let G=F2.safeParse($);return G.success?G.data:"user"}function W5($){let G=RW($.metadata),X=typeof G.channelName==="string"?G.channelName:void 0;return{id:$.id,sessionId:$.sessionId,interfaceType:$.interfaceType,channelId:$.channelId,channelName:X,startedAt:$.started,lastActiveAt:$.lastActive,createdAt:$.created,updatedAt:$.updated,metadata:G}}function MW($){return{id:$.id,conversationId:$.conversationId,role:nA($.role),content:$.content,timestamp:$.timestamp,metadata:RW($.metadata)}}var A8=U.object({name:U.string(),role:U.string(),purpose:U.string(),values:U.array(U.string())}),w8=U.object({name:U.string(),kind:U.enum(["professional","team","collective"]),organization:U.string().optional(),description:U.string().optional(),avatar:U.string().optional(),website:U.string().optional(),email:U.string().optional(),socialLinks:U.array(U.object({platform:U.enum(["github","instagram","linkedin","email","website"]),url:U.string(),label:U.string().optional()})).optional()});function QW($){return A8.parse($)}function KW($){return w8.parse($)}function FW($){return async()=>{return DW(await $.getAppInfo())}}function AW($,G){return{get:()=>QW($.getIdentity()),getProfile:()=>KW($.getProfile()),getAppInfo:G}}function wW($,G,X){let Y=$.getMessageBus();return{send:async(V)=>{return Y.send({...V,sender:G})},subscribe:(V,q)=>{if(UW(V)){let J=V,H=q,D=async(R)=>{let M=J.schema.safeParse(R.payload);if(!M.success)return X.warn(`Invalid payload for channel ${J.name}`,{error:M.error.message}),{noop:!0};let{payload:A,...F}=R;return H(M.data,F)};return Y.subscribe(J.name,D)}return Y.subscribe(V,q)}}}function BW($,G){let X=$.getJobQueueService();return{...$.jobs,enqueue:Q8(X,G,!0),enqueueBatch:K8($.jobs,G),registerHandler:F8(X,G)}}function OW($){let G=$.getPermissionService();return{assertEntityActionAllowed:(X,Y,W)=>{G.assertEntityActionAllowed(X,Y,W.userPermissionLevel)}}}function PW($){return{get:async(G)=>{let Y=await $.getConversationService().getConversation(G);return Y?W5(Y):null},search:async(G)=>{return(await $.getConversationService().searchConversations(G)).map(W5)},list:async(G)=>{return(await $.getConversationService().listConversations(G)).map(W5)},getMessages:async(G,X)=>{return(await $.getConversationService().getMessages(G,X)).map(MW)},countMessages:async(G)=>{return $.getConversationService().countMessages(G)}}}function NW($,G){return{registerHandler:(X,Y)=>{$.registerEvalHandler(G,X,Y)}}}function ZW($){return{register:(G,X)=>{$.getInsightsRegistry().register(G,X)}}}function zW($,G){return{register:(X)=>{$.registerEndpoint({...X,pluginId:G})}}}function _W($,G){return{register:(X)=>{$.registerInteraction({...X,pluginId:G})}}}function H4($,G,X){let Y=$.getEntityService(),W=$.getLogger().child(G),V=$.getDomain(),q=$.getLocalSiteUrl(),J=$.shouldPreferLocalUrls(),H=$.getThemeCSS(),D=FW($),R=$.getAttachmentRegistry();return{pluginId:G,logger:W,entityService:Y,identity:AW($,D),appInfo:D,domain:V,siteUrl:V?`https://${V}`:void 0,localSiteUrl:q,previewUrl:V?`https://${e9(V)}`:void 0,preferLocalUrls:J,themeCSS:H,entityDisplay:X?.entityDisplay,spaces:$.getSpaces(),permissions:OW($),messaging:wW($,G,W),jobs:BW($,G),attachments:R,conversations:PW($),dataDir:$.getDataDir(),eval:NW($,G),insights:ZW($),endpoints:zW($,G),interactions:_W($,G)}}import{createClient as nb}from"@libsql/client";var V5=M0("entities",{id:i("id").notNull(),entityType:i("entityType").notNull(),content:i("content").notNull(),contentHash:i("contentHash").notNull(),visibility:i("visibility",{enum:["public","shared","restricted"]}).notNull().default("public"),metadata:i("metadata",{mode:"json"}).$type().notNull().default(w2`'{}'`),created:v1("created").notNull().$defaultFn(()=>Date.now()),updated:v1("updated").notNull().$defaultFn(()=>Date.now())},($)=>{return{pk:Y5({columns:[$.id,$.entityType]}),visibilityCheck:YW("entities_visibility_check",w2`${$.visibility} IN ('public', 'shared', 'restricted')`)}});import{createClient as Yv}from"@libsql/client";var LW=$5({dataType(){return"F32_BLOB(1536)"},toDriver($){return Buffer.from($.buffer)},fromDriver($){return new Float32Array($.buffer,$.byteOffset,$.byteLength/4)}});var q5=M0("embeddings",{entityId:i("entity_id").notNull(),entityType:i("entity_type").notNull(),embedding:LW("embedding").notNull(),contentHash:i("content_hash").notNull()},($)=>{return{pk:Y5({columns:[$.entityId,$.entityType]})}});var oA=U.enum(["public","shared","restricted"]),i4=U.union([oA,U.literal("private")]).optional().transform(($)=>{if($===void 0)return"public";if($==="private")return"restricted";return $});var B8=U.object({id:U.string(),entityType:U.string(),content:U.string(),created:U.string().datetime(),updated:U.string().datetime(),visibility:i4,metadata:U.record(U.string(),U.unknown()),contentHash:U.string()}),sA=U.object({mediaType:U.string(),url:U.string(),downloadUrl:U.string().optional(),previewUrl:U.string().optional(),filename:U.string().optional(),sizeBytes:U.number().optional(),source:U.object({entityType:U.string().optional(),entityId:U.string().optional(),attachmentType:U.string().optional()}).optional()});var Qv=U.object({id:U.string().min(1,"Entity ID is required"),entityType:U.string().min(1,"Entity type is required"),contentHash:U.string().min(1,"Content hash is required"),operation:U.enum(["create","update"])});var Bv=U.object({limit:U.number().int().positive().optional().default(20),offset:U.number().int().min(0).optional().default(0),types:U.array(U.string()).optional().default([]),excludeTypes:U.array(U.string()).optional().default([]),weight:U.record(U.string(),U.number()).optional(),visibilityScope:U.enum(["public","shared","restricted"]).optional(),includeUngenerated:U.boolean().optional().default(!1)});var P8=t4(y5(),1);function J5($,G){if(Object.keys(G).length===0)return $;let X=Object.fromEntries(Object.entries(G).filter(([,Y])=>Y!==void 0));return P8.default.stringify($,X)}function O8($){if($ instanceof Date)return $.toISOString();if(Array.isArray($))return $.map(O8);if($!==null&&typeof $==="object"){let G={};for(let[X,Y]of Object.entries($))G[X]=O8(Y);return G}return $}function n4($,G){let{content:X,data:Y}=P8.default($),W=O8(Y);return{content:X.trim(),metadata:G.parse(W)}}var Zv=U.object({visibility:i4});var Gw=U.object({field:U.string(),direction:U.enum(["asc","desc"]),nullsFirst:U.boolean().optional()}),vv=U.object({limit:U.number().int().positive().optional(),offset:U.number().int().min(0).optional().default(0),sortFields:U.array(Gw).optional(),filter:U.object({metadata:U.record(U.string(),U.unknown()).optional(),visibilityScope:U.enum(["public","shared","restricted"]).optional()}).optional(),publishedOnly:U.boolean().optional()});var Mw=U.object({currentPage:U.number(),totalPages:U.number(),totalItems:U.number(),pageSize:U.number(),hasNextPage:U.boolean(),hasPrevPage:U.boolean()});function Qw($){return $.replace(/:/g,"-")}function Kw($){return $.split(/[:.-]/).map((G)=>G.charAt(0).toUpperCase()+G.slice(1)).join(" ")}var N8=new Map;async function TW($,G,X){let Y=N8.get(G);if(Y!==void 0)return Y;let W=Qw(G),V;try{V=await $.getEntity({entityType:"prompt",id:W})}catch{return X}if(V?.content){let q=n4(V.content,U.record(U.unknown())).content;return N8.set(G,q),q}try{let q=Kw(G),J=J5(X,{title:q,target:G});await $.createEntity({entity:{id:W,entityType:"prompt",content:J,metadata:{title:q,target:G,slug:W}}})}catch{}return N8.set(G,X),X}function H5($){let G=$.getEntityService(),X=$.getEntityRegistry(),Y=$.getDataSourceRegistry();return{register:(W,V,q,J)=>{X.registerEntityType(W,V,q,J)},getAdapter:(W)=>{try{return X.getAdapter(W)}catch{return}},extendFrontmatterSchema:(W,V)=>{X.extendFrontmatterSchema(W,V)},getEffectiveFrontmatterSchema:(W)=>{return X.getEffectiveFrontmatterSchema(W)},registerCreateInterceptor:(W,V)=>{X.registerCreateInterceptor(W,V)},update:async(W)=>{return G.updateEntity({entity:W})},registerDataSource:(W)=>{Y.register(W)}}}function U5($){return{resolve:(G,X)=>{return TW($,G,X)}}}function CW($,G,X){let Y=H4($,G,X),W=$.getEntityService();return{...Y,entityService:W,entities:H5($),ai:{query:(V,q)=>$.query(V,q),generate:async(V)=>{return $.generateContent(V)},generateObject:async(V,q)=>{return $.generateObject(V,q)},generateImage:async(V,q)=>{return $.generateImage(V,q)},canGenerateImages:()=>{return $.canGenerateImages()}},prompts:U5(W),permissions:Y.permissions}}function IW($,G,X){let Y=!1,W=!1;if($.jobs.registerHandler(X.job.type,X.job.handler),X.initialSync){let V=X.initialSync;$.messaging.subscribe("sync:initial:completed",async()=>{if(Y)return{success:!0};if(Y=!0,!(await V.shouldEnqueue?.()??!0))return G.info("Skipping derived entity projection initial sync",{projectionId:X.id,targetType:X.targetType}),{success:!0};return W=await SW($,G,X,V.jobData,Aw(V.jobOptions),"initial-sync"),{success:!0}})}if(X.sourceChange){let V=X.sourceChange,q=new Set(V.sourceTypes),J=V.events??["entity:created","entity:updated"],H=async(D)=>{if(V.requireInitialSync&&!Y)return{success:!0};let R=D.payload,M=Fw(V,R);if(!M||!q.has("*")&&!q.has(M))return{success:!0};if(!(await V.shouldEnqueue?.(R)??!0))return{success:!0};let F=await V.jobData(R);if(!F)return{success:!0};return await SW($,G,X,F,V.jobOptions?.(R),"source-change"),{success:!0}};for(let D of J)$.messaging.subscribe(D,H)}return{hasObservedInitialSync:()=>Y,hasQueuedInitialSync:()=>W}}function Fw($,G){if($.sourceType)return $.sourceType;if($.sourceKind&&$.sourceKind!=="entity")return $.sourceKind;return G.entityType}async function SW($,G,X,Y,W,V){try{return await $.jobs.enqueue({type:X.job.type,data:Y,...W?{options:W}:{}}),G.info("Queued derived entity projection",{projectionId:X.id,targetType:X.targetType,reason:V}),!0}catch(q){return G.error("Failed to queue derived entity projection",{projectionId:X.id,targetType:X.targetType,reason:V,error:D0(q)}),!1}}function Aw($){return typeof $==="function"?$():$}var ww=U.object({});class D5 extends A2{type="entity";entityActionPolicy;derivedEntityProjectionControllers=new Map;constructor($,G,X={},Y=ww,W){super($,G,X,Y);if(W!==void 0)this.entityActionPolicy=W}async register($,G){let X=CW($,this.id,G);if(this.context=X,this.setupMessageHandlers(X),X.entities.register(this.entityType,this.schema,this.adapter,this.getEntityTypeConfig()),this.interceptCreate!==D5.prototype.interceptCreate)X.entities.registerCreateInterceptor(this.entityType,(H,D)=>this.interceptCreate(H,D,X));let Y=this.createGenerationHandler(X);if(Y)X.jobs.registerHandler(`${this.entityType}:generation`,Y);let W=this.getTemplates();if(W&&Object.keys(W).length>0)$.registerTemplates(W,this.id);let V=this.getDataSources();for(let H of V)X.entities.registerDataSource(H);let q=this.getDerivedEntityProjections(X);for(let H of q){let D=IW(X,this.logger,H);this.derivedEntityProjectionControllers.set(H.id,D)}await this.onRegister(this.context);let J=await this.getInstructions();return{tools:[],resources:[],...J&&{instructions:J}}}async interceptCreate($,G,X){return{kind:"continue",input:$}}createGenerationHandler($){return null}getTemplates(){return null}getDataSources(){return[]}getEntityTypeConfig(){return}getDerivedEntityProjections($){return[]}getDerivedEntityProjectionController($){return this.derivedEntityProjectionControllers.get($)}}class xW extends D5{hooks;constructor($,G,X,Y,W){super($,G,X,Y);this.hooks=W}get entityType(){return this.hooks.getEntityType()}get schema(){return this.hooks.getSchema()}get adapter(){return this.hooks.getAdapter()}onRegister($){return this.hooks.onRegister($)}onReady($){return this.hooks.onReady($)}onShutdown(){return this.hooks.onShutdown()}getEntityTypeConfig(){return this.hooks.getEntityTypeConfig()}getDataSources(){return this.hooks.getDataSources()}getInstructions(){return this.hooks.getInstructions()}interceptCreate($,G,X){return this.hooks.interceptCreate($,G,X)}}class Z8{type="entity";id;version;packageName;description;delegate;constructor($,G,X,Y){if(this.id=$,this.version=G.version,this.packageName=G.name,G.description!==void 0)this.description=G.description;this.delegate=new xW($,G,X,Y,{getEntityType:()=>this.entityType,getSchema:()=>this.schema,getAdapter:()=>this.adapter,onRegister:(W)=>this.onRegister(W),onReady:(W)=>this.onReady(W),onShutdown:()=>this.onShutdown(),getEntityTypeConfig:()=>this.getEntityTypeConfig(),getDataSources:()=>this.getDataSources(),getInstructions:()=>this.getInstructions(),interceptCreate:(W,V,q)=>this.interceptCreate(W,V,q)})}register($,G){return this.delegate.register($,G)}async onRegister($){}async onReady($){}async onShutdown(){}async getInstructions(){return}getEntityTypeConfig(){return}getDataSources(){return[]}async interceptCreate($,G,X){return{kind:"continue",input:$}}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}import{createClient as jh}from"@libsql/client";var R5=M0("conversations",{id:i("id").primaryKey(),sessionId:i("session_id").notNull(),interfaceType:i("interface_type").notNull(),channelId:i("channel_id").notNull(),started:i("started").notNull(),lastActive:i("last_active").notNull(),metadata:i("metadata"),created:i("created").notNull(),updated:i("updated").notNull()},($)=>({sessionIdx:Y0("idx_conversations_session").on($.sessionId),channelIdx:Y0("idx_conversations_channel").on($.channelId),interfaceSessionIdx:Y0("idx_conversations_interface_session").on($.interfaceType,$.sessionId),interfaceChannelIdx:Y0("idx_conversations_interface_channel").on($.interfaceType,$.channelId)})),kW=M0("messages",{id:i("id").primaryKey(),conversationId:i("conversation_id").notNull().references(()=>R5.id,{onDelete:"cascade"}),role:i("role").notNull(),content:i("content").notNull(),timestamp:i("timestamp").notNull(),metadata:i("metadata")},($)=>({conversationIdx:Y0("idx_messages_conversation").on($.conversationId),timestampIdx:Y0("idx_messages_timestamp").on($.timestamp)})),bW=M0("summary_tracking",{conversationId:i("conversation_id").primaryKey().references(()=>R5.id,{onDelete:"cascade"}),lastSummarizedAt:i("last_summarized_at"),lastMessageId:i("last_message_id"),messagesSinceSummary:v1("messages_since_summary").default(0),updated:i("updated").notNull()});var Ih=U.preprocess(($)=>{if(typeof $!=="string")return $;try{return JSON.parse($)}catch{return}},U.record(U.unknown())).catch({});var M5=U.object({actorId:U.string(),canonicalId:U.string().optional(),interfaceType:U.string(),role:F2,displayName:U.string().optional(),username:U.string().optional(),isBot:U.boolean().optional()}),Q5=U.object({messageId:U.string().optional(),channelId:U.string().optional(),channelName:U.string().optional(),threadId:U.string().optional(),metadata:U.record(U.unknown()).optional()}),Bw=U.object({actor:M5.optional(),source:Q5.optional()}).passthrough(),Ow=U.object({id:U.string(),conversationId:U.string(),role:U.string(),content:U.string(),timestamp:U.string(),metadata:U.string().nullable()}),Pw=U.object({conversationId:U.string(),messageCount:U.number(),messages:U.array(Ow),windowStart:U.number(),windowEnd:U.number(),windowSize:U.number(),timestamp:U.string()});var _w=U.object({kind:U.string().min(1),id:U.string().min(1)}),Lw=U.object({kind:U.literal("text"),filename:U.string().min(1),mediaType:U.string().min(1),content:U.string(),sizeBytes:U.number().nonnegative().optional(),source:_w.optional()}),Ew=U.discriminatedUnion("kind",[Lw]),jw=U.object({userPermissionLevel:p0.optional(),interfaceType:U.string().optional(),channelId:U.string().optional(),channelName:U.string().optional(),actor:M5.optional(),source:Q5.optional(),attachments:U.array(Ew).optional()}),vW=U.object({id:U.string(),toolCallId:U.string().optional(),toolName:U.string(),summary:U.string(),preview:U.string().optional(),args:U.unknown()}),Tw=U.enum(["approval-requested","approval-responded","output-available","output-denied","output-error"]),Cw=U.object({kind:U.literal("tool-approval"),id:U.string(),toolCallId:U.string().optional(),toolName:U.string(),input:U.record(U.unknown()).optional(),summary:U.string(),preview:U.string().optional(),state:Tw,output:U.unknown().optional(),error:U.string().optional()}),Sw=U.object({entityType:U.string().optional(),entityId:U.string().optional(),attachmentType:U.string().optional()}),Iw=U.object({mediaType:U.string().min(1),url:U.string().min(1),downloadUrl:U.string().min(1).optional(),previewUrl:U.string().min(1).optional(),filename:U.string().min(1).optional(),sizeBytes:U.number().nonnegative().optional(),source:Sw.optional()}),xw=U.object({kind:U.literal("attachment"),id:U.string(),jobId:U.string().optional(),title:U.string(),description:U.string().optional(),attachment:Iw}),kw=U.discriminatedUnion("kind",[Cw,xw]);function gW($){let{attachment:G}=$,{source:X}=G;return{kind:"attachment",id:$.id,...$.jobId!==void 0&&{jobId:$.jobId},title:$.title,...$.description!==void 0&&{description:$.description},attachment:{mediaType:G.mediaType,url:G.url,...G.downloadUrl!==void 0&&{downloadUrl:G.downloadUrl},...G.previewUrl!==void 0&&{previewUrl:G.previewUrl},...G.filename!==void 0&&{filename:G.filename},...G.sizeBytes!==void 0&&{sizeBytes:G.sizeBytes},...X!==void 0&&{source:{...X.entityType!==void 0&&{entityType:X.entityType},...X.entityId!==void 0&&{entityId:X.entityId},...X.attachmentType!==void 0&&{attachmentType:X.attachmentType}}}}}}var hW=U.object({toolName:U.string(),args:U.record(U.unknown()).optional(),jobId:U.string().optional(),data:U.unknown().optional()}),bw=U.object({text:U.string(),toolResults:U.array(hW).optional(),cards:U.array(kw).optional(),pendingConfirmations:U.array(vW).optional(),usage:U.object({promptTokens:U.number(),completionTokens:U.number(),totalTokens:U.number()})});function yW($){return{text:$.text,...$.toolResults&&{toolResults:$.toolResults.map((G)=>({toolName:G.toolName,...G.args&&{args:G.args},...G.jobId!==void 0&&{jobId:G.jobId},...G.data!==void 0&&{data:G.data}}))},...$.cards&&{cards:$.cards.map(vw)},...$.pendingConfirmations&&{pendingConfirmations:$.pendingConfirmations.map((G)=>gw(G))},usage:$.usage}}function vw($){if($.kind==="attachment")return gW($);return{kind:$.kind,id:$.id,...$.toolCallId!==void 0&&{toolCallId:$.toolCallId},toolName:$.toolName,...$.input!==void 0&&{input:$.input},summary:$.summary,...$.preview!==void 0&&{preview:$.preview},state:$.state,...$.output!==void 0&&{output:$.output},...$.error!==void 0&&{error:$.error}}}function gw($){return{id:$.id,...$.toolCallId!==void 0&&{toolCallId:$.toolCallId},toolName:$.toolName,summary:$.summary,...$.preview!==void 0&&{preview:$.preview},args:$.args}}function hw($){if(!$)return;return{...$.userPermissionLevel&&{userPermissionLevel:$.userPermissionLevel},...$.interfaceType&&{interfaceType:$.interfaceType},...$.channelId&&{channelId:$.channelId},...$.channelName&&{channelName:$.channelName},...$.actor&&{actor:$.actor},...$.source&&{source:$.source},...$.attachments&&{attachments:$.attachments}}}function fW($){return{chat:async(G,X,Y)=>{return yW(await $.chat(G,X,hw(Y)))},confirmPendingAction:async(G,X,Y)=>{return yW(await $.confirmPendingAction(G,X,Y))},invalidate:()=>{$.invalidateAgent()}}}function mW($,G,X){let Y=H4($,G,X),W=$.getMCPService(),V=$.getPermissionService(),q=fW($.getAgentService());return{...Y,mcpTransport:W,agent:q,permissions:{...Y.permissions,getUserLevel:(J,H,D)=>{return V.determineUserLevel(J,H,D)}},daemons:{register:(J,H)=>{let D=`${G}:${J}`;$.registerDaemon(D,H,G),Y.logger.debug(`Registered daemon: ${D}`)}},conversations:{...Y.conversations,start:async(J)=>{return $.getConversationService().startConversation(J)},addMessage:async(J)=>{await $.getConversationService().addMessage(J)},updateMetadata:async(J)=>{return $.getConversationService().updateConversationMetadata(J)},delete:async(J)=>{return $.getConversationService().deleteConversation(J)}},tools:{listForPermissionLevel:(J)=>{return $.listToolsForPermissionLevel(J)}},apiRoutes:{getRoutes:()=>{return $.getPluginApiRoutes()},getMessageBus:()=>{return $.getMessageBus()}},webRoutes:{getRoutes:()=>{return $.getPluginWebRoutes()}},plugins:{has:(J)=>$.hasPlugin(J)}}}var yw=3600000;class o4 extends A2{type="interface";daemon;jobTrackingEntries=new Map;jobTrackingTtlMs=yw;async register($,G){let X=mW($,this.id,G);if(this.context=X,this.initializeDaemon(),this.daemon)await this.registerDaemon(X);return this.setupMessageHandlers(X),await this.onRegister(X),this.getCapabilities()}async onRegister($){}async registerDaemon($){if(!this.daemon)return;$.daemons.register(this.id,this.daemon),$.logger.debug(`Registered daemon for interface: ${this.id}`)}createDaemon(){return}requiresDaemonStartup(){return!1}getWebRoutes(){return[]}initializeDaemon(){let $=this.createDaemon();if($)this.daemon=$}async handleProgressEvent($,G){}cleanupExpiredEntries(){let $=Date.now(),G=[];for(let[X,Y]of this.jobTrackingEntries)if($-Y.createdAt>this.jobTrackingTtlMs)G.push(X);for(let X of G)this.jobTrackingEntries.delete(X)}ownsJob($,G){return this.jobTrackingEntries.has($)||G!==void 0&&this.jobTrackingEntries.has(G)}getJobTracking($,G){let X=this.jobTrackingEntries.get($);if(X)return X.info;if(G){let Y=this.jobTrackingEntries.get(G);if(Y)return Y.info}return}setJobTracking($,G){this.cleanupExpiredEntries(),this.jobTrackingEntries.set($,{info:G,createdAt:Date.now()})}removeJobTracking($){this.jobTrackingEntries.delete($)}async createJobWithTracking($,G){let Y=await this.getContext().jobs.enqueue($);return this.setJobTracking(Y,G),Y}async createBatchWithTracking($,G,X){let W=await this.getContext().jobs.enqueueBatch($,X);return this.setJobTracking(W,G),W}}class uW extends o4{hooks;constructor($,G,X,Y,W){super($,G,X,Y);this.hooks=W}onRegister($){return this.hooks.onRegister($)}onReady($){return this.hooks.onReady($)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}getWebRoutes(){return this.hooks.getWebRoutes()}requiresDaemonStartup(){return this.hooks.requiresDaemonStartup()}}class s4{type="interface";id;version;packageName;description;delegate;constructor($,G,X,Y){if(this.id=$,this.version=G.version,this.packageName=G.name,G.description!==void 0)this.description=G.description;this.delegate=new uW($,G,X,Y,{onRegister:(W)=>this.onRegister(W),onReady:(W)=>this.onReady(W),onShutdown:()=>this.onShutdown(),getTools:()=>this.getTools(),getResources:()=>this.getResources(),getInstructions:()=>this.getInstructions(),getWebRoutes:()=>this.getWebRoutes(),requiresDaemonStartup:()=>this.requiresDaemonStartup()})}register($,G){return this.delegate.register($,G)}async onRegister($){}async onReady($){}async onShutdown(){}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}getWebRoutes(){return[]}requiresDaemonStartup(){return!1}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}function pW($,G){$.messaging.subscribe("job-progress",async(X)=>{try{let Y=G8.safeParse(X.payload);if(!Y.success)return G.onInvalidSchema(),{success:!1};let W=Y.data;return await G.onProgress(W,W.metadata),{success:!0}}catch(Y){return G.onError(Y),{success:!1}}})}function lW($){let G=$.status==="completed"?"\u2705":"\u274C",X=$.status==="completed"?"completed":"failed",Y=$.metadata.operationType.replace(/_/g," "),W=$.metadata.operationTarget?`: ${$.metadata.operationTarget}`:"",V=`${G} **${Y}${W}** ${X}`;if($.message)V+=`
|
|
120
120
|
${$.message}`;return V}function z8($){let G=$.metadata.operationType.replace(/_/g," "),X=$.metadata.operationTarget?`: ${$.metadata.operationTarget}`:"",Y=`\uD83D\uDD04 **${G}${X}**`;if($.progress&&$.progress.total>0)Y+=` ${$.progress.current}/${$.progress.total} (${$.progress.percentage}%)`;if($.message)Y+=`
|
|
121
|
-
${$.message}`;return Y}var
|
|
121
|
+
${$.message}`;return Y}var fw=U.enum(["tool:invoking","tool:completed","tool:failed"]),mw=U.object({toolName:U.string().min(1),conversationId:U.string().min(1),interfaceType:U.string().min(1),channelId:U.string().min(1).optional(),channelName:U.string().min(1).optional(),error:U.string().optional()}),uw=["tool:invoking","tool:completed","tool:failed"];function rW($,G){for(let X of uw)$.messaging.subscribe(X,async(Y)=>{try{let W=fw.safeParse(Y.type),V=mw.safeParse(Y.payload);if(!W.success||!V.success)return G.onInvalidSchema(),{success:!1};return await G.onToolActivity({type:W.data,...V.data}),{success:!0}}catch(W){return G.onError(W),{success:!1}}})}var _8=1e5,pw=[".md",".txt",".markdown"],lw=["text/plain","text/markdown","text/x-markdown"],rw=/https?:\/\/[^\s<>"{}|\\^`[\]]+?(?=[,;:\s]|$)/gi,dw=["meet.google.com","zoom.us","teams.microsoft.com","whereby.com","gather.town","calendly.com","cal.com","discord.com","discord.gg","cdn.discordapp.com","media.discordapp.net","giphy.com","tenor.com","wetransfer.com","file.io"],cw=U.object({captureUrls:U.boolean().default(!1),blockedUrlDomains:U.array(U.string()).default(dw)});function dW($,G){if(G&&lw.some((X)=>G.startsWith(X)))return!0;return pw.some((X)=>$.toLowerCase().endsWith(X))}function cW($){return $<=_8}function iW($){if($.includes(0))return!1;try{return new TextDecoder("utf-8",{fatal:!0}).decode($),!0}catch{return!1}}function nW($,G){return`User uploaded a file "${$}":
|
|
122
122
|
|
|
123
|
-
${G}`}function oW($,G){let X=$.match(
|
|
123
|
+
${G}`}function oW($,G){let X=$.match(rw)??[];return[...new Set(X)].filter((Y)=>{try{let{hostname:W}=new URL(Y);return!G.some((V)=>W===V||W.endsWith(`.${V}`))}catch{return!1}})}var sW=500;class L8 extends o4{isUploadableTextFile($,G){return dW($,G)}isFileSizeAllowed($){return cW($)}formatFileUploadMessage($,G){return nW($,G)}getMaxFileUploadBytes(){return _8}isLikelyTextContent($){return iW($)}extractCaptureableUrls($,G){return oW($,G)}async captureUrlViaAgent($,G,X,Y,W){if(!this.context)return;let V=this.context.permissions.getUserLevel(Y,X,W);await this.context.agent.chat(`Save this link: ${$}`,`links-${G}`,{userPermissionLevel:V,interfaceType:Y,channelId:G})}progressEvents=new Map;sendMessageWithId($){return Promise.resolve(void 0)}editMessage($){return Promise.resolve(!1)}supportsMessageEditing(){return!1}progressCallback;isProcessingInput=!1;currentChannelId=null;bufferedCompletionMessages=[];progressMessageTracking=new Map;agentResponseTracking=new Map;registerProgressCallback($){this.progressCallback=$;let G=Array.from(this.progressEvents.values()).filter((X)=>X.status==="processing");$(G)}unregisterProgressCallback(){delete this.progressCallback}trackAgentResponseForJob($,G,X){this.agentResponseTracking.set($,{messageId:G,channelId:X,lastUpdate:Date.now()}),this.logger.debug("Tracking agent response for job",{jobId:$,messageId:G,channelId:X})}async onRegister($){await super.onRegister($),pW($,{onProgress:async(G,X)=>{await this.handleProgressEvent(G,X)},onError:(G)=>{this.logger.error("Error handling progress event",{error:G,interfaceId:this.id})},onInvalidSchema:()=>{this.logger.warn("Invalid progress event schema",{interfaceId:this.id})}}),rW($,{onToolActivity:async(G)=>{await this.handleToolActivityEvent(G)},onError:(G)=>{this.logger.error("Error handling tool activity event",{error:G,interfaceId:this.id})},onInvalidSchema:()=>{this.logger.warn("Invalid tool activity event schema",{interfaceId:this.id})}}),this.logger.debug("Message interface registered with progress and tool handlers",{id:this.id})}async handleProgressEvent($,G){if(!this.shouldHandleProgressEvent($))return;this.updateProgressState($);let X=$.metadata.channelId??null,Y=$.metadata.rootJobId;if(await this.handleProcessingProgress($,X,Y))return;if($.status==="completed"||$.status==="failed")await this.handleTerminalProgress($,X,Y);await this.onProgressUpdate($),this.logProgressProcessed($)}shouldHandleProgressEvent($){let G=$.metadata.interfaceType;return!G||G===this.id}updateProgressState($){this.progressEvents.set($.id,$),this.notifyProgressCallback()}async handleProcessingProgress($,G,X){if($.status!=="processing"||!this.supportsMessageEditing())return!1;let Y=this.agentResponseTracking.get($.id);if(Y)return await this.editTrackedProgressMessage($,Y),!0;let W=z8($),V=this.progressMessageTracking.get(X),q=Date.now();if(V){if(q-V.lastUpdate>=sW)await this.editMessage({channelId:V.channelId,messageId:V.messageId,newMessage:W}),V.lastUpdate=q}else if(G&&!this.isProcessingInput)await this.sendInitialProgressMessage(X,G,W,q);return!1}async editTrackedProgressMessage($,G){let X=Date.now();if(X-G.lastUpdate<sW)return;await this.editMessage({channelId:G.channelId,messageId:G.messageId,newMessage:z8($)}),G.lastUpdate=X}async sendInitialProgressMessage($,G,X,Y){let W=await this.sendMessageWithId({channelId:G,message:X});if(!W)return;this.progressMessageTracking.set($,{messageId:W,channelId:G,lastUpdate:Y}),this.logger.debug("Tracking progress message",{rootJobId:$,messageId:W,channelId:G})}async handleTerminalProgress($,G,X){let Y=lW($),W=this.progressMessageTracking.get(X),V=this.agentResponseTracking.get($.id);if(this.logger.debug("Completion event received",{eventId:$.id,rootJobId:X,hasProgressTracking:!!W,hasAgentTracking:!!V,supportsEditing:this.supportsMessageEditing()}),this.supportsMessageEditing())await this.updateTrackedCompletion($,Y,W,V,X);if(!W&&!V&&G)this.sendOrBufferCompletionMessage(Y,G);this.scheduleProgressCleanup($.id)}async updateTrackedCompletion($,G,X,Y,W){if(Y){if(await this.editMessage({channelId:Y.channelId,messageId:Y.messageId,newMessage:G}),this.agentResponseTracking.delete($.id),X)this.progressMessageTracking.delete(W);return}if(X)await this.editMessage({channelId:X.channelId,messageId:X.messageId,newMessage:G}),this.progressMessageTracking.delete(W)}sendOrBufferCompletionMessage($,G){if(this.isProcessingInput){this.bufferedCompletionMessages.push({message:$,channelId:G});return}this.sendMessageToChannel({channelId:G,message:$})}scheduleProgressCleanup($){setTimeout(()=>{this.progressEvents.delete($),this.notifyProgressCallback()},500)}logProgressProcessed($){this.logger.debug("Progress event processed",{eventId:$.id,status:$.status,operationType:$.metadata.operationType,targetChannel:$.metadata.channelId})}async onProgressUpdate($){}async handleToolActivityEvent($){}notifyProgressCallback(){if(this.progressCallback){let $=Array.from(this.progressEvents.values());this.progressCallback($)}}getProgressEvents(){return Array.from(this.progressEvents.values())}getActiveProgressEvents(){return Array.from(this.progressEvents.values()).filter(($)=>$.status==="processing")}startProcessingInput($=null){this.isProcessingInput=!0,this.currentChannelId=$}endProcessingInput(){this.isProcessingInput=!1;for(let{message:$,channelId:G}of this.bufferedCompletionMessages)this.sendMessageToChannel({channelId:G,message:$});this.bufferedCompletionMessages=[],this.currentChannelId=null}getCurrentChannelId(){return this.currentChannelId}}class aW extends L8{hooks;constructor($,G,X,Y,W){super($,G,X,Y);this.hooks=W}async onRegister($){await super.onRegister($),await this.hooks.onRegister($)}onReady($){return this.hooks.onReady($)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}getWebRoutes(){return this.hooks.getWebRoutes()}requiresDaemonStartup(){return this.hooks.requiresDaemonStartup()}sendMessageToChannel($){this.hooks.sendMessageToChannel($)}sendMessageWithId($){return this.hooks.sendMessageWithId($)}editMessage($){return this.hooks.editMessage($)}supportsMessageEditing(){return this.hooks.supportsMessageEditing()}onProgressUpdate($){return this.hooks.onProgressUpdate($)}trackAgentResponseForJobPublic($,G,X){this.trackAgentResponseForJob($,G,X)}captureUrlViaAgentPublic($,G,X,Y,W){return this.captureUrlViaAgent($,G,X,Y,W)}getCurrentChannelIdPublic(){return this.getCurrentChannelId()}}class E8 extends s4{messageDelegate;constructor($,G,X,Y){super($,G,X,Y);this.messageDelegate=new aW($,G,X,Y,{onRegister:(W)=>this.onRegister(W),onReady:(W)=>this.onReady(W),onShutdown:()=>this.onShutdown(),getTools:()=>this.getTools(),getResources:()=>this.getResources(),getInstructions:()=>this.getInstructions(),getWebRoutes:()=>this.getWebRoutes(),requiresDaemonStartup:()=>this.requiresDaemonStartup(),sendMessageToChannel:(W)=>this.sendMessageToChannel(W),sendMessageWithId:(W)=>this.sendMessageWithId(W),editMessage:(W)=>this.editMessage(W),supportsMessageEditing:()=>this.supportsMessageEditing(),onProgressUpdate:(W)=>this.onProgressUpdate(W)})}register($,G){return this.messageDelegate.register($,G)}async onRegister($){}async onReady($){}async onShutdown(){}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}sendMessageWithId($){return Promise.resolve(void 0)}editMessage($){return Promise.resolve(!1)}supportsMessageEditing(){return!1}async onProgressUpdate($){}isUploadableTextFile($,G){let X=[".md",".txt",".markdown"];if(G&&["text/plain","text/markdown","text/x-markdown"].some((W)=>G.startsWith(W)))return!0;return X.some((W)=>$.toLowerCase().endsWith(W))}isFileSizeAllowed($){return $<=1e5}formatFileUploadMessage($,G){return`User uploaded a file "${$}":
|
|
124
124
|
|
|
125
|
-
${G}`}extractCaptureableUrls($,G){let X=$.match(/https?:\/\/[^\s<>"{}|\\^`[\]]+?(?=[,;:\s]|$)/gi)??[];return[...new Set(X)].filter((Y)=>{try{let{hostname:W}=new URL(Y);return!G.some((V)=>W===V||W.endsWith(`.${V}`))}catch{return!1}})}captureUrlViaAgent($,G,X,Y,W){return this.messageDelegate.captureUrlViaAgentPublic($,G,X,Y,W)}trackAgentResponseForJob($,G,X){this.messageDelegate.trackAgentResponseForJobPublic($,G,X)}registerProgressCallback($){this.messageDelegate.registerProgressCallback($)}unregisterProgressCallback(){this.messageDelegate.unregisterProgressCallback()}getProgressEvents(){return this.messageDelegate.getProgressEvents()}getActiveProgressEvents(){return this.messageDelegate.getActiveProgressEvents()}startProcessingInput($=null){this.messageDelegate.startProcessingInput($)}endProcessingInput(){this.messageDelegate.endProcessingInput()}getCurrentChannelId(){return this.messageDelegate.getCurrentChannelIdPublic()}ready(){return this.messageDelegate.ready()}shutdown(){return this.messageDelegate.shutdown?.()??Promise.resolve()}}function tW($,G,X){let Y=H4($,G,X),W=$.getEntityService(),V=$.getRenderService(),q=$.getContentService();return{...Y,entityService:W,entities:H5($),templates:{register:(J,H)=>{$.registerTemplates(J,H??G)},format:(J,H)=>{return q.formatContent(J,H,{pluginId:G})},parse:(J,H)=>{return q.parseContent(J,H,G)},resolve:async(J,H)=>{return await q.resolveContent(J,H,G)},getCapabilities:(J)=>{let H=J.includes(":")?J:`${G}:${J}`,D=$.getTemplate(H);if(!D)return null;let R=u4.getCapabilities(D);return{canGenerate:R.canGenerate,canFetch:R.canFetch,canRender:R.canRender,isStaticOnly:R.isStaticOnly}}},views:{get:(J)=>{return V.get(J)??void 0},list:()=>{return V.list()},hasRenderer:(J,H="web")=>{return V.hasRenderer(J,H)},getRenderer:(J,H="web")=>{return V.getRenderer(J,H)},validate:(J,H)=>{return V.validate(J,H)}},prompts:U5(W),registerInstructions:(J)=>{$.registerInstructions(G,J)}}}class j8 extends A2{type="service";getApiRoutes(){return[]}getWebRoutes(){return[]}async register($,G){let X=tW($,this.id,G);return this.context=X,this.setupMessageHandlers(X),await this.onRegister(X),this.getCapabilities()}get entityService(){return this.getContext().entityService}registerEntityType($,G,X,Y){this.getContext().entities.register($,G,X,Y)}async enqueueJob($){return this.getContext().jobs.enqueue($)}async enqueueBatch($,G){return this.getContext().jobs.enqueueBatch($,G)}async registerEntityTypes($){}async registerJobHandlers($){}async onRegister($){await this.registerEntityTypes($),await this.registerJobHandlers($)}}class eW extends j8{hooks;constructor($,G,X,Y,W){super($,G,X,Y);this.hooks=W}onRegister($){return this.hooks.onRegister($)}onReady($){return this.hooks.onReady($)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}}class T8{type="service";id;version;packageName;description;delegate;constructor($,G,X,Y){if(this.id=$,this.version=G.version,this.packageName=G.name,G.description!==void 0)this.description=G.description;this.delegate=new eW($,G,X,Y,{onRegister:(W)=>this.onRegister(W),onReady:(W)=>this.onReady(W),onShutdown:()=>this.onShutdown(),getTools:()=>this.getTools(),getResources:()=>this.getResources(),getInstructions:()=>this.getInstructions()})}register($,G){return this.delegate.register($,G)}async onRegister($){}async onReady($){}async onShutdown(){}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}var
|
|
125
|
+
${G}`}extractCaptureableUrls($,G){let X=$.match(/https?:\/\/[^\s<>"{}|\\^`[\]]+?(?=[,;:\s]|$)/gi)??[];return[...new Set(X)].filter((Y)=>{try{let{hostname:W}=new URL(Y);return!G.some((V)=>W===V||W.endsWith(`.${V}`))}catch{return!1}})}captureUrlViaAgent($,G,X,Y,W){return this.messageDelegate.captureUrlViaAgentPublic($,G,X,Y,W)}trackAgentResponseForJob($,G,X){this.messageDelegate.trackAgentResponseForJobPublic($,G,X)}registerProgressCallback($){this.messageDelegate.registerProgressCallback($)}unregisterProgressCallback(){this.messageDelegate.unregisterProgressCallback()}getProgressEvents(){return this.messageDelegate.getProgressEvents()}getActiveProgressEvents(){return this.messageDelegate.getActiveProgressEvents()}startProcessingInput($=null){this.messageDelegate.startProcessingInput($)}endProcessingInput(){this.messageDelegate.endProcessingInput()}getCurrentChannelId(){return this.messageDelegate.getCurrentChannelIdPublic()}ready(){return this.messageDelegate.ready()}shutdown(){return this.messageDelegate.shutdown?.()??Promise.resolve()}}function tW($,G,X){let Y=H4($,G,X),W=$.getEntityService(),V=$.getRenderService(),q=$.getContentService();return{...Y,entityService:W,entities:H5($),templates:{register:(J,H)=>{$.registerTemplates(J,H??G)},format:(J,H)=>{return q.formatContent(J,H,{pluginId:G})},parse:(J,H)=>{return q.parseContent(J,H,G)},resolve:async(J,H)=>{return await q.resolveContent(J,H,G)},getCapabilities:(J)=>{let H=J.includes(":")?J:`${G}:${J}`,D=$.getTemplate(H);if(!D)return null;let R=u4.getCapabilities(D);return{canGenerate:R.canGenerate,canFetch:R.canFetch,canRender:R.canRender,isStaticOnly:R.isStaticOnly}}},views:{get:(J)=>{return V.get(J)??void 0},list:()=>{return V.list()},hasRenderer:(J,H="web")=>{return V.hasRenderer(J,H)},getRenderer:(J,H="web")=>{return V.getRenderer(J,H)},validate:(J,H)=>{return V.validate(J,H)}},prompts:U5(W),registerInstructions:(J)=>{$.registerInstructions(G,J)}}}class j8 extends A2{type="service";getApiRoutes(){return[]}getWebRoutes(){return[]}async register($,G){let X=tW($,this.id,G);return this.context=X,this.setupMessageHandlers(X),await this.onRegister(X),this.getCapabilities()}get entityService(){return this.getContext().entityService}registerEntityType($,G,X,Y){this.getContext().entities.register($,G,X,Y)}async enqueueJob($){return this.getContext().jobs.enqueue($)}async enqueueBatch($,G){return this.getContext().jobs.enqueueBatch($,G)}async registerEntityTypes($){}async registerJobHandlers($){}async onRegister($){await this.registerEntityTypes($),await this.registerJobHandlers($)}}class eW extends j8{hooks;constructor($,G,X,Y,W){super($,G,X,Y);this.hooks=W}onRegister($){return this.hooks.onRegister($)}onReady($){return this.hooks.onReady($)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}}class T8{type="service";id;version;packageName;description;delegate;constructor($,G,X,Y){if(this.id=$,this.version=G.version,this.packageName=G.name,G.description!==void 0)this.description=G.description;this.delegate=new eW($,G,X,Y,{onRegister:(W)=>this.onRegister(W),onReady:(W)=>this.onReady(W),onShutdown:()=>this.onShutdown(),getTools:()=>this.getTools(),getResources:()=>this.getResources(),getInstructions:()=>this.getInstructions()})}register($,G){return this.delegate.register($,G)}async onRegister($){}async onReady($){}async onShutdown(){}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}var iw=U.object({status:U.enum(["healthy","warning","error","unknown"]),message:U.string().optional(),lastCheck:U.string().optional(),details:U.record(U.unknown()).optional()}),nw=U.object({name:U.string(),pluginId:U.string(),status:U.string(),health:iw.optional()}),ow=U.object({model:U.string(),version:U.string(),uptime:U.number(),entities:U.number(),entityCounts:U.array(t9),embeddings:U.number(),ai:U.object({model:U.string(),embeddingModel:U.string()}),daemons:U.array(nw),endpoints:U.array(s9),interactions:U.array(a9)});var sw=U.union([U.object({success:U.boolean(),data:U.unknown().optional(),error:U.string().optional()}),U.object({noop:U.literal(!0)})]),aw=U.object({id:U.string(),timestamp:U.string(),type:U.string(),source:U.string(),target:U.string().optional(),metadata:J4.optional()});export{$A as urlCaptureConfigSchema,tF as toolSuccess,eF as toolError,GA as defineChannel,sF as createTool,aF as createResource,hW as ToolResultDataSchema,T8 as ServicePlugin,vW as PendingConfirmationSchema,iA as MessageSchema,sw as MessageResponseSchema,E8 as MessageInterfacePlugin,s4 as InterfacePlugin,J4 as ExtensionMetadataSchema,Z8 as EntityPlugin,cA as ConversationSchema,jw as ChatContextSchema,A8 as BrainCharacterSchema,aw as BaseMessageSchema,ow as AppInfoSchema,w8 as AnchorProfileSchema,bw as AgentResponseSchema};
|
|
126
126
|
|
|
127
|
-
//# debugId=
|
|
127
|
+
//# debugId=E2E33B18D942954264756E2164756E21
|
|
128
128
|
//# sourceMappingURL=plugins.js.map
|