diff --git "a/_next/static/chunks/380-00f106ed79323266.js" "b/_next/static/chunks/380-00f106ed79323266.js" new file mode 100644--- /dev/null +++ "b/_next/static/chunks/380-00f106ed79323266.js" @@ -0,0 +1,122 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[380],{71620:function(e,t,n){e.exports={default:n(30333),__esModule:!0}},41188:function(e,t,n){e.exports={default:n(7617),__esModule:!0}},39631:function(e,t,n){e.exports={default:n(76826),__esModule:!0}},42291:function(e,t,n){e.exports={default:n(42941),__esModule:!0}},40622:function(e,t,n){e.exports={default:n(76759),__esModule:!0}},72177:function(e,t,n){e.exports={default:n(27432),__esModule:!0}},28102:function(e,t,n){e.exports={default:n(23367),__esModule:!0}},75246:function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}},82244:function(e,t,n){"use strict";t.__esModule=!0;var r,i=(r=n(39631))&&r.__esModule?r:{default:r};t.default=function(){function e(e,t){for(var n=0;nc;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}}},55072:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},90687:function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},2257:function(e,t,n){var r=n(33547);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},26064:function(e){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},15635:function(e,t,n){e.exports=!n(35511)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},54039:function(e,t,n){var r=n(73656),i=n(9054).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},13020:function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},87452:function(e,t,n){var r=n(82855),i=n(37446),o=n(51035);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),l=o.f,u=0;s.length>u;)l.call(e,a=s[u++])&&t.push(a);return t}},74015:function(e,t,n){var r=n(9054),i=n(90687),o=n(2257),a=n(79751),s=n(77276),l="prototype",u=function(e,t,n){var c,d,f,h=e&u.F,p=e&u.G,m=e&u.S,g=e&u.P,y=e&u.B,v=e&u.W,b=p?i:i[t]||(i[t]={}),w=b[l],x=p?r:m?r[t]:(r[t]||{})[l];for(c in p&&(n=t),n)!((d=!h&&x&&void 0!==x[c])&&s(b,c))&&(f=d?x[c]:n[c],b[c]=p&&"function"!=typeof x[c]?n[c]:y&&d?o(f,r):v&&x[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[l]=e[l],t}(f):g&&"function"==typeof f?o(Function.call,f):f,g&&((b.virtual||(b.virtual={}))[c]=f,e&u.R&&w&&!w[c]&&a(w,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},35511:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},9054:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},77276:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},79751:function(e,t,n){var r=n(1899),i=n(98070);e.exports=n(15635)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},48484:function(e,t,n){var r=n(9054).document;e.exports=r&&r.documentElement},79597:function(e,t,n){e.exports=!n(15635)&&!n(35511)(function(){return 7!=Object.defineProperty(n(54039)("div"),"a",{get:function(){return 7}}).a})},97818:function(e,t,n){var r=n(55072);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},79102:function(e,t,n){var r=n(55072);e.exports=Array.isArray||function(e){return"Array"==r(e)}},73656:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},17213:function(e,t,n){"use strict";var r=n(62763),i=n(98070),o=n(44614),a={};n(79751)(a,n(16964)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},51686:function(e,t,n){"use strict";var r=n(23e3),i=n(74015),o=n(10682),a=n(79751),s=n(38301),l=n(17213),u=n(44614),c=n(34021),d=n(16964)("iterator"),f=!([].keys&&"next"in[].keys()),h="values",p=function(){return this};e.exports=function(e,t,n,m,g,y,v){l(n,t,m);var b,w,x,k=function(e){return!f&&e in C?C[e]:function(){return new n(this,e)}},_=t+" Iterator",S=g==h,O=!1,C=e.prototype,E=C[d]||C["@@iterator"]||g&&C[g],P=E||k(g),j=g?S?k("entries"):P:void 0,T="Array"==t&&C.entries||E;if(T&&(x=c(T.call(new e)))!==Object.prototype&&x.next&&(u(x,_,!0),r||"function"==typeof x[d]||a(x,d,p)),S&&E&&E.name!==h&&(O=!0,P=function(){return E.call(this)}),(!r||v)&&(f||O||!C[d])&&a(C,d,P),s[t]=P,s[_]=p,g){if(b={values:S?P:k(h),keys:y?P:k("keys"),entries:j},v)for(w in b)w in C||o(C,w,b[w]);else i(i.P+i.F*(f||O),t,b)}return b}},69631:function(e){e.exports=function(e,t){return{value:t,done:!!e}}},38301:function(e){e.exports={}},23e3:function(e){e.exports=!0},9899:function(e,t,n){var r=n(86733)("meta"),i=n(73656),o=n(77276),a=n(1899).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(35511)(function(){return l(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return u&&d.NEED&&l(e)&&!o(e,r)&&c(e),e}}},65147:function(e,t,n){"use strict";var r=n(15635),i=n(82855),o=n(37446),a=n(51035),s=n(56784),l=n(97818),u=Object.assign;e.exports=!u||n(35511)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=s(e),u=arguments.length,c=1,d=o.f,f=a.f;u>c;)for(var h,p=l(arguments[c++]),m=d?i(p).concat(d(p)):i(p),g=m.length,y=0;g>y;)h=m[y++],(!r||f.call(p,h))&&(n[h]=p[h]);return n}:u},62763:function(e,t,n){var r=n(67188),i=n(6624),o=n(13020),a=n(79740)("IE_PROTO"),s=function(){},l="prototype",u=function(){var e,t=n(54039)("iframe"),r=o.length;for(t.style.display="none",n(48484).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write(""),e.close(),u=e.F;r--;)delete u[l][o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[l]=r(e),n=new s,s[l]=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},1899:function(e,t,n){var r=n(67188),i=n(79597),o=n(57747),a=Object.defineProperty;t.f=n(15635)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},6624:function(e,t,n){var r=n(1899),i=n(67188),o=n(82855);e.exports=n(15635)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,l=0;s>l;)r.f(e,n=a[l++],t[n]);return e}},66999:function(e,t,n){var r=n(51035),i=n(98070),o=n(7826),a=n(57747),s=n(77276),l=n(79597),u=Object.getOwnPropertyDescriptor;t.f=n(15635)?u:function(e,t){if(e=o(e),t=a(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},8455:function(e,t,n){var r=n(7826),i=n(42057).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(e){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?s(e):i(r(e))}},42057:function(e,t,n){var r=n(93222),i=n(13020).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},37446:function(e,t){t.f=Object.getOwnPropertySymbols},34021:function(e,t,n){var r=n(77276),i=n(56784),o=n(79740)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return r(e=i(e),o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},93222:function(e,t,n){var r=n(77276),i=n(7826),o=n(63527)(!1),a=n(79740)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),l=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~o(u,n)||u.push(n));return u}},82855:function(e,t,n){var r=n(93222),i=n(13020);e.exports=Object.keys||function(e){return r(e,i)}},51035:function(e,t){t.f=({}).propertyIsEnumerable},55921:function(e,t,n){var r=n(74015),i=n(90687),o=n(35511);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},98070:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},10682:function(e,t,n){e.exports=n(79751)},11633:function(e,t,n){var r=n(73656),i=n(67188),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(2257)(Function.call,n(66999).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},44614:function(e,t,n){var r=n(1899).f,i=n(77276),o=n(16964)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},79740:function(e,t,n){var r=n(5035)("keys"),i=n(86733);e.exports=function(e){return r[e]||(r[e]=i(e))}},5035:function(e,t,n){var r=n(90687),i=n(9054),o="__core-js_shared__",a=i[o]||(i[o]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(23e3)?"pure":"global",copyright:"\xa9 2020 Denis Pushkarev (zloirock.ru)"})},55755:function(e,t,n){var r=n(67050),i=n(26064);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),l=r(n),u=s.length;return l<0||l>=u?e?"":void 0:(o=s.charCodeAt(l))<55296||o>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):o:e?s.slice(l,l+2):(o-55296<<10)+(a-56320)+65536}}},56481:function(e,t,n){var r=n(67050),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},67050:function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},7826:function(e,t,n){var r=n(97818),i=n(26064);e.exports=function(e){return r(i(e))}},95065:function(e,t,n){var r=n(67050),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},56784:function(e,t,n){var r=n(26064);e.exports=function(e){return Object(r(e))}},57747:function(e,t,n){var r=n(73656);e.exports=function(e,t){var n,i;if(!r(e))return e;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e))||"function"==typeof(n=e.valueOf)&&!r(i=n.call(e))||!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},86733:function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},95898:function(e,t,n){var r=n(9054),i=n(90687),o=n(23e3),a=n(9480),s=n(1899).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},9480:function(e,t,n){t.f=n(16964)},16964:function(e,t,n){var r=n(5035)("wks"),i=n(86733),o=n(9054).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},56518:function(e,t,n){"use strict";var r=n(57568),i=n(69631),o=n(38301),a=n(7826);e.exports=n(51686)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},67497:function(e,t,n){var r=n(74015);r(r.S+r.F,"Object",{assign:n(65147)})},28857:function(e,t,n){var r=n(74015);r(r.S,"Object",{create:n(62763)})},14791:function(e,t,n){var r=n(74015);r(r.S+!n(15635)*r.F,"Object",{defineProperty:n(1899).f})},80423:function(e,t,n){var r=n(56784),i=n(34021);n(55921)("getPrototypeOf",function(){return function(e){return i(r(e))}})},29857:function(e,t,n){var r=n(74015);r(r.S,"Object",{setPrototypeOf:n(11633).set})},43711:function(){},56235:function(e,t,n){"use strict";var r=n(55755)(!0);n(51686)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},29557:function(e,t,n){"use strict";var r=n(9054),i=n(77276),o=n(15635),a=n(74015),s=n(10682),l=n(9899).KEY,u=n(35511),c=n(5035),d=n(44614),f=n(86733),h=n(16964),p=n(9480),m=n(95898),g=n(87452),y=n(79102),v=n(67188),b=n(73656),w=n(56784),x=n(7826),k=n(57747),_=n(98070),S=n(62763),O=n(8455),C=n(66999),E=n(37446),P=n(1899),j=n(82855),T=C.f,A=P.f,I=O.f,M=r.Symbol,z=r.JSON,R=z&&z.stringify,N="prototype",D=h("_hidden"),L=h("toPrimitive"),F={}.propertyIsEnumerable,q=c("symbol-registry"),Z=c("symbols"),U=c("op-symbols"),$=Object[N],V="function"==typeof M&&!!E.f,B=r.QObject,H=!B||!B[N]||!B[N].findChild,K=o&&u(function(){return 7!=S(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=T($,t);r&&delete $[t],A(e,t,n),r&&e!==$&&A($,t,r)}:A,W=function(e){var t=Z[e]=S(M[N]);return t._k=e,t},J=V&&"symbol"==typeof M.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof M},G=function(e,t,n){return(e===$&&G(U,t,n),v(e),t=k(t,!0),v(n),i(Z,t))?(n.enumerable?(i(e,D)&&e[D][t]&&(e[D][t]=!1),n=S(n,{enumerable:_(0,!1)})):(i(e,D)||A(e,D,_(1,{})),e[D][t]=!0),K(e,t,n)):A(e,t,n)},Q=function(e,t){v(e);for(var n,r=g(t=x(t)),i=0,o=r.length;o>i;)G(e,n=r[i++],t[n]);return e},Y=function(e){var t=F.call(this,e=k(e,!0));return(!(this===$&&i(Z,e))||!!i(U,e))&&(!(t||!i(this,e)||!i(Z,e)||i(this,D)&&this[D][e])||t)},X=function(e,t){if(e=x(e),t=k(t,!0),!(e===$&&i(Z,t))||i(U,t)){var n=T(e,t);return n&&i(Z,t)&&!(i(e,D)&&e[D][t])&&(n.enumerable=!0),n}},ee=function(e){for(var t,n=I(x(e)),r=[],o=0;n.length>o;)i(Z,t=n[o++])||t==D||t==l||r.push(t);return r},et=function(e){for(var t,n=e===$,r=I(n?U:x(e)),o=[],a=0;r.length>a;)i(Z,t=r[a++])&&(!n||i($,t))&&o.push(Z[t]);return o};V||(s((M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===$&&t.call(U,n),i(this,D)&&i(this[D],e)&&(this[D][e]=!1),K(this,e,_(1,n))};return o&&H&&K($,e,{configurable:!0,set:t}),W(e)})[N],"toString",function(){return this._k}),C.f=X,P.f=G,n(42057).f=O.f=ee,n(51035).f=Y,E.f=et,o&&!n(23e3)&&s($,"propertyIsEnumerable",Y,!0),p.f=function(e){return W(h(e))}),a(a.G+a.W+!V*a.F,{Symbol:M});for(var en="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),er=0;en.length>er;)h(en[er++]);for(var ei=j(h.store),eo=0;ei.length>eo;)m(ei[eo++]);a(a.S+!V*a.F,"Symbol",{for:function(e){return i(q,e+="")?q[e]:q[e]=M(e)},keyFor:function(e){if(!J(e))throw TypeError(e+" is not a symbol!");for(var t in q)if(q[t]===e)return t},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+!V*a.F,"Object",{create:function(e,t){return void 0===t?S(e):Q(S(e),t)},defineProperty:G,defineProperties:Q,getOwnPropertyDescriptor:X,getOwnPropertyNames:ee,getOwnPropertySymbols:et});var ea=u(function(){E.f(1)});a(a.S+a.F*ea,"Object",{getOwnPropertySymbols:function(e){return E.f(w(e))}}),z&&a(a.S+a.F*(!V||u(function(){var e=M();return"[null]"!=R([e])||"{}"!=R({a:e})||"{}"!=R(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],!(!b(t)&&void 0===e||J(e)))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!J(t))return t}),r[1]=t,R.apply(z,r)}}),M[N][L]||n(79751)(M[N],L,M[N].valueOf),d(M,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},66894:function(e,t,n){n(95898)("asyncIterator")},1373:function(e,t,n){n(95898)("observable")},60076:function(e,t,n){n(56518);for(var r=n(9054),i=n(79751),o=n(38301),a=n(16964)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;le.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o=function(){for(var e=arguments.length,t=Array(e),n=0;n!!e&&n.indexOf(e)===t).join(" ")};/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let s=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:u="",children:c,iconNode:d,...f}=e;return(0,r.createElement)("svg",{ref:t,...a,width:i,height:i,stroke:n,strokeWidth:l?24*Number(s)/Number(i):s,className:o("lucide",u),...f},[...d.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(c)?c:[c]])}),l=(e,t)=>{let n=(0,r.forwardRef)((n,a)=>{let{className:l,...u}=n;return(0,r.createElement)(s,{ref:a,iconNode:t,className:o("lucide-".concat(i(e)),l),...u})});return n.displayName="".concat(e),n}},94207:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},10462:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("BrainCircuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]])},22468:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},42421:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},1282:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},92940:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},71935:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},6884:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},60287:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]])},55182:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]])},30690:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},29178:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},54817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},64341:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},11240:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/** + * @license lucide-react v0.379.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */let r=(0,n(78030).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},99949:function(e,t,n){"use strict";var r=n(88877);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},41448:function(e,t,n){e.exports=n(99949)()},88877:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},46260:function(e,t,n){"use strict";var r=f(n(87430)),i=f(n(42291)),o=f(n(75246)),a=f(n(82244)),s=f(n(93365)),l=f(n(7607)),u=f(n(2265)),c=f(n(41448)),d=f(n(71451));function f(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(){(0,o.default)(this,t);for(var e,n,r,a=arguments.length,l=Array(a),u=0;ue.error.message});async function l({prompt:e,downloadImplementation:t=i.LR}){let n;let o=function(e){let t;let n=[];for(let{role:r,content:i}of e)switch(r){case"system":(null==t?void 0:t.type)!=="system"&&(t={type:"system",messages:[]},n.push(t)),t.messages.push({role:r,content:i});break;case"assistant":(null==t?void 0:t.type)!=="assistant"&&(t={type:"assistant",messages:[]},n.push(t)),t.messages.push({role:r,content:i});break;case"user":case"tool":(null==t?void 0:t.type)!=="user"&&(t={type:"user",messages:[]},n.push(t)),t.messages.push({role:r,content:i});break;default:throw Error(`Unsupported role: ${r}`)}return n}(e),a=[];for(let e of o){let o=e.type;switch(o){case"system":if(null!=n)throw new r.A_({functionality:"Multiple system messages that are separated by user/assistant messages"});n=e.messages.map(({content:e})=>e).join("\n");break;case"user":{let n=[];for(let{role:r,content:o}of e.messages)switch(r){case"user":for(let e of o)switch(e.type){case"text":n.push({type:"text",text:e.text});break;case"image":{let r,o;if(e.image instanceof URL){let n=await t({url:e.image});r=n.data,o=n.mimeType}else r=e.image,o=e.mimeType;n.push({type:"image",source:{type:"base64",media_type:null!=o?o:"image/jpeg",data:(0,i.k0)(r)}})}}break;case"tool":for(let e of o)n.push({type:"tool_result",tool_use_id:e.toolCallId,content:JSON.stringify(e.result),is_error:e.isError});break;default:throw Error(`Unsupported role: ${r}`)}a.push({role:"user",content:n});break}case"assistant":{if(e.messages.length>1)throw new r.A_({functionality:"Multiple assistant messages in block"});let{content:t}=e.messages[0];a.push({role:"assistant",content:t.map(e=>{switch(e.type){case"text":return{type:"text",text:e.text};case"tool-call":return{type:"tool_use",id:e.toolCallId,name:e.toolName,input:e.args}}})});break}default:throw Error(`Unsupported type: ${o}`)}}return{system:n,messages:a}}function u(e){switch(e){case"end_turn":case"stop_sequence":return"stop";case"tool_use":return"tool-calls";case"max_tokens":return"length";default:return"other"}}var c=class{constructor(e,t,n){this.specificationVersion="v1",this.defaultObjectGenerationMode="tool",this.modelId=e,this.settings=t,this.config=n}get provider(){return this.config.provider}async getArgs({mode:e,prompt:t,maxTokens:n,temperature:i,topP:o,frequencyPenalty:a,presencePenalty:s,seed:u}){let c=e.type,d=[];null!=a&&d.push({type:"unsupported-setting",setting:"frequencyPenalty"}),null!=s&&d.push({type:"unsupported-setting",setting:"presencePenalty"}),null!=u&&d.push({type:"unsupported-setting",setting:"seed"});let f=await l({prompt:t}),h={model:this.modelId,top_k:this.settings.topK,max_tokens:null!=n?n:4096,temperature:i,top_p:o,system:f.system,messages:f.messages};switch(c){case"regular":return{args:{...h,...function(e){var t;let n=(null==(t=e.tools)?void 0:t.length)?e.tools:void 0;if(null==n)return{tools:void 0,tool_choice:void 0};let r=n.map(e=>({name:e.name,description:e.description,input_schema:e.parameters})),i=e.toolChoice;if(null==i)return{tools:r,tool_choice:void 0};let o=i.type;switch(o){case"auto":return{tools:r,tool_choice:{type:"auto"}};case"required":return{tools:r,tool_choice:{type:"any"}};case"none":return{tools:void 0,tool_choice:void 0};case"tool":return{tools:r,tool_choice:{type:"tool",name:i.toolName}};default:throw Error(`Unsupported tool choice type: ${o}`)}}(e)},warnings:d};case"object-json":throw new r.A_({functionality:"json-mode object generation"});case"object-tool":{let{name:t,description:n,parameters:r}=e.tool;return h.messages[h.messages.length-1].content.push({type:"text",text:` + +Use the '${t}' tool.`}),{args:{...h,tools:[{name:t,description:n,input_schema:r}]},warnings:d}}case"object-grammar":throw new r.A_({functionality:"grammar-mode object generation"});default:throw Error(`Unsupported type: ${c}`)}}async doGenerate(e){let t;let{args:n,warnings:r}=await this.getArgs(e),{responseHeaders:o,value:a}=await (0,i.A8)({url:`${this.config.baseURL}/messages`,headers:this.config.headers(),body:n,failedResponseHandler:s,successfulResponseHandler:(0,i.tc)(d),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:l,...c}=n,f="";for(let e of a.content)"text"===e.type&&(f+=e.text);if(a.content.some(e=>"tool_use"===e.type))for(let e of(t=[],a.content))"tool_use"===e.type&&t.push({toolCallType:"function",toolCallId:e.id,toolName:e.name,args:JSON.stringify(e.input)});return{text:f,toolCalls:t,finishReason:u(a.stop_reason),usage:{promptTokens:a.usage.input_tokens,completionTokens:a.usage.output_tokens},rawCall:{rawPrompt:l,rawSettings:c},rawResponse:{headers:o},warnings:r}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),{responseHeaders:r,value:o}=await (0,i.A8)({url:`${this.config.baseURL}/messages`,headers:this.config.headers(),body:{...t,stream:!0},failedResponseHandler:s,successfulResponseHandler:(0,i.cP)(f),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:a,...l}=t,c="other",d={promptTokens:Number.NaN,completionTokens:Number.NaN},h={};return{stream:o.pipeThrough(new TransformStream({transform(e,t){if(!e.success){t.enqueue({type:"error",error:e.error});return}let n=e.value;switch(n.type){case"ping":return;case"content_block_start":{let e=n.content_block.type;switch(e){case"text":return;case"tool_use":h[n.index]={toolCallId:n.content_block.id,toolName:n.content_block.name,jsonText:""};return;default:throw Error(`Unsupported content block type: ${e}`)}}case"content_block_stop":if(null!=h[n.index]){let e=h[n.index];t.enqueue({type:"tool-call",toolCallType:"function",toolCallId:e.toolCallId,toolName:e.toolName,args:e.jsonText}),delete h[n.index]}return;case"content_block_delta":{let e=n.delta.type;switch(e){case"text_delta":t.enqueue({type:"text-delta",textDelta:n.delta.text});return;case"input_json_delta":{let e=h[n.index];t.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:e.toolCallId,toolName:e.toolName,argsTextDelta:n.delta.partial_json}),e.jsonText+=n.delta.partial_json;return}default:throw Error(`Unsupported delta type: ${e}`)}}case"message_start":d.promptTokens=n.message.usage.input_tokens,d.completionTokens=n.message.usage.output_tokens;return;case"message_delta":d.completionTokens=n.usage.output_tokens,c=u(n.delta.stop_reason);return;case"message_stop":t.enqueue({type:"finish",finishReason:c,usage:d});return;default:throw Error(`Unsupported chunk type: ${n}`)}}})),rawCall:{rawPrompt:a,rawSettings:l},rawResponse:{headers:r},warnings:n}}},d=o.z.object({type:o.z.literal("message"),content:o.z.array(o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("text"),text:o.z.string()}),o.z.object({type:o.z.literal("tool_use"),id:o.z.string(),name:o.z.string(),input:o.z.unknown()})])),stop_reason:o.z.string().optional().nullable(),usage:o.z.object({input_tokens:o.z.number(),output_tokens:o.z.number()})}),f=o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("message_start"),message:o.z.object({usage:o.z.object({input_tokens:o.z.number(),output_tokens:o.z.number()})})}),o.z.object({type:o.z.literal("content_block_start"),index:o.z.number(),content_block:o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("text"),text:o.z.string()}),o.z.object({type:o.z.literal("tool_use"),id:o.z.string(),name:o.z.string()})])}),o.z.object({type:o.z.literal("content_block_delta"),index:o.z.number(),delta:o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("input_json_delta"),partial_json:o.z.string()}),o.z.object({type:o.z.literal("text_delta"),text:o.z.string()})])}),o.z.object({type:o.z.literal("content_block_stop"),index:o.z.number()}),o.z.object({type:o.z.literal("message_delta"),delta:o.z.object({stop_reason:o.z.string().optional().nullable()}),usage:o.z.object({output_tokens:o.z.number()})}),o.z.object({type:o.z.literal("message_stop")}),o.z.object({type:o.z.literal("ping")})]);function h(e={}){var t,n;let r=null!=(n=(0,i.QT)(null!=(t=e.baseURL)?t:e.baseUrl))?n:"https://api.anthropic.com/v1",o=()=>({"anthropic-version":"2023-06-01","x-api-key":(0,i.pd)({apiKey:e.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"}),...e.headers}),a=(t,n={})=>new c(t,n,{provider:"anthropic.messages",baseURL:r,headers:o,fetch:e.fetch}),s=function(e,t){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return a(e,t)};return s.languageModel=a,s.chat=a,s.messages=a,s}h()},91334:function(e,t,n){"use strict";n.d(t,{JV:function(){return b}});var r=n(97220),i=n(41338),o=n(59772);function a(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.content)?void 0:t.map(({token:e,logprob:t,top_logprobs:n})=>({token:e,logprob:t,topLogprobs:n?n.map(({token:e,logprob:t})=>({token:e,logprob:t})):[]})))?n:void 0}function s(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var l=o.z.object({error:o.z.object({message:o.z.string(),type:o.z.string(),param:o.z.any().nullable(),code:o.z.string().nullable()})}),u=(0,i.Sq)({errorSchema:l,errorToMessage:e=>e.error.message}),c=class{constructor(e,t,n){this.specificationVersion="v1",this.defaultObjectGenerationMode="tool",this.modelId=e,this.settings=t,this.config=n}get provider(){return this.config.provider}getArgs({mode:e,prompt:t,maxTokens:n,temperature:o,topP:a,frequencyPenalty:s,presencePenalty:l,seed:u}){let c=e.type,d={model:this.modelId,logit_bias:this.settings.logitBias,logprobs:!0===this.settings.logprobs||"number"==typeof this.settings.logprobs||void 0,top_logprobs:"number"==typeof this.settings.logprobs?this.settings.logprobs:"boolean"==typeof this.settings.logprobs&&this.settings.logprobs?0:void 0,user:this.settings.user,parallel_tool_calls:this.settings.parallelToolCalls,max_tokens:n,temperature:o,top_p:a,frequency_penalty:s,presence_penalty:l,seed:u,messages:function(e){let t=[];for(let{role:n,content:r}of e)switch(n){case"system":t.push({role:"system",content:r});break;case"user":if(1===r.length&&"text"===r[0].type){t.push({role:"user",content:r[0].text});break}t.push({role:"user",content:r.map(e=>{var t;switch(e.type){case"text":return{type:"text",text:e.text};case"image":return{type:"image_url",image_url:{url:e.image instanceof URL?e.image.toString():`data:${null!=(t=e.mimeType)?t:"image/jpeg"};base64,${(0,i.k0)(e.image)}`}}}})});break;case"assistant":{let e="",n=[];for(let t of r)switch(t.type){case"text":e+=t.text;break;case"tool-call":n.push({id:t.toolCallId,type:"function",function:{name:t.toolName,arguments:JSON.stringify(t.args)}});break;default:throw Error(`Unsupported part: ${t}`)}t.push({role:"assistant",content:e,tool_calls:n.length>0?n:void 0});break}case"tool":for(let e of r)t.push({role:"tool",tool_call_id:e.toolCallId,content:JSON.stringify(e.result)});break;default:throw Error(`Unsupported role: ${n}`)}return t}(t)};switch(c){case"regular":return{...d,...function(e){var t;let n=(null==(t=e.tools)?void 0:t.length)?e.tools:void 0;if(null==n)return{tools:void 0,tool_choice:void 0};let r=n.map(e=>({type:"function",function:{name:e.name,description:e.description,parameters:e.parameters}})),i=e.toolChoice;if(null==i)return{tools:r,tool_choice:void 0};let o=i.type;switch(o){case"auto":case"none":case"required":return{tools:r,tool_choice:o};case"tool":return{tools:r,tool_choice:{type:"function",function:{name:i.toolName}}};default:throw Error(`Unsupported tool choice type: ${o}`)}}(e)};case"object-json":return{...d,response_format:{type:"json_object"}};case"object-tool":return{...d,tool_choice:{type:"function",function:{name:e.tool.name}},tools:[{type:"function",function:{name:e.tool.name,description:e.tool.description,parameters:e.tool.parameters}}]};case"object-grammar":throw new r.A_({functionality:"object-grammar mode"});default:throw Error(`Unsupported type: ${c}`)}}async doGenerate(e){var t,n;let r=this.getArgs(e),{responseHeaders:o,value:l}=await (0,i.A8)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:this.config.headers(),body:r,failedResponseHandler:u,successfulResponseHandler:(0,i.tc)(d),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:c,...f}=r,h=l.choices[0];return{text:null!=(t=h.message.content)?t:void 0,toolCalls:null==(n=h.message.tool_calls)?void 0:n.map(e=>{var t;return{toolCallType:"function",toolCallId:null!=(t=e.id)?t:(0,i.Ox)(),toolName:e.function.name,args:e.function.arguments}}),finishReason:s(h.finish_reason),usage:{promptTokens:l.usage.prompt_tokens,completionTokens:l.usage.completion_tokens},rawCall:{rawPrompt:c,rawSettings:f},rawResponse:{headers:o},warnings:[],logprobs:a(h.logprobs)}}async doStream(e){let t;let n=this.getArgs(e),{responseHeaders:o,value:l}=await (0,i.A8)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:this.config.headers(),body:{...n,stream:!0,stream_options:"strict"===this.config.compatibility?{include_usage:!0}:void 0},failedResponseHandler:u,successfulResponseHandler:(0,i.cP)(f),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:c,...d}=n,h=[],p="other",m={promptTokens:Number.NaN,completionTokens:Number.NaN};return{stream:l.pipeThrough(new TransformStream({transform(e,n){var o,l,u,c,d,f,g,y,v,b,w,x;if(!e.success){p="error",n.enqueue({type:"error",error:e.error});return}let k=e.value;if("error"in k){p="error",n.enqueue({type:"error",error:k.error});return}null!=k.usage&&(m={promptTokens:k.usage.prompt_tokens,completionTokens:k.usage.completion_tokens});let _=k.choices[0];if((null==_?void 0:_.finish_reason)!=null&&(p=s(_.finish_reason)),(null==_?void 0:_.delta)==null)return;let S=_.delta;null!=S.content&&n.enqueue({type:"text-delta",textDelta:S.content});let O=a(null==_?void 0:_.logprobs);if((null==O?void 0:O.length)&&(void 0===t&&(t=[]),t.push(...O)),null!=S.tool_calls)for(let e of S.tool_calls){let t=e.index;if(null==h[t]){if("function"!==e.type)throw new r.Rt({data:e,message:"Expected 'function' type."});if(null==e.id)throw new r.Rt({data:e,message:"Expected 'id' to be a string."});if((null==(o=e.function)?void 0:o.name)==null)throw new r.Rt({data:e,message:"Expected 'function.name' to be a string."});h[t]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=(l=e.function.arguments)?l:""}};let a=h[t];(null==(u=a.function)?void 0:u.name)!=null&&(null==(c=a.function)?void 0:c.arguments)!=null&&(0,i.Gr)(a.function.arguments)&&(n.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:a.id,toolName:a.function.name,argsTextDelta:a.function.arguments}),n.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(d=a.id)?d:(0,i.Ox)(),toolName:a.function.name,args:a.function.arguments}));continue}let a=h[t];(null==(f=e.function)?void 0:f.arguments)!=null&&(a.function.arguments+=null!=(y=null==(g=e.function)?void 0:g.arguments)?y:""),n.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:a.id,toolName:a.function.name,argsTextDelta:null!=(v=e.function.arguments)?v:""}),(null==(b=a.function)?void 0:b.name)!=null&&(null==(w=a.function)?void 0:w.arguments)!=null&&(0,i.Gr)(a.function.arguments)&&n.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(x=a.id)?x:(0,i.Ox)(),toolName:a.function.name,args:a.function.arguments})}},flush(e){e.enqueue({type:"finish",finishReason:p,logprobs:t,usage:m})}})),rawCall:{rawPrompt:c,rawSettings:d},rawResponse:{headers:o},warnings:[]}}},d=o.z.object({choices:o.z.array(o.z.object({message:o.z.object({role:o.z.literal("assistant"),content:o.z.string().nullable().optional(),tool_calls:o.z.array(o.z.object({id:o.z.string().optional().nullable(),type:o.z.literal("function"),function:o.z.object({name:o.z.string(),arguments:o.z.string()})})).optional()}),index:o.z.number(),logprobs:o.z.object({content:o.z.array(o.z.object({token:o.z.string(),logprob:o.z.number(),top_logprobs:o.z.array(o.z.object({token:o.z.string(),logprob:o.z.number()}))})).nullable()}).nullable().optional(),finish_reason:o.z.string().optional().nullable()})),usage:o.z.object({prompt_tokens:o.z.number(),completion_tokens:o.z.number()})}),f=o.z.union([o.z.object({choices:o.z.array(o.z.object({delta:o.z.object({role:o.z.enum(["assistant"]).optional(),content:o.z.string().nullish(),tool_calls:o.z.array(o.z.object({index:o.z.number(),id:o.z.string().nullish(),type:o.z.literal("function").optional(),function:o.z.object({name:o.z.string().nullish(),arguments:o.z.string().nullish()})})).nullish()}).nullish(),logprobs:o.z.object({content:o.z.array(o.z.object({token:o.z.string(),logprob:o.z.number(),top_logprobs:o.z.array(o.z.object({token:o.z.string(),logprob:o.z.number()}))})).nullable()}).nullish(),finish_reason:o.z.string().nullable().optional(),index:o.z.number()})),usage:o.z.object({prompt_tokens:o.z.number(),completion_tokens:o.z.number()}).nullish()}),l]);function h(e){return null==e?void 0:e.tokens.map((t,n)=>({token:t,logprob:e.token_logprobs[n],topLogprobs:e.top_logprobs?Object.entries(e.top_logprobs[n]).map(([e,t])=>({token:e,logprob:t})):[]}))}var p=class{constructor(e,t,n){this.specificationVersion="v1",this.defaultObjectGenerationMode=void 0,this.modelId=e,this.settings=t,this.config=n}get provider(){return this.config.provider}getArgs({mode:e,inputFormat:t,prompt:n,maxTokens:i,temperature:o,topP:a,frequencyPenalty:s,presencePenalty:l,seed:u}){var c;let d=e.type,{prompt:f,stopSequences:h}=function({prompt:e,inputFormat:t,user:n="user",assistant:i="assistant"}){if("prompt"===t&&1===e.length&&"user"===e[0].role&&1===e[0].content.length&&"text"===e[0].content[0].type)return{prompt:e[0].content[0].text};let o="";for(let{role:t,content:a}of("system"===e[0].role&&(o+=`${e[0].content} + +`,e=e.slice(1)),e))switch(t){case"system":throw new r.Mt({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{let e=a.map(e=>{switch(e.type){case"text":return e.text;case"image":throw new r.A_({functionality:"images"})}}).join("");o+=`${n}: +${e} + +`;break}case"assistant":{let e=a.map(e=>{switch(e.type){case"text":return e.text;case"tool-call":throw new r.A_({functionality:"tool-call messages"})}}).join("");o+=`${i}: +${e} + +`;break}case"tool":throw new r.A_({functionality:"tool messages"});default:throw Error(`Unsupported role: ${t}`)}return{prompt:o+=`${i}: +`,stopSequences:[` +${n}:`]}}({prompt:n,inputFormat:t}),p={model:this.modelId,echo:this.settings.echo,logit_bias:this.settings.logitBias,logprobs:"number"==typeof this.settings.logprobs?this.settings.logprobs:"boolean"==typeof this.settings.logprobs&&this.settings.logprobs?0:void 0,suffix:this.settings.suffix,user:this.settings.user,max_tokens:i,temperature:o,top_p:a,frequency_penalty:s,presence_penalty:l,seed:u,prompt:f,stop:h};switch(d){case"regular":if(null==(c=e.tools)?void 0:c.length)throw new r.A_({functionality:"tools"});if(e.toolChoice)throw new r.A_({functionality:"toolChoice"});return p;case"object-json":throw new r.A_({functionality:"object-json mode"});case"object-tool":throw new r.A_({functionality:"object-tool mode"});case"object-grammar":throw new r.A_({functionality:"object-grammar mode"});default:throw Error(`Unsupported type: ${d}`)}}async doGenerate(e){let t=this.getArgs(e),{responseHeaders:n,value:r}=await (0,i.A8)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:this.config.headers(),body:t,failedResponseHandler:u,successfulResponseHandler:(0,i.tc)(m),abortSignal:e.abortSignal,fetch:this.config.fetch}),{prompt:o,...a}=t,l=r.choices[0];return{text:l.text,usage:{promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens},finishReason:s(l.finish_reason),logprobs:h(l.logprobs),rawCall:{rawPrompt:o,rawSettings:a},rawResponse:{headers:n},warnings:[]}}async doStream(e){let t;let n=this.getArgs(e),{responseHeaders:r,value:o}=await (0,i.A8)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:this.config.headers(),body:{...this.getArgs(e),stream:!0,stream_options:"strict"===this.config.compatibility?{include_usage:!0}:void 0},failedResponseHandler:u,successfulResponseHandler:(0,i.cP)(g),abortSignal:e.abortSignal,fetch:this.config.fetch}),{prompt:a,...l}=n,c="other",d={promptTokens:Number.NaN,completionTokens:Number.NaN};return{stream:o.pipeThrough(new TransformStream({transform(e,n){if(!e.success){c="error",n.enqueue({type:"error",error:e.error});return}let r=e.value;if("error"in r){c="error",n.enqueue({type:"error",error:r.error});return}null!=r.usage&&(d={promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens});let i=r.choices[0];(null==i?void 0:i.finish_reason)!=null&&(c=s(i.finish_reason)),(null==i?void 0:i.text)!=null&&n.enqueue({type:"text-delta",textDelta:i.text});let o=h(null==i?void 0:i.logprobs);(null==o?void 0:o.length)&&(void 0===t&&(t=[]),t.push(...o))},flush(e){e.enqueue({type:"finish",finishReason:c,logprobs:t,usage:d})}})),rawCall:{rawPrompt:a,rawSettings:l},rawResponse:{headers:r},warnings:[]}}},m=o.z.object({choices:o.z.array(o.z.object({text:o.z.string(),finish_reason:o.z.string(),logprobs:o.z.object({tokens:o.z.array(o.z.string()),token_logprobs:o.z.array(o.z.number()),top_logprobs:o.z.array(o.z.record(o.z.string(),o.z.number())).nullable()}).nullable().optional()})),usage:o.z.object({prompt_tokens:o.z.number(),completion_tokens:o.z.number()})}),g=o.z.union([o.z.object({choices:o.z.array(o.z.object({text:o.z.string(),finish_reason:o.z.string().nullish(),index:o.z.number(),logprobs:o.z.object({tokens:o.z.array(o.z.string()),token_logprobs:o.z.array(o.z.number()),top_logprobs:o.z.array(o.z.record(o.z.string(),o.z.number())).nullable()}).nullable().optional()})),usage:o.z.object({prompt_tokens:o.z.number(),completion_tokens:o.z.number()}).optional().nullable()}),l]),y=class{constructor(e,t,n){this.specificationVersion="v1",this.modelId=e,this.settings=t,this.config=n}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var e;return null!=(e=this.settings.maxEmbeddingsPerCall)?e:2048}get supportsParallelCalls(){var e;return null==(e=this.settings.supportsParallelCalls)||e}async doEmbed({values:e,abortSignal:t}){if(e.length>this.maxEmbeddingsPerCall)throw new r.ON({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let{responseHeaders:n,value:o}=await (0,i.A8)({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:this.config.headers(),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:this.settings.dimensions,user:this.settings.user},failedResponseHandler:u,successfulResponseHandler:(0,i.tc)(v),abortSignal:t,fetch:this.config.fetch});return{embeddings:o.data.map(e=>e.embedding),rawResponse:{headers:n}}}},v=o.z.object({data:o.z.array(o.z.object({embedding:o.z.array(o.z.number())}))});function b(e={}){var t,n,r;let o=null!=(n=(0,i.QT)(null!=(t=e.baseURL)?t:e.baseUrl))?n:"https://api.openai.com/v1",a=null!=(r=e.compatibility)?r:"compatible",s=()=>({Authorization:`Bearer ${(0,i.pd)({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":e.organization,"OpenAI-Project":e.project,...e.headers}),l=(t,n={})=>new c(t,n,{provider:"openai.chat",url:({path:e})=>`${o}${e}`,headers:s,compatibility:a,fetch:e.fetch}),u=(t,n={})=>new p(t,n,{provider:"openai.completion",url:({path:e})=>`${o}${e}`,headers:s,compatibility:a,fetch:e.fetch}),d=(t,n={})=>new y(t,n,{provider:"openai.embedding",url:({path:e})=>`${o}${e}`,headers:s,fetch:e.fetch}),f=(e,t)=>{if(new.target)throw Error("The OpenAI model function cannot be called with the new keyword.");return"gpt-3.5-turbo-instruct"===e?u(e,t):l(e,t)},h=function(e,t){return f(e,t)};return h.languageModel=f,h.chat=l,h.completion=u,h.embedding=d,h.textEmbedding=d,h}b({compatibility:"strict"})},41338:function(e,t,n){"use strict";n.d(t,{MS:function(){return k},k0:function(){return _},cP:function(){return w},Sq:function(){return b},tc:function(){return x},LR:function(){return l},Ox:function(){return c},e$:function(){return d},D_:function(){return f},Gr:function(){return m},pd:function(){return h},A8:function(){return y},NX:function(){return p},QT:function(){return S}});var r=n(97220),i=n(60035);let o=[239,187,191];class a extends TransformStream{constructor(){let e;super({start(t){e=function(e){let t,n,r,i,a,s,l;return u(),{feed:function(u){var c;n=n?n+u:u,t&&(c=n,o.every((e,t)=>c.charCodeAt(t)===e))&&(n=n.slice(o.length)),t=!1;let d=n.length,f=0,h=!1;for(;f0&&(e({type:"event",id:a,event:s||void 0,data:l.slice(0,-1)}),l="",a=void 0),s=void 0;return}let o=r<0,u=t.slice(n,n+(o?i:r)),c=0;c=o?i:" "===t[n+r+1]?r+2:r+1;let d=n+c,f=i-c,h=t.slice(d,d+f).toString();if("data"===u)l+=h?"".concat(h,"\n"):"\n";else if("event"===u)s=h;else if("id"!==u||h.includes("\0")){if("retry"===u){let t=parseInt(h,10);Number.isNaN(t)||e({type:"reconnect-interval",value:t})}}else a=h}(n,f,u,o),f+=o+1}f===d?n="":f>0&&(n=n.slice(f))},reset:u};function u(){t=!0,n="",r=0,i=-1,a=void 0,s=void 0,l=""}}(e=>{"event"===e.type&&t.enqueue(e)})},transform(t){e.feed(t)}})}}var s=n(25566);async function l({url:e,fetchImplementation:t=fetch}){var n;let i=e.toString();try{let e=await t(i);if(!e.ok)throw new r.Bx({url:i,statusCode:e.status,statusText:e.statusText});return{data:new Uint8Array(await e.arrayBuffer()),mimeType:null!=(n=e.headers.get("content-type"))?n:void 0}}catch(e){if(r.Bx.isDownloadError(e))throw e;throw new r.Bx({url:i,cause:e})}}function u(e){let t={};return e.headers.forEach((e,n)=>{t[n]=e}),t}var c=((e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function d(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}function f(e){return e instanceof DOMException&&("AbortError"===e.name||"TimeoutError"===e.name)}function h({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:i}){if("string"==typeof e)return e;if(null!=e)throw new r.tZ({message:`${i} API key must be a string.`});if(void 0===s)throw new r.tZ({message:`${i} API key is missing. Pass it using the '${n}' parameter. Environment variables is not supported in this environment.`});if(null==(e=s.env[t]))throw new r.tZ({message:`${i} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if("string"!=typeof e)throw new r.tZ({message:`${i} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function p({text:e,schema:t}){try{let n=i.parse(e);if(null==t)return{success:!0,value:n};return function({value:e,schema:t}){try{let n=t.safeParse(e);if(n.success)return{success:!0,value:n.data};return{success:!1,error:new r.Gz({value:e,cause:n.error})}}catch(t){return{success:!1,error:r.Gz.isTypeValidationError(t)?t:new r.Gz({value:e,cause:t})}}}({value:n,schema:t})}catch(t){return{success:!1,error:r.xU.isJSONParseError(t)?t:new r.xU({text:e,cause:t})}}}function m(e){try{return i.parse(e),!0}catch(e){return!1}}var g=()=>fetch,y=async({url:e,headers:t,body:n,failedResponseHandler:r,successfulResponseHandler:i,abortSignal:o,fetch:a})=>v({url:e,headers:{...t,"Content-Type":"application/json"},body:{content:JSON.stringify(n),values:n},failedResponseHandler:r,successfulResponseHandler:i,abortSignal:o,fetch:a}),v=async({url:e,headers:t={},body:n,successfulResponseHandler:i,failedResponseHandler:o,abortSignal:a,fetch:s=g()})=>{try{let l=Object.fromEntries(Object.entries(t).filter(([e,t])=>null!=t)),c=await s(e,{method:"POST",headers:l,body:n.content,signal:a}),d=u(c);if(!c.ok){let t;try{t=await o({response:c,url:e,requestBodyValues:n.values})}catch(t){if(f(t)||r.w.isAPICallError(t))throw t;throw new r.w({message:"Failed to process error response",cause:t,statusCode:c.status,url:e,responseHeaders:d,requestBodyValues:n.values})}throw t.value}try{return await i({response:c,url:e,requestBodyValues:n.values})}catch(t){if(t instanceof Error&&(f(t)||r.w.isAPICallError(t)))throw t;throw new r.w({message:"Failed to process successful response",cause:t,statusCode:c.status,url:e,responseHeaders:d,requestBodyValues:n.values})}}catch(t){if(f(t))throw t;if(t instanceof TypeError&&"fetch failed"===t.message){let i=t.cause;if(null!=i)throw new r.w({message:`Cannot connect to API: ${i.message}`,cause:i,url:e,requestBodyValues:n.values,isRetryable:!0})}throw t}},b=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:o,url:a,requestBodyValues:s})=>{let l=await o.text(),c=u(o);if(""===l.trim())return{responseHeaders:c,value:new r.w({message:o.statusText,url:a,requestBodyValues:s,statusCode:o.status,responseHeaders:c,responseBody:l,isRetryable:null==n?void 0:n(o)})};try{let u=function({text:e,schema:t}){try{let n=i.parse(e);if(null==t)return n;return function({value:e,schema:t}){try{return t.parse(e)}catch(t){throw new r.Gz({value:e,cause:t})}}({value:n,schema:t})}catch(t){if(r.xU.isJSONParseError(t)||r.Gz.isTypeValidationError(t))throw t;throw new r.xU({text:e,cause:t})}}({text:l,schema:e});return{responseHeaders:c,value:new r.w({message:t(u),url:a,requestBodyValues:s,statusCode:o.status,responseHeaders:c,responseBody:l,data:u,isRetryable:null==n?void 0:n(o,u)})}}catch(e){return{responseHeaders:c,value:new r.w({message:o.statusText,url:a,requestBodyValues:s,statusCode:o.status,responseHeaders:c,responseBody:l,isRetryable:null==n?void 0:n(o)})}}},w=e=>async({response:t})=>{let n=u(t);if(null==t.body)throw new r.g8({});return{responseHeaders:n,value:t.body.pipeThrough(new TextDecoderStream).pipeThrough(new a).pipeThrough(new TransformStream({transform({data:t},n){"[DONE]"!==t&&n.enqueue(p({text:t,schema:e}))}}))}},x=e=>async({response:t,url:n,requestBodyValues:i})=>{let o=await t.text(),a=p({text:o,schema:e}),s=u(t);if(!a.success)throw new r.w({message:"Invalid JSON response",cause:a.error,statusCode:t.status,responseHeaders:s,responseBody:o,url:n,requestBodyValues:i});return{responseHeaders:s,value:a.value}};function k(e){let t=globalThis.atob(e.replace(/-/g,"+").replace(/_/g,"/"));return Uint8Array.from(t,e=>e.codePointAt(0))}function _(e){let t="";for(let n=0;n=500),data:l}){super(e),this.name="AI_APICallError",this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=o,this.cause=a,this.isRetryable=s,this.data=l}static isAPICallError(e){return e instanceof Error&&"AI_APICallError"===e.name&&"string"==typeof e.url&&"object"==typeof e.requestBodyValues&&(null==e.statusCode||"number"==typeof e.statusCode)&&(null==e.responseHeaders||"object"==typeof e.responseHeaders)&&(null==e.responseBody||"string"==typeof e.responseBody)&&(null==e.cause||"object"==typeof e.cause)&&"boolean"==typeof e.isRetryable&&(null==e.data||"object"==typeof e.data)}toJSON(){return{name:this.name,message:this.message,url:this.url,requestBodyValues:this.requestBodyValues,statusCode:this.statusCode,responseHeaders:this.responseHeaders,responseBody:this.responseBody,cause:this.cause,isRetryable:this.isRetryable,data:this.data}}},i=class extends Error{constructor({url:e,statusCode:t,statusText:n,cause:r,message:i=null==r?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${r}`}){super(i),this.name="AI_DownloadError",this.url=e,this.statusCode=t,this.statusText=n,this.cause=r}static isDownloadError(e){return e instanceof Error&&"AI_DownloadError"===e.name&&"string"==typeof e.url&&(null==e.statusCode||"number"==typeof e.statusCode)&&(null==e.statusText||"string"==typeof e.statusText)}toJSON(){return{name:this.name,message:this.message,url:this.url,statusCode:this.statusCode,statusText:this.statusText,cause:this.cause}}},o=class extends Error{constructor({message:e="Empty response body"}={}){super(e),this.name="AI_EmptyResponseBodyError"}static isEmptyResponseBodyError(e){return e instanceof Error&&"AI_EmptyResponseBodyError"===e.name}toJSON(){return{name:this.name,message:this.message,stack:this.stack}}},a=class extends Error{constructor({parameter:e,value:t,message:n}){super(`Invalid argument for parameter ${e}: ${n}`),this.name="AI_InvalidArgumentError",this.parameter=e,this.value=t}static isInvalidArgumentError(e){return e instanceof Error&&"AI_InvalidArgumentError"===e.name&&"string"==typeof e.parameter&&"string"==typeof e.value}toJSON(){return{name:this.name,message:this.message,stack:this.stack,parameter:this.parameter,value:this.value}}},s=class extends Error{constructor({content:e,cause:t,message:n=`Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ${typeof e}.`}){super(n),this.name="AI_InvalidDataContentError",this.cause=t,this.content=e}static isInvalidDataContentError(e){return e instanceof Error&&"AI_InvalidDataContentError"===e.name&&null!=e.content}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause,content:this.content}}},l=class extends Error{constructor({prompt:e,message:t}){super(`Invalid prompt: ${t}`),this.name="AI_InvalidPromptError",this.prompt=e}static isInvalidPromptError(e){return e instanceof Error&&"AI_InvalidPromptError"===e.name&&null!=prompt}toJSON(){return{name:this.name,message:this.message,stack:this.stack,prompt:this.prompt}}},u=class extends Error{constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super(t),this.name="AI_InvalidResponseDataError",this.data=e}static isInvalidResponseDataError(e){return e instanceof Error&&"AI_InvalidResponseDataError"===e.name&&null!=e.data}toJSON(){return{name:this.name,message:this.message,stack:this.stack,data:this.data}}};function c(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var d=class extends Error{constructor({toolArgs:e,toolName:t,cause:n,message:r=`Invalid arguments for tool ${t}: ${c(n)}`}){super(r),this.name="AI_InvalidToolArgumentsError",this.toolArgs=e,this.toolName=t,this.cause=n}static isInvalidToolArgumentsError(e){return e instanceof Error&&"AI_InvalidToolArgumentsError"===e.name&&"string"==typeof e.toolName&&"string"==typeof e.toolArgs}toJSON(){return{name:this.name,message:this.message,cause:this.cause,stack:this.stack,toolName:this.toolName,toolArgs:this.toolArgs}}},f=class extends Error{constructor({text:e,cause:t}){super(`JSON parsing failed: Text: ${e}. +Error message: ${c(t)}`),this.name="AI_JSONParseError",this.cause=t,this.text=e}static isJSONParseError(e){return e instanceof Error&&"AI_JSONParseError"===e.name&&"string"==typeof e.text&&"string"==typeof e.cause}toJSON(){return{name:this.name,message:this.message,cause:this.cause,stack:this.stack,valueText:this.text}}},h=class extends Error{constructor({message:e}){super(e),this.name="AI_LoadAPIKeyError"}static isLoadAPIKeyError(e){return e instanceof Error&&"AI_LoadAPIKeyError"===e.name}toJSON(){return{name:this.name,message:this.message}}},p=class extends Error{constructor({toolName:e,availableTools:t,message:n=`Model tried to call unavailable tool '${e}'. ${void 0===t?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super(n),this.name="AI_NoSuchToolError",this.toolName=e,this.availableTools=t}static isNoSuchToolError(e){return e instanceof Error&&"AI_NoSuchToolError"===e.name&&"toolName"in e&&void 0!=e.toolName&&"string"==typeof e.name}toJSON(){return{name:this.name,message:this.message,stack:this.stack,toolName:this.toolName,availableTools:this.availableTools}}},m=class extends Error{constructor({message:e,reason:t,errors:n}){super(e),this.name="AI_RetryError",this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isRetryError(e){return e instanceof Error&&"AI_RetryError"===e.name&&"string"==typeof e.reason&&Array.isArray(e.errors)}toJSON(){return{name:this.name,message:this.message,reason:this.reason,lastError:this.lastError,errors:this.errors}}},g=class extends Error{constructor(e){super(`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`),this.name="AI_TooManyEmbeddingValuesForCallError",this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInvalidPromptError(e){return e instanceof Error&&"AI_TooManyEmbeddingValuesForCallError"===e.name&&"provider"in e&&"string"==typeof e.provider&&"modelId"in e&&"string"==typeof e.modelId&&"maxEmbeddingsPerCall"in e&&"number"==typeof e.maxEmbeddingsPerCall&&"values"in e&&Array.isArray(e.values)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:this.values}}},y=class extends Error{constructor({value:e,cause:t}){super(`Type validation failed: Value: ${JSON.stringify(e)}. +Error message: ${c(t)}`),this.name="AI_TypeValidationError",this.cause=t,this.value=e}static isTypeValidationError(e){return e instanceof Error&&"AI_TypeValidationError"===e.name}toJSON(){return{name:this.name,message:this.message,cause:this.cause,stack:this.stack,value:this.value}}},v=class extends Error{constructor({functionality:e}){super(`'${e}' functionality not supported.`),this.name="AI_UnsupportedFunctionalityError",this.functionality=e}static isUnsupportedFunctionalityError(e){return e instanceof Error&&"AI_UnsupportedFunctionalityError"===e.name&&"string"==typeof e.functionality}toJSON(){return{name:this.name,message:this.message,stack:this.stack,functionality:this.functionality}}}},38364:function(e,t,n){"use strict";n.d(t,{f:function(){return a}});var r=n(22988),i=n(2265),o=n(25171);let a=(0,i.forwardRef)((e,t)=>(0,i.createElement)(o.WV.label,(0,r.Z)({},e,{ref:t,onMouseDown:t=>{var n;null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}})))},34939:function(e,t,n){"use strict";n.d(t,{j:function(){return o}});var r=n(49010),i=n(56298),o=new class extends r.l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!i.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}}},92812:function(e,t,n){"use strict";n.d(t,{R:function(){return s},m:function(){return a}});var r=n(69948),i=n(43494),o=n(30924),a=class extends i.F{#r;#i;#o;constructor(e){super(),this.mutationId=e.mutationId,this.#i=e.mutationCache,this.#r=[],this.state=e.state||s(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#i.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#i.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){this.#o=(0,o.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});let t="pending"===this.state.status,n=!this.#o.canStart();try{if(!t){this.#a({type:"pending",variables:e,isPaused:n}),await this.#i.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:n})}let r=await this.#o.start();return await this.#i.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#i.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#a({type:"success",data:r}),r}catch(t){try{throw await this.#i.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#i.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#a({type:"error",error:t})}}finally{this.#i.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),r.V.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#i.notify({mutation:this,type:"updated",action:e})})}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},69948:function(e,t,n){"use strict";n.d(t,{V:function(){return r}});var r=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=e=>setTimeout(e,0),o=r=>{t?e.push(r):i(()=>{n(r)})},a=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{--t||a()}return n},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}()},49937:function(e,t,n){"use strict";n.d(t,{N:function(){return o}});var r=n(49010),i=n(56298),o=new class extends r.l{#s=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!i.sk&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#s!==e&&(this.#s=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#s}}},43151:function(e,t,n){"use strict";n.d(t,{S:function(){return g}});var r=n(56298),i=n(69948),o=n(30924),a=n(43494),s=class extends a.F{#l;#u;#c;#o;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#l=e.state||function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=this.#l,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#o?.promise}setOptions(e){this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){let n=(0,r.oE)(this.state.data,e,this.options);return this.#a({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(r.ZT).catch(r.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#l)}isActive(){return this.observers.some(e=>!1!==e.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,r.Kp)(this.state.dataUpdatedAt,e)}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#f?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,n.signal)})},a={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{let e=(0,r.cG)(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return(i(n),this.#f=!1,this.options.persister)?this.options.persister(e,n,this):e(n)}};i(a),this.options.behavior?.onFetch(a,this),this.#u=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#a({type:"fetch",meta:a.fetchOptions?.meta});let s=e=>{(0,o.DV)(e)&&e.silent||this.#a({type:"error",error:e}),(0,o.DV)(e)||(this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#o=(0,o.Mz)({initialPromise:t?.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(void 0===e){s(Error(`${this.queryHash} data is undefined`));return}this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:s,onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#o.start()}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":var n,r;return{...t,...(n=t.data,r=this.options,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,o.Kw)(r.networkMode)?"fetching":"paused",...void 0===n&&{error:null,status:"pending"}}),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=e.error;if((0,o.DV)(i)&&i.revert&&this.#u)return{...this.#u,fetchStatus:"idle"};return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),i.V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}},l=n(49010),u=class extends l.l{constructor(e={}){super(),this.config=e,this.#h=new Map}#h;build(e,t,n){let i=t.queryKey,o=t.queryHash??(0,r.Rm)(i,t),a=this.get(o);return a||(a=new s({cache:this,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){this.#h.has(e.queryHash)||(this.#h.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#h.get(e.queryHash);t&&(e.destroy(),t===e&&this.#h.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){i.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#h.get(e)}getAll(){return[...this.#h.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,r._x)(e,t)):t}notify(e){i.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){i.V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){i.V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c=n(92812),d=class extends l.l{constructor(e={}){super(),this.config=e,this.#p=new Map,this.#m=Date.now()}#p;#m;build(e,t,n){let r=new c.m({mutationCache:this,mutationId:++this.#m,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){let t=f(e),n=this.#p.get(t)??[];n.push(e),this.#p.set(t,n),this.notify({type:"added",mutation:e})}remove(e){let t=f(e);if(this.#p.has(t)){let n=this.#p.get(t)?.filter(t=>t!==e);n&&(0===n.length?this.#p.delete(t):this.#p.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){let t=this.#p.get(f(e))?.find(e=>"pending"===e.state.status);return!t||t===e}runNext(e){let t=this.#p.get(f(e))?.find(t=>t!==e&&t.state.isPaused);return t?.continue()??Promise.resolve()}clear(){i.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#p.values()].flat()}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,r.X7)(e,t))}notify(e){i.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return i.V.batch(()=>Promise.all(e.map(e=>e.continue().catch(r.ZT))))}};function f(e){return e.options.scope?.id??String(e.mutationId)}var h=n(34939),p=n(49937);function m(e,{pages:t,pageParams:n}){let r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}var g=class{#g;#i;#d;#y;#v;#b;#w;#x;constructor(e={}){this.#g=e.queryCache||new u,this.#i=e.mutationCache||new d,this.#d=e.defaultOptions||{},this.#y=new Map,this.#v=new Map,this.#b=0}mount(){this.#b++,1===this.#b&&(this.#w=h.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#g.onFocus())}),this.#x=p.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#g.onOnline())}))}unmount(){this.#b--,0===this.#b&&(this.#w?.(),this.#w=void 0,this.#x?.(),this.#x=void 0)}isFetching(e){return this.#g.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#i.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.getQueryData(e.queryKey);if(void 0===t)return this.fetchQuery(e);{let n=this.defaultQueryOptions(e),r=this.#g.build(this,n);return e.revalidateIfStale&&r.isStaleByTime(n.staleTime)&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return this.#g.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#g.get(i.queryHash),a=o?.state.data,s=(0,r.SE)(t,a);if(void 0!==s)return this.#g.build(this,i).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return i.V.batch(()=>this.#g.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state}removeQueries(e){let t=this.#g;i.V.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#g,r={type:"active",...e};return i.V.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){let n={revert:!0,...t};return Promise.all(i.V.batch(()=>this.#g.findAll(e).map(e=>e.cancel(n)))).then(r.ZT).catch(r.ZT)}invalidateQueries(e={},t={}){return i.V.batch(()=>{if(this.#g.findAll(e).forEach(e=>{e.invalidate()}),"none"===e.refetchType)return Promise.resolve();let n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){let n={...t,cancelRefetch:t?.cancelRefetch??!0};return Promise.all(i.V.batch(()=>this.#g.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(r.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(r.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let n=this.#g.build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(r.ZT).catch(r.ZT)}fetchInfiniteQuery(e){var t;return e.behavior=(t=e.pages,{onFetch:(e,n)=>{let i=async()=>{let n;let i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],s=e.state.data?.pageParams||[],l=!1,u=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?l=!0:e.signal.addEventListener("abort",()=>{l=!0}),e.signal)})},c=(0,r.cG)(e.options,e.fetchOptions),d=async(t,n,i)=>{if(l)return Promise.reject();if(null==n&&t.pages.length)return Promise.resolve(t);let o={queryKey:e.queryKey,pageParam:n,direction:i?"backward":"forward",meta:e.options.meta};u(o);let a=await c(o),{maxPages:s}=e.options,d=i?r.Ht:r.VX;return{pages:d(t.pages,a,s),pageParams:d(t.pageParams,n,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:s},r=(e?function(e,{pages:t,pageParams:n}){return e.getPreviousPageParam?.(t[0],t,n[0],n)}:m)(i,t);n=await d(t,r,e)}else{n=await d({pages:[],pageParams:[]},s[0]??i.initialPageParam);let e=t??a.length;for(let t=1;te.options.persister?.(i,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=i}}),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(r.ZT).catch(r.ZT)}resumePausedMutations(){return p.N.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#g}getMutationCache(){return this.#i}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#y.set((0,r.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#y.values()],n={};return t.forEach(t=>{(0,r.to)(e,t.queryKey)&&(n={...n,...t.defaultOptions})}),n}setMutationDefaults(e,t){this.#v.set((0,r.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#v.values()],n={};return t.forEach(t=>{(0,r.to)(e,t.mutationKey)&&(n={...n,...t.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,r.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),!0!==t.enabled&&t.queryFn===r.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#g.clear(),this.#i.clear()}}},43494:function(e,t,n){"use strict";n.d(t,{F:function(){return i}});var r=n(56298),i=class{#k;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.PN)(this.gcTime)&&(this.#k=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r.sk?1/0:3e5))}clearGcTimeout(){this.#k&&(clearTimeout(this.#k),this.#k=void 0)}}},30924:function(e,t,n){"use strict";n.d(t,{DV:function(){return u},Kw:function(){return s},Mz:function(){return c}});var r=n(34939),i=n(49937),o=n(56298);function a(e){return Math.min(1e3*2**e,3e4)}function s(e){return(e??"online")!=="online"||i.N.isOnline()}var l=class{constructor(e){this.revert=e?.revert,this.silent=e?.silent}};function u(e){return e instanceof l}function c(e){let t,n,u,c=!1,d=0,f=!1,h=new Promise((e,t)=>{n=e,u=t}),p=()=>r.j.isFocused()&&("always"===e.networkMode||i.N.isOnline())&&e.canRun(),m=()=>s(e.networkMode)&&e.canRun(),g=r=>{f||(f=!0,e.onSuccess?.(r),t?.(),n(r))},y=n=>{f||(f=!0,e.onError?.(n),t?.(),u(n))},v=()=>new Promise(n=>{t=e=>{(f||p())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,f||e.onContinue?.()}),b=()=>{let t;if(f)return;let n=0===d?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(g).catch(t=>{if(f)return;let n=e.retry??(o.sk?0:3),r=e.retryDelay??a,i="function"==typeof r?r(d,t):r,s=!0===n||"number"==typeof n&&dp()?void 0:v()).then(()=>{c?y(t):b()})})};return{promise:h,cancel:t=>{f||(y(new l(t)),e.abort?.())},continue:()=>(t?.(),h),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:m,start:()=>(m()?b():v().then(b),h)}}},49010:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},56298:function(e,t,n){"use strict";n.d(t,{CN:function(){return x},Ht:function(){return w},Kp:function(){return s},PN:function(){return a},Rm:function(){return c},SE:function(){return o},VS:function(){return h},VX:function(){return b},X7:function(){return u},Ym:function(){return d},ZT:function(){return i},_v:function(){return y},_x:function(){return l},cG:function(){return k},oE:function(){return v},sk:function(){return r},to:function(){return f}});var r="undefined"==typeof window||"Deno"in globalThis;function i(){}function o(e,t){return"function"==typeof e?e(t):e}function a(e){return"number"==typeof e&&e>=0&&e!==1/0}function s(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){let{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==c(a,t.options))return!1}else if(!f(t.queryKey,a))return!1}if("all"!==n){let e=t.isActive();if("active"===n&&!e||"inactive"===n&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&(!i||i===t.state.fetchStatus)&&(!o||!!o(t))}function u(e,t){let{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(d(t.options.mutationKey)!==d(o))return!1}else if(!f(t.options.mutationKey,o))return!1}return(!r||t.state.status===r)&&(!i||!!i(t))}function c(e,t){return(t?.queryKeyHashFn||d)(e)}function d(e){return JSON.stringify(e,(e,t)=>m(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function f(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(n=>!f(e[n],t[n]))}function h(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function p(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function m(e){if(!g(e))return!1;let t=e.constructor;if(void 0===t)return!0;let n=t.prototype;return!!(g(n)&&n.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function g(e){return"[object Object]"===Object.prototype.toString.call(e)}function y(e){return new Promise(t=>{setTimeout(t,e)})}function v(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?function e(t,n){if(t===n)return t;let r=p(t)&&p(n);if(r||m(t)&&m(n)){let i=r?t:Object.keys(t),o=i.length,a=r?n:Object.keys(n),s=a.length,l=r?[]:{},u=0;for(let o=0;on?r.slice(1):r}function w(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var x=Symbol(),k=(e,t)=>!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==x?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))},93191:function(e,t,n){"use strict";n.d(t,{NL:function(){return a},aH:function(){return s}});var r=n(2265),i=n(57437),o=r.createContext(void 0),a=e=>{let t=r.useContext(o);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},s=e=>{let{client:t,children:n}=e;return r.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,i.jsx)(o.Provider,{value:t,children:n})}},6007:function(e,t,n){"use strict";n.d(t,{D:function(){return d}});var r=n(2265),i=n(92812),o=n(69948),a=n(49010),s=n(56298),l=class extends a.l{#_;#S=void 0;#O;#C;constructor(e,t){super(),this.#_=e,this.setOptions(t),this.bindMethods(),this.#E()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#_.defaultMutationOptions(e),(0,s.VS)(this.options,t)||this.#_.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#O,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.Ym)(t.mutationKey)!==(0,s.Ym)(this.options.mutationKey)?this.reset():this.#O?.state.status==="pending"&&this.#O.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#O?.removeObserver(this)}onMutationUpdate(e){this.#E(),this.#P(e)}getCurrentResult(){return this.#S}reset(){this.#O?.removeObserver(this),this.#O=void 0,this.#E(),this.#P()}mutate(e,t){return this.#C=t,this.#O?.removeObserver(this),this.#O=this.#_.getMutationCache().build(this.#_,this.options),this.#O.addObserver(this),this.#O.execute(e)}#E(){let e=this.#O?.state??(0,i.R)();this.#S={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#P(e){o.V.batch(()=>{if(this.#C&&this.hasListeners()){let t=this.#S.variables,n=this.#S.context;e?.type==="success"?(this.#C.onSuccess?.(e.data,t,n),this.#C.onSettled?.(e.data,null,t,n)):e?.type==="error"&&(this.#C.onError?.(e.error,t,n),this.#C.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach(e=>{e(this.#S)})})}},u=n(93191);function c(){}function d(e,t){var n,i;let a=(0,u.NL)(t),[s]=r.useState(()=>new l(a,e));r.useEffect(()=>{s.setOptions(e)},[s,e]);let d=r.useSyncExternalStore(r.useCallback(e=>s.subscribe(o.V.batchCalls(e)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),f=r.useCallback((e,t)=>{s.mutate(e,t).catch(c)},[s]);if(d.error&&(n=s.options.throwOnError,i=[d.error],"function"==typeof n?n(...i):!!n))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}},43061:function(e,t,n){"use strict";n.d(t,{Nr:function(){return o},_:function(){return d},iP:function(){return f}});var r=n(2265);function i(e,t){window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}function o(e,t){let[n,i]=r.useState(e);return r.useEffect(()=>{let n=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}let a=(e,t)=>{let n=JSON.stringify(t);window.localStorage.setItem(e,n),i(e,n)},s=e=>{window.localStorage.removeItem(e),i(e,null)},l=e=>window.localStorage.getItem(e),u=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),c=()=>{throw Error("useLocalStorage is a client-only hook")};function d(e,t){let n=r.useSyncExternalStore(u,()=>l(e),c),i=r.useCallback(t=>{try{let r="function"==typeof t?t(JSON.parse(n)):t;null==r?s(e):a(e,r)}catch(e){console.warn(e)}},[e,n]);return r.useEffect(()=>{null===l(e)&&void 0!==t&&a(e,t)},[e,t]),[n?JSON.parse(n):t,i]}function f(){let[e,t]=r.useState({width:null,height:null});return r.useLayoutEffect(()=>{let e=()=>{t({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),e}},55767:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var r=n(86417),i=n(85770),o=n(99112),a=n(96329),s=n(95046);function l(e={}){let t,u,c;return(0,r.K)(r=>({id:"metaMaskSDK",name:"MetaMask",type:l.type,async setup(){let e=await this.getProvider();e&&e.on("connect",this.onConnect.bind(this))},async connect({chainId:e,isReconnecting:n}={}){let i=await this.getProvider(),s=[];n&&(s=await this.getAccounts().catch(()=>[]));try{s?.length||(s=(await t.connect()).map(e=>(0,o.K)(e))),i.removeListener("connect",this.onConnect.bind(this)),i.on("accountsChanged",this.onAccountsChanged.bind(this)),i.on("chainChanged",this.onChainChanged),i.on("disconnect",this.onDisconnect.bind(this));let n=await this.getChainId();if(e&&n!==e){let t=await this.switchChain({chainId:e}).catch(e=>{if(e.code===a.ab.code)throw e;return{id:n}});n=t?.id??n}return await r.storage?.removeItem("metaMaskSDK.disconnected"),{accounts:s,chainId:n}}catch(e){if(e.code===a.ab.code)throw new a.ab(e);if(e.code===a.pT.code)throw new a.pT(e);throw e}},async disconnect(){let e=await this.getProvider();e.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),e.removeListener("chainChanged",this.onChainChanged),e.removeListener("disconnect",this.onDisconnect.bind(this)),e.on("connect",this.onConnect.bind(this)),t.terminate(),await r.storage?.setItem("metaMaskSDK.disconnected",!0)},async getAccounts(){let e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>(0,o.K)(e))},async getChainId(){let e=await this.getProvider();return Number(e.getChainId()||await e?.request({method:"eth_chainId"}))},async getProvider(){async function i(){let{default:i}=await n.e(497).then(n.t.bind(n,97797,19));return t=new("function"!=typeof i&&"function"==typeof i.default?i.default:i)({dappMetadata:{},...e,_source:"wagmi",readonlyRPCMap:Object.fromEntries(r.chains.map(e=>[e.id,e.rpcUrls.default.http[0]]))}),await t.init(),t.getProvider()}return u||(c||(c=i()),u=await c),u},async isAuthorized(){try{if("undefined"!=typeof navigator&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||await r.storage?.getItem("metaMaskSDK.disconnected"))return!1;return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){let n=await this.getProvider(),o=r.chains.find(e=>e.id===t);if(!o)throw new a.x3(new i.X4);try{return await Promise.all([n.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,s.eC)(t)}]}),new Promise(e=>r.emitter.once("change",({chainId:n})=>{n===t&&e()}))]),o}catch(r){if(4902===r.code||r?.data?.originalError?.code===4902)try{let r,i;let{default:l,...u}=o.blockExplorers??{};e?.blockExplorerUrls?r=e.blockExplorerUrls:l&&(r=[l.url,...Object.values(u).map(e=>e.url)]),i=e?.rpcUrls?.length?e.rpcUrls:[o.rpcUrls.default?.http[0]??""];let c={blockExplorerUrls:r,chainId:(0,s.eC)(t),chainName:e?.chainName??o.name,iconUrls:e?.iconUrls,nativeCurrency:e?.nativeCurrency??o.nativeCurrency,rpcUrls:i};if(await n.request({method:"wallet_addEthereumChain",params:[c]}),await this.getChainId()!==t)throw new a.ab(Error("User rejected switch after adding network."));return o}catch(e){throw new a.ab(e)}if(r.code===a.ab.code)throw new a.ab(r);throw new a.x3(r)}},async onAccountsChanged(e){if(0===e.length)this.onDisconnect();else if(r.emitter.listenerCount("connect")){let e=(await this.getChainId()).toString();this.onConnect({chainId:e}),await r.storage?.removeItem("metaMaskSDK.disconnected")}else r.emitter.emit("change",{accounts:e.map(e=>(0,o.K)(e))})},onChainChanged(e){let t=Number(e);r.emitter.emit("change",{chainId:t})},async onConnect(e){let t=await this.getAccounts();if(0===t.length)return;let n=Number(e.chainId);r.emitter.emit("connect",{accounts:t,chainId:n});let i=await this.getProvider();i&&(i.removeListener("connect",this.onConnect.bind(this)),i.on("accountsChanged",this.onAccountsChanged.bind(this)),i.on("chainChanged",this.onChainChanged),i.on("disconnect",this.onDisconnect.bind(this)))},async onDisconnect(e){let t=await this.getProvider();e&&1013===e.code&&t&&(await this.getAccounts()).length||("undefined"!=typeof localStorage&&(localStorage.removeItem("MMSDK_cached_address"),localStorage.removeItem("MMSDK_cached_chainId")),r.emitter.emit("disconnect"),t.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect.bind(this)),t.on("connect",this.onConnect.bind(this)))}}))}l.type="metaMask"},86417:function(e,t,n){"use strict";function r(e){return e}n.d(t,{K:function(){return r}})},55925:function(e,t,n){"use strict";let r;n.d(t,{_:function(){return z}});var i=n(500);let o=e=>(t,n,r)=>{let i=r.subscribe;return r.subscribe=(e,t,n)=>{let o=e;if(t){let i=(null==n?void 0:n.equalityFn)||Object.is,a=e(r.getState());o=n=>{let r=e(n);if(!i(a,r)){let e=a;t(a=r,e)}},(null==n?void 0:n.fireImmediately)&&t(a,a)}return i(o)},e(t,n,r)},a=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>a(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>a(t)(e)}}},s=(e,t)=>(n,r,i)=>{let o,s,l={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},u=!1,c=new Set,d=new Set;try{o=l.getStorage()}catch(e){}if(!o)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...e)},r,i);let f=a(l.serialize),h=()=>{let e;let t=f({state:l.partialize({...r()}),version:l.version}).then(e=>o.setItem(l.name,e)).catch(t=>{e=t});if(e)throw e;return t},p=i.setState;i.setState=(e,t)=>{p(e,t),h()};let m=e((...e)=>{n(...e),h()},r,i),g=()=>{var e;if(!o)return;u=!1,c.forEach(e=>e(r()));let t=(null==(e=l.onRehydrateStorage)?void 0:e.call(l,r()))||void 0;return a(o.getItem.bind(o))(l.name).then(e=>{if(e)return l.deserialize(e)}).then(e=>{if(e){if("number"!=typeof e.version||e.version===l.version)return e.state;if(l.migrate)return l.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return n(s=l.merge(e,null!=(t=r())?t:m),!0),h()}).then(()=>{null==t||t(s,void 0),u=!0,d.forEach(e=>e(s))}).catch(e=>{null==t||t(void 0,e)})};return i.persist={setOptions:e=>{l={...l,...e},e.getStorage&&(o=e.getStorage())},clearStorage:()=>{null==o||o.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>g(),hasHydrated:()=>u,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},g(),s||m},l=(e,t)=>(n,r,i)=>{let o,s={storage:function(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var t;let r=e=>null===e?null:JSON.parse(e,void 0),i=null!=(t=n.getItem(e))?t:null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)}}(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,u=new Set,c=new Set,d=s.storage;if(!d)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)},r,i);let f=()=>{let e=s.partialize({...r()});return d.setItem(s.name,{state:e,version:s.version})},h=i.setState;i.setState=(e,t)=>{h(e,t),f()};let p=e((...e)=>{n(...e),f()},r,i),m=()=>{var e,t;if(!d)return;l=!1,u.forEach(e=>{var t;return e(null!=(t=r())?t:p)});let i=(null==(t=s.onRehydrateStorage)?void 0:t.call(s,null!=(e=r())?e:p))||void 0;return a(d.getItem.bind(d))(s.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return e.state;if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return n(o=s.merge(e,null!=(t=r())?t:p),!0),f()}).then(()=>{null==i||i(o,void 0),o=r(),l=!0,c.forEach(e=>e(o))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions:e=>{s={...s,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},s.skipHydration||m(),o||p},u=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),s(e,t)):l(e,t),c=e=>{let t;let n=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=r?r:"object"!=typeof i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,o),o},d=e=>e?c(e):c;var f=n(99112),h=n(96329),p=n(39881),m=n(13581),g=n(95046),y=n(85770),v=n(66564);class b extends v.G{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}var w=n(86417);let x=/(rabby|trustwallet)/,k={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider:e=>e?.coinbaseWalletExtension?e.coinbaseWalletExtension:S(e,"isCoinbaseWallet")},metaMask:{id:"metaMask",name:"MetaMask",provider:e=>S(e,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;for(let t of["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"])if(e[t])return!1;return!0})},phantom:{id:"phantom",name:"Phantom",provider:e=>e?.phantom?.ethereum?e.phantom?.ethereum:S(e,"isPhantom")}};function _(e={}){let t,n,r,i;let{shimDisconnect:o=!0,unstable_shimAsyncInject:a}=e;function s(){let t=e.target;if("function"==typeof t){let e=t();if(e)return e}return"object"==typeof t?t:"string"==typeof t?{...k[t]??{id:t,name:`${t[0].toUpperCase()}${t.slice(1)}`,provider:`is${t[0].toUpperCase()}${t.slice(1)}`}}:{id:"injected",name:"Injected",provider:e=>e?.ethereum}}return(0,w.K)(l=>({get icon(){return s().icon},get id(){return s().id},get name(){return s().name},get supportsSimulation(){return x.test(this.id.toLowerCase())},type:_.type,async setup(){let n=await this.getProvider();n&&e.target&&(r||(r=this.onConnect.bind(this),n.on("connect",r)),t||(t=this.onAccountsChanged.bind(this),n.on("accountsChanged",t)))},async connect({chainId:a,isReconnecting:s}={}){let u=await this.getProvider();if(!u)throw new b;let c=[];if(s)c=await this.getAccounts().catch(()=>[]);else if(o)try{let e=await u.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});c=e[0]?.caveats?.[0]?.value?.map(e=>f.K(e))}catch(e){if(e.code===h.ab.code)throw new h.ab(e);if(e.code===h.pT.code)throw e}try{c?.length||s||(c=(await u.request({method:"eth_requestAccounts"})).map(e=>(0,f.K)(e))),r&&(u.removeListener("connect",r),r=void 0),t||(t=this.onAccountsChanged.bind(this),u.on("accountsChanged",t)),n||(n=this.onChainChanged.bind(this),u.on("chainChanged",n)),i||(i=this.onDisconnect.bind(this),u.on("disconnect",i));let d=await this.getChainId();if(a&&d!==a){let e=await this.switchChain({chainId:a}).catch(e=>{if(e.code===h.ab.code)throw e;return{id:d}});d=e?.id??d}return o&&await l.storage?.removeItem(`${this.id}.disconnected`),e.target||await l.storage?.setItem("injected.connected",!0),{accounts:c,chainId:d}}catch(e){if(e.code===h.ab.code)throw new h.ab(e);if(e.code===h.pT.code)throw new h.pT(e);throw e}},async disconnect(){let t=await this.getProvider();if(!t)throw new b;n&&(t.removeListener("chainChanged",n),n=void 0),i&&(t.removeListener("disconnect",i),i=void 0),r||(r=this.onConnect.bind(this),t.on("connect",r));try{await t.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]})}catch{}o&&await l.storage?.setItem(`${this.id}.disconnected`,!0),e.target||await l.storage?.removeItem("injected.connected")},async getAccounts(){let e=await this.getProvider();if(!e)throw new b;return(await e.request({method:"eth_accounts"})).map(e=>(0,f.K)(e))},async getChainId(){let e=await this.getProvider();if(!e)throw new b;return Number(await e.request({method:"eth_chainId"}))},async getProvider(){let e;if("undefined"==typeof window)return;let t=s();return(e="function"==typeof t.provider?t.provider(window):"string"==typeof t.provider?S(window,t.provider):t.provider)&&!e.removeListener&&("off"in e&&"function"==typeof e.off?e.removeListener=e.off:e.removeListener=()=>{}),e},async isAuthorized(){try{if(o&&await l.storage?.getItem(`${this.id}.disconnected`)||!e.target&&!await l.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(void 0!==a&&!1!==a){let e=async()=>("undefined"!=typeof window&&window.removeEventListener("ethereum#initialized",e),!!await this.getProvider()),t="number"==typeof a?a:1e3;if(await Promise.race([..."undefined"!=typeof window?[new Promise(t=>window.addEventListener("ethereum#initialized",()=>t(e()),{once:!0}))]:[],new Promise(n=>setTimeout(()=>n(e()),t))]))return!0}throw new b}return!!(await (0,p.J)(()=>(0,m.F)(()=>this.getAccounts(),{timeout:100}))).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){let n=await this.getProvider();if(!n)throw new b;let r=l.chains.find(e=>e.id===t);if(!r)throw new h.x3(new y.X4);try{return await Promise.all([n.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,g.eC)(t)}]}).then(async()=>{await this.getChainId()===t&&l.emitter.emit("change",{chainId:t})}),new Promise(e=>l.emitter.once("change",({chainId:n})=>{n===t&&e()}))]),r}catch(i){if(4902===i.code||i?.data?.originalError?.code===4902)try{let i,o;let{default:a,...s}=r.blockExplorers??{};e?.blockExplorerUrls?i=e.blockExplorerUrls:a&&(i=[a.url,...Object.values(s).map(e=>e.url)]),o=e?.rpcUrls?.length?e.rpcUrls:[r.rpcUrls.default?.http[0]??""];let l={blockExplorerUrls:i,chainId:(0,g.eC)(t),chainName:e?.chainName??r.name,iconUrls:e?.iconUrls,nativeCurrency:e?.nativeCurrency??r.nativeCurrency,rpcUrls:o};if(await n.request({method:"wallet_addEthereumChain",params:[l]}),await this.getChainId()!==t)throw new h.ab(Error("User rejected switch after adding network."));return r}catch(e){throw new h.ab(e)}if(i.code===h.ab.code)throw new h.ab(i);throw new h.x3(i)}},async onAccountsChanged(e){if(0===e.length)this.onDisconnect();else if(l.emitter.listenerCount("connect")){let e=(await this.getChainId()).toString();this.onConnect({chainId:e}),o&&await l.storage?.removeItem(`${this.id}.disconnected`)}else l.emitter.emit("change",{accounts:e.map(e=>(0,f.K)(e))})},onChainChanged(e){let t=Number(e);l.emitter.emit("change",{chainId:t})},async onConnect(e){let o=await this.getAccounts();if(0===o.length)return;let a=Number(e.chainId);l.emitter.emit("connect",{accounts:o,chainId:a});let s=await this.getProvider();s&&(r&&(s.removeListener("connect",r),r=void 0),t||(t=this.onAccountsChanged.bind(this),s.on("accountsChanged",t)),n||(n=this.onChainChanged.bind(this),s.on("chainChanged",n)),i||(i=this.onDisconnect.bind(this),s.on("disconnect",i)))},async onDisconnect(e){let t=await this.getProvider();e&&1013===e.code&&t&&(await this.getAccounts()).length||(l.emitter.emit("disconnect"),t&&(n&&(t.removeListener("chainChanged",n),n=void 0),i&&(t.removeListener("disconnect",i),i=void 0),r||(r=this.onConnect.bind(this),t.on("connect",r))))}}))}function S(e,t){function n(e){return"function"==typeof t?t(e):"string"!=typeof t||e[t]}let r=e.ethereum;return r?.providers?r.providers.find(e=>n(e)):r&&n(r)?r:void 0}_.type="injected";var O=n(36393);class C{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new O.v})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){let n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function E(e,t){return JSON.parse(e,(e,n)=>{let r=n;return r?.__type==="bigint"&&(r=BigInt(r.value)),r?.__type==="Map"&&(r=new Map(r.value)),t?.(e,r)??r})}function P(e,t){return e.slice(0,t).join(".")||"."}function j(e,t){let{length:n}=e;for(let r=0;r{let r=n;return"bigint"==typeof r&&(r={__type:"bigint",value:n.toString()}),r instanceof Map&&(r={__type:"Map",value:Array.from(n.entries())}),t?.(e,r)??r},r),n??void 0)}let A={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},I=256;var M=n(52520);function z(e){let t;let{multiInjectedProviderDiscovery:n=!0,storage:a=function(e){let{deserialize:t=E,key:n="wagmi",serialize:r=T,storage:i=A}=e;function o(e){return e instanceof Promise?e.then(e=>e).catch(()=>null):e}return{...i,key:n,async getItem(e,r){let a=i.getItem(`${n}.${e}`),s=await o(a);return s?t(s)??null:r??null},async setItem(e,t){let a=`${n}.${e}`;null===t?await o(i.removeItem(a)):await o(i.setItem(a,r(t)))},async removeItem(e){await o(i.removeItem(`${n}.${e}`))}}}({storage:"undefined"!=typeof window&&window.localStorage?window.localStorage:A}),syncConnectedChain:s=!0,ssr:l,...c}=e,f="undefined"!=typeof window&&n?function(){let e=new Set,t=[],n=()=>(function(e){let t=t=>e(t.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)})(n=>{t.some(({info:e})=>e.uuid===n.info.uuid)||(t=[...t,n],e.forEach(e=>e(t,{added:[n]})))}),r=n();return{_listeners:()=>e,clear(){e.forEach(e=>e([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),r()},findProvider:({rdns:e})=>t.find(t=>t.info.rdns===e),getProviders:()=>t,reset(){this.clear(),r(),r=n()},subscribe:(n,{emitImmediately:r}={})=>(e.add(n),r&&n(t,{added:t}),()=>e.delete(n))}}():void 0,h=d(()=>c.chains),p=d(()=>[...c.connectors??[],...l?[]:f?.getProviders().map(g)??[]].map(m));function m(e){let t=new C(function(e=11){if(!r||I+e>512){r="",I=0;for(let e=0;e<256;e++)r+=(256+256*Math.random()|0).toString(16).substring(1)}return r.substring(I,I+++e)}()),n={...e({emitter:t,chains:h.getState(),storage:a}),emitter:t,uid:t.uid};return t.on("connect",S),n.setup?.(),n}function g(e){let{info:t}=e,n=e.provider;return _({target:{...t,id:t.rdns,provider:n}})}let v=new Map;function b(){return{chainId:h.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let w="0.0.0-canary-";t=M.i.startsWith(w)?Number.parseInt(M.i.replace(w,"")):Number.parseInt(M.i.split(".")[0]??"0");let x=d(o(a?u(b,{migrate(e,n){if(n===t)return e;let r=b(),i=e&&"object"==typeof e&&"chainId"in e&&"number"==typeof e.chainId?e.chainId:r.chainId;return{...r,chainId:i}},name:"store",partialize:e=>({connections:{__type:"Map",value:Array.from(e.connections.entries()).map(([e,t])=>{let{id:n,name:r,type:i,uid:o}=t.connector;return[e,{...t,connector:{id:n,name:r,type:i,uid:o}}]})},chainId:e.chainId,current:e.current}),skipHydration:l,storage:a,version:t}):b));function k(e){x.setState(t=>{let n=t.connections.get(e.uid);return n?{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts??n.accounts,chainId:e.chainId??n.chainId,connector:n.connector})}:t})}function S(e){"connecting"!==x.getState().status&&"reconnecting"!==x.getState().status&&x.setState(t=>{let n=p.getState().find(t=>t.uid===e.uid);return n?(n.emitter.listenerCount("connect")&&n.emitter.off("connect",k),n.emitter.listenerCount("change")||n.emitter.on("change",k),n.emitter.listenerCount("disconnect")||n.emitter.on("disconnect",O),{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts,chainId:e.chainId,connector:n}),current:e.uid,status:"connected"}):t})}function O(e){x.setState(t=>{let n=t.connections.get(e.uid);if(n){let e=n.connector;e.emitter.listenerCount("change")&&n.connector.emitter.off("change",k),e.emitter.listenerCount("disconnect")&&n.connector.emitter.off("disconnect",O),e.emitter.listenerCount("connect")||n.connector.emitter.on("connect",S)}if(t.connections.delete(e.uid),0===t.connections.size)return{...t,connections:new Map,current:null,status:"disconnected"};let r=t.connections.values().next().value;return{...t,connections:new Map(t.connections),current:r.connector.uid}})}return s&&x.subscribe(({connections:e,current:t})=>t?e.get(t)?.chainId:void 0,e=>{if(h.getState().some(t=>t.id===e))return x.setState(t=>({...t,chainId:e??t.chainId}))}),f?.subscribe(e=>{let t=new Map;for(let e of p.getState())t.set(e.id,!0);let n=[];for(let r of e){let e=m(g(r));t.has(e.id)||n.push(e)}(!a||x.persist.hasHydrated())&&p.setState(e=>[...e,...n],!0)}),{get chains(){return h.getState()},get connectors(){return p.getState()},storage:a,getClient:function(e={}){let t;let n=e.chainId??x.getState().chainId,r=h.getState().find(e=>e.id===n);if(e.chainId&&!r)throw new y.X4;{let e=v.get(x.getState().chainId);if(e&&!r)return e;if(!r)throw new y.X4}{let e=v.get(n);if(e)return e}if(c.client)t=c.client({chain:r});else{let e=r.id,n=h.getState().map(e=>e.id),o={};for(let[t,r]of Object.entries(c))if("chains"!==t&&"client"!==t&&"connectors"!==t&&"transports"!==t){if("object"==typeof r){if(e in r)o[t]=r[e];else{if(n.some(e=>e in r))continue;o[t]=r}}else o[t]=r}t=(0,i.e)({...o,chain:r,batch:o.batch??{multicall:!0},transport:t=>c.transports[e]({...t,connectors:p})})}return v.set(n,t),t},get state(){return x.getState()},setState(e){let t;t="function"==typeof e?e(x.getState()):e;let n=b();"object"!=typeof t&&(t=n),Object.keys(n).some(e=>!(e in t))&&(t=n),x.setState(t,!0)},subscribe:(e,t,n)=>x.subscribe(e,t,n?{...n,fireImmediately:n.emitImmediately}:void 0),_internal:{mipd:f,store:x,ssr:!!l,syncConnectedChain:s,transports:c.transports,chains:{setState(e){let t="function"==typeof e?e(h.getState()):e;if(0!==t.length)return h.setState(t,!0)},subscribe:e=>h.subscribe(e)},connectors:{providerDetailToConnector:g,setup:m,setState:e=>p.setState("function"==typeof e?e(p.getState()):e,!0),subscribe:e=>p.subscribe(e)},events:{change:k,connect:S,disconnect:O}}}}},66564:function(e,t,n){"use strict";n.d(t,{G:function(){return l}});var r,i,o=n(52520);let a=()=>`@wagmi/core@${o.i}`;var s=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class l extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return a()}constructor(e,t={}){super(),r.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});let n=t.cause instanceof l?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof l&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=i,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return s(this,r,"m",i).call(this,this,e)}}r=new WeakSet,i=function e(t,n){return n?.(t)?t:t.cause?s(this,r,"m",e).call(this,t.cause,n):t}},85770:function(e,t,n){"use strict";n.d(t,{JK:function(){return s},X4:function(){return i},aH:function(){return a},wi:function(){return o}});var r=n(66564);class i extends r.G{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class o extends r.G{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class a extends r.G{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class s extends r.G{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}},90331:function(e,t,n){"use strict";n.d(t,{v:function(){return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){let r,i;if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)&&Array.isArray(n)){if((r=t.length)!==n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();let o=Object.keys(t);if((r=o.length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){let r=o[i];if(r&&!e(t[r],n[r]))return!1}return!0}return t!=t&&n!=n}}})},52520:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});let r="2.10.5"},95982:function(e,t,n){"use strict";n.d(t,{kP:function(){return et}}),n(60035);var r={code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw Error('"text" parts expect a string value.');return{type:"text",value:e}}},i={code:"1",name:"function_call",parse:e=>{if(null==e||"object"!=typeof e||!("function_call"in e)||"object"!=typeof e.function_call||null==e.function_call||!("name"in e.function_call)||!("arguments"in e.function_call)||"string"!=typeof e.function_call.name||"string"!=typeof e.function_call.arguments)throw Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},o={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw Error('"data" parts expect an array value.');return{type:"data",value:e}}},a={code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw Error('"error" parts expect a string value.');return{type:"error",value:e}}},s={code:"4",name:"assistant_message",parse:e=>{if(null==e||"object"!=typeof e||!("id"in e)||!("role"in e)||!("content"in e)||"string"!=typeof e.id||"string"!=typeof e.role||"assistant"!==e.role||!Array.isArray(e.content)||!e.content.every(e=>null!=e&&"object"==typeof e&&"type"in e&&"text"===e.type&&"text"in e&&null!=e.text&&"object"==typeof e.text&&"value"in e.text&&"string"==typeof e.text.value))throw Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},l={code:"5",name:"assistant_control_data",parse:e=>{if(null==e||"object"!=typeof e||!("threadId"in e)||!("messageId"in e)||"string"!=typeof e.threadId||"string"!=typeof e.messageId)throw Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},u={code:"6",name:"data_message",parse:e=>{if(null==e||"object"!=typeof e||!("role"in e)||!("data"in e)||"string"!=typeof e.role||"data"!==e.role)throw Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},c={code:"7",name:"tool_calls",parse:e=>{if(null==e||"object"!=typeof e||!("tool_calls"in e)||"object"!=typeof e.tool_calls||null==e.tool_calls||!Array.isArray(e.tool_calls)||e.tool_calls.some(e=>null==e||"object"!=typeof e||!("id"in e)||"string"!=typeof e.id||!("type"in e)||"string"!=typeof e.type||!("function"in e)||null==e.function||"object"!=typeof e.function||!("arguments"in e.function)||"string"!=typeof e.function.name||"string"!=typeof e.function.arguments))throw Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},d={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},f={code:"9",name:"tool_call",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args)throw Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},h={code:"a",name:"tool_result",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args||!("result"in e))throw Error('"tool_result" parts expect an object with a "toolCallId", "toolName", "args", and "result" property.');return{type:"tool_result",value:e}}},p=[r,i,o,a,s,l,u,c,d,f,h];function m(e,t){let n=p.find(t=>t.name===e);if(!n)throw Error(`Invalid stream part type: ${e}`);return`${n.code}:${JSON.stringify(t)} +`}r.code,i.code,o.code,a.code,s.code,l.code,u.code,c.code,d.code,f.code,h.code,r.name,r.code,i.name,i.code,o.name,o.code,a.name,a.code,s.name,s.code,l.name,l.code,u.name,u.code,c.name,c.code,d.name,d.code,f.name,f.code,h.name,h.code,p.map(e=>e.code);var g=n(97220),y=n(41338);let v=Symbol("Let zodToJsonSchema decide on which parser to use"),b={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email"},w=e=>"string"==typeof e?{...b,name:e}:{...b,...e};var x=n(59772);function k(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function _(e,t,n,r,i){e[t]=n,k(e,t,r,i)}let S=(e,t)=>L(e.innerType._def,t),O=(e,t)=>{let n={type:"integer",format:"unix-time"};if("openApi3"===t.target)return n;for(let r of e.checks)switch(r.kind){case"min":_(n,"minimum",r.value,r.message,t);break;case"max":_(n,"maximum",r.value,r.message,t)}return n},C=e=>(!("type"in e)||"string"!==e.type)&&"allOf"in e,E={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$"};function P(e,t){let n={type:"string"};function r(e){return"escape"===t.patternStrategy?j(e):e}if(e.checks)for(let i of e.checks)switch(i.kind){case"min":_(n,"minLength","number"==typeof n.minLength?Math.max(n.minLength,i.value):i.value,i.message,t);break;case"max":_(n,"maxLength","number"==typeof n.maxLength?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":T(n,"email",i.message,t);break;case"format:idn-email":T(n,"idn-email",i.message,t);break;case"pattern:zod":A(n,E.email,i.message,t)}break;case"url":T(n,"uri",i.message,t);break;case"uuid":T(n,"uuid",i.message,t);break;case"regex":A(n,i.regex.source,i.message,t);break;case"cuid":A(n,E.cuid,i.message,t);break;case"cuid2":A(n,E.cuid2,i.message,t);break;case"startsWith":A(n,"^"+r(i.value),i.message,t);break;case"endsWith":A(n,r(i.value)+"$",i.message,t);break;case"datetime":T(n,"date-time",i.message,t);break;case"length":_(n,"minLength","number"==typeof n.minLength?Math.max(n.minLength,i.value):i.value,i.message,t),_(n,"maxLength","number"==typeof n.maxLength?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"includes":A(n,r(i.value),i.message,t);break;case"ip":"v6"!==i.version&&T(n,"ipv4",i.message,t),"v4"!==i.version&&T(n,"ipv6",i.message,t);break;case"emoji":A(n,E.emoji,i.message,t);break;case"ulid":A(n,E.ulid,i.message,t)}return n}let j=e=>Array.from(e).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),T=(e,t,n,r)=>{e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):_(e,"format",t,n,r)},A=(e,t,n,r)=>{e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:t,...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):_(e,"pattern",t,n,r)};function I(e,t){if("openApi3"===t.target&&e.keyType?._def.typeName===x.pA.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,r)=>({...n,[r]:L(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",r]})??{}}),{}),additionalProperties:!1};let n={type:"object",additionalProperties:L(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??{}};if("openApi3"===t.target)return n;if(e.keyType?._def.typeName===x.pA.ZodString&&e.keyType._def.checks?.length){let r=Object.entries(P(e.keyType._def,t)).reduce((e,[t,n])=>"type"===t?e:{...e,[t]:n},{});return{...n,propertyNames:r}}return e.keyType?._def.typeName===x.pA.ZodEnum?{...n,propertyNames:{enum:e.keyType._def.values}}:n}let M={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},z=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>L(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0},R=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return L(e.innerType._def,t);let n=L(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}},N=(e,t)=>{if("input"===t.pipeStrategy)return L(e.in._def,t);if("output"===t.pipeStrategy)return L(e.out._def,t);let n=L(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=L(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(e=>void 0!==e)}},D=(e,t)=>L(e.innerType._def,t);function L(e,t,n=!1){let r=t.seen.get(e);if(t.override){let i=t.override?.(e,t,r,n);if(i!==v)return i}if(r&&!n){let e=F(r,t);if(void 0!==e)return e}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let o=Z(e,e.typeName,t);return o&&U(e,t,o),i.jsonSchema=o,o}let F=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:q(t.currentPath,e.path)};case"none":case"seen":if(e.path.lengtht.currentPath[n]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},q=(e,t)=>{let n=0;for(;n{switch(t){case x.pA.ZodString:return P(e,n);case x.pA.ZodNumber:return function(e,t){let n={type:"number"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"int":n.type="integer",k(n,"type",r.message,t);break;case"min":"jsonSchema7"===t.target?r.inclusive?_(n,"minimum",r.value,r.message,t):_(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),_(n,"minimum",r.value,r.message,t));break;case"max":"jsonSchema7"===t.target?r.inclusive?_(n,"maximum",r.value,r.message,t):_(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),_(n,"maximum",r.value,r.message,t));break;case"multipleOf":_(n,"multipleOf",r.value,r.message,t)}return n}(e,n);case x.pA.ZodObject:return function(e,t){let n={type:"object",...Object.entries(e.shape()).reduce((e,[n,r])=>{if(void 0===r||void 0===r._def)return e;let i=L(r._def,{...t,currentPath:[...t.currentPath,"properties",n],propertyPath:[...t.currentPath,"properties",n]});return void 0===i?e:{properties:{...e.properties,[n]:i},required:r.isOptional()?e.required:[...e.required,n]}},{properties:{},required:[]}),additionalProperties:"strict"===t.removeAdditionalStrategy?"ZodNever"===e.catchall._def.typeName?"strict"!==e.unknownKeys:L(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0:"ZodNever"===e.catchall._def.typeName?"passthrough"===e.unknownKeys:L(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0};return n.required.length||delete n.required,n}(e,n);case x.pA.ZodBigInt:return function(e,t){let n={type:"integer",format:"int64"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"min":"jsonSchema7"===t.target?r.inclusive?_(n,"minimum",r.value,r.message,t):_(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),_(n,"minimum",r.value,r.message,t));break;case"max":"jsonSchema7"===t.target?r.inclusive?_(n,"maximum",r.value,r.message,t):_(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),_(n,"maximum",r.value,r.message,t));break;case"multipleOf":_(n,"multipleOf",r.value,r.message,t)}return n}(e,n);case x.pA.ZodBoolean:return{type:"boolean"};case x.pA.ZodDate:return function e(t,n,r){let i=r??n.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,i)=>e(t,n,r))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return O(t,n)}}(e,n);case x.pA.ZodUndefined:return{not:{}};case x.pA.ZodNull:return"openApi3"===n.target?{enum:["null"],nullable:!0}:{type:"null"};case x.pA.ZodArray:return function(e,t){let n={type:"array"};return e.type?._def?.typeName!==x.pA.ZodAny&&(n.items=L(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&_(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&_(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(_(n,"minItems",e.exactLength.value,e.exactLength.message,t),_(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}(e,n);case x.pA.ZodUnion:case x.pA.ZodDiscriminatedUnion:return function(e,t){if("openApi3"===t.target)return z(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in M&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=M[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}if(n.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return z(e,t)}(e,n);case x.pA.ZodIntersection:return function(e,t){let n=[L(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),L(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e),r="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(e=>{if(C(e))i.push(...e.allOf),void 0===e.unevaluatedProperties&&(r=void 0);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:n,...r}=e;t=r}else r=void 0;i.push(t)}}),i.length?{allOf:i,...r}:void 0}(e,n);case x.pA.ZodTuple:return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,t)=>L(e._def,{...n,currentPath:[...n.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:L(e.rest._def,{...n,currentPath:[...n.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,t)=>L(e._def,{...n,currentPath:[...n.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case x.pA.ZodRecord:return I(e,n);case x.pA.ZodLiteral:return function(e,t){let n=typeof e.value;return"bigint"!==n&&"number"!==n&&"boolean"!==n&&"string"!==n?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===n?"integer":n,enum:[e.value]}:{type:"bigint"===n?"integer":n,const:e.value}}(e,n);case x.pA.ZodEnum:return{type:"string",enum:e.values};case x.pA.ZodNativeEnum:return function(e){let t=e.values,n=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:1===r.length?"string"===r[0]?"string":"number":["string","number"],enum:n}}(e);case x.pA.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:M[e.innerType._def.typeName],nullable:!0}:{type:[M[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){let n=L(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let n=L(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case x.pA.ZodOptional:return R(e,n);case x.pA.ZodMap:return"record"===n.mapStrategy?I(e,n):{type:"array",maxItems:125,items:{type:"array",items:[L(e.keyType._def,{...n,currentPath:[...n.currentPath,"items","items","0"]})||{},L(e.valueType._def,{...n,currentPath:[...n.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}};case x.pA.ZodSet:return function(e,t){let n={type:"array",uniqueItems:!0,items:L(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&_(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&_(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}(e,n);case x.pA.ZodLazy:return L(e.getter()._def,n);case x.pA.ZodPromise:return L(e.type._def,n);case x.pA.ZodNaN:case x.pA.ZodNever:return{not:{}};case x.pA.ZodEffects:return"input"===n.effectStrategy?L(e.schema._def,n):{};case x.pA.ZodAny:case x.pA.ZodUnknown:return{};case x.pA.ZodDefault:return{...L(e.innerType._def,n),default:e.defaultValue()};case x.pA.ZodBranded:return L(e.type._def,n);case x.pA.ZodReadonly:return D(e,n);case x.pA.ZodCatch:return S(e,n);case x.pA.ZodPipeline:return N(e,n);case x.pA.ZodFunction:case x.pA.ZodVoid:case x.pA.ZodSymbol:default:return}},U=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),$=e=>{let t=w(e),n=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};var V=(e,t)=>{let n=$(t),r="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:L(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??{}}),{}):void 0,i="string"==typeof t?t:t?.name,o=L(e._def,void 0===i?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1)??{},a=void 0===i?r?{...o,[n.definitionPath]:r}:o:{$ref:[..."relative"===n.$refStrategy?[]:n.basePath,n.definitionPath,i].join("/"),[n.definitionPath]:{...r,[i]:o}};return"jsonSchema7"===n.target?a.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"===n.target&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),a},B=Object.defineProperty;async function H(e){return new Promise(t=>setTimeout(t,e))}var K=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2}={})=>async r=>W(r,{maxRetries:e,delayInMs:t,backoffFactor:n});async function W(e,{maxRetries:t,delayInMs:n,backoffFactor:r},i=[]){try{return await e()}catch(l){if((0,y.D_)(l)||0===t)throw l;let o=(0,y.e$)(l),a=[...i,l],s=a.length;if(s>t)throw new g.Ms({message:`Failed after ${s} attempts. Last error: ${o}`,reason:"maxRetriesExceeded",errors:a});if(l instanceof Error&&g.w.isAPICallError(l)&&!0===l.isRetryable&&s<=t)return await H(n),W(e,{maxRetries:t,delayInMs:r*n,backoffFactor:r},a);if(1===s)throw l;throw new g.Ms({message:`Failed after ${s} attempts with non-retryable error: '${o}'`,reason:"errorNotRetryable",errors:a})}}var J=[{mimeType:"image/gif",bytes:[71,73,70]},{mimeType:"image/png",bytes:[137,80,78,71]},{mimeType:"image/jpeg",bytes:[255,216]},{mimeType:"image/webp",bytes:[82,73,70,70]}];function G(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)try{return(0,y.MS)(e)}catch(t){throw new g.e7({message:"Invalid data content. Content string is not a base64-encoded image.",content:e,cause:t})}if(e instanceof ArrayBuffer)return new Uint8Array(e);throw new g.e7({content:e})}var Q=class extends Error{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super(t),this.name="AI_InvalidMessageRoleError",this.role=e}static isInvalidMessageRoleError(e){return e instanceof Error&&"AI_InvalidMessageRoleError"===e.name&&"string"==typeof e.role}toJSON(){return{name:this.name,message:this.message,stack:this.stack,role:this.role}}};function Y(e){let t=e.role;switch(t){case"system":return{role:"system",content:e.content};case"user":if("string"==typeof e.content)return{role:"user",content:[{type:"text",text:e.content}]};return{role:"user",content:e.content.map(t=>{var n;switch(t.type){case"text":return t;case"image":{if(t.image instanceof URL)return{type:"image",image:t.image,mimeType:t.mimeType};if("string"==typeof t.image)try{let n=new URL(t.image);switch(n.protocol){case"http:":case"https:":return{type:"image",image:n,mimeType:t.mimeType};case"data:":try{let[e,n]=t.image.split(","),r=e.split(";")[0].split(":")[1];if(null==r||null==n)throw Error("Invalid data URL format");return{type:"image",image:G(n),mimeType:r}}catch(t){throw Error(`Error processing data URL: ${(0,y.e$)(e)}`)}default:throw Error(`Unsupported URL protocol: ${n.protocol}`)}}catch(e){}let r=G(t.image);return{type:"image",image:r,mimeType:null!=(n=t.mimeType)?n:function(e){for(let{bytes:t,mimeType:n}of J)if(e.length>=t.length&&t.every((t,n)=>e[n]===t))return n}(r)}}}})};case"assistant":if("string"==typeof e.content)return{role:"assistant",content:[{type:"text",text:e.content}]};return{role:"assistant",content:e.content.filter(e=>"text"!==e.type||""!==e.text)};case"tool":return e;default:throw new Q({role:t})}}function X(e,{contentType:t}){var n;let r=new Headers(null!=(n=null==e?void 0:e.headers)?n:{});return r.has("Content-Type")||r.set("Content-Type",t),r}function ee(e,t){let n=e.pipeThrough(new TransformStream(t));return n[Symbol.asyncIterator]=()=>{let e=n.getReader();return{async next(){let{done:t,value:n}=await e.read();return t?{done:!0,value:void 0}:{done:!1,value:n}}}},n}async function et({model:e,tools:t,toolChoice:n,system:r,prompt:i,messages:o,maxRetries:a,abortSignal:s,onFinish:l,...u}){let c=K({maxRetries:a}),d=function(e){if(null==e.prompt&&null==e.messages)throw new g.Mt({prompt:e,message:"prompt or messages must be defined"});if(null!=e.prompt&&null!=e.messages)throw new g.Mt({prompt:e,message:"prompt and messages cannot be defined at the same time"});return null!=e.prompt?{type:"prompt",prompt:e.prompt,messages:void 0,system:e.system}:{type:"messages",prompt:void 0,messages:e.messages,system:e.system}}({system:r,prompt:i,messages:o}),{stream:f,warnings:h,rawResponse:p}=await c(()=>e.doStream({mode:{type:"regular",...function({tools:e,toolChoice:t}){return null!=e&&Object.keys(e).length>0?{tools:Object.entries(e).map(([e,t])=>({type:"function",name:e,description:t.description,parameters:V(t.parameters)})),toolChoice:null==t?{type:"auto"}:"string"==typeof t?{type:t}:{type:"tool",toolName:t.toolName}}:{tools:void 0,toolChoice:void 0}}({tools:t,toolChoice:n})},...function({maxTokens:e,temperature:t,topP:n,presencePenalty:r,frequencyPenalty:i,seed:o,maxRetries:a}){if(null!=e){if(!Number.isInteger(e))throw new g.RU({parameter:"maxTokens",value:e,message:"maxTokens must be an integer"});if(e<1)throw new g.RU({parameter:"maxTokens",value:e,message:"maxTokens must be >= 1"})}if(null!=t&&"number"!=typeof t)throw new g.RU({parameter:"temperature",value:t,message:"temperature must be a number"});if(null!=n&&"number"!=typeof n)throw new g.RU({parameter:"topP",value:n,message:"topP must be a number"});if(null!=r&&"number"!=typeof r)throw new g.RU({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(null!=i&&"number"!=typeof i)throw new g.RU({parameter:"frequencyPenalty",value:i,message:"frequencyPenalty must be a number"});if(null!=o&&!Number.isInteger(o))throw new g.RU({parameter:"seed",value:o,message:"seed must be an integer"});if(null!=a){if(!Number.isInteger(a))throw new g.RU({parameter:"maxRetries",value:a,message:"maxRetries must be an integer"});if(a<0)throw new g.RU({parameter:"maxRetries",value:a,message:"maxRetries must be >= 0"})}return{maxTokens:e,temperature:null!=t?t:0,topP:n,presencePenalty:r,frequencyPenalty:i,seed:o,maxRetries:null!=a?a:2}}(u),inputFormat:d.type,prompt:function(e){let t=[];null!=e.system&&t.push({role:"system",content:e.system});let n=e.type;switch(n){case"prompt":t.push({role:"user",content:[{type:"text",text:e.prompt}]});break;case"messages":t.push(...e.messages.map(Y));break;default:throw Error(`Unsupported prompt type: ${n}`)}return t}(d),abortSignal:s}));return new en({stream:function({tools:e,generatorStream:t}){let n=!1,r=new Set,i=null,o=new ReadableStream({start(e){i=e}}),a=new TransformStream({transform(t,o){let a=t.type;switch(a){case"text-delta":case"error":o.enqueue(t);break;case"tool-call":{let a=t.toolName;if(null==e){i.enqueue({type:"error",error:new g.h4({toolName:t.toolName})});break}let s=e[a];if(null==s){i.enqueue({type:"error",error:new g.h4({toolName:t.toolName,availableTools:Object.keys(e)})});break}try{let a=function({toolCall:e,tools:t}){let n=e.toolName;if(null==t)throw new g.h4({toolName:e.toolName});let r=t[n];if(null==r)throw new g.h4({toolName:e.toolName,availableTools:Object.keys(t)});let i=(0,y.NX)({text:e.args,schema:r.parameters});if(!1===i.success)throw new g.YN({toolName:n,toolArgs:e.args,cause:i.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:n,args:i.value}}({toolCall:t,tools:e});if(o.enqueue(a),null!=s.execute){let e=(0,y.Ox)();r.add(e),s.execute(a.args).then(t=>{i.enqueue({...a,type:"tool-result",result:t}),r.delete(e),n&&0===r.size&&i.close()},t=>{i.enqueue({type:"error",error:t}),r.delete(e),n&&0===r.size&&i.close()})}}catch(e){i.enqueue({type:"error",error:e})}break}case"finish":var s;o.enqueue({type:"finish",finishReason:t.finishReason,logprobs:t.logprobs,usage:{promptTokens:(s=t.usage).promptTokens,completionTokens:s.completionTokens,totalTokens:s.promptTokens+s.completionTokens}});break;case"tool-call-delta":break;default:throw Error(`Unhandled chunk type: ${a}`)}},flush(){n=!0,0===r.size&&i.close()}});return new ReadableStream({start:async e=>Promise.all([t.pipeThrough(a).pipeTo(new WritableStream({write(t){e.enqueue(t)},close(){}})),o.pipeTo(new WritableStream({write(t){e.enqueue(t)},close(){e.close()}}))])})}({tools:t,generatorStream:f}),warnings:h,rawResponse:p,onFinish:l})}var en=class{constructor({stream:e,warnings:t,rawResponse:n,onFinish:r}){let i,o,a,s,l,u,c;this.warnings=t,this.rawResponse=n,this.onFinish=r,this.usage=new Promise(e=>{i=e}),this.finishReason=new Promise(e=>{o=e}),this.text=new Promise(e=>{a=e}),this.toolCalls=new Promise(e=>{s=e}),this.toolResults=new Promise(e=>{l=e});let d="",f=[],h=[],p=this;this.originalStream=e.pipeThrough(new TransformStream({async transform(e,t){t.enqueue(e),"text-delta"===e.type&&(d+=e.textDelta),"tool-call"===e.type&&f.push(e),"tool-result"===e.type&&h.push(e),"finish"===e.type&&(c=e.usage,u=e.finishReason,i(c),o(u),a(d),s(f))},async flush(e){var r;try{l(h),await (null==(r=p.onFinish)?void 0:r.call(p,{finishReason:null!=u?u:"unknown",usage:null!=c?c:{promptTokens:NaN,completionTokens:NaN,totalTokens:NaN},text:d,toolCalls:f,toolResults:h,rawResponse:n,warnings:t}))}catch(t){e.error(t)}}}))}teeStream(){let[e,t]=this.originalStream.tee();return this.originalStream=t,e}get textStream(){return ee(this.teeStream(),{transform(e,t){if("text-delta"===e.type)e.textDelta.length>0&&t.enqueue(e.textDelta);else if("error"===e.type)throw e.error}})}get fullStream(){return ee(this.teeStream(),{transform(e,t){"text-delta"===e.type?e.textDelta.length>0&&t.enqueue(e):t.enqueue(e)}})}toAIStream(e={}){let t="",n=new TransformStream({async start(){e.onStart&&await e.onStart()},async transform(n,r){if(r.enqueue(n),"text-delta"===n.type){let r=n.textDelta;t+=r,e.onToken&&await e.onToken(r),e.onText&&await e.onText(r)}},async flush(){e.onCompletion&&await e.onCompletion(t),e.onFinal&&await e.onFinal(t)}}),r=new TransformStream({transform:async(e,t)=>{switch(e.type){case"text-delta":t.enqueue(m("text",e.textDelta));break;case"tool-call":t.enqueue(m("tool_call",{toolCallId:e.toolCallId,toolName:e.toolName,args:e.args}));break;case"tool-result":t.enqueue(m("tool_result",{toolCallId:e.toolCallId,toolName:e.toolName,args:e.args,result:e.result}));break;case"error":t.enqueue(m("error",JSON.stringify(e.error)))}}});return this.fullStream.pipeThrough(n).pipeThrough(r).pipeThrough(new TextEncoderStream)}pipeAIStreamToResponse(e,t){var n;e.writeHead(null!=(n=null==t?void 0:t.status)?n:200,{"Content-Type":"text/plain; charset=utf-8",...null==t?void 0:t.headers});let r=this.toAIStream().getReader();(async()=>{try{for(;;){let{done:t,value:n}=await r.read();if(t)break;e.write(n)}}catch(e){throw e}finally{e.end()}})()}pipeTextStreamToResponse(e,t){var n;e.writeHead(null!=(n=null==t?void 0:t.status)?n:200,{"Content-Type":"text/plain; charset=utf-8",...null==t?void 0:t.headers});let r=this.textStream.pipeThrough(new TextEncoderStream).getReader();(async()=>{try{for(;;){let{done:t,value:n}=await r.read();if(t)break;e.write(n)}}catch(e){throw e}finally{e.end()}})()}toAIStreamResponse(e){return new ei(this.toAIStream(),e)}toTextStreamResponse(e){var t;return new Response(this.textStream.pipeThrough(new TextEncoderStream),{status:null!=(t=null==e?void 0:e.status)?t:200,headers:X(e,{contentType:"text/plain; charset=utf-8"})})}};function er(e,t){return e.pipeThrough(new TransformStream({transform:async(e,t)=>{if("string"==typeof e)t.enqueue(e);else if("string"==typeof e.content)t.enqueue(e.content);else for(let n of e.content)"text"===n.type&&t.enqueue(n.text)}})).pipeThrough(function(e){let t=new TextEncoder,n="",r=e||{};return new TransformStream({async start(){r.onStart&&await r.onStart()},async transform(e,i){let o="string"==typeof e?e:e.content;i.enqueue(t.encode(o)),n+=o,r.onToken&&await r.onToken(o),r.onText&&"string"==typeof e&&await r.onText(e)},async flush(){r.onCompletion&&await r.onCompletion(n),!r.onFinal||"experimental_onFunctionCall"in r||await r.onFinal(n)}})}(t)).pipeThrough(function(){let e=new TextEncoder,t=new TextDecoder;return new TransformStream({transform:async(n,r)=>{let i=t.decode(n);r.enqueue(e.encode(m("text",i)))}})}())}new TextDecoder("utf-8"),((e,t)=>{for(var n in t)B(e,n,{get:t[n],enumerable:!0})})({},{toAIStream:()=>er}),Symbol("internal_openai_fn_messages");var ei=class extends Response{constructor(e,t,n){let r=e;n&&(r=function(e,t){let n,r;let i=e.getReader(),o=t.getReader(),a=!1,s=!1;async function l(e){try{null==n&&(n=i.read());let t=await n;n=void 0,t.done?e.close():e.enqueue(t.value)}catch(t){e.error(t)}}async function u(e){try{null==r&&(r=o.read());let t=await r;r=void 0,t.done?e.close():e.enqueue(t.value)}catch(t){e.error(t)}}return new ReadableStream({async pull(e){try{if(a){u(e);return}if(s){l(e);return}null==n&&(n=i.read()),null==r&&(r=o.read());let{result:t,reader:c}=await Promise.race([n.then(e=>({result:e,reader:i})),r.then(e=>({result:e,reader:o}))]);t.done||e.enqueue(t.value),c===i?(n=void 0,t.done&&(u(e),a=!0)):(r=void 0,t.done&&(s=!0,l(e)))}catch(t){e.error(t)}},cancel(){i.cancel(),o.cancel()}})}(n.stream,e)),super(r,{...t,status:200,headers:X(t,{contentType:"text/plain; charset=utf-8"})})}}},16876:function(e,t,n){"use strict";n.d(t,{mY:function(){return T}});var r=/[\\\/_+.#"@\[\(\{&]/,i=/[\\\/_+.#"@\[\(\{&]/g,o=/[\s-]/,a=/[\s-]/g;function s(e){return e.toLowerCase().replace(a," ")}var l=n(13304),u=n(2265),c=n(25171),d='[cmdk-group=""]',f='[cmdk-group-items=""]',h='[cmdk-item=""]',p=`${h}:not([aria-disabled="true"])`,m="cmdk-item-select",g="data-value",y=(e,t,n)=>{var l;return l=e,function e(t,n,s,l,u,c,d){if(c===n.length)return u===t.length?1:.99;var f=`${u},${c}`;if(void 0!==d[f])return d[f];for(var h,p,m,g,y=l.charAt(c),v=s.indexOf(y,u),b=0;v>=0;)(h=e(t,n,s,l,v+1,c+1,d))>b&&(v===u?h*=1:r.test(t.charAt(v-1))?(h*=.8,(m=t.slice(u,v-1).match(i))&&u>0&&(h*=Math.pow(.999,m.length))):o.test(t.charAt(v-1))?(h*=.9,(g=t.slice(u,v-1).match(a))&&u>0&&(h*=Math.pow(.999,g.length))):(h*=.17,u>0&&(h*=Math.pow(.999,v-u))),t.charAt(v)!==n.charAt(c)&&(h*=.9999)),(h<.1&&s.charAt(v-1)===l.charAt(c+1)||l.charAt(c+1)===l.charAt(c)&&s.charAt(v-1)!==l.charAt(c))&&.1*(p=e(t,n,s,l,v+1,c+2,d))>h&&(h=.1*p),h>b&&(b=h),v=s.indexOf(y,v+1);return d[f]=b,b}(l=n&&n.length>0?`${l+" "+n.join(" ")}`:l,t,s(l),s(t),0,0,{})},v=u.createContext(void 0),b=()=>u.useContext(v),w=u.createContext(void 0),x=()=>u.useContext(w),k=u.createContext(void 0),_=u.forwardRef((e,t)=>{let n=M(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=M(()=>new Set),i=M(()=>new Map),o=M(()=>new Map),a=M(()=>new Set),s=A(e),{label:l,children:b,value:x,onValueChange:k,filter:_,shouldFilter:S,loop:O,disablePointerSelection:C=!1,vimBindings:E=!0,...P}=e,j=u.useId(),T=u.useId(),z=u.useId(),R=u.useRef(null),N=D();I(()=>{if(void 0!==x){let e=x.trim();n.current.value=e,q.emit()}},[x]),I(()=>{N(6,H)},[]);let q=u.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,o,a;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)B(),$(),N(1,V);else if("value"===e&&(r||N(5,H),(null==(i=s.current)?void 0:i.value)!==void 0)){null==(a=(o=s.current).onValueChange)||a.call(o,null!=t?t:"");return}q.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),Z=u.useMemo(()=>({value:(e,t,r)=>{var i;t!==(null==(i=o.current.get(e))?void 0:i.value)&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,U(t,r)),N(2,()=>{$(),q.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),N(3,()=>{B(),$(),n.current.value||V(),q.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=K();N(4,()=>{B(),(null==t?void 0:t.getAttribute("id"))===e&&V(),q.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{o.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],disablePointerSelection:C,listId:j,inputId:z,labelId:T,listInnerRef:R}),[]);function U(e,t){var r,i;let o=null!=(i=null==(r=s.current)?void 0:r.filter)?i:y;return e?o(e,n.current.search,t):0}function $(){if(!n.current.search||!1===s.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),o=0;r.forEach(t=>{o=Math.max(e.get(t),o)}),t.push([n,o])});let r=R.current;W().sort((t,n)=>{var r,i;let o=t.getAttribute("id"),a=n.getAttribute("id");return(null!=(r=e.get(a))?r:0)-(null!=(i=e.get(o))?i:0)}).forEach(e=>{let t=e.closest(f);t?t.appendChild(e.parentElement===t?e:e.closest(`${f} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${f} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=R.current.querySelector(`${d}[${g}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)})}function V(){let e=W().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(g);q.setState("value",t||void 0)}function B(){var e,t,a,l;if(!n.current.search||!1===s.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let u=0;for(let i of r.current){let r=U(null!=(t=null==(e=o.current.get(i))?void 0:e.value)?t:"",null!=(l=null==(a=o.current.get(i))?void 0:a.keywords)?l:[]);n.current.filtered.items.set(i,r),r>0&&u++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=u}function H(){var e,t,n;let r=K();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(d))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function K(){var e;return null==(e=R.current)?void 0:e.querySelector(`${h}[aria-selected="true"]`)}function W(){var e;return Array.from(null==(e=R.current)?void 0:e.querySelectorAll(p))}function J(e){let t=W()[e];t&&q.setState("value",t.getAttribute(g))}function G(e){var t;let n=K(),r=W(),i=r.findIndex(e=>e===n),o=r[i+e];null!=(t=s.current)&&t.loop&&(o=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),o&&q.setState("value",o.getAttribute(g))}function Q(e){let t=K(),n=null==t?void 0:t.closest(d),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,d):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,d))?void 0:n.querySelector(p);r?q.setState("value",r.getAttribute(g)):G(e)}let Y=()=>J(W().length-1),X=e=>{e.preventDefault(),e.metaKey?Y():e.altKey?Q(1):G(1)},ee=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?Q(-1):G(-1)};return u.createElement(c.WV.div,{ref:t,tabIndex:-1,...P,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=P.onKeyDown)||t.call(P,e),!e.defaultPrevented)switch(e.key){case"n":case"j":E&&e.ctrlKey&&X(e);break;case"ArrowDown":X(e);break;case"p":case"k":E&&e.ctrlKey&&ee(e);break;case"ArrowUp":ee(e);break;case"Home":e.preventDefault(),J(0);break;case"End":e.preventDefault(),Y();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=K();if(t){let e=new Event(m);t.dispatchEvent(e)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:Z.inputId,id:Z.labelId,style:F},l),L(e,e=>u.createElement(w.Provider,{value:q},u.createElement(v.Provider,{value:Z},e))))}),S=u.forwardRef((e,t)=>{var n,r;let i=u.useId(),o=u.useRef(null),a=u.useContext(k),s=b(),l=A(e),d=null!=(r=null==(n=l.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;I(()=>{if(!d)return s.item(i,null==a?void 0:a.id)},[d]);let f=N(i,o,[e.value,e.children,o],e.keywords),h=x(),p=R(e=>e.value&&e.value===f.current),g=R(e=>!!d||!1===s.filter()||!e.search||e.filtered.items.get(i)>0);function y(){var e,t;v(),null==(t=(e=l.current).onSelect)||t.call(e,f.current)}function v(){h.setState("value",f.current,!0)}if(u.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(m,y),()=>t.removeEventListener(m,y)},[g,e.onSelect,e.disabled]),!g)return null;let{disabled:w,value:_,onSelect:S,forceMount:O,keywords:C,...E}=e;return u.createElement(c.WV.div,{ref:z([o,t]),...E,id:i,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!p,"data-disabled":!!w,"data-selected":!!p,onPointerMove:w||s.disablePointerSelection?void 0:v,onClick:w?void 0:y},e.children)}),O=u.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,a=u.useId(),s=u.useRef(null),l=u.useRef(null),d=u.useId(),f=b(),h=R(e=>!!i||!1===f.filter()||!e.search||e.filtered.groups.has(a));I(()=>f.group(a),[]),N(a,s,[e.value,e.heading,l]);let p=u.useMemo(()=>({id:a,forceMount:i}),[i]);return u.createElement(c.WV.div,{ref:z([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:!h||void 0},n&&u.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),L(e,e=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},u.createElement(k.Provider,{value:p},e))))}),C=u.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=u.useRef(null),o=R(e=>!e.search);return n||o?u.createElement(c.WV.div,{ref:z([i,t]),...r,"cmdk-separator":"",role:"separator"}):null}),E=u.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=null!=e.value,o=x(),a=R(e=>e.search),s=R(e=>e.value),l=b(),d=u.useMemo(()=>{var e;let t=null==(e=l.listInnerRef.current)?void 0:e.querySelector(`${h}[${g}="${encodeURIComponent(s)}"]`);return null==t?void 0:t.getAttribute("id")},[]);return u.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),u.createElement(c.WV.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":d,id:l.inputId,type:"text",value:i?e.value:a,onChange:e=>{i||o.setState("search",e.target.value),null==n||n(e.target.value)}})}),P=u.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=u.useRef(null),a=u.useRef(null),s=b();return u.useEffect(()=>{if(a.current&&o.current){let e=a.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),u.createElement(c.WV.div,{ref:z([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:s.listId},L(e,e=>u.createElement("div",{ref:z([a,s.listInnerRef]),"cmdk-list-sizer":""},e)))}),j=u.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=e;return u.createElement(l.fC,{open:n,onOpenChange:r},u.createElement(l.h_,{container:a},u.createElement(l.aV,{"cmdk-overlay":"",className:i}),u.createElement(l.VY,{"aria-label":e.label,"cmdk-dialog":"",className:o},u.createElement(_,{ref:t,...s}))))}),T=Object.assign(_,{List:P,Item:S,Input:E,Group:O,Separator:C,Dialog:j,Empty:u.forwardRef((e,t)=>R(e=>0===e.filtered.count)?u.createElement(c.WV.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:u.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return u.createElement(c.WV.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},L(e,e=>u.createElement("div",{"aria-hidden":!0},e)))})});function A(e){let t=u.useRef(e);return I(()=>{t.current=e}),t}var I="undefined"==typeof window?u.useEffect:u.useLayoutEffect;function M(e){let t=u.useRef();return void 0===t.current&&(t.current=e()),t}function z(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function R(e){let t=x(),n=()=>e(t.snapshot());return u.useSyncExternalStore(t.subscribe,n,n)}function N(e,t,n,r=[]){let i=u.useRef(),o=b();return I(()=>{var a;let s=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),l=r.map(e=>e.trim());o.value(e,s,l),null==(a=t.current)||a.setAttribute(g,s),i.current=s}),i}var D=()=>{let[e,t]=u.useState(),n=M(()=>new Map);return I(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function L({asChild:e,children:t},n){let r;return e&&u.isValidElement(t)?u.cloneElement("function"==typeof(r=t.type)?r(t.props):"render"in r?r.render(t.props):t,{ref:t.ref},n(t.props.children)):n(t)}var F={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"}},68628:function(e,t,n){"use strict";function r(e=[],t=[]){let n=Math.min(e.length,t.length),r=0,i=0,o=0,a=0;for(;a1&&void 0!==arguments[1]?arguments[1]:{},n=t.localeMatcher||"lookup";switch(n){case"lookup":case"best fit":return function(e){var t=s(e);if(t)return t;for(var n=e.split("-");e.length>1;){n.pop();var r=s(e=n.join("-"));if(r)return r}}(e);default:throw RangeError('Invalid "localeMatcher" option: '.concat(n))}}var u={af:function(e){return 1==e?"one":"other"},am:function(e){return e>=0&&e<=1?"one":"other"},ar:function(e){var t=String(e).split("."),n=Number(t[0])==e&&t[0].slice(-2);return 0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},ast:function(e){var t=!String(e).split(".")[1];return 1==e&&t?"one":"other"},be:function(e){var t=String(e).split("."),n=Number(t[0])==e,r=n&&t[0].slice(-1),i=n&&t[0].slice(-2);return 1==r&&11!=i?"one":r>=2&&r<=4&&(i<12||i>14)?"few":n&&0==r||r>=5&&r<=9||i>=11&&i<=14?"many":"other"},br:function(e){var t=String(e).split("."),n=Number(t[0])==e,r=n&&t[0].slice(-1),i=n&&t[0].slice(-2),o=n&&t[0].slice(-6);return 1==r&&11!=i&&71!=i&&91!=i?"one":2==r&&12!=i&&72!=i&&92!=i?"two":(3==r||4==r||9==r)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":0!=e&&n&&0==o?"many":"other"},bs:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],o=n.slice(-1),a=n.slice(-2),s=r.slice(-1),l=r.slice(-2);return i&&1==o&&11!=a||1==s&&11!=l?"one":i&&o>=2&&o<=4&&(a<12||a>14)||s>=2&&s<=4&&(l<12||l>14)?"few":"other"},ca:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-6);return 1==e&&r?"one":0!=n&&0==i&&r?"many":"other"},ceb:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],o=n.slice(-1),a=r.slice(-1);return i&&(1==n||2==n||3==n)||i&&4!=o&&6!=o&&9!=o||!i&&4!=a&&6!=a&&9!=a?"one":"other"},cs:function(e){var t=String(e).split("."),n=t[0],r=!t[1];return 1==e&&r?"one":n>=2&&n<=4&&r?"few":r?"other":"many"},cy:function(e){return 0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e){var t=String(e).split("."),n=t[0],r=Number(t[0])==e;return 1!=e&&(r||0!=n&&1!=n)?"other":"one"},dsb:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],o=n.slice(-2),a=r.slice(-2);return i&&1==o||1==a?"one":i&&2==o||2==a?"two":i&&(3==o||4==o)||3==a||4==a?"few":"other"},dz:function(e){return"other"},es:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-6);return 1==e?"one":0!=n&&0==i&&r?"many":"other"},ff:function(e){return e>=0&&e<2?"one":"other"},fr:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-6);return e>=0&&e<2?"one":0!=n&&0==i&&r?"many":"other"},ga:function(e){var t=Number(String(e).split(".")[0])==e;return 1==e?"one":2==e?"two":t&&e>=3&&e<=6?"few":t&&e>=7&&e<=10?"many":"other"},gd:function(e){var t=Number(String(e).split(".")[0])==e;return 1==e||11==e?"one":2==e||12==e?"two":t&&e>=3&&e<=10||t&&e>=13&&e<=19?"few":"other"},he:function(e){var t=String(e).split("."),n=t[0],r=!t[1];return 1==n&&r||0==n&&!r?"one":2==n&&r?"two":"other"},is:function(e){var t=String(e).split("."),n=t[0],r=(t[1]||"").replace(/0+$/,""),i=Number(t[0])==e,o=n.slice(-1),a=n.slice(-2);return i&&1==o&&11!=a||r%10==1&&r%100!=11?"one":"other"},ksh:function(e){return 0==e?"zero":1==e?"one":"other"},lt:function(e){var t=String(e).split("."),n=t[1]||"",r=Number(t[0])==e,i=r&&t[0].slice(-1),o=r&&t[0].slice(-2);return 1==i&&(o<11||o>19)?"one":i>=2&&i<=9&&(o<11||o>19)?"few":0!=n?"many":"other"},lv:function(e){var t=String(e).split("."),n=t[1]||"",r=n.length,i=Number(t[0])==e,o=i&&t[0].slice(-1),a=i&&t[0].slice(-2),s=n.slice(-2),l=n.slice(-1);return i&&0==o||a>=11&&a<=19||2==r&&s>=11&&s<=19?"zero":1==o&&11!=a||2==r&&1==l&&11!=s||2!=r&&1==l?"one":"other"},mk:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],o=n.slice(-1),a=n.slice(-2),s=r.slice(-1),l=r.slice(-2);return i&&1==o&&11!=a||1==s&&11!=l?"one":"other"},mt:function(e){var t=String(e).split("."),n=Number(t[0])==e&&t[0].slice(-2);return 1==e?"one":2==e?"two":0==e||n>=3&&n<=10?"few":n>=11&&n<=19?"many":"other"},pa:function(e){return 0==e||1==e?"one":"other"},pl:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-1),o=n.slice(-2);return 1==e&&r?"one":r&&i>=2&&i<=4&&(o<12||o>14)?"few":r&&1!=n&&(0==i||1==i)||r&&i>=5&&i<=9||r&&o>=12&&o<=14?"many":"other"},pt:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-6);return 0==n||1==n?"one":0!=n&&0==i&&r?"many":"other"},ro:function(e){var t=String(e).split("."),n=!t[1],r=Number(t[0])==e&&t[0].slice(-2);return 1==e&&n?"one":!n||0==e||1!=e&&r>=1&&r<=19?"few":"other"},ru:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-1),o=n.slice(-2);return r&&1==i&&11!=o?"one":r&&i>=2&&i<=4&&(o<12||o>14)?"few":r&&0==i||r&&i>=5&&i<=9||r&&o>=11&&o<=14?"many":"other"},se:function(e){return 1==e?"one":2==e?"two":"other"},si:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"";return 0==e||1==e||0==n&&1==r?"one":"other"},sl:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-2);return r&&1==i?"one":r&&2==i?"two":r&&(3==i||4==i)||!r?"few":"other"}};function c(e){return"pt-PT"===e?e:function(e){var t=e.match(d);if(!t)throw TypeError("Invalid locale: ".concat(e));return t[1]}(e)}u.as=u.am,u.az=u.af,u.bg=u.af,u.bn=u.am,u.brx=u.af,u.ce=u.af,u.chr=u.af,u.de=u.ast,u.ee=u.af,u.el=u.af,u.en=u.ast,u.et=u.ast,u.eu=u.af,u.fa=u.am,u.fi=u.ast,u.fil=u.ceb,u.fo=u.af,u.fur=u.af,u.fy=u.ast,u.gl=u.ast,u.gu=u.am,u.ha=u.af,u.hi=u.am,u.hr=u.bs,u.hsb=u.dsb,u.hu=u.af,u.hy=u.ff,u.ia=u.ast,u.id=u.dz,u.ig=u.dz,u.it=u.ca,u.ja=u.dz,u.jgo=u.af,u.jv=u.dz,u.ka=u.af,u.kea=u.dz,u.kk=u.af,u.kl=u.af,u.km=u.dz,u.kn=u.am,u.ko=u.dz,u.ks=u.af,u.ku=u.af,u.ky=u.af,u.lb=u.af,u.lkt=u.dz,u.lo=u.dz,u.ml=u.af,u.mn=u.af,u.mr=u.af,u.ms=u.dz,u.my=u.dz,u.nb=u.af,u.ne=u.af,u.nl=u.ast,u.nn=u.af,u.no=u.af,u.or=u.af,u.pcm=u.am,u.ps=u.af,u.rm=u.af,u.sah=u.dz,u.sc=u.ast,u.sd=u.af,u.sk=u.cs,u.so=u.af,u.sq=u.af,u.sr=u.bs,u.su=u.dz,u.sv=u.ast,u.sw=u.ast,u.ta=u.af,u.te=u.af,u.th=u.dz,u.ti=u.pa,u.tk=u.af,u.to=u.dz,u.tr=u.af,u.ug=u.af,u.uk=u.ru,u.ur=u.ast,u.uz=u.af,u.vi=u.dz,u.wae=u.af,u.wo=u.dz,u.xh=u.af,u.yi=u.ast,u.yo=u.dz,u.yue=u.dz,u.zh=u.dz,u.zu=u.am;var d=/^([a-z0-9]+)/i;function f(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=n.numeric,o=n.style,a=n.localeMatcher;if(this.numeric="always",this.style="long",this.localeMatcher="lookup",void 0!==r){if(0>w.indexOf(r))throw RangeError('Invalid "numeric" option: '.concat(r));this.numeric=r}if(void 0!==o){if(0>x.indexOf(o))throw RangeError('Invalid "style" option: '.concat(o));this.style=o}if(void 0!==a){if(0>k.indexOf(a))throw RangeError('Invalid "localeMatcher" option: '.concat(a));this.localeMatcher=a}if("string"==typeof e&&(e=[e]),e.push(i),this.locale=t.supportedLocalesOf(e,{localeMatcher:this.localeMatcher})[0],!this.locale)throw Error("No supported locale was found");h.supportedLocalesOf(this.locale).length>0?this.pluralRules=new h(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=l(this.locale,{localeMatcher:this.localeMatcher})}return e=[{key:"format",value:function(){var e=O(arguments),t=y(e,2),n=t[0],r=t[1];return this.getRule(n,r).replace("{0}",this.formatNumber(Math.abs(n)))}},{key:"formatToParts",value:function(){var e=O(arguments),t=y(e,2),n=t[0],r=t[1],i=this.getRule(n,r),o=i.indexOf("{0}");if(o<0)return[{type:"literal",value:i}];var a=[];return o>0&&a.push({type:"literal",value:i.slice(0,o)}),a=a.concat(this.formatNumberToParts(Math.abs(n)).map(function(e){return g(g({},e),{},{unit:r})})),o+31&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e)e=[e];else if(!Array.isArray(e))throw TypeError('Invalid "locales" argument');return e.filter(function(e){return l(e,t)})},_.addLocale=function(e){if(!e)throw Error("No locale data passed");o[e.locale]=e,a[e.locale.toLowerCase()]=e.locale},_.setDefaultLocale=function(e){i=e},_.getDefaultLocale=function(){return i},_.PluralRules=h;var S='Invalid "unit" argument';function O(e){if(e.length<2)throw TypeError('"unit" argument is required');return[function(e){if(e=Number(e),Number.isFinite&&!Number.isFinite(e))throw RangeError("".concat('Invalid "number" argument',": ").concat(e));return e}(e[0]),function(e){if("symbol"===p(e))throw TypeError(S);if("string"!=typeof e||("s"===e[e.length-1]&&(e=e.slice(0,e.length-1)),0>b.indexOf(e)))throw RangeError("".concat(S,": ").concat(e));return e}(e[1])]}function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var E=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.cache={}}return e=[{key:"get",value:function(){for(var e=this.cache,t=arguments.length,n=Array(t),r=0;re.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.polyfill;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e&&(e=[e]),this.locale=function(e,t){for(var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return j(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,void 0)}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=r()).done;){var i=n.value;if(t(i))return i;for(var o=i.split("-");o.length>1;)if(o.pop(),t(i=o.join("-")))return i}throw Error("No locale data has been registered for any of the locales: ".concat(e.join(", ")))}(e.concat(t.getDefaultLocale()),Z),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===r?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=_,this.IntlPluralRules=_.PluralRules),this.relativeTimeFormatCache=new E,this.pluralRulesCache=new E}return e=[{key:"format",value:function(e,t,n){n||(t&&!function(e){return"string"==typeof e||void 0!==T(e)&&null!==e&&e.constructor===A&&(Array.isArray(e.steps)||Array.isArray(e.gradation)||Array.isArray(e.flavour)||"string"==typeof e.flavour||Array.isArray(e.labels)||"string"==typeof e.labels||Array.isArray(e.units)||"function"==typeof e.custom)}(t)?(n=t,t=void 0):n={}),t||(t=H),"string"==typeof t&&(t=function(e){switch(e){case"default":case"round":return $;case"round-minute":return H;case"approximate":default:return W;case"time":case"approximate-time":return J;case"mini":return ef;case"mini-now":return em;case"mini-minute":return ev;case"mini-minute-now":return ex;case"twitter":return X;case"twitter-now":return en;case"twitter-minute":return eo;case"twitter-minute-now":return el;case"twitter-first-minute":return ed}}(t));var r,i,o,a,s,l,u,c=function(e){if(e.constructor===Date||"object"===ek(e)&&"function"==typeof e.getTime)return e.getTime();if("number"==typeof e)return e;throw Error("Unsupported relative time formatter input: ".concat(ek(e),", ").concat(e))}(e),d=this.getLabels(t.flavour||t.labels),f=d.labels,h=d.labelsType;void 0!==t.now&&(u=t.now),void 0===u&&void 0!==n.now&&(u=n.now),void 0===u&&(u=Date.now());var p=(u-c)/1e3,m=n.future||p<0,g=(r=Z(this.locale).now,i=Z(this.locale).long,(o=f.now||r&&r.now)?"string"==typeof o?o:m?o.future:o.past:i&&i.second&&i.second.current?i.second.current:void 0);if(t.custom){var y=t.custom({now:u,date:new Date(c),time:c,elapsed:p,locale:this.locale});if(void 0!==y)return y}var v=(a=t.units,s=Object.keys(f),g&&s.push("now"),a&&(s=a.filter(function(e){return"now"===e||s.indexOf(e)>=0})),s),b=n.round||t.round,w=function(e){if(Array.isArray(e))return e}(l=function(e,t,n){var r=n.now,i=n.future,o=n.round,a=n.units,s=n.getNextStep,l=function(e,t,n){var r=n.now,i=n.future,o=n.round;if(0!==e.length){var a=function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=D(t[i],function(e){for(var t=1;t0?e[a-1]:s}}}(e=e.filter(function(e){var t=e.unit,n=e.formatAs;return!(t=t||n)||a.indexOf(t)>=0}),t,{now:r,future:i,round:o});if(s){if(l){var u=e[e.indexOf(l)-1],c=e[e.indexOf(l)+1];return[u,l,c]}return[void 0,void 0,e[0]]}return l}(t.gradation||t.steps||H.steps,p,{now:u,units:v,round:b,future:m,getNextStep:!0}))||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,s=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),3!==o.length);a=!0);}catch(e){s=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(s)throw r}}return o}}(l,3)||e_(l,3)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),x=w[0],k=w[1],_=w[2],S=this.formatDateForStep(c,k,p,{labels:f,labelsType:h,nowLabel:g,now:u,future:m,round:b})||"";return n.getTimeToNextUpdate?[S,function(e,t,n){var r,i=n.prevStep,o=n.nextStep,a=n.now,s=n.future,l=n.round,u=e.getTime?e.getTime():e,c=function(e){return function(e,t,n){var r=n.now,i=n.round;if(I(e)){var o=1e3*I(e),a=Math.abs(t-r),s=z(i)(a/o)*o;return t>r?s>0?a-s+((1-R(i))*o+1):a-s+1:-(a-s)+R(i)*o}}(e,u,{now:a,round:l})},d=function(e,t,n){var r=n.now,i=n.future,o=n.round,a=n.prevStep;if(e){var s,l,u,c,d=void 0===(c=D(e,{timestamp:t,now:l=(s={now:r,future:i,round:o,prevStep:a}).now,future:u=s.future,round:s.round,prevStep:s.prevStep}))?void 0:u?t-1e3*c+1:0===c&&t===l?31536e9:t+1e3*c;if(void 0===d)return;return d-r}return i?t-r+1:31536e9}(s?t:o,u,{future:s,now:a,round:l,prevStep:s?i:t});if(void 0!==d){if(t&&(t.getTimeToNextUpdate&&(r=t.getTimeToNextUpdate(u,{getTimeToNextUpdateForUnit:c,getRoundFunction:z,now:a,future:s,round:l})),void 0===r)){var f=t.unit||t.formatAs;f&&(r=c(f))}return void 0===r?d:Math.min(r,d)}}(c,k,{nextStep:_,prevStep:x,now:u,future:m,round:b})]:S}},{key:"formatDateForStep",value:function(e,t,n,r){var i=this,o=r.labels,a=r.labelsType,s=r.nowLabel,l=r.now,u=r.future,c=r.round;if(t){if(t.format)return t.format(e,this.locale,{formatAs:function(e,t){return i.formatValue(t,e,{labels:o,future:u})},now:l,future:u});var d=t.unit||t.formatAs;if(!d)throw Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(t)));if("now"===d)return s;var f=Math.abs(n)/M(t);t.granularity&&(f=z(c)(f/t.granularity)*t.granularity);var h=-1*Math.sign(n)*z(c)(f);switch(0===h&&(h=u?0:-0),a){case"long":case"short":case"narrow":return this.getFormatter(a).format(h,d);default:return this.formatValue(h,d,{labels:o,future:u})}}}},{key:"formatValue",value:function(e,t,n){var r=n.labels,i=n.future;return this.getFormattingRule(r,t,e,{future:i}).replace("{0}",this.formatNumber(Math.abs(e)))}},{key:"getFormattingRule",value:function(e,t,n,r){var i=r.future;if(this.locale,"string"==typeof(e=e[t]))return e;var o=e[0===n?i?"future":"past":n<0?"past":"future"]||e;return"string"==typeof o?o:o[this.getPluralRules().select(Math.abs(n))]||o.other}},{key:"formatNumber",value:function(e){return this.numberFormat?this.numberFormat.format(e):String(e)}},{key:"getFormatter",value:function(e){return this.relativeTimeFormatCache.get(this.locale,e)||this.relativeTimeFormatCache.put(this.locale,e,new this.IntlRelativeTimeFormat(this.locale,{style:e}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof e&&(e=[e]),e=(e=e.map(function(e){switch(e){case"tiny":case"mini-time":return"mini";default:return e}})).concat("long");for(var t,n=Z(this.locale),r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=e_(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(t=r()).done;){var i=t.value;if(n[i])return{labelsType:i,labels:n[i]}}}}],function(e,t){for(var n=0;n-1&&e.test(String.fromCharCode(t))}}},88973:function(e,t,n){"use strict";function r(e,t,n,r){let i;let o=e.length,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a0?(r(e,e.length,0,t),e):t}n.d(t,{V:function(){return i},d:function(){return r}})},80658:function(e,t,n){"use strict";n.d(t,{r:function(){return i}});var r=n(99685);function i(e){return null===e||(0,r.z3)(e)||(0,r.B8)(e)?1:(0,r.Xh)(e)?2:void 0}},54696:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(88973);let i={}.hasOwnProperty;function o(e){let t={},n=-1;for(;++n"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),T=P({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function A(e,t){return t in e?e[t]:t}function I(e,t){return A(e,t.toLowerCase())}let M=P({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:I,properties:{xmlns:null,xmlnsXLink:null}}),z=P({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:v,ariaAutoComplete:null,ariaBusy:v,ariaChecked:v,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:x,ariaCurrent:null,ariaDescribedBy:x,ariaDetails:null,ariaDisabled:v,ariaDropEffect:x,ariaErrorMessage:null,ariaExpanded:v,ariaFlowTo:x,ariaGrabbed:v,ariaHasPopup:null,ariaHidden:v,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:x,ariaLevel:w,ariaLive:null,ariaModal:v,ariaMultiLine:v,ariaMultiSelectable:v,ariaOrientation:null,ariaOwns:x,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:v,ariaReadOnly:v,ariaRelevant:null,ariaRequired:v,ariaRoleDescription:x,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:v,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null}}),R=P({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:I,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:k,acceptCharset:x,accessKey:x,action:null,allow:null,allowFullScreen:y,allowPaymentRequest:y,allowUserMedia:y,alt:null,as:null,async:y,autoCapitalize:null,autoComplete:x,autoFocus:y,autoPlay:y,blocking:x,capture:null,charSet:null,checked:y,cite:null,className:x,cols:w,colSpan:null,content:null,contentEditable:v,controls:y,controlsList:x,coords:w|k,crossOrigin:null,data:null,dateTime:null,decoding:null,default:y,defer:y,dir:null,dirName:null,disabled:y,download:b,draggable:v,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:y,formTarget:null,headers:x,height:w,hidden:y,high:w,href:null,hrefLang:null,htmlFor:x,httpEquiv:x,id:null,imageSizes:null,imageSrcSet:null,inert:y,inputMode:null,integrity:null,is:null,isMap:y,itemId:null,itemProp:x,itemRef:x,itemScope:y,itemType:x,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:y,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:y,muted:y,name:null,nonce:null,noModule:y,noValidate:y,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:y,optimum:w,pattern:null,ping:x,placeholder:null,playsInline:y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:y,referrerPolicy:null,rel:x,required:y,reversed:y,rows:w,rowSpan:w,sandbox:x,scope:null,scoped:y,seamless:y,selected:y,shadowRootClonable:y,shadowRootDelegatesFocus:y,shadowRootMode:null,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:v,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:y,useMap:null,value:v,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:x,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:y,declare:y,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:y,noHref:y,noShade:y,noWrap:y,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:v,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:y,disableRemotePlayback:y,prefix:null,property:null,results:w,security:null,unselectable:null}}),N=P({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:A,properties:{about:_,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:x,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:y,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:k,g2:k,glyphName:k,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:_,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:x,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_,rev:_,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_,requiredFeatures:_,requiredFonts:_,requiredFormats:_,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:_,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),D=h([T,j,M,z,R],"html"),L=h([T,j,M,z,N],"svg"),F=/^data[-\w.:]+$/i,q=/-[a-z]/g,Z=/[A-Z]/g;function U(e){return"-"+e.toLowerCase()}function $(e){return e.charAt(1).toUpperCase()}let V={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var B=n(50001),H=B.default||B;let K=J("end"),W=J("start");function J(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function G(e){return e&&"object"==typeof e?"position"in e||"type"in e?Y(e.position):"start"in e||"end"in e?Y(e):"line"in e||"column"in e?Q(e):"":""}function Q(e){return X(e&&e.line)+":"+X(e&&e.column)}function Y(e){return Q(e&&e.start)+"-"+Q(e&&e.end)}function X(e){return e&&"number"==typeof e?e:1}class ee extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},o=!1;if(t&&(i="line"in t&&"column"in t?{place:t}:"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){let e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=G(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ee.prototype.file="",ee.prototype.name="",ee.prototype.reason="",ee.prototype.message="",ee.prototype.stack="",ee.prototype.column=void 0,ee.prototype.line=void 0,ee.prototype.ancestors=void 0,ee.prototype.cause=void 0,ee.prototype.fatal=void 0,ee.prototype.place=void 0,ee.prototype.ruleId=void 0,ee.prototype.source=void 0;let et={}.hasOwnProperty,en=new Map,er=/[A-Z]/g,ei=/-([a-z])/g,eo=new Set(["table","tbody","thead","tfoot","tr"]),ea=new Set(["td","th"]),es="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function el(e,t,n){return"element"===t.type?function(e,t,n){let r=e.schema,i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=L,e.schema=i),e.ancestors.push(t);let o=ef(e,t.tagName,!1),a=function(e,t){let n,r;let i={};for(r in t.properties)if("children"!==r&&et.call(t.properties,r)){let o=function(e,t,n){let r=function(e,t){let n=p(t),r=t,i=m;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&F.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(q,$);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!q.test(e)){let n=e.replace(Z,U);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=C}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e,t){let n={};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){let n={};try{H(t,function(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(ei,ep)),n[r]=t})}catch(t){if(!e.ignoreInvalidStyle){let n=new ee("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:t,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=es+"#cannot-parse-style-attribute",n}}return n}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t;let n={};for(t in e)et.call(e,t)&&(n[function(e){let t=e.replace(er,em);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?V[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(o){let[r,a]=o;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&ea.has(t.tagName)?n=a:i[r]=a}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(e,t),s=ed(e,t);return eo.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&d(e.value):d(e))})),eu(e,a,o,t),ec(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return(0,o.ok)("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}eh(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){let r=e.schema,i=r;"svg"===t.name&&"html"===r.space&&(i=L,e.schema=i),e.ancestors.push(t);let a=null===t.name?e.Fragment:ef(e,t.name,!0),s=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];(0,o.ok)("ExpressionStatement"===t.type);let i=t.expression;(0,o.ok)("ObjectExpression"===i.type);let a=i.properties[0];(0,o.ok)("SpreadElement"===a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else eh(e,t.position)}else{let i;let a=r.name;if(r.value&&"object"==typeof r.value){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];(0,o.ok)("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else eh(e,t.position)}else i=null===r.value||r.value;n[a]=i}return n}(e,t),l=ed(e,t);return eu(e,s,a,t),ec(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eh(e,t.position)}(e,t):"root"===t.type?function(e,t,n){let r={};return ec(r,ed(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?t.value:void 0}function eu(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ec(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ed(e,t){let n=[],r=-1,i=e.passKeys?new Map:en;for(;++r=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),Number.POSITIVE_INFINITY);return n&&ex(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),ex(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ex(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length)){if(er))return;let s=i.events.length,l=s;for(;l--;)if("exit"===i.events[l][0]&&"chunkFlow"===i.events[l][1].type){if(e){n=i.events[l][1].end;break}e=!0}for(g(a),o=s;ot;){let t=o[n];i.containerState=t[1],t[0].exit.call(i,e)}o.length=t}function y(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},eP={tokenize:function(e,t,n){return(0,eS.f)(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};var ej=n(42462);let eT={tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):(0,eO.Ch)(t)?e.check(eA,o,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}},resolve:function(e){return ek(e),e}},eA={tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,eS.f)(e,i,"linePrefix")};function i(i){if(null===i||(0,eO.Ch)(i))return n(i);let o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}},partial:!0},eI={tokenize:function(e){let t=this,n=e.attempt(ej.w,function(r){if(null===r){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,(0,eS.f)(e,e.attempt(this.parser.constructs.flow,r,e.attempt(eT,r)),"linePrefix")));return n;function r(r){if(null===r){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}},eM={resolveAll:eD()},ez=eN("string"),eR=eN("text");function eN(e){return{tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,o,a);return o;function o(e){return l(e)?i(e):a(e)}function a(e){if(null===e){t.consume(e);return}return t.enter("data"),t.consume(e),s}function s(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i=3&&(null===a||(0,eO.Ch)(a))?(e.exit("thematicBreak"),t(a)):n(a)}(o)}}},eZ={name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,a=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:(0,eO.pY)(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(eq,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return(0,eO.pY)(i)&&++a<10?(e.consume(i),t):(!r.interrupt||a<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),s(i)):n(i)}(t)}return n(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(ej.w,r.interrupt?n:l,e.attempt(eU,c,u))}function l(e){return r.containerState.initialBlankLine=!0,o++,c(e)}function u(t){return(0,eO.xz)(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ej.w,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,(0,eS.f)(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!(0,eO.xz)(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(e$,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,(0,eS.f)(e,e.attempt(eZ,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)}},eU={tokenize:function(e,t,n){let r=this;return(0,eS.f)(e,function(e){let i=r.events[r.events.length-1];return!(0,eO.xz)(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},e$={tokenize:function(e,t,n){let r=this;return(0,eS.f)(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)},partial:!0},eV={name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return(0,eO.xz)(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){let r=this;return function(t){return(0,eO.xz)(t)?(0,eS.f)(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(eV,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function eB(e,t,n,r,i,o,a,s,l){let u=l||Number.POSITIVE_INFINITY,c=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||(0,eO.Av)(t)?n(t):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(t))};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||(0,eO.Ch)(t)?n(t):(e.consume(t),92===t?h:f)}function h(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function p(i){return!c&&(null===i||41===i||(0,eO.z3)(i))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(i)):c999||null===d||91===d||93===d&&!a||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):93===d?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(0,eO.Ch)(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||(0,eO.Ch)(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),a||(a=!(0,eO.xz)(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function eK(e,t,n,r,i,o){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),a=40===t?41:t,s):n(t)};function s(n){return n===a?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),l(n))}function l(t){return t===a?(e.exit(o),s(a)):null===t?n(t):(0,eO.Ch)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,eS.f)(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===a||null===t||(0,eO.Ch)(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return t===a||92===t?(e.consume(t),u):u(t)}}function eW(e,t){let n;return function r(i){return(0,eO.Ch)(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):(0,eO.xz)(i)?(0,eS.f)(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var eJ=n(34620);let eG={tokenize:function(e,t,n){return function(t){return(0,eO.z3)(t)?eW(e,r)(t):n(t)};function r(t){return eK(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return(0,eO.xz)(t)?(0,eS.f)(e,o,"whitespace")(t):o(t)}function o(e){return null===e||(0,eO.Ch)(e)?t(e):n(e)}},partial:!0},eQ={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),(0,eS.f)(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?o(n):(0,eO.Ch)(n)?e.attempt(eY,t,o)(n):(e.enter("codeFlowValue"),function n(r){return null===r||(0,eO.Ch)(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function o(n){return e.exit("codeIndented"),t(n)}}},eY={tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):(0,eO.Ch)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):(0,eS.f)(e,o,"linePrefix",5)(t)}function o(e){let o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):(0,eO.Ch)(e)?i(e):n(e)}},partial:!0},eX={name:"setextUnderline",tokenize:function(e,t,n){let r;let i=this;return function(t){let a,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){a="paragraph"===i.events[s][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||a)?(e.enter("setextHeadingLine"),r=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),(0,eO.xz)(n)?(0,eS.f)(e,o,"lineSuffix")(n):o(n))}(t)):n(t)};function o(r){return null===r||(0,eO.Ch)(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);let a={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[i][1].end)):e[n][1]=a,e.push(["exit",a,t]),e}},e0=["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"],e1=["pre","script","style","textarea"],e2={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ej.w,t,n)}},partial:!0},e4={tokenize:function(e,t,n){let r=this;return function(t){return(0,eO.Ch)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},e9={tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},e3={name:"codeFenced",tokenize:function(e,t,n){let r;let i=this,o={tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),(0,eO.xz)(t)?(0,eS.f)(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o>=s?(e.exit("codeFencedFenceSequence"),(0,eO.xz)(i)?(0,eS.f)(e,u,"whitespace")(i):u(i)):n(i)}(t)):n(t)}function u(r){return null===r||(0,eO.Ch)(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0},a=0,s=0;return function(t){return function(t){let o=i.events[i.events.length-1];return a=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,r=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(s++,e.consume(i),t):s<3?n(i):(e.exit("codeFencedFenceSequence"),(0,eO.xz)(i)?(0,eS.f)(e,l,"whitespace")(i):l(i))}(t)}(t)};function l(o){return null===o||(0,eO.Ch)(o)?(e.exit("codeFencedFence"),i.interrupt?t(o):e.check(e9,c,p)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||(0,eO.Ch)(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(i)):(0,eO.xz)(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),(0,eS.f)(e,u,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(o))}function u(t){return null===t||(0,eO.Ch)(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||(0,eO.Ch)(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function c(t){return e.attempt(o,p,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),f}function f(t){return a>0&&(0,eO.xz)(t)?(0,eS.f)(e,h,"linePrefix",a+1)(t):h(t)}function h(t){return null===t||(0,eO.Ch)(t)?e.check(e9,c,p)(t):(e.enter("codeFlowValue"),function t(n){return null===n||(0,eO.Ch)(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function p(n){return e.exit("codeFenced"),t(n)}},concrete:!0},e5=document.createElement("i");function e6(e){let t="&"+e+";";e5.innerHTML=t;let n=e5.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let e7={name:"characterReference",tokenize:function(e,t,n){let r,i;let o=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,i=eO.H$,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=eO.AF,u):(e.enter("characterReferenceValue"),r=7,i=eO.pY,u(t))}function u(s){if(59===s&&a){let r=e.exit("characterReferenceValue");return i!==eO.H$||e6(o.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let d=Object.assign({},e[n][1].end),f=Object.assign({},e[c][1].start);tl(d,-s),tl(f,s),o={type:s>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[n][1].end)},a={type:s>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[c][1].start),end:f},i={type:s>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[c][1].start)},r={type:s>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[n][1].end=Object.assign({},o.start),e[c][1].start=Object.assign({},a.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=(0,eb.V)(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=(0,eb.V)(l,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),l=(0,eb.V)(l,(0,eF.C)(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=(0,eb.V)(l,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,l=(0,eb.V)(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,(0,eb.d)(e,n-1,c-n+3,l),c=n+l.length-u-2;break}}for(c=-1;++co&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4),i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},(0,eb.d)(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}},42:eq,45:[eX,eq],60:{name:"htmlFlow",tokenize:function(e,t,n){let r,i,o,a,s;let l=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u};function u(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),i=!0,h):63===a?(e.consume(a),r=3,l.interrupt?t:I):(0,eO.jv)(a)?(e.consume(a),o=String.fromCharCode(a),p):n(a)}function c(i){return 45===i?(e.consume(i),r=2,d):91===i?(e.consume(i),r=5,a=0,f):(0,eO.jv)(i)?(e.consume(i),r=4,l.interrupt?t:I):n(i)}function d(r){return 45===r?(e.consume(r),l.interrupt?t:I):n(r)}function f(r){let i="CDATA[";return r===i.charCodeAt(a++)?(e.consume(r),a===i.length)?l.interrupt?t:S:f:n(r)}function h(t){return(0,eO.jv)(t)?(e.consume(t),o=String.fromCharCode(t),p):n(t)}function p(a){if(null===a||47===a||62===a||(0,eO.z3)(a)){let s=47===a,u=o.toLowerCase();return!s&&!i&&e1.includes(u)?(r=1,l.interrupt?t(a):S(a)):e0.includes(o.toLowerCase())?(r=6,s)?(e.consume(a),m):l.interrupt?t(a):S(a):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(a):i?function t(n){return(0,eO.xz)(n)?(e.consume(n),t):k(n)}(a):g(a))}return 45===a||(0,eO.H$)(a)?(e.consume(a),o+=String.fromCharCode(a),p):n(a)}function m(r){return 62===r?(e.consume(r),l.interrupt?t:S):n(r)}function g(t){return 47===t?(e.consume(t),k):58===t||95===t||(0,eO.jv)(t)?(e.consume(t),y):(0,eO.xz)(t)?(e.consume(t),g):k(t)}function y(t){return 45===t||46===t||58===t||95===t||(0,eO.H$)(t)?(e.consume(t),y):v(t)}function v(t){return 61===t?(e.consume(t),b):(0,eO.xz)(t)?(e.consume(t),v):g(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,w):(0,eO.xz)(t)?(e.consume(t),b):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||(0,eO.z3)(n)?v(n):(e.consume(n),t)}(t)}function w(t){return t===s?(e.consume(t),s=null,x):null===t||(0,eO.Ch)(t)?n(t):(e.consume(t),w)}function x(e){return 47===e||62===e||(0,eO.xz)(e)?g(e):n(e)}function k(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||(0,eO.Ch)(t)?S(t):(0,eO.xz)(t)?(e.consume(t),_):n(t)}function S(t){return 45===t&&2===r?(e.consume(t),P):60===t&&1===r?(e.consume(t),j):62===t&&4===r?(e.consume(t),M):63===t&&3===r?(e.consume(t),I):93===t&&5===r?(e.consume(t),A):(0,eO.Ch)(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(e2,z,O)(t)):null===t||(0,eO.Ch)(t)?(e.exit("htmlFlowData"),O(t)):(e.consume(t),S)}function O(t){return e.check(e4,C,z)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||(0,eO.Ch)(t)?O(t):(e.enter("htmlFlowData"),S(t))}function P(t){return 45===t?(e.consume(t),I):S(t)}function j(t){return 47===t?(e.consume(t),o="",T):S(t)}function T(t){if(62===t){let n=o.toLowerCase();return e1.includes(n)?(e.consume(t),M):S(t)}return(0,eO.jv)(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),T):S(t)}function A(t){return 93===t?(e.consume(t),I):S(t)}function I(t){return 62===t?(e.consume(t),M):45===t&&2===r?(e.consume(t),I):S(t)}function M(t){return null===t||(0,eO.Ch)(t)?(e.exit("htmlFlowData"),z(t)):(e.consume(t),M)}function z(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},61:eX,95:eq,96:e3,126:e3},tp={38:e7,92:e8},tm={[-5]:te,[-4]:te,[-3]:te,33:to,38:e7,42:ts,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return(0,eO.jv)(t)?(e.consume(t),o):64===t?n(t):s(t)}function o(t){return 43===t||45===t||46===t||(0,eO.H$)(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||(0,eO.H$)(n))&&r++<32?(e.consume(n),t):(r=0,s(n))}(t)):s(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||(0,eO.Av)(r)?n(r):(e.consume(r),a)}function s(t){return 64===t?(e.consume(t),l):(0,eO.n9)(t)?(e.consume(t),s):n(t)}function l(i){return(0,eO.H$)(i)?function i(o){return 46===o?(e.consume(o),r=0,l):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(o){if((45===o||(0,eO.H$)(o))&&r++<63){let n=45===o?t:i;return e.consume(o),n}return n(o)}(o)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,o;let a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),v):(0,eO.jv)(t)?(e.consume(t),k):n(t)}function l(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),i=0,h):(0,eO.jv)(t)?(e.consume(t),y):n(t)}function u(t){return 45===t?(e.consume(t),f):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):(0,eO.Ch)(t)?(o=c,T(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),f):c(t)}function f(e){return 62===e?j(e):45===e?d(e):c(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?p:h):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),m):(0,eO.Ch)(t)?(o=p,T(t)):(e.consume(t),p)}function m(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?j(t):93===t?(e.consume(t),g):p(t)}function y(t){return null===t||62===t?j(t):(0,eO.Ch)(t)?(o=y,T(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):(0,eO.Ch)(t)?(o=v,T(t)):(e.consume(t),v)}function b(e){return 62===e?j(e):v(e)}function w(t){return(0,eO.jv)(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||(0,eO.H$)(t)?(e.consume(t),x):function t(n){return(0,eO.Ch)(n)?(o=t,T(n)):(0,eO.xz)(n)?(e.consume(n),t):j(n)}(t)}function k(t){return 45===t||(0,eO.H$)(t)?(e.consume(t),k):47===t||62===t||(0,eO.z3)(t)?_(t):n(t)}function _(t){return 47===t?(e.consume(t),j):58===t||95===t||(0,eO.jv)(t)?(e.consume(t),S):(0,eO.Ch)(t)?(o=_,T(t)):(0,eO.xz)(t)?(e.consume(t),_):j(t)}function S(t){return 45===t||46===t||58===t||95===t||(0,eO.H$)(t)?(e.consume(t),S):function t(n){return 61===n?(e.consume(n),O):(0,eO.Ch)(n)?(o=t,T(n)):(0,eO.xz)(n)?(e.consume(n),t):_(n)}(t)}function O(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):(0,eO.Ch)(t)?(o=O,T(t)):(0,eO.xz)(t)?(e.consume(t),O):(e.consume(t),E)}function C(t){return t===r?(e.consume(t),r=void 0,P):null===t?n(t):(0,eO.Ch)(t)?(o=C,T(t)):(e.consume(t),C)}function E(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||(0,eO.z3)(t)?_(t):(e.consume(t),E)}function P(e){return 47===e||62===e||(0,eO.z3)(e)?_(e):n(e)}function j(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function T(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return(0,eO.xz)(t)?(0,eS.f)(e,I,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):I(t)}function I(t){return e.enter("htmlTextData"),o(t)}}}],91:tu,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return(0,eO.Ch)(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},e8],93:tt,95:ts,96:{name:"codeText",tokenize:function(e,t,n){let r,i,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),o++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(l){return null===l?n(l):32===l?(e.enter("space"),e.consume(l),e.exit("space"),a):96===l?(i=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(i.type="codeTextData",s(a))}(l)):(0,eO.Ch)(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):(e.enter("codeTextData"),s(l))}function s(t){return null===t||32===t||96===t||(0,eO.Ch)(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),s)}},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let tx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tk(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return tw(n.slice(t?2:1),t?16:10)}return e6(n)||e}let t_={}.hasOwnProperty;function tS(e){return{line:e.line,column:e.column,offset:e.offset}}function tO(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+G({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+G({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+G({start:t.start,end:t.end})+") is still open")}function tC(e){let t=this;t.parser=function(n){var r,o;let a,s,l,u;return"string"!=typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(o=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(y),autolinkProtocol:u,autolinkEmail:u,atxHeading:r(p),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(h),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(h,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,i),htmlFlowData:u,htmlText:r(g,i),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(y),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(p),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];if(!t.depth){let n=this.sliceSerialize(e).length;t.depth=n}},autolink:a(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let t;let n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=tw(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=e6(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=tS(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,eJ.d)(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){let t=e.children;n.children=t}else n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(tx,tk),n.identifier=(0,eJ.d)(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=tS(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),c.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,eJ.d)(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};(function e(t,n){let r=-1;for(;++r0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tO).call(a,void 0,e[0])}for(r.position={start:tS(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tS(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}a>0&&n.push(e[o].slice(0,a))}return n}(a,e)}function f(){let{line:e,column:t,offset:n,_index:i,_bufferIndex:o}=r;return{line:e,column:t,offset:n,_index:i,_bufferIndex:o}}function h(e,t){t.restore()}function p(e,t){return function(n,i,o){let a,c,d,h;return Array.isArray(n)?p(n):"tokenize"in n?p([n]):function(e){let t=null!==e&&n[e],r=null!==e&&n.null;return p([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)};function p(e){return(a=e,c=0,0===e.length)?o:m(e[c])}function m(e){return function(n){return(h=function(){let e=f(),t=u.previous,n=u.currentConstruct,i=u.events.length,o=Array.from(s);return{restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=i,s=o,g()},from:i}}(),d=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,l,y,v)(n)}}function y(t){return e(d,h),i}function v(e){return(h.restore(),++c{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[o,a]=t[i];switch(o){case 0:case -1:return n(a,i);case 1:{let e=n([],i);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new tE[e](t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new tE[o](a),i)};return r},tj=e=>tP(new Map,e)(0),{toString:tT}={},{keys:tA}=Object,tI=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=tT.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},tM=([e,t])=>0===e&&("function"===t||"symbol"===t),tz=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},o=r=>{if(n.has(r))return n.get(r);let[a,s]=tI(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+s);t=null;break;case"undefined":return i([-1],r)}return i([a,t],r)}case 1:{if(s)return i([s,[...r]],r);let e=[],t=i([a,e],r);for(let t of r)e.push(o(t));return t}case 2:{if(s)switch(s){case"BigInt":return i([s,r.toString()],r);case"Boolean":case"Number":case"String":return i([s,r.valueOf()],r)}if(t&&"toJSON"in r)return o(r.toJSON());let n=[],l=i([a,n],r);for(let t of tA(r))(e||!tM(tI(r[t])))&&n.push([o(t),o(r[t])]);return l}case 3:return i([a,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([a,{source:e,flags:t}],r)}case 5:{let t=[],n=i([a,t],r);for(let[n,i]of r)(e||!(tM(tI(n))||tM(tI(i))))&&t.push([o(n),o(i)]);return n}case 6:{let t=[],n=i([a,t],r);for(let n of r)(e||!tM(tI(n)))&&t.push(o(n));return n}}let{message:l}=r;return i([a,{name:s,message:l}],r)};return o},tR=(e,{json:t,lossy:n}={})=>{let r=[];return tz(!(t||n),!!t,new Map,r)(e),r};var tN="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?tj(tR(e,t)):structuredClone(e):(e,t)=>tj(tR(e,t));function tD(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&o<57344){let t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(a=String.fromCharCode(o,t),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function tL(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function tF(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}var tq=n(20037);function tZ(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),o=i[0];o&&"text"===o.type?o.value="["+o.value:i.unshift({type:"text",value:"["});let a=i[i.length-1];return a&&"text"===a.type?a.value+=r:i.push({type:"text",value:r}),i}function tU(e){let t=e.spread;return null==t?e.children.length>1:t}function t$(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let tV={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n;let r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=tD(i.toLowerCase()),a=e.footnoteOrder.indexOf(i),s=e.footnoteCounts.get(i);void 0===s?(s=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=a+1,s+=1,e.footnoteCounts.set(i,s);let l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,l);let u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tZ(e,t);let i={src:tD(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){let n={src:tD(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tZ(e,t);let i={href:tD(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){let n={href:tD(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=W(t.children[1]),a=K(t.children[t.children.length-1]);o&&a&&(r.position={start:o,end:a}),i.push(r)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,a=o?o.length:t.children.length,s=-1,l=[];for(;++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(t$(t.slice(i),i>0,!1)),o.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:tB,yaml:tB,definition:tB,footnoteDefinition:tB};function tB(){}let tH={}.hasOwnProperty,tK={};function tW(e,t){e.position&&(t.position=function(e){let t=W(e),n=K(e);if(t&&n)return{start:t,end:n}}(e))}function tJ(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,tN(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function tG(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r0&&n.push({type:"text",value:"\n"}),n}function tQ(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function tY(e,t){let n=function(e,t){let n=t||tK,r=new Map,i=new Map,o={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,c);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+u+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=o[o.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else o.push(...d);let p={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(o,!0)};e.patch(i,p),s.push(p)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...tN(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&((0,o.ok)("children"in a),a.children.push({type:"text",value:"\n"},i)),a}function tX(e,t){return e&&"run"in e?async function(n,r){let i=tY(n,{file:r,...t});await e.run(i,r)}:function(n,r){return tY(n,{file:r,...t||e})}}function t0(e){if(e)throw e}var t1=n(6726);function t2(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let t4={basename:function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');t9(e);let r=0,i=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else a<0&&(n=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(i=o):(s=-1,i=a));return r===i?i=a:i<0&&(i=e.length),e.slice(r,i)},dirname:function(e){let t;if(t9(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){let t;t9(e);let n=e.length,r=-1,i=0,o=-1,a=0;for(;n--;){let s=e.codePointAt(n);if(47===s){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===s?o<0?o=n:1!==a&&(a=1):o>-1&&(a=-1)}return o<0||r<0||0===a||1===a&&o===r-1&&o===i+1?"":e.slice(o,r)},join:function(...e){let t,n=-1;for(;++n2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",o=0):o=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),a=l,s=0;continue}}else if(i.length>0){i="",o=0,a=l,s=0;continue}}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(a+1,l):i=e.slice(a+1,l),o=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return i}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function t9(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function t3(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let t5=["history","path","basename","stem","extname","dirname"];class t6{constructor(e){let t,n;t=e?t3(e)?{path:e}:"string"==typeof e||e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e?{value:e}:e:{},this.cwd="/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++rt.length;a&&t.push(r);try{o=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(o&&o.then&&"function"==typeof o.then?o.then(i,r):o instanceof Error?r(o):i(o))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(s,i)(...a):r(null,...a)})(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new nr,t=-1;for(;++t0){let[r,...o]=t,a=n[i][1];t2(a)&&t2(r)&&(r=t1(!0,a,r)),n[i]=[e,r,...o]}}}}let ni=new nr().freeze();function no(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function na(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function ns(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nl(e){if(!t2(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function nu(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function nc(e){return e&&"object"==typeof e&&"message"in e&&"messages"in e?e:new t6(e)}let nd=[],nf={allowDangerousHtml:!0},nh=/^(https?|ircs?|mailto|xmpp)$/i,np=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function nm(e){let t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,a=e.components,s=e.disallowedElements,l=e.rehypePlugins||nd,u=e.remarkPlugins||nd,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nf}:nf,d=e.skipHtml,f=e.unwrapDisallowed,h=e.urlTransform||ng,p=ni().use(tC).use(u).use(tX,c).use(l),m=new t6;for(let n of("string"==typeof r?m.value=r:(0,o.t1)("Unexpected value `"+r+"` for `children` prop, expected `string`"),t&&s&&(0,o.t1)("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),np))Object.hasOwn(e,n.from)&&(0,o.t1)("Unexpected `"+n.from+"` prop, "+(n.to?"use `"+n.to+"` instead":"remove it")+" (see for more info)");let g=p.parse(m),y=p.runSync(g,m);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:"root"===y.type?y.children:[y]}),(0,tq.Vn)(y,function(e,r,i){if("raw"===e.type&&i&&"number"==typeof r)return d?i.children.splice(r,1):i.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in eg)if(Object.hasOwn(eg,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=eg[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=h(String(n||""),t,e))}}if("element"===e.type){let o=t?!t.includes(e.tagName):!!s&&s.includes(e.tagName);if(!o&&n&&"number"==typeof r&&(o=!n(e,r,i)),o&&i&&"number"==typeof r)return f&&e.children?i.children.splice(r,1,...e.children):i.children.splice(r,1),r}}),function(e,t){var n,r,i;let o;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let a=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=t.jsxDEV,o=function(e,t,r,i){let o=Array.isArray(r.children),s=W(e);return n(t,r,i,o,{columnNumber:s?s.column-1:void 0,fileName:a,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");r=t.jsx,i=t.jsxs,o=function(e,t,n,o){let a=Array.isArray(n.children)?i:r;return o?a(t,n,o):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:o,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?L:D,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},l=el(s,e,void 0);return l&&"string"!=typeof l?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}(y,{Fragment:ey.Fragment,components:a,ignoreInvalidStyle:!0,jsx:ey.jsx,jsxs:ey.jsxs,passKeys:!0,passNode:!0})}function ng(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||nh.test(e.slice(0,t))?e:""}},19997:function(e,t,n){"use strict";function r(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}n.d(t,{Z:function(){return ez}});var i=n(58899),o=n(99685),a=n(3053),s=n(5373);let l="phrasing",u=["autolink","link","image","label"];function c(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function d(e){this.config.enter.autolinkProtocol.call(this,e)}function f(e){this.config.exit.autolinkProtocol.call(this,e)}function h(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];(0,i.ok)("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function p(e){this.config.exit.autolinkEmail.call(this,e)}function m(e){this.exit(e)}function g(e){!function(e,t,n){let r=(0,s.O)((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r0?{type:"text",value:o}:void 0),!1===o?r.lastIndex=n+1:(s!==n&&c.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(o)?c.push(...o):o&&c.push(o),s=n+d[0].length,u=!0),!r.global)break;d=r.exec(e.value)}return u?(s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")"),o=r(e,"("),a=r(e,")");for(;-1!==i&&o>a;)e+=n.slice(0,i+1),i=(n=n.slice(i+1)).indexOf(")"),a++;return[e,n]}(n+i);if(!s[0])return!1;let l={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[l,{type:"text",value:s[1]}]:l}function v(e,t,n,r){return!(!b(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function b(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||(0,o.B8)(n)||(0,o.Xh)(n))&&(!t||47!==n)}var w=n(34620);function x(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function k(){this.buffer()}function _(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,i.ok)("footnoteDefinition"===n.type),n.label=t,n.identifier=(0,w.d)(this.sliceSerialize(e)).toLowerCase()}function S(e){this.exit(e)}function O(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function C(){this.buffer()}function E(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,i.ok)("footnoteReference"===n.type),n.label=t,n.identifier=(0,w.d)(this.sliceSerialize(e)).toLowerCase()}function P(e){this.exit(e)}function j(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),s(),a(),o+=i.move("]")}function T(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),a=n.enter("footnoteDefinition"),s=n.enter("label");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),s(),o+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),o+=i.move(n.indentLines(n.containerFlow(e,i.current()),A)),a(),o}function A(e,t,n){return 0===t?e:(n?"":" ")+e}j.peek=function(){return"["};let I=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function M(e){this.enter({type:"delete",children:[]},e)}function z(e){this.exit(e)}function R(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"})+i.move("~~"),o(),a}function N(e){return e.length}function D(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}R.peek=function(){return"~"};n(20037);var L=n(2430);function F(e,t,n){let r=e.value||"",i="`",o=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let a=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));let s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);let l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){return t?(n?"":" ".repeat(a))+e:(n?o:o+" ".repeat(a-o.length))+e});return l(),u};function Z(e){let t=e._align;(0,i.ok)(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function U(e){this.exit(e),this.data.inTable=void 0}function $(e){this.enter({type:"tableRow",children:[]},e)}function V(e){this.exit(e)}function B(e){this.enter({type:"tableCell",children:[]},e)}function H(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,K));let n=this.stack[this.stack.length-1];(0,i.ok)("inlineCode"===n.type),n.value=t,this.exit(e)}function K(e,t){return"|"===t?t:e}function W(e){let t=this.stack[this.stack.length-2];(0,i.ok)("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function J(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];(0,i.ok)("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r;let i=t.children,o=-1;for(;++o0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}ea[43]=eo,ea[45]=eo,ea[46]=eo,ea[95]=eo,ea[72]=[eo,ei],ea[104]=[eo,ei],ea[87]=[eo,er],ea[119]=[eo,er];var eh=n(42462),ep=n(69406);let em={tokenize:function(e,t,n){let r=this;return(0,ep.f)(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function eg(e,t,n){let r;let i=this,o=i.events.length,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;o--;){let e=i.events[o][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!r||!r._balanced)return n(o);let s=(0,w.d)(i.sliceSerialize({start:r.end,end:i.now()}));return 94===s.codePointAt(0)&&a.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)):n(o)}}function ey(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function ev(e,t,n){let r;let i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),l};function l(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(l){if(s>999||93===l&&!r||null===l||91===l||(0,o.z3)(l))return n(l);if(93===l){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return a.includes((0,w.d)(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(l)}return(0,o.z3)(l)||(r=!0),s++,e.consume(l),92===l?c:u}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function eb(e,t,n){let r,i;let a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),l=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),u};function u(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(l>999||93===t&&!i||null===t||91===t||(0,o.z3)(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=(0,w.d)(a.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return(0,o.z3)(t)||(i=!0),l++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}function f(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(r)||s.push(r),(0,ep.f)(e,h,"gfmFootnoteDefinitionWhitespace")):n(t)}function h(e){return t(e)}}function ew(e,t,n){return e.check(eh.w,t,e.attempt(em,t,n))}function ex(e){e.exit("gfmFootnoteDefinition")}var ek=n(88973),e_=n(80658),eS=n(63374);class eO{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push([...e]),e.length=0;let r=n.pop();for(;r;)e.push(...r),r=n.pop();this.map.length=0}}function eC(e,t,n){let r;let i=this,a=0,s=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,o="tableHead"===r||"tableRow"===r?b:l;return o===b&&i.parser.lazy[i.now().line]?n(e):o(e)};function l(t){return e.enter("tableHead"),e.enter("tableRow"),124===t||(r=!0,s+=1),u(t)}function u(t){return null===t?n(t):(0,o.Ch)(t)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),f):n(t):(0,o.xz)(t)?(0,ep.f)(e,u,"whitespace")(t):(s+=1,r&&(r=!1,a+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,u):(e.enter("data"),c(t))}function c(t){return null===t||124===t||(0,o.z3)(t)?(e.exit("data"),u(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function f(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,(0,o.xz)(t))?(0,ep.f)(e,h,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):h(t)}function h(t){return 45===t||58===t?m(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return(0,o.xz)(t)?(0,ep.f)(e,m,"whitespace")(t):m(t)}function m(t){return 58===t?(s+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(s+=1,g(t)):null===t||(0,o.Ch)(t)?v(t):n(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(n))}(t)):n(t)}function y(t){return(0,o.xz)(t)?(0,ep.f)(e,v,"whitespace")(t):v(t)}function v(i){return 124===i?h(i):null===i||(0,o.Ch)(i)?r&&a===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i):n(i)}function b(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||(0,o.Ch)(n)?(e.exit("tableRow"),t(n)):(0,o.xz)(n)?(0,ep.f)(e,w,"whitespace")(n):(e.enter("data"),x(n))}function x(t){return null===t||124===t||(0,o.z3)(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?k:x)}function k(t){return 92===t||124===t?(e.consume(t),x):x(t)}}function eE(e,t){let n,r,i,o=-1,a=!0,s=0,l=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,f=new eO;for(;++on[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==i&&(o.end=Object.assign({},eT(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function ej(e,t,n,r,i){let o=[],a=eT(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function eT(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let eA={tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return(0,o.z3)(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return(0,o.Ch)(r)?t(r):(0,o.xz)(r)?e.check({tokenize:eI},t,n)(r):n(r)}}};function eI(e,t,n){return(0,ep.f)(e,function(e){return null===e?n(e):t(e)},"whitespace")}let eM={};function ez(e){let t=e||eM,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push((0,Q.W)([{text:ea},{document:{91:{tokenize:eb,continuation:{tokenize:ew},exit:ex}},text:{91:{tokenize:ev},93:{add:"after",tokenize:eg,resolveTo:ey}}},function(e){let t=(e||{}).singleTilde,n={tokenize:function(e,n,r){let i=this.previous,o=this.events,a=0;return function(s){return 126===i&&"characterEscape"!==o[o.length-1][1].type?r(s):(e.enter("strikethroughSequenceTemporary"),function o(s){let l=(0,e_.r)(i);if(126===s)return a>1?r(s):(e.consume(s),a++,o);if(a<2&&!t)return r(s);let u=e.exit("strikethroughSequenceTemporary"),c=(0,e_.r)(s);return u._open=!c||2===c&&!!l,u._close=!l||2===l&&!!c,n(s)}(s))}},resolveAll:function(e,t){let n=-1;for(;++nl&&(l=e[u].length);++ds[d])&&(s[d]=e)}n.push(o)}o[u]=n,a[u]=i}let d=-1;if("object"==typeof n&&"length"in n)for(;++ds[d]&&(s[d]=o),h[d]=o),f[d]=a}o.splice(1,0,f),a.splice(1,0,h),u=-1;let p=[];for(;++u":"")+")"})}return f;function f(){var d;let f,h,p,m=i;if((!t||l(r,s,c[c.length-1]||void 0))&&(m=Array.isArray(d=n(r,c))?d:"number"==typeof d?[!0,d]:null==d?i:[d])[0]===o)return m;if("children"in r&&r.children&&r.children&&"skip"!==m[0])for(h=(a?r.children.length:-1)+u,p=c.concat(r);h>-1&&h512){r="",o=0;for(let e=0;e<256;e++)r+=(256+256*Math.random()|0).toString(16).substring(1)}return r.substring(o,o+++e)}()};return Object.assign(g,{extend:function e(t){return n=>{let r=n(t);for(let e in g)delete r[e];let i={...t,...r};return Object.assign(i,{extend:e(i)})}}(g)})}},36655:function(e,t,n){"use strict";n.d(t,{q:function(){return s}});var r=n(48926),i=n(4456),o=n(96329),a=n(39881);function s({key:e,name:t,request:n,retryCount:s=3,retryDelay:l=150,timeout:u,type:c},d){return{config:{key:e,name:t,request:n,retryCount:s,retryDelay:l,timeout:u,type:c},request:function(e,t={}){return async(n,s={})=>{let{retryDelay:l=150,retryCount:u=3}={...t,...s};return(0,a.J)(async()=>{try{return await e(n)}catch(e){switch(e.code){case o.s7.code:throw new o.s7(e);case o.B.code:throw new o.B(e);case o.LX.code:throw new o.LX(e);case o.nY.code:throw new o.nY(e);case o.XS.code:throw new o.XS(e);case o.yR.code:throw new o.yR(e);case o.Og.code:throw new o.Og(e);case o.pT.code:throw new o.pT(e);case o.KB.code:throw new o.KB(e);case o.gS.code:throw new o.gS(e);case o.Pv.code:throw new o.Pv(e);case o.GD.code:throw new o.GD(e);case o.ab.code:throw new o.ab(e);case o.PE.code:throw new o.PE(e);case o.Ts.code:throw new o.Ts(e);case o.u5.code:throw new o.u5(e);case o.I0.code:throw new o.I0(e);case o.x3.code:throw new o.x3(e);case 5e3:throw new o.ab(e);default:if(e instanceof r.G)throw e;throw new o.ir(e)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof i.Gg){let e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e)}return~~(1<"code"in e&&"number"==typeof e.code?-1===e.code||e.code===o.Pv.code||e.code===o.XS.code:!(e instanceof i.Gg)||!e.status||403===e.status||408===e.status||413===e.status||429===e.status||500===e.status||502===e.status||503===e.status||504===e.status})}}(n,{retryCount:s,retryDelay:l}),value:d}}},87446:function(e,t,n){"use strict";n.d(t,{d:function(){return d}});var r=n(4456),i=n(48926);class o extends i.G{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}let a=new Map;var s=n(13581),l=n(47499);let u={current:0,take(){return this.current++},reset(){this.current=0}};var c=n(36655);function d(e,t={}){let{batch:n,fetchOptions:i,key:d="http",name:f="HTTP JSON-RPC",onFetchRequest:h,onFetchResponse:p,retryDelay:m}=t;return({chain:g,retryCount:y,timeout:v})=>{let{batchSize:b=1e3,wait:w=0}="object"==typeof n?n:{},x=t.retryCount??y,k=v??t.timeout??1e4,_=e||g?.rpcUrls.default.http[0];if(!_)throw new o;let S=function(e,t={}){return{async request(n){let{body:i,onRequest:o=t.onRequest,onResponse:a=t.onResponse,timeout:c=t.timeout??1e4}=n,d={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:f,method:h,signal:p}=d;try{let t;let n=await (0,s.F)(async({signal:t})=>{let n={...d,body:Array.isArray(i)?(0,l.P)(i.map(e=>({jsonrpc:"2.0",id:e.id??u.take(),...e}))):(0,l.P)({jsonrpc:"2.0",id:i.id??u.take(),...i}),headers:{...f,"Content-Type":"application/json"},method:h||"POST",signal:p||(c>0?t:null)},r=new Request(e,n);return o&&await o(r),await fetch(e,n)},{errorInstance:new r.W5({body:i,url:e}),timeout:c,signal:!0});if(a&&await a(n),n.headers.get("Content-Type")?.startsWith("application/json")?t=await n.json():(t=await n.text(),t=JSON.parse(t||"{}")),!n.ok)throw new r.Gg({body:i,details:(0,l.P)(t.error)||n.statusText,headers:n.headers,status:n.status,url:e});return t}catch(t){if(t instanceof r.Gg||t instanceof r.W5)throw t;throw new r.Gg({body:i,details:t.message,url:e})}}}}(_,{fetchOptions:i,onRequest:h,onResponse:p,timeout:k});return(0,c.q)({key:d,name:f,async request({method:e,params:t}){let i={method:e,params:t},{schedule:o}=function({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:i}){let o=async()=>{let t=u();s();let n=t.map(({args:e})=>e);0!==n.length&&e(n).then(e=>{i&&Array.isArray(e)&&e.sort(i);for(let n=0;n{for(let n=0;na.delete(t),l=()=>u().map(({args:e})=>e),u=()=>a.get(t)||[],c=e=>a.set(t,[...u(),e]);return{flush:s,async schedule(e){let t={},i=new Promise((e,n)=>{t.resolve=e,t.reject=n});return(n?.([...l(),e])&&o(),u().length>0)?c({args:e,pendingPromise:t}):(c({args:e,pendingPromise:t}),setTimeout(o,r)),i}}}({id:_,wait:w,shouldSplitBatch:e=>e.length>b,fn:e=>S.request({body:e}),sort:(e,t)=>e.id-t.id}),s=async e=>n?o(e):[await S.request({body:e})],[{error:l,result:u}]=await s(i);if(l)throw new r.bs({body:i,error:l,url:_});return u},retryCount:x,retryDelay:m,timeout:k,type:"http"},{fetchOptions:i,url:_})}}},4456:function(e,t,n){"use strict";n.d(t,{Gg:function(){return a},W5:function(){return l},bs:function(){return s}});var r=n(47499),i=n(48926),o=n(94290);class a extends i.G{constructor({body:e,details:t,headers:n,status:i,url:a}){super("HTTP request failed.",{details:t,metaMessages:[i&&`Status: ${i}`,`URL: ${(0,o.Gr)(a)}`,e&&`Request body: ${(0,r.P)(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=i,this.url=a}}class s extends i.G{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(0,o.Gr)(n)}`,`Request body: ${(0,r.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class l extends i.G{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,o.Gr)(t)}`,`Request body: ${(0,r.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}},96329:function(e,t,n){"use strict";n.d(t,{B:function(){return l},GD:function(){return v},I0:function(){return _},KB:function(){return m},LX:function(){return u},Og:function(){return h},PE:function(){return w},Pv:function(){return y},Ts:function(){return x},XS:function(){return d},ab:function(){return b},gS:function(){return g},ir:function(){return O},nY:function(){return c},pT:function(){return p},s7:function(){return s},u5:function(){return k},x3:function(){return S},yR:function(){return f}});var r=n(48926),i=n(4456);class o extends r.G{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof i.bs?e.code:t??-1}}class a extends o{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class s extends o{constructor(e){super(e,{code:s.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class l extends o{constructor(e){super(e,{code:l.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class u extends o{constructor(e){super(e,{code:u.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class c extends o{constructor(e){super(e,{code:c.code,shortMessage:"Invalid parameters were provided to the RPC method.\nDouble check you have provided the correct parameters."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends o{constructor(e){super(e,{code:d.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class f extends o{constructor(e){super(e,{code:f.code,shortMessage:"Missing or invalid parameters.\nDouble check you have provided the correct parameters."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class h extends o{constructor(e){super(e,{code:h.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class p extends o{constructor(e){super(e,{code:p.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class m extends o{constructor(e){super(e,{code:m.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class g extends o{constructor(e){super(e,{code:g.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class y extends o{constructor(e){super(e,{code:y.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class v extends o{constructor(e){super(e,{code:v.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class b extends a{constructor(e){super(e,{code:b.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class w extends a{constructor(e){super(e,{code:w.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class x extends a{constructor(e){super(e,{code:x.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class k extends a{constructor(e){super(e,{code:k.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(k,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class _ extends a{constructor(e){super(e,{code:_.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class S extends a{constructor(e){super(e,{code:S.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class O extends o{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}},95258:function(e,t,n){"use strict";function r(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}n.d(t,{a:function(){return r}})},39881:function(e,t,n){"use strict";async function r(e){return new Promise(t=>setTimeout(t,e))}function i(e,{delay:t=100,retryCount:n=2,shouldRetry:i=()=>!0}={}){return new Promise((o,a)=>{let s=async({count:l=0}={})=>{let u=async({error:e})=>{let n="function"==typeof t?t({count:l,error:e}):t;n&&await r(n),s({count:l+1})};try{let t=await e();o(t)}catch(e){if(l{(async()=>{let a;try{let s=new AbortController;n>0&&(a=setTimeout(()=>{r?s.abort():o(t)},n)),i(await e({signal:s?.signal||null}))}catch(e){e?.name==="AbortError"&&o(t),o(e)}finally{clearTimeout(a)}})()})}n.d(t,{F:function(){return r}})},47499:function(e,t,n){"use strict";n.d(t,{P:function(){return r}});let r=(e,t,n)=>JSON.stringify(e,(e,n)=>{let r="bigint"==typeof n?n.toString():n;return"function"==typeof t?t(e,r):r},n)},40181:function(e,t,n){"use strict";n.d(t,{V:function(){return s},F:function(){return l}});var r=n(2265);let i=!1;async function o(e,t={}){let n;if(i)return[];i=!0,e.setState(e=>({...e,status:e.current?"reconnecting":"connecting"}));let r=[];if(t.connectors?.length)for(let n of t.connectors){let t;t="function"==typeof n?e._internal.connectors.setup(n):n,r.push(t)}else r.push(...e.connectors);try{n=await e.storage?.getItem("recentConnectorId")}catch{}let o={};for(let[,t]of e.state.connections)o[t.connector.id]=1;n&&(o[n]=0);let a=Object.keys(o).length>0?[...r].sort((e,t)=>(o[e.id]??10)-(o[t.id]??10)):r,s=!1,l=[],u=[];for(let t of a){let n=await t.getProvider().catch(()=>void 0);if(!n||u.some(e=>e===n)||!await t.isAuthorized())continue;let r=await t.connect({isReconnecting:!0}).catch(()=>null);r&&(t.emitter.off("connect",e._internal.events.connect),t.emitter.on("change",e._internal.events.change),t.emitter.on("disconnect",e._internal.events.disconnect),e.setState(e=>{let n=new Map(s?e.connections:new Map).set(t.uid,{accounts:r.accounts,chainId:r.chainId,connector:t});return{...e,current:s?e.current:t.uid,connections:n}}),l.push({accounts:r.accounts,chainId:r.chainId,connector:t}),u.push(n),s=!0)}return("reconnecting"===e.state.status||"connecting"===e.state.status)&&(s?e.setState(e=>({...e,status:"connected"})):e.setState(e=>({...e,connections:new Map,current:null,status:"disconnected"}))),i=!1,l}function a(e){let{children:t,config:n,initialState:i,reconnectOnMount:a=!0}=e,{onMount:s}=function(e,t){let{initialState:n,reconnectOnMount:r}=t;return n&&!e._internal.store.persist.hasHydrated()&&e.setState({...n,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){if(e._internal.ssr){await e._internal.store.persist.rehydrate();let t=e._internal.mipd?.getProviders().map(e._internal.connectors.providerDetailToConnector).map(e._internal.connectors.setup);e._internal.connectors.setState(e=>[...e,...t??[]])}r?o(e):e.storage&&e.setState(e=>({...e,connections:new Map}))}}}(n,{initialState:i,reconnectOnMount:a});n._internal.ssr||s();let l=(0,r.useRef)(!0);return(0,r.useEffect)(()=>{if(l.current&&n._internal.ssr)return s(),()=>{l.current=!1}},[]),t}let s=(0,r.createContext)(void 0);function l(e){let{children:t,config:n}=e;return(0,r.createElement)(a,e,(0,r.createElement)(s.Provider,{value:n},t))}},4842:function(e,t,n){"use strict";n.d(t,{m:function(){return u}});var r=n(90331);function i(e){let t=e.state.current,n=e.state.connections.get(t),r=n?.accounts,i=r?.[0],o=e.chains.find(e=>e.id===n?.chainId),a=e.state.status;switch(a){case"connected":return{address:i,addresses:r,chain:o,chainId:n?.chainId,connector:n?.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:a};case"reconnecting":return{address:i,addresses:r,chain:o,chainId:n?.chainId,connector:n?.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:a};case"connecting":return{address:i,addresses:r,chain:o,chainId:n?.chainId,connector:n?.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:a};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:a}}}var o=n(94956),a=n(2265),s=n(35006);let l=e=>"object"==typeof e&&!Array.isArray(e);function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,o.Z)(e);return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.v,o=(0,a.useRef)([]),u=(0,s.useSyncExternalStoreWithSelector)(e,t,n,e=>e,(e,t)=>{if(l(e)&&l(t)&&o.current.length){for(let n of o.current)if(!i(e[n],t[n]))return!1;return!0}return i(e,t)});if(l(u)){let e={...u},t={};for(let[n,r]of Object.entries(e))t={...t,[n]:{configurable:!1,enumerable:!0,get:()=>(o.current.includes(n)||o.current.push(n),r)}};return Object.defineProperties(e,t),e}return u}(e=>(function(e,t){let{onChange:n}=t;return e.subscribe(()=>i(e),n,{equalityFn(e,t){let{connector:n,...i}=e,{connector:o,...a}=t;return(0,r.v)(i,a)&&n?.id===o?.id&&n?.uid===o?.uid}})})(t,{onChange:e}),()=>i(t))}},94956:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(2265),i=n(40181),o=n(66564);let a=()=>"wagmi@2.9.11";class s extends o.G{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return a()}}class l extends s{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function u(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(e=t.config)&&void 0!==e?e:(0,r.useContext)(i.V);if(!n)throw new l;return n}},24934:function(e,t,n){"use strict";n.d(t,{$:function(){return d}});var r=n(6007),i=n(85770);async function o(e,t){let n;if((n="function"==typeof t.connector?e._internal.connectors.setup(t.connector):t.connector).uid===e.state.current)throw new i.wi;try{e.setState(e=>({...e,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});let r=await n.connect({chainId:t.chainId}),i=r.accounts;return n.emitter.off("connect",e._internal.events.connect),n.emitter.on("change",e._internal.events.change),n.emitter.on("disconnect",e._internal.events.disconnect),await e.storage?.setItem("recentConnectorId",n.id),e.setState(e=>({...e,connections:new Map(e.connections).set(n.uid,{accounts:i,chainId:r.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:i,chainId:r.chainId}}catch(t){throw e.setState(e=>({...e,status:e.current?"connected":"disconnected"})),t}}var a=n(2265),s=n(94956),l=n(90331);let u=[];function c(e){let t=e.connectors;return(0,l.v)(u,t)?u:(u=t,t)}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mutation:t}=e,n=(0,s.Z)(e),{mutate:i,mutateAsync:l,...u}=(0,r.D)({...t,mutationFn:e=>o(n,e),mutationKey:["connect"]});return(0,a.useEffect)(()=>n.subscribe(e=>{let{status:t}=e;return t},(e,t)=>{"connected"===t&&"disconnected"===e&&u.reset()}),[n,u.reset]),{...u,connect:i,connectAsync:l,connectors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,s.Z)(e);return(0,a.useSyncExternalStore)(e=>(function(e,t){let{onChange:n}=t;return e._internal.connectors.subscribe((e,t)=>{n(Object.values(e),t)})})(t,{onChange:e}),()=>c(t),()=>c(t))}({config:n})}}},74703:function(e,t,n){"use strict";n.d(t,{q:function(){return c}});var r=n(6007);async function i(e,t={}){let n;if(t.connector)n=t.connector;else{let{connections:t,current:r}=e.state,i=t.get(r);n=i?.connector}let r=e.state.connections;n&&(await n.disconnect(),n.emitter.off("change",e._internal.events.change),n.emitter.off("disconnect",e._internal.events.disconnect),n.emitter.on("connect",e._internal.events.connect),r.delete(n.uid)),e.setState(e=>{if(0===r.size)return{...e,connections:new Map,current:null,status:"disconnected"};let t=r.values().next().value;return{...e,connections:new Map(r),current:t.connector.uid}});{let t=e.state.current;if(!t)return;let n=e.state.connections.get(t)?.connector;if(!n)return;await e.storage?.setItem("recentConnectorId",n.id)}}var o=n(94956),a=n(90331);let s=[];function l(e){let t=[...e.state.connections.values()];return"reconnecting"===e.state.status||(0,a.v)(s,t)?s:(s=t,t)}var u=n(2265);function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mutation:t}=e,n=(0,o.Z)(e),{mutate:s,mutateAsync:c,...d}=(0,r.D)({...t,mutationFn:e=>i(n,e),mutationKey:["disconnect"]});return{...d,connectors:(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,o.Z)(e);return(0,u.useSyncExternalStore)(e=>(function(e,t){let{onChange:n}=t;return e.subscribe(()=>l(e),n,{equalityFn:a.v})})(t,{onChange:e}),()=>l(t),()=>l(t))})({config:n}).map(e=>e.connector),disconnect:s,disconnectAsync:c}}},58961:function(e,t,n){"use strict";n.d(t,{Q:function(){return g}});var r=n(6007),i=n(96104),o=n(48926);class a extends o.G{constructor({docsPath:e}={}){super("Could not find an Account to execute with this Action.\nPlease provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient.",{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}var s=n(95046);async function l(e,{account:t=e.account,message:n}){if(!t)throw new a({docsPath:"/docs/actions/wallet/signMessage"});let r=(0,i.T)(t);if("local"===r.type)return r.signMessage({message:n});let o="string"==typeof n?(0,s.$G)(n):n.raw instanceof Uint8Array?(0,s.NC)(n.raw):n.raw;return e.request({method:"personal_sign",params:[o,r.address]},{retryCount:0})}var u=n(500),c=n(36655),d=n(99112),f=n(85770);async function h(e,t={}){let n;if(t.connector){let{connector:e}=t,[r,i]=await Promise.all([e.getAccounts(),e.getChainId()]);n={accounts:r,chainId:i,connector:e}}else n=e.state.connections.get(e.state.current);if(!n)throw new f.aH;let r=t.chainId??n.chainId,o=n.connector;if(o.getClient)return o.getClient({chainId:r});let a=(0,i.T)(t.account??n.accounts[0]);a.address=(0,d.K)(a.address);let s=e.chains.find(e=>e.id===r),l=await n.connector.getProvider({chainId:r});if(t.account&&!n.accounts.some(e=>e.toLowerCase()===a.address.toLowerCase()))throw new f.JK({address:a.address,connector:o});return(0,u.e)({account:a,chain:s,name:"Connector Client",transport:e=>(function(e,t={}){let{key:n="custom",name:r="Custom Provider",retryDelay:i}=t;return({retryCount:o})=>(0,c.q)({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:i,type:"custom"})})(l)({...e,retryCount:0})})}async function p(e,t){let{account:n,connector:r,...i}=t;return(function(e,t,n){let r=e[t.name];if("function"==typeof r)return r;let i=e[n];return"function"==typeof i?i:n=>t(e,n)})("object"==typeof n&&"local"===n.type?e.getClient():await h(e,{account:n,connector:r}),l,"signMessage")({...i,...n?{account:n}:{}})}var m=n(94956);function g(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mutation:n}=t,i=(e=(0,m.Z)(t),{mutationFn:t=>p(e,t),mutationKey:["signMessage"]}),{mutate:o,mutateAsync:a,...s}=(0,r.D)({...n,...i});return{...s,signMessage:o,signMessageAsync:a}}},59772:function(e,t,n){"use strict";let r;n.d(t,{pA:function(){return ta},z:function(){return ts}}),(e7=tt||(tt={})).assertEqual=e=>e,e7.assertIs=function(e){},e7.assertNever=function(e){throw Error()},e7.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e7.getValidEnumValues=e=>{let t=e7.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),n={};for(let r of t)n[r]=e[r];return e7.objectValues(n)},e7.objectValues=e=>e7.objectKeys(e).map(function(t){return e[t]}),e7.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e7.find=(e,t)=>{for(let n of e)if(t(n))return n},e7.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e7.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e7.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(tn||(tn={})).mergeShapes=(e,t)=>({...e,...t});let i=tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o=e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":if(Array.isArray(e))return i.array;if(null===e)return i.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return i.promise;if("undefined"!=typeof Map&&e instanceof Map)return i.map;if("undefined"!=typeof Set&&e instanceof Set)return i.set;if("undefined"!=typeof Date&&e instanceof Date)return i.date;return i.object;default:return i.unknown}},a=tt.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"]);class s extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}s.create=e=>new s(e);let l=(e,t)=>{let n;switch(e.code){case a.invalid_type:n=e.received===i.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case a.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,tt.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:n=`Unrecognized key(s) in object: ${tt.joinValues(e.keys,", ")}`;break;case a.invalid_union:n="Invalid input";break;case a.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${tt.joinValues(e.options)}`;break;case a.invalid_enum_value:n=`Invalid enum value. Expected ${tt.joinValues(e.options)}, received '${e.received}'`;break;case a.invalid_arguments:n="Invalid function arguments";break;case a.invalid_return_type:n="Invalid function return type";break;case a.invalid_date:n="Invalid date";break;case a.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:tt.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case a.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case a.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case a.custom:n="Invalid input";break;case a.invalid_intersection_types:n="Intersection results could not be merged";break;case a.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case a.not_finite:n="Number must be finite";break;default:n=t.defaultError,tt.assertNever(e)}return{message:n}},u=l;function c(){return u}let d=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(void 0!==i.message)return{...i,path:o,message:i.message};let s="";for(let e of r.filter(e=>!!e).slice().reverse())s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}};function f(e,t){let n=c(),r=d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===l?void 0:l].filter(e=>!!e)});e.common.issues.push(r)}class h{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let r of t){if("aborted"===r.status)return p;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let e of t){let t=await e.key,r=await e.value;n.push({key:t,value:r})}return h.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if("aborted"===t.status||"aborted"===i.status)return p;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}let p=Object.freeze({status:"aborted"}),m=e=>({status:"dirty",value:e}),g=e=>({status:"valid",value:e}),y=e=>"aborted"===e.status,v=e=>"dirty"===e.status,b=e=>"valid"===e.status,w=e=>"undefined"!=typeof Promise&&e instanceof Promise;function x(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function k(e,t,n,r,i){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError,(e8=tr||(tr={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},e8.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class _{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let S=(e,t)=>{if(b(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new s(e.common.issues);return this._error=t,this._error}}};function O(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{var o,a;let{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:i.defaultError}:void 0===i.data?{message:null!==(o=null!=s?s:r)&&void 0!==o?o:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!==(a=null!=s?s:n)&&void 0!==a?a:i.defaultError}},description:i}}class C{constructor(e){this.spa=this.safeParseAsync,this._def=e,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)}get description(){return this._def.description}_getType(e){return o(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new h,ctx:{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(w(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},i=this._parseSync({data:e,path:r.path,parent:r});return S(r,i)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parse({data:e,path:n.path,parent:n});return S(n,await (w(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{let i=e(t),o=()=>r.addIssue({code:a.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(o(),!1)):!!i||(o(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1))}_refinement(e){return new eg({schema:this,typeName:ta.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ey.create(this,this._def)}nullable(){return ev.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return X.create(this,this._def)}promise(){return em.create(this,this._def)}or(e){return et.create([this,e],this._def)}and(e){return ei.create(this,e,this._def)}transform(e){return new eg({...O(this._def),schema:this,typeName:ta.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new eb({...O(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:ta.ZodDefault})}brand(){return new e_({typeName:ta.ZodBranded,type:this,...O(this._def)})}catch(e){return new ew({...O(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:ta.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eS.create(this,e)}readonly(){return eO.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let E=/^c[^\s-]{8,}$/i,P=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Z]{26}$/,T=/^[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,A=/^[a-z0-9_-]{21}$/i,I=/^[-+]?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)?)??$/,M=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,z=/^(?:(?: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])$/,R=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,N=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D="((\\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])))",L=RegExp(`^${D}$`);function F(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function q(e){let t=`${D}T${F(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,RegExp(`^${t}$`)}class Z extends C{_parse(e){var t,n;let o;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==i.string){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.string,received:t.parsedType}),p}let s=new h;for(let i of this._def.checks)if("min"===i.kind)e.data.lengthi.value&&(f(o=this._getOrReturnCtx(e,o),{code:a.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if("length"===i.kind){let t=e.data.length>i.value,n=e.data.lengthe.test(t),{validation:t,code:a.invalid_string,...tr.errToObj(n)})}_addCheck(e){return new Z({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...tr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...tr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...tr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...tr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...tr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...tr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...tr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...tr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...tr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...tr.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...tr.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...tr.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...tr.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...tr.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...tr.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...tr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...tr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...tr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...tr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...tr.errToObj(t)})}nonempty(e){return this.min(1,tr.errToObj(e))}trim(){return new Z({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Z({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Z({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new Z({checks:[],typeName:ta.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class U extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==i.number){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.number,received:t.parsedType}),p}let n=new h;for(let r of this._def.checks)"int"===r.kind?tt.isInteger(e.data)||(f(t=this._getOrReturnCtx(e,t),{code:a.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.datar.value:e.data>=r.value)&&(f(t=this._getOrReturnCtx(e,t),{code:a.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==function(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}(e.data,r.value)&&(f(t=this._getOrReturnCtx(e,t),{code:a.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(f(t=this._getOrReturnCtx(e,t),{code:a.not_finite,message:r.message}),n.dirty()):tt.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,tr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,tr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,tr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,tr.toString(t))}setLimit(e,t,n,r){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:tr.toString(r)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:tr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:tr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:tr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tr.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&tt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.valuenew U({checks:[],typeName:ta.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class $ extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==i.bigint){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.bigint,received:t.parsedType}),p}let n=new h;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.datar.value:e.data>=r.value)&&(f(t=this._getOrReturnCtx(e,t),{code:a.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(f(t=this._getOrReturnCtx(e,t),{code:a.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):tt.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,tr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,tr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,tr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,tr.toString(t))}setLimit(e,t,n,r){return new $({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:tr.toString(r)}]})}_addCheck(e){return new $({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:tr.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new $({checks:[],typeName:ta.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class V extends C{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==i.boolean){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.boolean,received:t.parsedType}),p}return g(e.data)}}V.create=e=>new V({typeName:ta.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class B extends C{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==i.date){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.date,received:t.parsedType}),p}if(isNaN(e.data.getTime()))return f(this._getOrReturnCtx(e),{code:a.invalid_date}),p;let n=new h;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()r.value&&(f(t=this._getOrReturnCtx(e,t),{code:a.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):tt.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:tr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:tr.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew B({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ta.ZodDate,...O(e)});class H extends C{_parse(e){if(this._getType(e)!==i.symbol){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.symbol,received:t.parsedType}),p}return g(e.data)}}H.create=e=>new H({typeName:ta.ZodSymbol,...O(e)});class K extends C{_parse(e){if(this._getType(e)!==i.undefined){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.undefined,received:t.parsedType}),p}return g(e.data)}}K.create=e=>new K({typeName:ta.ZodUndefined,...O(e)});class W extends C{_parse(e){if(this._getType(e)!==i.null){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.null,received:t.parsedType}),p}return g(e.data)}}W.create=e=>new W({typeName:ta.ZodNull,...O(e)});class J extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return g(e.data)}}J.create=e=>new J({typeName:ta.ZodAny,...O(e)});class G extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return g(e.data)}}G.create=e=>new G({typeName:ta.ZodUnknown,...O(e)});class Q extends C{_parse(e){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.never,received:t.parsedType}),p}}Q.create=e=>new Q({typeName:ta.ZodNever,...O(e)});class Y extends C{_parse(e){if(this._getType(e)!==i.undefined){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.void,received:t.parsedType}),p}return g(e.data)}}Y.create=e=>new Y({typeName:ta.ZodVoid,...O(e)});class X extends C{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==i.array)return f(t,{code:a.invalid_type,expected:i.array,received:t.parsedType}),p;if(null!==r.exactLength){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(f(t,{code:a.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new _(t,e,t.path,n)))).then(e=>h.mergeArray(n,e));let o=[...t.data].map((e,n)=>r.type._parseSync(new _(t,e,t.path,n)));return h.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new X({...this._def,minLength:{value:e,message:tr.toString(t)}})}max(e,t){return new X({...this._def,maxLength:{value:e,message:tr.toString(t)}})}length(e,t){return new X({...this._def,exactLength:{value:e,message:tr.toString(t)}})}nonempty(e){return this.min(1,e)}}X.create=(e,t)=>new X({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ta.ZodArray,...O(t)});class ee extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=tt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==i.object){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.object,received:t.parsedType}),p}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Q&&"strip"===this._def.unknownKeys))for(let e in n.data)o.includes(e)||s.push(e);let l=[];for(let e of o){let t=r[e],i=n.data[e];l.push({key:{status:"valid",value:e},value:t._parse(new _(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Q){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of s)l.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&(f(n,{code:a.unrecognized_keys,keys:s}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of s){let r=n.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new _(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of l){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>h.mergeObjectSync(t,e)):h.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return tr.errToObj,new ee({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;let s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=tr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(e){return new ee({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ta.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ee({...this._def,catchall:e})}pick(e){let t={};return tt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new ee({...this._def,shape:()=>t})}omit(e){let t={};return tt.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new ee({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof ee){let n={};for(let r in t.shape){let i=t.shape[r];n[r]=ey.create(e(i))}return new ee({...t._def,shape:()=>n})}return t instanceof X?new X({...t._def,type:e(t.element)}):t instanceof ey?ey.create(e(t.unwrap())):t instanceof ev?ev.create(e(t.unwrap())):t instanceof eo?eo.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};return tt.objectKeys(this.shape).forEach(n=>{let r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}),new ee({...this._def,shape:()=>t})}required(e){let t={};return tt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ey;)e=e._def.innerType;t[n]=e}}),new ee({...this._def,shape:()=>t})}keyof(){return ef(tt.objectKeys(this.shape))}}ee.create=(e,t)=>new ee({shape:()=>e,unknownKeys:"strip",catchall:Q.create(),typeName:ta.ZodObject,...O(t)}),ee.strictCreate=(e,t)=>new ee({shape:()=>e,unknownKeys:"strict",catchall:Q.create(),typeName:ta.ZodObject,...O(t)}),ee.lazycreate=(e,t)=>new ee({shape:e,unknownKeys:"strip",catchall:Q.create(),typeName:ta.ZodObject,...O(t)});class et extends C{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new s(e.ctx.common.issues));return f(t,{code:a.invalid_union,unionErrors:n}),p});{let e;let r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new s(e));return f(t,{code:a.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}}et.create=(e,t)=>new et({options:e,typeName:ta.ZodUnion,...O(t)});let en=e=>{if(e instanceof ec)return en(e.schema);if(e instanceof eg)return en(e.innerType());if(e instanceof ed)return[e.value];if(e instanceof eh)return e.options;if(e instanceof ep)return tt.objectValues(e.enum);if(e instanceof eb)return en(e._def.innerType);if(e instanceof K)return[void 0];else if(e instanceof W)return[null];else if(e instanceof ey)return[void 0,...en(e.unwrap())];else if(e instanceof ev)return[null,...en(e.unwrap())];else if(e instanceof e_)return en(e.unwrap());else if(e instanceof eO)return en(e.unwrap());else if(e instanceof ew)return en(e._def.innerType);else return[]};class er extends C{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.object)return f(t,{code:a.invalid_type,expected:i.object,received:t.parsedType}),p;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(f(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let n of t){let t=en(n.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new er({typeName:ta.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...O(n)})}}class ei extends C{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(y(e)||y(r))return p;let s=function e(t,n){let r=o(t),a=o(n);if(t===n)return{valid:!0,data:t};if(r===i.object&&a===i.object){let r=tt.objectKeys(n),i=tt.objectKeys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of i){let i=e(t[r],n[r]);if(!i.valid)return{valid:!1};o[r]=i.data}return{valid:!0,data:o}}if(r===i.array&&a===i.array){if(t.length!==n.length)return{valid:!1};let r=[];for(let i=0;ir(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ei.create=(e,t,n)=>new ei({left:e,right:t,typeName:ta.ZodIntersection,...O(n)});class eo extends C{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.array)return f(n,{code:a.invalid_type,expected:i.array,received:n.parsedType}),p;if(n.data.lengththis._def.items.length&&(f(n,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new _(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>h.mergeArray(t,e)):h.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new eo({...this._def,rest:e})}}eo.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new eo({items:e,typeName:ta.ZodTuple,rest:null,...O(t)})};class ea extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.object)return f(n,{code:a.invalid_type,expected:i.object,received:n.parsedType}),p;let r=[],o=this._def.keyType,s=this._def.valueType;for(let e in n.data)r.push({key:o._parse(new _(n,e,n.path,e)),value:s._parse(new _(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?h.mergeObjectAsync(t,r):h.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new ea(t instanceof C?{keyType:e,valueType:t,typeName:ta.ZodRecord,...O(n)}:{keyType:Z.create(),valueType:e,typeName:ta.ZodRecord,...O(t)})}}class es extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.map)return f(n,{code:a.invalid_type,expected:i.map,received:n.parsedType}),p;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([e,t],i)=>({key:r._parse(new _(n,e,n.path,[i,"key"])),value:o._parse(new _(n,t,n.path,[i,"value"]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of s){let r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return p;("dirty"===r.status||"dirty"===i.status)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of s){let r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return p;("dirty"===r.status||"dirty"===i.status)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}es.create=(e,t,n)=>new es({valueType:t,keyType:e,typeName:ta.ZodMap,...O(n)});class el extends C{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.set)return f(n,{code:a.invalid_type,expected:i.set,received:n.parsedType}),p;let r=this._def;null!==r.minSize&&n.data.sizer.maxSize.value&&(f(n,{code:a.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let o=this._def.valueType;function s(e){let n=new Set;for(let r of e){if("aborted"===r.status)return p;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let l=[...n.data.values()].map((e,t)=>o._parse(new _(n,e,n.path,t)));return n.common.async?Promise.all(l).then(e=>s(e)):s(l)}min(e,t){return new el({...this._def,minSize:{value:e,message:tr.toString(t)}})}max(e,t){return new el({...this._def,maxSize:{value:e,message:tr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}el.create=(e,t)=>new el({valueType:e,minSize:null,maxSize:null,typeName:ta.ZodSet,...O(t)});class eu extends C{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.function)return f(t,{code:a.invalid_type,expected:i.function,received:t.parsedType}),p;function n(e,n){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),l].filter(e=>!!e),issueData:{code:a.invalid_arguments,argumentsError:n}})}function r(e,n){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),l].filter(e=>!!e),issueData:{code:a.invalid_return_type,returnTypeError:n}})}let o={errorMap:t.common.contextualErrorMap},u=t.data;if(this._def.returns instanceof em){let e=this;return g(async function(...t){let i=new s([]),a=await e._def.args.parseAsync(t,o).catch(e=>{throw i.addIssue(n(t,e)),i}),l=await Reflect.apply(u,this,a);return await e._def.returns._def.type.parseAsync(l,o).catch(e=>{throw i.addIssue(r(l,e)),i})})}{let e=this;return g(function(...t){let i=e._def.args.safeParse(t,o);if(!i.success)throw new s([n(t,i.error)]);let a=Reflect.apply(u,this,i.data),l=e._def.returns.safeParse(a,o);if(!l.success)throw new s([r(a,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eu({...this._def,args:eo.create(e).rest(G.create())})}returns(e){return new eu({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new eu({args:e||eo.create([]).rest(G.create()),returns:t||G.create(),typeName:ta.ZodFunction,...O(n)})}}class ec extends C{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ec.create=(e,t)=>new ec({getter:e,typeName:ta.ZodLazy,...O(t)});class ed extends C{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ef(e,t){return new eh({values:e,typeName:ta.ZodEnum,...O(t)})}ed.create=(e,t)=>new ed({value:e,typeName:ta.ZodLiteral,...O(t)});class eh extends C{constructor(){super(...arguments),ti.set(this,void 0)}_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),n=this._def.values;return f(t,{expected:tt.joinValues(n),received:t.parsedType,code:a.invalid_type}),p}if(x(this,ti,"f")||k(this,ti,new Set(this._def.values),"f"),!x(this,ti,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return f(t,{received:t.data,code:a.invalid_enum_value,options:n}),p}return g(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return eh.create(e,{...this._def,...t})}exclude(e,t=this._def){return eh.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ti=new WeakMap,eh.create=ef;class ep extends C{constructor(){super(...arguments),to.set(this,void 0)}_parse(e){let t=tt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==i.string&&n.parsedType!==i.number){let e=tt.objectValues(t);return f(n,{expected:tt.joinValues(e),received:n.parsedType,code:a.invalid_type}),p}if(x(this,to,"f")||k(this,to,new Set(tt.getValidEnumValues(this._def.values)),"f"),!x(this,to,"f").has(e.data)){let e=tt.objectValues(t);return f(n,{received:n.data,code:a.invalid_enum_value,options:e}),p}return g(e.data)}get enum(){return this._def.values}}to=new WeakMap,ep.create=(e,t)=>new ep({values:e,typeName:ta.ZodNativeEnum,...O(t)});class em extends C{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==i.promise&&!1===t.common.async?(f(t,{code:a.invalid_type,expected:i.promise,received:t.parsedType}),p):g((t.parsedType===i.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}em.create=(e,t)=>new em({type:e,typeName:ta.ZodPromise,...O(t)});class eg extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ta.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{f(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===r.type){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return p;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?p:"dirty"===r.status||"dirty"===t.value?m(r.value):r});{if("aborted"===t.value)return p;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?p:"dirty"===r.status||"dirty"===t.value?m(r.value):r}}if("refinement"===r.type){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?p:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))));{let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?p:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}}if("transform"===r.type){if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>b(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);{let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!b(e))return e;let o=r.transform(e.value,i);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}}tt.assertNever(r)}}eg.create=(e,t,n)=>new eg({schema:e,typeName:ta.ZodEffects,effect:t,...O(n)}),eg.createWithPreprocess=(e,t,n)=>new eg({schema:t,effect:{type:"preprocess",transform:e},typeName:ta.ZodEffects,...O(n)});class ey extends C{_parse(e){return this._getType(e)===i.undefined?g(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ey.create=(e,t)=>new ey({innerType:e,typeName:ta.ZodOptional,...O(t)});class ev extends C{_parse(e){return this._getType(e)===i.null?g(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ev.create=(e,t)=>new ev({innerType:e,typeName:ta.ZodNullable,...O(t)});class eb extends C{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===i.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eb.create=(e,t)=>new eb({innerType:e,typeName:ta.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...O(t)});class ew extends C{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return w(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new s(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ew.create=(e,t)=>new ew({innerType:e,typeName:ta.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...O(t)});class ex extends C{_parse(e){if(this._getType(e)!==i.nan){let t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:i.nan,received:t.parsedType}),p}return{status:"valid",value:e.data}}}ex.create=e=>new ex({typeName:ta.ZodNaN,...O(e)});let ek=Symbol("zod_brand");class e_ extends C{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class eS extends C{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),m(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new eS({in:e,out:t,typeName:ta.ZodPipeline})}}class eO extends C{_parse(e){let t=this._def.innerType._parse(e),n=e=>(b(e)&&(e.value=Object.freeze(e.value)),e);return w(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}function eC(e,t={},n){return e?J.create().superRefine((r,i)=>{var o,a;if(!e(r)){let e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,s=null===(a=null!==(o=e.fatal)&&void 0!==o?o:n)||void 0===a||a;i.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:s})}}):J.create()}eO.create=(e,t)=>new eO({innerType:e,typeName:ta.ZodReadonly,...O(t)});let eE={object:ee.lazycreate};(te=ta||(ta={})).ZodString="ZodString",te.ZodNumber="ZodNumber",te.ZodNaN="ZodNaN",te.ZodBigInt="ZodBigInt",te.ZodBoolean="ZodBoolean",te.ZodDate="ZodDate",te.ZodSymbol="ZodSymbol",te.ZodUndefined="ZodUndefined",te.ZodNull="ZodNull",te.ZodAny="ZodAny",te.ZodUnknown="ZodUnknown",te.ZodNever="ZodNever",te.ZodVoid="ZodVoid",te.ZodArray="ZodArray",te.ZodObject="ZodObject",te.ZodUnion="ZodUnion",te.ZodDiscriminatedUnion="ZodDiscriminatedUnion",te.ZodIntersection="ZodIntersection",te.ZodTuple="ZodTuple",te.ZodRecord="ZodRecord",te.ZodMap="ZodMap",te.ZodSet="ZodSet",te.ZodFunction="ZodFunction",te.ZodLazy="ZodLazy",te.ZodLiteral="ZodLiteral",te.ZodEnum="ZodEnum",te.ZodEffects="ZodEffects",te.ZodNativeEnum="ZodNativeEnum",te.ZodOptional="ZodOptional",te.ZodNullable="ZodNullable",te.ZodDefault="ZodDefault",te.ZodCatch="ZodCatch",te.ZodPromise="ZodPromise",te.ZodBranded="ZodBranded",te.ZodPipeline="ZodPipeline",te.ZodReadonly="ZodReadonly";let eP=Z.create,ej=U.create,eT=ex.create,eA=$.create,eI=V.create,eM=B.create,ez=H.create,eR=K.create,eN=W.create,eD=J.create,eL=G.create,eF=Q.create,eq=Y.create,eZ=X.create,eU=ee.create,e$=ee.strictCreate,eV=et.create,eB=er.create,eH=ei.create,eK=eo.create,eW=ea.create,eJ=es.create,eG=el.create,eQ=eu.create,eY=ec.create,eX=ed.create,e0=eh.create,e1=ep.create,e2=em.create,e4=eg.create,e9=ey.create,e3=ev.create,e5=eg.createWithPreprocess,e6=eS.create;var e7,e8,te,tt,tn,tr,ti,to,ta,ts=Object.freeze({__proto__:null,defaultErrorMap:l,setErrorMap:function(e){u=e},getErrorMap:c,makeIssue:d,EMPTY_PATH:[],addIssueToContext:f,ParseStatus:h,INVALID:p,DIRTY:m,OK:g,isAborted:y,isDirty:v,isValid:b,isAsync:w,get util(){return tt},get objectUtil(){return tn},ZodParsedType:i,getParsedType:o,ZodType:C,datetimeRegex:q,ZodString:Z,ZodNumber:U,ZodBigInt:$,ZodBoolean:V,ZodDate:B,ZodSymbol:H,ZodUndefined:K,ZodNull:W,ZodAny:J,ZodUnknown:G,ZodNever:Q,ZodVoid:Y,ZodArray:X,ZodObject:ee,ZodUnion:et,ZodDiscriminatedUnion:er,ZodIntersection:ei,ZodTuple:eo,ZodRecord:ea,ZodMap:es,ZodSet:el,ZodFunction:eu,ZodLazy:ec,ZodLiteral:ed,ZodEnum:eh,ZodNativeEnum:ep,ZodPromise:em,ZodEffects:eg,ZodTransformer:eg,ZodOptional:ey,ZodNullable:ev,ZodDefault:eb,ZodCatch:ew,ZodNaN:ex,BRAND:ek,ZodBranded:e_,ZodPipeline:eS,ZodReadonly:eO,custom:eC,Schema:C,ZodSchema:C,late:eE,get ZodFirstPartyTypeKind(){return ta},coerce:{string:e=>Z.create({...e,coerce:!0}),number:e=>U.create({...e,coerce:!0}),boolean:e=>V.create({...e,coerce:!0}),bigint:e=>$.create({...e,coerce:!0}),date:e=>B.create({...e,coerce:!0})},any:eD,array:eZ,bigint:eA,boolean:eI,date:eM,discriminatedUnion:eB,effect:e4,enum:e0,function:eQ,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>eC(t=>t instanceof e,t),intersection:eH,lazy:eY,literal:eX,map:eJ,nan:eT,nativeEnum:e1,never:eF,null:eN,nullable:e3,number:ej,object:eU,oboolean:()=>eI().optional(),onumber:()=>ej().optional(),optional:e9,ostring:()=>eP().optional(),pipeline:e6,preprocess:e5,promise:e2,record:eW,set:eG,strictObject:e$,string:eP,symbol:ez,transformer:e4,tuple:eK,undefined:eR,union:eV,unknown:eL,void:eq,NEVER:p,ZodIssueCode:a,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:s})}}]); \ No newline at end of file