bangonit 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/webapp/.next/standalone/app/webapp/.next/BUILD_ID +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/app-build-manifest.json +11 -11
- package/app/webapp/.next/standalone/app/webapp/.next/app-path-routes-manifest.json +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/build-manifest.json +3 -3
- package/app/webapp/.next/standalone/app/webapp/.next/prerender-manifest.json +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/required-server-files.json +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/_not-found/page.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/_not-found.html +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/_not-found.rsc +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/api/chat/route.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/api/chat/route.js.nft.json +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/api/screenshot/route.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/api/screenshot/route.js.nft.json +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/app/page.js +5 -5
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/app/page_client-reference-manifest.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/app.html +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/app.rsc +2 -2
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/index.html +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/index.rsc +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/page.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/app-paths-manifest.json +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/chunks/151.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/chunks/{124.js → 373.js} +15 -15
- package/app/webapp/.next/standalone/app/webapp/.next/server/chunks/679.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/middleware-build-manifest.js +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/pages/404.html +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/pages/500.html +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/server/server-reference-manifest.json +1 -1
- package/app/webapp/.next/{static/chunks/app/app/page-4c6dfbf12230aab7.js → standalone/app/webapp/.next/static/chunks/app/app/page-f4f042a34d2b4471.js} +1 -1
- package/app/webapp/.next/standalone/app/webapp/.next/static/chunks/app/layout-40f50d9380154ecf.js +1 -0
- package/app/webapp/.next/standalone/app/webapp/.next/static/chunks/{main-app-106dd83f859b9dfa.js → main-app-76384b941f0b51cb.js} +1 -1
- package/app/webapp/.next/standalone/app/webapp/server.js +1 -1
- package/app/webapp/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib → sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3} +0 -0
- package/app/webapp/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/package.json +11 -5
- package/app/webapp/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
- package/app/webapp/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
- package/app/webapp/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
- package/app/webapp/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
- package/app/webapp/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
- package/app/webapp/.next/standalone/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/package.json +13 -7
- package/app/webapp/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/LICENSE +191 -0
- package/app/webapp/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
- package/app/webapp/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
- package/app/webapp/.next/standalone/package.json +8 -6
- package/app/webapp/.next/{standalone/app/webapp/.next/static/chunks/app/app/page-4c6dfbf12230aab7.js → static/chunks/app/app/page-f4f042a34d2b4471.js} +1 -1
- package/app/webapp/.next/static/chunks/app/layout-40f50d9380154ecf.js +1 -0
- package/app/webapp/.next/static/chunks/{main-app-106dd83f859b9dfa.js → main-app-76384b941f0b51cb.js} +1 -1
- package/bin/boi.js +22 -0
- package/package.json +8 -6
- package/app/webapp/.next/standalone/app/webapp/.next/static/chunks/app/layout-57acb80d8da0067a.js +0 -1
- package/app/webapp/.next/standalone/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
- package/app/webapp/.next/static/chunks/app/layout-57acb80d8da0067a.js +0 -1
- package/bin/app/desktopapp/src/shared/args.js +0 -22
- package/bin/src/cli/bangonit.js +0 -1309
- /package/app/webapp/.next/standalone/app/webapp/.next/static/{QoPxkNUQxw6VoKyWIUhlL → ZoXPKe-6bpxSAS83EaRH6}/_buildManifest.js +0 -0
- /package/app/webapp/.next/standalone/app/webapp/.next/static/{QoPxkNUQxw6VoKyWIUhlL → ZoXPKe-6bpxSAS83EaRH6}/_ssgManifest.js +0 -0
- /package/app/webapp/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/index.js +0 -0
- /package/app/webapp/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/versions.json +0 -0
- /package/app/webapp/.next/standalone/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/LICENSE +0 -0
- /package/app/webapp/.next/static/{QoPxkNUQxw6VoKyWIUhlL → ZoXPKe-6bpxSAS83EaRH6}/_buildManifest.js +0 -0
- /package/app/webapp/.next/static/{QoPxkNUQxw6VoKyWIUhlL → ZoXPKe-6bpxSAS83EaRH6}/_ssgManifest.js +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(()=>{var e={};e.id=191,e.ids=[191],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},
|
|
1
|
+
(()=>{var e={};e.id=191,e.ids=[191],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},7080:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GlobalError:()=>s.a,__next_app__:()=>p,originalPathname:()=>d,pages:()=>c,routeModule:()=>h,tree:()=>u}),n(1241),n(7718),n(7824);var r=n(3282),a=n(5736),i=n(3906),s=n.n(i),o=n(6880),l={};for(let e in o)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>o[e]);n.d(t,l);let u=["",{children:["app",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(n.bind(n,1241)),"/home/floydophone/repos/domyjob/app/webapp/src/app/app/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(n.bind(n,7718)),"/home/floydophone/repos/domyjob/app/webapp/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(n.t.bind(n,7824,23)),"next/dist/client/components/not-found-error"]}],c=["/home/floydophone/repos/domyjob/app/webapp/src/app/app/page.tsx"],d="/app/page",p={require:n,loadChunk:()=>Promise.resolve()},h=new r.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/app/page",pathname:"/app",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:u}})},7834:(e,t,n)=>{Promise.resolve().then(n.bind(n,4564))},821:()=>{},8082:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,4424,23)),Promise.resolve().then(n.t.bind(n,7752,23)),Promise.resolve().then(n.t.bind(n,5275,23)),Promise.resolve().then(n.t.bind(n,9842,23)),Promise.resolve().then(n.t.bind(n,1633,23)),Promise.resolve().then(n.t.bind(n,9224,23))},4564:(e,t,n)=>{"use strict";let r;n.r(t),n.d(t,{default:()=>hn});var a,i,s,o,l,u,c,d,p,h,f,m,g,y,v,b,x,k,w,_,S,I,E,T,C,A,N,z,O,P,R,j,D,M,$,L,F,Z,q,U,V,B,W,H,J,G,K,Y,X={};n.r(X),n.d(X,{boolean:()=>l$,booleanish:()=>lL,commaOrSpaceSeparated:()=>lV,commaSeparated:()=>lU,number:()=>lZ,overloadedBoolean:()=>lF,spaceSeparated:()=>lq});var Q={};n.r(Q),n.d(Q,{attentionMarkers:()=>cZ,contentInitial:()=>cj,disable:()=>cq,document:()=>cR,flow:()=>cM,flowInitial:()=>cD,insideSpan:()=>cF,string:()=>c$,text:()=>cL});var ee=n(3227),et=n(3677),en="vercel.ai.error",er=Symbol.for(en),ea=class e extends(s=Error,i=er,s){constructor({name:e,message:t,cause:n}){super(t),this[i]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,en)}static hasMarker(e,t){let n=Symbol.for(t);return null!=e&&"object"==typeof e&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}};function ei(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}Symbol.for("vercel.ai.error.AI_APICallError"),Symbol.for("vercel.ai.error.AI_EmptyResponseBodyError");var es="AI_InvalidArgumentError",eo=`vercel.ai.error.${es}`,el=Symbol.for(eo),eu=class extends(l=ea,o=el,l){constructor({message:e,cause:t,argument:n}){super({name:es,message:e,cause:t}),this[o]=!0,this.argument=n}static isInstance(e){return ea.hasMarker(e,eo)}},ec=(Symbol.for("vercel.ai.error.AI_InvalidPromptError"),Symbol.for("vercel.ai.error.AI_InvalidResponseDataError"),"AI_JSONParseError"),ed=`vercel.ai.error.${ec}`,ep=Symbol.for(ed),eh=class extends(c=ea,u=ep,c){constructor({text:e,cause:t}){super({name:ec,message:`JSON parsing failed: Text: ${e}.
|
|
2
2
|
Error message: ${ei(t)}`,cause:t}),this[u]=!0,this.text=e}static isInstance(e){return ea.hasMarker(e,ed)}},ef=(Symbol.for("vercel.ai.error.AI_LoadAPIKeyError"),Symbol.for("vercel.ai.error.AI_LoadSettingError"),Symbol.for("vercel.ai.error.AI_NoContentGeneratedError"),"AI_NoSuchModelError"),em=`vercel.ai.error.${ef}`,eg=Symbol.for(em),ey=class extends(p=ea,d=eg,p){constructor({errorName:e=ef,modelId:t,modelType:n,message:r=`No such ${n}: ${t}`}){super({name:e,message:r}),this[d]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return ea.hasMarker(e,em)}},ev=(Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError"),"AI_TypeValidationError"),eb=`vercel.ai.error.${ev}`,ex=Symbol.for(eb),ek=class e extends(f=ea,h=ex,f){constructor({value:e,cause:t,context:n}){let r="Type validation failed";if((null==n?void 0:n.field)&&(r+=` for ${n.field}`),(null==n?void 0:n.entityName)||(null==n?void 0:n.entityId)){r+=" (";let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(", ")+")"}super({name:ev,message:`${r}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${ei(t)}`,cause:t}),this[h]=!0,this.value=e,this.context=n}static isInstance(e){return ea.hasMarker(e,eb)}static wrap({value:t,cause:n,context:r}){var a,i,s;return e.isInstance(n)&&n.value===t&&(null==(a=n.context)?void 0:a.field)===(null==r?void 0:r.field)&&(null==(i=n.context)?void 0:i.entityName)===(null==r?void 0:r.entityName)&&(null==(s=n.context)?void 0:s.entityId)===(null==r?void 0:r.entityId)?n:new e({value:t,cause:n,context:r})}},ew="AI_UnsupportedFunctionalityError",e_=`vercel.ai.error.${ew}`,eS=Symbol.for(e_),eI=class extends(g=ea,m=eS,g){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:ew,message:t}),this[m]=!0,this.functionality=e}static isInstance(e){return ea.hasMarker(e,e_)}};function eE(e){return null===e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||(Array.isArray(e)?e.every(eE):"object"==typeof e&&Object.entries(e).every(([e,t])=>"string"==typeof e&&(void 0===t||eE(t))))}Symbol("ZodOutput"),Symbol("ZodInput");class eT{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}let eC=new eT;function eA(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eN(e,t){return"bigint"==typeof t?t.toString():t}function ez(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function eO(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function eP(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function eR(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ej(e){return JSON.stringify(e)}let eD=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function eM(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let e$=ez(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eL(e){if(!1===eM(e))return!1;let t=e.constructor;if(void 0===t)return!0;let n=t.prototype;return!1!==eM(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}let eF=new Set(["string","number","symbol"]);function eZ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eq(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function eU(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let eV={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function eB(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function eW(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eH(e){return"string"==typeof e?e:e?.message}function eJ(e,t,n){let r={...e,path:e.path??[]};if(!e.message){let a=eH(e.inst?._zod.def?.error?.(e))??eH(t?.error?.(e))??eH(n.customError?.(e))??eH(n.localeError?.(e))??"Invalid input";r.message=a}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function eG(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eK(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}class eY{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??eC,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let i={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,i);let s=e._zod.toJSONSchema?.();if(s)i.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)i.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=i.schema;switch(r.type){case"string":{t.type="string";let{minimum:n,maximum:r,format:a,patterns:s,contentEncoding:o}=e._zod.bag;if("number"==typeof n&&(t.minLength=n),"number"==typeof r&&(t.maxLength=r),a&&(t.format=({guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""})[a]??a,""===t.format&&delete t.format),o&&(t.contentEncoding=o),s&&s.size>0){let e=[...s];1===e.length?t.pattern=e[0].source:e.length>1&&(i.schema.allOf=[...e.map(e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source}))])}break}case"number":{let{minimum:n,maximum:r,format:a,multipleOf:i,exclusiveMaximum:s,exclusiveMinimum:o}=e._zod.bag;"string"==typeof a&&a.includes("int")?t.type="integer":t.type="number","number"==typeof o&&(t.exclusiveMinimum=o),"number"==typeof n&&(t.minimum=n,"number"==typeof o&&(o>=n?delete t.minimum:delete t.exclusiveMinimum)),"number"==typeof s&&(t.exclusiveMaximum=s),"number"==typeof r&&(t.maximum=r,"number"==typeof s&&(s<=r?delete t.maximum:delete t.exclusiveMaximum)),"number"==typeof i&&(t.multipleOf=i);break}case"boolean":case"success":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw Error("Date cannot be represented in JSON Schema");break;case"array":{let{minimum:a,maximum:i}=e._zod.bag;"number"==typeof a&&(t.minItems=a),"number"==typeof i&&(t.maxItems=i),t.type="array",t.items=this.process(r.element,{...n,path:[...n.path,"items"]});break}case"object":{t.type="object",t.properties={};let e=r.shape;for(let r in e)t.properties[r]=this.process(e[r],{...n,path:[...n.path,"properties",r]});let a=new Set([...new Set(Object.keys(e))].filter(e=>{let t=r.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout}));a.size>0&&(t.required=Array.from(a)),r.catchall?._zod.def.type==="never"?t.additionalProperties=!1:r.catchall?r.catchall&&(t.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,"additionalProperties"]})):"output"===this.io&&(t.additionalProperties=!1);break}case"union":t.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,"anyOf",t]}));break;case"intersection":{let e=this.process(r.left,{...n,path:[...n.path,"allOf",0]}),a=this.process(r.right,{...n,path:[...n.path,"allOf",1]}),i=[..."allOf"in e&&1===Object.keys(e).length?e.allOf:[e],..."allOf"in a&&1===Object.keys(a).length?a.allOf:[a]];t.allOf=i;break}case"tuple":{t.type="array";let a=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,"prefixItems",t]}));if("draft-2020-12"===this.target?t.prefixItems=a:t.items=a,r.rest){let e=this.process(r.rest,{...n,path:[...n.path,"items"]});"draft-2020-12"===this.target?t.items=e:t.additionalItems=e}r.rest&&(t.items=this.process(r.rest,{...n,path:[...n.path,"items"]}));let{minimum:i,maximum:s}=e._zod.bag;"number"==typeof i&&(t.minItems=i),"number"==typeof s&&(t.maxItems=s);break}case"record":t.type="object",t.propertyNames=this.process(r.keyType,{...n,path:[...n.path,"propertyNames"]}),t.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,"additionalProperties"]});break;case"map":if("throw"===this.unrepresentable)throw Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw Error("Set cannot be represented in JSON Schema");break;case"enum":{let e=eA(r.entries);e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=e;break}case"literal":{let e=[];for(let t of r.values)if(void 0===t){if("throw"===this.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof t){if("throw"===this.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");e.push(Number(t))}else e.push(t);if(0===e.length);else if(1===e.length){let n=e[0];t.type=null===n?"null":typeof n,t.const=n}else e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),e.every(e=>"boolean"==typeof e)&&(t.type="string"),e.every(e=>null===e)&&(t.type="null"),t.enum=e;break}case"file":{let n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:r,maximum:a,mime:i}=e._zod.bag;void 0!==r&&(n.minLength=r),void 0!==a&&(n.maxLength=a),i?1===i.length?(n.contentMediaType=i[0],Object.assign(t,n)):t.anyOf=i.map(e=>({...n,contentMediaType:e})):Object.assign(t,n);break}case"transform":if("throw"===this.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema");break;case"nullable":{let e=this.process(r.innerType,n);t.anyOf=[e,{type:"null"}];break}case"nonoptional":case"promise":case"optional":this.process(r.innerType,n),i.ref=r.innerType;break;case"default":this.process(r.innerType,n),i.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case"prefault":this.process(r.innerType,n),i.ref=r.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case"catch":{let e;this.process(r.innerType,n),i.ref=r.innerType;try{e=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{let n=e._zod.pattern;if(!n)throw Error("Pattern not found in template literal");t.type="string",t.pattern=n.source;break}case"pipe":{let e="input"===this.io?"transform"===r.in._zod.def.type?r.out:r.in:r.out;this.process(e,n),i.ref=e;break}case"readonly":this.process(r.innerType,n),i.ref=r.innerType,t.readOnly=!0;break;case"lazy":{let t=e._zod.innerType;this.process(t,n),i.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")}}}let o=this.metadataRegistry.get(e);return o&&Object.assign(i.schema,o),"input"===this.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let a=t._zod.def;switch(a.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return e(a.element,r);case"object":for(let t in a.shape)if(e(a.shape[t],r))return!0;return!1;case"union":for(let t of a.options)if(e(t,r))return!0;return!1;case"intersection":return e(a.left,r)||e(a.right,r);case"tuple":for(let t of a.items)if(e(t,r))return!0;if(a.rest&&e(a.rest,r))return!0;return!1;case"record":case"map":return e(a.keyType,r)||e(a.valueType,r);case"set":return e(a.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return e(a.innerType,r);case"lazy":return e(a.getter(),r);case"transform":return!0;case"pipe":return e(a.in,r)||e(a.out,r)}throw Error(`Unknown schema type: ${a.type}`)}(e)&&(delete i.schema.examples,delete i.schema.default),"input"===this.io&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let a=e=>{let t="draft-2020-12"===this.target?"$defs":"definitions";if(n.external){let r=n.external.registry.get(e[0])?.id,a=n.external.uri??(e=>e);if(r)return{ref:a(r)};let i=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=i,{defId:i,ref:`${a("__shared")}#/${t}/${i}`}}if(e[1]===r)return{ref:"#"};let a=`#/${t}/`,i=e[1].schema.id??`__schema${this.counter++}`;return{defId:i,ref:a+i}},i=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=a(e);t.def={...t.schema},r&&(t.defId=r);let i=t.schema;for(let e in i)delete i[e];i.$ref=n};if("throw"===n.cycles)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>
|
|
4
4
|
|
|
5
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){i(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){i(t);continue}}if(this.metadataRegistry.get(t[0])?.id||r.cycle||r.count>1&&"ref"===n.reused){i(t);continue}}let s=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,a={...r};if(null===n.ref)return;let i=n.ref;if(n.ref=null,i){s(i,t);let e=this.seen.get(i).schema;e.$ref&&"draft-7"===t.target?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,a))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())s(e[0],{target:this.target});let o={};if("draft-2020-12"===this.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?o.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");o.$id=n.external.uri(t)}Object.assign(o,r.def);let l=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}n.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?o.$defs=l:o.definitions=l);try{return JSON.parse(JSON.stringify(o))}catch(e){throw Error("Error converting schema to JSON.")}}}function eX(e,t,n){function r(n,r){var a;for(let i in Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(a=n._zod).traits??(a.traits=new Set),n._zod.traits.add(e),t(n,r),s.prototype)i in n||Object.defineProperty(n,i,{value:s.prototype[i].bind(n)});n._zod.constr=s,n._zod.def=r}let a=n?.Parent??Object;class i extends a{}function s(e){var t;let a=n?.Parent?new i:this;for(let n of(r(a,e),(t=a._zod).deferred??(t.deferred=[]),a._zod.deferred))n();return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class eQ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}let e0={};function e1(e){return e&&Object.assign(e0,e),e0}let e2=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,eN,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},e4=eX("$ZodError",e2),e9=eX("$ZodError",e2,{Parent:Error}),e5=e=>(t,n,r)=>{let a=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new eQ;return i.issues.length?{success:!1,error:new(e??e4)(i.issues.map(e=>eJ(e,a,e1())))}:{success:!0,data:i.value}},e3=e5(e9),e6=e=>async(t,n,r)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>eJ(e,a,e1())))}:{success:!0,data:i.value}},e8=e6(e9),e7=(e,t)=>{e4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t){let n=t||function(e){return e.message},r={_errors:[]},a=e=>{for(let t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>a({issues:e}));else if("invalid_key"===t.code)a({issues:t.issues});else if("invalid_element"===t.code)a({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else{let e=r,a=0;for(;a<t.path.length;){let r=t.path[a];a===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})};eX("ZodError",e7);let te=eX("ZodError",e7,{Parent:Error}),tt=(e,t,n,r)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},i=e._zod.run({value:t,issues:[]},a);if(i instanceof Promise)throw new eQ;if(i.issues.length){let e=new(r?.Err??te)(i.issues.map(e=>eJ(e,a,e1())));throw eD(e,r?.callee),e}return i.value},tn=async(e,t,n,r)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},i=e._zod.run({value:t,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){let e=new(r?.Err??te)(i.issues.map(e=>eJ(e,a,e1())));throw eD(e,r?.callee),e}return i.value},tr=e5(te),ta=e6(te);(function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.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},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t})(y||(y={})),(v||(v={})).mergeShapes=(e,t)=>({...e,...t});let ti=y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ts=e=>{switch(typeof e){case"undefined":return ti.undefined;case"string":return ti.string;case"number":return Number.isNaN(e)?ti.nan:ti.number;case"boolean":return ti.boolean;case"function":return ti.function;case"bigint":return ti.bigint;case"symbol":return ti.symbol;case"object":if(Array.isArray(e))return ti.array;if(null===e)return ti.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return ti.promise;if("undefined"!=typeof Map&&e instanceof Map)return ti.map;if("undefined"!=typeof Set&&e instanceof Set)return ti.set;if("undefined"!=typeof Date&&e instanceof Date)return ti.date;return ti.object;default:return ti.unknown}},to=y.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 tl extends Error{get errors(){return this.issues}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}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){let n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof tl))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,y.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}tl.create=e=>new tl(e);let tu=(e,t)=>{let n;switch(e.code){case to.invalid_type:n=e.received===ti.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case to.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,y.jsonStringifyReplacer)}`;break;case to.unrecognized_keys:n=`Unrecognized key(s) in object: ${y.joinValues(e.keys,", ")}`;break;case to.invalid_union:n="Invalid input";break;case to.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${y.joinValues(e.options)}`;break;case to.invalid_enum_value:n=`Invalid enum value. Expected ${y.joinValues(e.options)}, received '${e.received}'`;break;case to.invalid_arguments:n="Invalid function arguments";break;case to.invalid_return_type:n="Invalid function return type";break;case to.invalid_date:n="Invalid date";break;case to.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}"`:y.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case to.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}`:"bigint"===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 to.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 to.custom:n="Invalid input";break;case to.invalid_intersection_types:n="Intersection results could not be merged";break;case to.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case to.not_finite:n="Number must be finite";break;default:n=t.defaultError,y.assertNever(e)}return{message:n}};!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(b||(b={}));let tc=e=>{let{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],s={...a,path:i};if(void 0!==a.message)return{...a,path:i,message:a.message};let o="";for(let e of r.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...a,path:i,message:o}};function td(e,t){let n=tc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,tu,tu==tu?void 0:tu].filter(e=>!!e)});e.common.issues.push(n)}class tp{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 th;"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 tp.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:a}=r;if("aborted"===t.status||"aborted"===a.status)return th;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==a.value||r.alwaysSet)&&(n[t.value]=a.value)}return{status:e.value,value:n}}}let th=Object.freeze({status:"aborted"}),tf=e=>({status:"dirty",value:e}),tm=e=>({status:"valid",value:e}),tg=e=>"aborted"===e.status,ty=e=>"dirty"===e.status,tv=e=>"valid"===e.status,tb=e=>"undefined"!=typeof Promise&&e instanceof Promise;class tx{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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let tk=(e,t)=>{if(tv(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 tl(e.common.issues);return this._error=t,this._error}}};function tw(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:a}=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:a}:{errorMap:(t,a)=>{let{message:i}=e;return"invalid_enum_value"===t.code?{message:i??a.defaultError}:void 0===a.data?{message:i??r??a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:i??n??a.defaultError}},description:a}}class t_{get description(){return this._def.description}_getType(e){return ts(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ts(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tp,ctx:{common:e.parent.common,data:e.data,parsedType:ts(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(tb(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){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ts(e)},r=this._parseSync({data:e,path:n.path,parent:n});return tk(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ts(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return tv(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>tv(e)?{value:e.value}:{issues:t.common.issues})}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:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ts(e)},r=this._parse({data:e,path:n.path,parent:n});return tk(n,await (tb(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 a=e(t),i=()=>r.addIssue({code:to.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(e=>!!e||(i(),!1)):!!a||(i(),!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 ns({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return no.create(this,this._def)}nullable(){return nl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tQ.create(this)}promise(){return ni.create(this,this._def)}or(e){return t1.create([this,e],this._def)}and(e){return t9.create(this,e,this._def)}transform(e){return new ns({...tw(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new nu({...tw(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:x.ZodDefault})}brand(){return new np({typeName:x.ZodBranded,type:this,...tw(this._def)})}catch(e){return new nc({...tw(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:x.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return nh.create(this,e)}readonly(){return nf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let tS=/^c[^\s-]{8,}$/i,tI=/^[0-9a-z]+$/,tE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tT=/^[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,tC=/^[a-z0-9_-]{21}$/i,tA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tN=/^[-+]?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)?)??$/,tz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tO=/^(?:(?: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])$/,tP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,tR=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,t$="((\\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])))",tL=RegExp(`^${t$}$`);function tF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}class tZ extends t_{_parse(e){var t,n,a,i;let s;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ti.string){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.string,received:t.parsedType}),th}let o=new tp;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(td(s=this._getOrReturnCtx(e,s),{code:to.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("max"===l.kind)e.data.length>l.value&&(td(s=this._getOrReturnCtx(e,s),{code:to.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("length"===l.kind){let t=e.data.length>l.value,n=e.data.length<l.value;(t||n)&&(s=this._getOrReturnCtx(e,s),t?td(s,{code:to.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):n&&td(s,{code:to.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if("email"===l.kind)tz.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"email",code:to.invalid_string,message:l.message}),o.dirty());else if("emoji"===l.kind)r||(r=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),r.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"emoji",code:to.invalid_string,message:l.message}),o.dirty());else if("uuid"===l.kind)tT.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"uuid",code:to.invalid_string,message:l.message}),o.dirty());else if("nanoid"===l.kind)tC.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"nanoid",code:to.invalid_string,message:l.message}),o.dirty());else if("cuid"===l.kind)tS.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"cuid",code:to.invalid_string,message:l.message}),o.dirty());else if("cuid2"===l.kind)tI.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"cuid2",code:to.invalid_string,message:l.message}),o.dirty());else if("ulid"===l.kind)tE.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"ulid",code:to.invalid_string,message:l.message}),o.dirty());else if("url"===l.kind)try{new URL(e.data)}catch{td(s=this._getOrReturnCtx(e,s),{validation:"url",code:to.invalid_string,message:l.message}),o.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"regex",code:to.invalid_string,message:l.message}),o.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):"datetime"===l.kind?(function(e){let t=`${t$}T${tF(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,RegExp(`^${t}$`)})(l).test(e.data)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:"datetime",message:l.message}),o.dirty()):"date"===l.kind?tL.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:"date",message:l.message}),o.dirty()):"time"===l.kind?RegExp(`^${tF(l)}$`).test(e.data)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:"time",message:l.message}),o.dirty()):"duration"===l.kind?tN.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"duration",code:to.invalid_string,message:l.message}),o.dirty()):"ip"===l.kind?(t=e.data,("v4"===(n=l.version)||!n)&&tO.test(t)||("v6"===n||!n)&&tR.test(t)||(td(s=this._getOrReturnCtx(e,s),{validation:"ip",code:to.invalid_string,message:l.message}),o.dirty())):"jwt"===l.kind?!function(e,t){if(!tA.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));if("object"!=typeof a||null===a||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)return!1;return!0}catch{return!1}}(e.data,l.alg)&&(td(s=this._getOrReturnCtx(e,s),{validation:"jwt",code:to.invalid_string,message:l.message}),o.dirty()):"cidr"===l.kind?(a=e.data,("v4"===(i=l.version)||!i)&&tP.test(a)||("v6"===i||!i)&&tj.test(a)||(td(s=this._getOrReturnCtx(e,s),{validation:"cidr",code:to.invalid_string,message:l.message}),o.dirty())):"base64"===l.kind?tD.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"base64",code:to.invalid_string,message:l.message}),o.dirty()):"base64url"===l.kind?tM.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"base64url",code:to.invalid_string,message:l.message}),o.dirty()):y.assertNever(l);return{status:o.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:to.invalid_string,...b.errToObj(n)})}_addCheck(e){return new tZ({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...b.errToObj(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===e?.precision?null:e?.precision,...b.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...b.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new tZ({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new tZ({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new tZ({...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 isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===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<e)&&(e=t.value);return e}}tZ.create=e=>new tZ({checks:[],typeName:x.ZodString,coerce:e?.coerce??!1,...tw(e)});class tq extends t_{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)!==ti.number){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.number,received:t.parsedType}),th}let n=new tp;for(let r of this._def.checks)"int"===r.kind?y.isInteger(e.data)||(td(t=this._getOrReturnCtx(e,t),{code:to.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.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,a=n>r?n:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}(e.data,r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(td(t=this._getOrReturnCtx(e,t),{code:to.not_finite,message:r.message}),n.dirty()):y.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,r){return new tq({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(r)}]})}_addCheck(e){return new tq({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.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<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&y.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.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}tq.create=e=>new tq({checks:[],typeName:x.ZodNumber,coerce:e?.coerce||!1,...tw(e)});class tU extends t_{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ti.bigint)return this._getInvalidInput(e);let n=new tp;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(td(t=this._getOrReturnCtx(e,t),{code:to.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):y.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.bigint,received:t.parsedType}),th}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,r){return new tU({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(r)}]})}_addCheck(e){return new tU({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.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<e)&&(e=t.value);return e}}tU.create=e=>new tU({checks:[],typeName:x.ZodBigInt,coerce:e?.coerce??!1,...tw(e)});class tV extends t_{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ti.boolean){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.boolean,received:t.parsedType}),th}return tm(e.data)}}tV.create=e=>new tV({typeName:x.ZodBoolean,coerce:e?.coerce||!1,...tw(e)});class tB extends t_{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ti.date){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.date,received:t.parsedType}),th}if(Number.isNaN(e.data.getTime()))return td(this._getOrReturnCtx(e),{code:to.invalid_date}),th;let n=new tp;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):y.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tB({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.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.value<e)&&(e=t.value);return null!=e?new Date(e):null}}tB.create=e=>new tB({checks:[],coerce:e?.coerce||!1,typeName:x.ZodDate,...tw(e)});class tW extends t_{_parse(e){if(this._getType(e)!==ti.symbol){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.symbol,received:t.parsedType}),th}return tm(e.data)}}tW.create=e=>new tW({typeName:x.ZodSymbol,...tw(e)});class tH extends t_{_parse(e){if(this._getType(e)!==ti.undefined){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.undefined,received:t.parsedType}),th}return tm(e.data)}}tH.create=e=>new tH({typeName:x.ZodUndefined,...tw(e)});class tJ extends t_{_parse(e){if(this._getType(e)!==ti.null){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.null,received:t.parsedType}),th}return tm(e.data)}}tJ.create=e=>new tJ({typeName:x.ZodNull,...tw(e)});class tG extends t_{constructor(){super(...arguments),this._any=!0}_parse(e){return tm(e.data)}}tG.create=e=>new tG({typeName:x.ZodAny,...tw(e)});class tK extends t_{constructor(){super(...arguments),this._unknown=!0}_parse(e){return tm(e.data)}}tK.create=e=>new tK({typeName:x.ZodUnknown,...tw(e)});class tY extends t_{_parse(e){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.never,received:t.parsedType}),th}}tY.create=e=>new tY({typeName:x.ZodNever,...tw(e)});class tX extends t_{_parse(e){if(this._getType(e)!==ti.undefined){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.void,received:t.parsedType}),th}return tm(e.data)}}tX.create=e=>new tX({typeName:x.ZodVoid,...tw(e)});class tQ extends t_{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==ti.array)return td(t,{code:to.invalid_type,expected:ti.array,received:t.parsedType}),th;if(null!==r.exactLength){let e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(td(t,{code:e?to.too_big:to.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(td(t,{code:to.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(td(t,{code:to.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 tx(t,e,t.path,n)))).then(e=>tp.mergeArray(n,e));let a=[...t.data].map((e,n)=>r.type._parseSync(new tx(t,e,t.path,n)));return tp.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new tQ({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new tQ({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new tQ({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}tQ.create=(e,t)=>new tQ({type:e,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...tw(t)});class t0 extends t_{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=y.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==ti.object){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.object,received:t.parsedType}),th}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof tY&&"strip"===this._def.unknownKeys))for(let e in n.data)a.includes(e)||i.push(e);let s=[];for(let e of a){let t=r[e],a=n.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new tx(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof tY){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of i)s.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(td(n,{code:to.unrecognized_keys,keys:i}),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 i){let r=n.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new tx(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>tp.mergeObjectSync(t,e)):tp.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new t0({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:b.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t0({...this._def,unknownKeys:"strip"})}passthrough(){return new t0({...this._def,unknownKeys:"passthrough"})}extend(e){return new t0({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t0({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new t0({...this._def,catchall:e})}pick(e){let t={};for(let n of y.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new t0({...this._def,shape:()=>t})}omit(e){let t={};for(let n of y.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new t0({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof t0){let n={};for(let r in t.shape){let a=t.shape[r];n[r]=no.create(e(a))}return new t0({...t._def,shape:()=>n})}return t instanceof tQ?new tQ({...t._def,type:e(t.element)}):t instanceof no?no.create(e(t.unwrap())):t instanceof nl?nl.create(e(t.unwrap())):t instanceof t5?t5.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};for(let n of y.objectKeys(this.shape)){let r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new t0({...this._def,shape:()=>t})}required(e){let t={};for(let n of y.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof no;)e=e._def.innerType;t[n]=e}return new t0({...this._def,shape:()=>t})}keyof(){return nn(y.objectKeys(this.shape))}}t0.create=(e,t)=>new t0({shape:()=>e,unknownKeys:"strip",catchall:tY.create(),typeName:x.ZodObject,...tw(t)}),t0.strictCreate=(e,t)=>new t0({shape:()=>e,unknownKeys:"strict",catchall:tY.create(),typeName:x.ZodObject,...tw(t)}),t0.lazycreate=(e,t)=>new t0({shape:e,unknownKeys:"strip",catchall:tY.create(),typeName:x.ZodObject,...tw(t)});class t1 extends t_{_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 tl(e.ctx.common.issues));return td(t,{code:to.invalid_union,unionErrors:n}),th});{let e;let r=[];for(let a of n){let n={...t,common:{...t.common,issues:[]},parent:null},i=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,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 a=r.map(e=>new tl(e));return td(t,{code:to.invalid_union,unionErrors:a}),th}}get options(){return this._def.options}}t1.create=(e,t)=>new t1({options:e,typeName:x.ZodUnion,...tw(t)});let t2=e=>{if(e instanceof ne)return t2(e.schema);if(e instanceof ns)return t2(e.innerType());if(e instanceof nt)return[e.value];if(e instanceof nr)return e.options;if(e instanceof na)return y.objectValues(e.enum);if(e instanceof nu)return t2(e._def.innerType);if(e instanceof tH)return[void 0];else if(e instanceof tJ)return[null];else if(e instanceof no)return[void 0,...t2(e.unwrap())];else if(e instanceof nl)return[null,...t2(e.unwrap())];else if(e instanceof np)return t2(e.unwrap());else if(e instanceof nf)return t2(e.unwrap());else if(e instanceof nc)return t2(e._def.innerType);else return[]};class t4 extends t_{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ti.object)return td(t,{code:to.invalid_type,expected:ti.object,received:t.parsedType}),th;let n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(td(t,{code:to.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),th)}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=t2(n.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of t){if(r.has(a))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,n)}}return new t4({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...tw(n)})}}class t9 extends t_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(tg(e)||tg(r))return th;let a=function e(t,n){let r=ts(t),a=ts(n);if(t===n)return{valid:!0,data:t};if(r===ti.object&&a===ti.object){let r=y.objectKeys(n),a=y.objectKeys(t).filter(e=>-1!==r.indexOf(e)),i={...t,...n};for(let r of a){let a=e(t[r],n[r]);if(!a.valid)return{valid:!1};i[r]=a.data}return{valid:!0,data:i}}if(r===ti.array&&a===ti.array){if(t.length!==n.length)return{valid:!1};let r=[];for(let a=0;a<t.length;a++){let i=e(t[a],n[a]);if(!i.valid)return{valid:!1};r.push(i.data)}return{valid:!0,data:r}}return r===ti.date&&a===ti.date&&+t==+n?{valid:!0,data:t}:{valid:!1}}(e.value,r.value);return a.valid?((ty(e)||ty(r))&&t.dirty(),{status:t.value,value:a.data}):(td(n,{code:to.invalid_intersection_types}),th)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(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}))}}t9.create=(e,t,n)=>new t9({left:e,right:t,typeName:x.ZodIntersection,...tw(n)});class t5 extends t_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ti.array)return td(n,{code:to.invalid_type,expected:ti.array,received:n.parsedType}),th;if(n.data.length<this._def.items.length)return td(n,{code:to.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),th;!this._def.rest&&n.data.length>this._def.items.length&&(td(n,{code:to.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 tx(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>tp.mergeArray(t,e)):tp.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new t5({...this._def,rest:e})}}t5.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new t5({items:e,typeName:x.ZodTuple,rest:null,...tw(t)})};class t3 extends t_{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!==ti.object)return td(n,{code:to.invalid_type,expected:ti.object,received:n.parsedType}),th;let r=[],a=this._def.keyType,i=this._def.valueType;for(let e in n.data)r.push({key:a._parse(new tx(n,e,n.path,e)),value:i._parse(new tx(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?tp.mergeObjectAsync(t,r):tp.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new t3(t instanceof t_?{keyType:e,valueType:t,typeName:x.ZodRecord,...tw(n)}:{keyType:tZ.create(),valueType:e,typeName:x.ZodRecord,...tw(t)})}}class t6 extends t_{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!==ti.map)return td(n,{code:to.invalid_type,expected:ti.map,received:n.parsedType}),th;let r=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([e,t],i)=>({key:r._parse(new tx(n,e,n.path,[i,"key"])),value:a._parse(new tx(n,t,n.path,[i,"value"]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of i){let r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return th;("dirty"===r.status||"dirty"===a.status)&&t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of i){let r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return th;("dirty"===r.status||"dirty"===a.status)&&t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}t6.create=(e,t,n)=>new t6({valueType:t,keyType:e,typeName:x.ZodMap,...tw(n)});class t8 extends t_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ti.set)return td(n,{code:to.invalid_type,expected:ti.set,received:n.parsedType}),th;let r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(td(n,{code:to.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(td(n,{code:to.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let a=this._def.valueType;function i(e){let n=new Set;for(let r of e){if("aborted"===r.status)return th;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let s=[...n.data.values()].map((e,t)=>a._parse(new tx(n,e,n.path,t)));return n.common.async?Promise.all(s).then(e=>i(e)):i(s)}min(e,t){return new t8({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new t8({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t8.create=(e,t)=>new t8({valueType:e,minSize:null,maxSize:null,typeName:x.ZodSet,...tw(t)});class t7 extends t_{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ti.function)return td(t,{code:to.invalid_type,expected:ti.function,received:t.parsedType}),th;function n(e,n){return tc({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,tu,tu].filter(e=>!!e),issueData:{code:to.invalid_arguments,argumentsError:n}})}function r(e,n){return tc({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,tu,tu].filter(e=>!!e),issueData:{code:to.invalid_return_type,returnTypeError:n}})}let a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ni){let e=this;return tm(async function(...t){let s=new tl([]),o=await e._def.args.parseAsync(t,a).catch(e=>{throw s.addIssue(n(t,e)),s}),l=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(l,a).catch(e=>{throw s.addIssue(r(l,e)),s})})}{let e=this;return tm(function(...t){let s=e._def.args.safeParse(t,a);if(!s.success)throw new tl([n(t,s.error)]);let o=Reflect.apply(i,this,s.data),l=e._def.returns.safeParse(o,a);if(!l.success)throw new tl([r(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t7({...this._def,args:t5.create(e).rest(tK.create())})}returns(e){return new t7({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new t7({args:e||t5.create([]).rest(tK.create()),returns:t||tK.create(),typeName:x.ZodFunction,...tw(n)})}}class ne extends t_{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})}}ne.create=(e,t)=>new ne({getter:e,typeName:x.ZodLazy,...tw(t)});class nt extends t_{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return td(t,{received:t.data,code:to.invalid_literal,expected:this._def.value}),th}return{status:"valid",value:e.data}}get value(){return this._def.value}}function nn(e,t){return new nr({values:e,typeName:x.ZodEnum,...tw(t)})}nt.create=(e,t)=>new nt({value:e,typeName:x.ZodLiteral,...tw(t)});class nr extends t_{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),n=this._def.values;return td(t,{expected:y.joinValues(n),received:t.parsedType,code:to.invalid_type}),th}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return td(t,{received:t.data,code:to.invalid_enum_value,options:n}),th}return tm(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 nr.create(e,{...this._def,...t})}exclude(e,t=this._def){return nr.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}nr.create=nn;class na extends t_{_parse(e){let t=y.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ti.string&&n.parsedType!==ti.number){let e=y.objectValues(t);return td(n,{expected:y.joinValues(e),received:n.parsedType,code:to.invalid_type}),th}if(this._cache||(this._cache=new Set(y.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=y.objectValues(t);return td(n,{received:n.data,code:to.invalid_enum_value,options:e}),th}return tm(e.data)}get enum(){return this._def.values}}na.create=(e,t)=>new na({values:e,typeName:x.ZodNativeEnum,...tw(t)});class ni extends t_{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==ti.promise&&!1===t.common.async?(td(t,{code:to.invalid_type,expected:ti.promise,received:t.parsedType}),th):tm((t.parsedType===ti.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ni.create=(e,t)=>new ni({type:e,typeName:x.ZodPromise,...tw(t)});class ns extends t_{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{td(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){let e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return th;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?th:"dirty"===r.status||"dirty"===t.value?tf(r.value):r});{if("aborted"===t.value)return th;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?th:"dirty"===r.status||"dirty"===t.value?tf(r.value):r}}if("refinement"===r.type){let e=e=>{let t=r.refinement(e,a);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?th:("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?th:("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=>tv(e)?Promise.resolve(r.transform(e.value,a)).then(e=>({status:t.value,value:e})):th);{let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!tv(e))return th;let i=r.transform(e.value,a);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}}y.assertNever(r)}}ns.create=(e,t,n)=>new ns({schema:e,typeName:x.ZodEffects,effect:t,...tw(n)}),ns.createWithPreprocess=(e,t,n)=>new ns({schema:t,effect:{type:"preprocess",transform:e},typeName:x.ZodEffects,...tw(n)});class no extends t_{_parse(e){return this._getType(e)===ti.undefined?tm(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}no.create=(e,t)=>new no({innerType:e,typeName:x.ZodOptional,...tw(t)});class nl extends t_{_parse(e){return this._getType(e)===ti.null?tm(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nl.create=(e,t)=>new nl({innerType:e,typeName:x.ZodNullable,...tw(t)});class nu extends t_{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===ti.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}nu.create=(e,t)=>new nu({innerType:e,typeName:x.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...tw(t)});class nc extends t_{_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 tb(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new tl(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new tl(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}nc.create=(e,t)=>new nc({innerType:e,typeName:x.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...tw(t)});class nd extends t_{_parse(e){if(this._getType(e)!==ti.nan){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.nan,received:t.parsedType}),th}return{status:"valid",value:e.data}}}nd.create=e=>new nd({typeName:x.ZodNaN,...tw(e)}),Symbol("zod_brand");class np extends t_{_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 nh extends t_{_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?th:"dirty"===e.status?(t.dirty(),tf(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?th:"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 nh({in:e,out:t,typeName:x.ZodPipeline})}}class nf extends t_{_parse(e){let t=this._def.innerType._parse(e),n=e=>(tv(e)&&(e.value=Object.freeze(e.value)),e);return tb(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}nf.create=(e,t)=>new nf({innerType:e,typeName:x.ZodReadonly,...tw(t)}),t0.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(x||(x={}));let nm=tZ.create;tq.create,nd.create,tU.create,tV.create,tB.create,tW.create,tH.create,tJ.create,tG.create,tK.create,tY.create,tX.create,tQ.create;let ng=t0.create;t0.strictCreate,t1.create;let ny=t4.create;t9.create,t5.create,t3.create,t6.create,t8.create,t7.create,ne.create;let nv=nt.create;nr.create,na.create,ni.create,ns.create,no.create,nl.create,ns.createWithPreprocess,nh.create;class nb extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function nx(e){}class nk extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(a){r=function(e){if("function"==typeof e)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=nx,onError:n=nx,onRetry:r=nx,onComment:a}=e,i="",s=!0,o,l="",u="";function c(e){if(""===e){l.length>0&&t({id:o,event:u||void 0,data:l.endsWith(`
|
|
5
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){i(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){i(t);continue}}if(this.metadataRegistry.get(t[0])?.id||r.cycle||r.count>1&&"ref"===n.reused){i(t);continue}}let s=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,a={...r};if(null===n.ref)return;let i=n.ref;if(n.ref=null,i){s(i,t);let e=this.seen.get(i).schema;e.$ref&&"draft-7"===t.target?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,a))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())s(e[0],{target:this.target});let o={};if("draft-2020-12"===this.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?o.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");o.$id=n.external.uri(t)}Object.assign(o,r.def);let l=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}n.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?o.$defs=l:o.definitions=l);try{return JSON.parse(JSON.stringify(o))}catch(e){throw Error("Error converting schema to JSON.")}}}function eX(e,t,n){function r(n,r){var a;for(let i in Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(a=n._zod).traits??(a.traits=new Set),n._zod.traits.add(e),t(n,r),s.prototype)i in n||Object.defineProperty(n,i,{value:s.prototype[i].bind(n)});n._zod.constr=s,n._zod.def=r}let a=n?.Parent??Object;class i extends a{}function s(e){var t;let a=n?.Parent?new i:this;for(let n of(r(a,e),(t=a._zod).deferred??(t.deferred=[]),a._zod.deferred))n();return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class eQ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}let e0={};function e1(e){return e&&Object.assign(e0,e),e0}let e2=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,eN,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},e4=eX("$ZodError",e2),e9=eX("$ZodError",e2,{Parent:Error}),e3=e=>(t,n,r)=>{let a=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new eQ;return i.issues.length?{success:!1,error:new(e??e4)(i.issues.map(e=>eJ(e,a,e1())))}:{success:!0,data:i.value}},e5=e3(e9),e6=e=>async(t,n,r)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>eJ(e,a,e1())))}:{success:!0,data:i.value}},e8=e6(e9),e7=(e,t)=>{e4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t){let n=t||function(e){return e.message},r={_errors:[]},a=e=>{for(let t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>a({issues:e}));else if("invalid_key"===t.code)a({issues:t.issues});else if("invalid_element"===t.code)a({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else{let e=r,a=0;for(;a<t.path.length;){let r=t.path[a];a===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})};eX("ZodError",e7);let te=eX("ZodError",e7,{Parent:Error}),tt=(e,t,n,r)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},i=e._zod.run({value:t,issues:[]},a);if(i instanceof Promise)throw new eQ;if(i.issues.length){let e=new(r?.Err??te)(i.issues.map(e=>eJ(e,a,e1())));throw eD(e,r?.callee),e}return i.value},tn=async(e,t,n,r)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},i=e._zod.run({value:t,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){let e=new(r?.Err??te)(i.issues.map(e=>eJ(e,a,e1())));throw eD(e,r?.callee),e}return i.value},tr=e3(te),ta=e6(te);(function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.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},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t})(y||(y={})),(v||(v={})).mergeShapes=(e,t)=>({...e,...t});let ti=y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ts=e=>{switch(typeof e){case"undefined":return ti.undefined;case"string":return ti.string;case"number":return Number.isNaN(e)?ti.nan:ti.number;case"boolean":return ti.boolean;case"function":return ti.function;case"bigint":return ti.bigint;case"symbol":return ti.symbol;case"object":if(Array.isArray(e))return ti.array;if(null===e)return ti.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return ti.promise;if("undefined"!=typeof Map&&e instanceof Map)return ti.map;if("undefined"!=typeof Set&&e instanceof Set)return ti.set;if("undefined"!=typeof Date&&e instanceof Date)return ti.date;return ti.object;default:return ti.unknown}},to=y.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 tl extends Error{get errors(){return this.issues}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}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){let n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof tl))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,y.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}tl.create=e=>new tl(e);let tu=(e,t)=>{let n;switch(e.code){case to.invalid_type:n=e.received===ti.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case to.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,y.jsonStringifyReplacer)}`;break;case to.unrecognized_keys:n=`Unrecognized key(s) in object: ${y.joinValues(e.keys,", ")}`;break;case to.invalid_union:n="Invalid input";break;case to.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${y.joinValues(e.options)}`;break;case to.invalid_enum_value:n=`Invalid enum value. Expected ${y.joinValues(e.options)}, received '${e.received}'`;break;case to.invalid_arguments:n="Invalid function arguments";break;case to.invalid_return_type:n="Invalid function return type";break;case to.invalid_date:n="Invalid date";break;case to.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}"`:y.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case to.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}`:"bigint"===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 to.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 to.custom:n="Invalid input";break;case to.invalid_intersection_types:n="Intersection results could not be merged";break;case to.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case to.not_finite:n="Number must be finite";break;default:n=t.defaultError,y.assertNever(e)}return{message:n}};!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(b||(b={}));let tc=e=>{let{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],s={...a,path:i};if(void 0!==a.message)return{...a,path:i,message:a.message};let o="";for(let e of r.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...a,path:i,message:o}};function td(e,t){let n=tc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,tu,tu==tu?void 0:tu].filter(e=>!!e)});e.common.issues.push(n)}class tp{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 th;"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 tp.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:a}=r;if("aborted"===t.status||"aborted"===a.status)return th;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==a.value||r.alwaysSet)&&(n[t.value]=a.value)}return{status:e.value,value:n}}}let th=Object.freeze({status:"aborted"}),tf=e=>({status:"dirty",value:e}),tm=e=>({status:"valid",value:e}),tg=e=>"aborted"===e.status,ty=e=>"dirty"===e.status,tv=e=>"valid"===e.status,tb=e=>"undefined"!=typeof Promise&&e instanceof Promise;class tx{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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let tk=(e,t)=>{if(tv(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 tl(e.common.issues);return this._error=t,this._error}}};function tw(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:a}=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:a}:{errorMap:(t,a)=>{let{message:i}=e;return"invalid_enum_value"===t.code?{message:i??a.defaultError}:void 0===a.data?{message:i??r??a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:i??n??a.defaultError}},description:a}}class t_{get description(){return this._def.description}_getType(e){return ts(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ts(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tp,ctx:{common:e.parent.common,data:e.data,parsedType:ts(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(tb(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){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ts(e)},r=this._parseSync({data:e,path:n.path,parent:n});return tk(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ts(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return tv(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>tv(e)?{value:e.value}:{issues:t.common.issues})}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:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ts(e)},r=this._parse({data:e,path:n.path,parent:n});return tk(n,await (tb(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 a=e(t),i=()=>r.addIssue({code:to.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(e=>!!e||(i(),!1)):!!a||(i(),!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 ns({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return no.create(this,this._def)}nullable(){return nl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tQ.create(this)}promise(){return ni.create(this,this._def)}or(e){return t1.create([this,e],this._def)}and(e){return t9.create(this,e,this._def)}transform(e){return new ns({...tw(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new nu({...tw(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:x.ZodDefault})}brand(){return new np({typeName:x.ZodBranded,type:this,...tw(this._def)})}catch(e){return new nc({...tw(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:x.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return nh.create(this,e)}readonly(){return nf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let tS=/^c[^\s-]{8,}$/i,tI=/^[0-9a-z]+$/,tE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tT=/^[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,tC=/^[a-z0-9_-]{21}$/i,tA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tN=/^[-+]?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)?)??$/,tz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tO=/^(?:(?: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])$/,tP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,tR=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,t$="((\\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])))",tL=RegExp(`^${t$}$`);function tF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}class tZ extends t_{_parse(e){var t,n,a,i;let s;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ti.string){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.string,received:t.parsedType}),th}let o=new tp;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(td(s=this._getOrReturnCtx(e,s),{code:to.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("max"===l.kind)e.data.length>l.value&&(td(s=this._getOrReturnCtx(e,s),{code:to.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("length"===l.kind){let t=e.data.length>l.value,n=e.data.length<l.value;(t||n)&&(s=this._getOrReturnCtx(e,s),t?td(s,{code:to.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):n&&td(s,{code:to.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if("email"===l.kind)tz.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"email",code:to.invalid_string,message:l.message}),o.dirty());else if("emoji"===l.kind)r||(r=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),r.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"emoji",code:to.invalid_string,message:l.message}),o.dirty());else if("uuid"===l.kind)tT.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"uuid",code:to.invalid_string,message:l.message}),o.dirty());else if("nanoid"===l.kind)tC.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"nanoid",code:to.invalid_string,message:l.message}),o.dirty());else if("cuid"===l.kind)tS.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"cuid",code:to.invalid_string,message:l.message}),o.dirty());else if("cuid2"===l.kind)tI.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"cuid2",code:to.invalid_string,message:l.message}),o.dirty());else if("ulid"===l.kind)tE.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"ulid",code:to.invalid_string,message:l.message}),o.dirty());else if("url"===l.kind)try{new URL(e.data)}catch{td(s=this._getOrReturnCtx(e,s),{validation:"url",code:to.invalid_string,message:l.message}),o.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"regex",code:to.invalid_string,message:l.message}),o.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):"datetime"===l.kind?(function(e){let t=`${t$}T${tF(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,RegExp(`^${t}$`)})(l).test(e.data)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:"datetime",message:l.message}),o.dirty()):"date"===l.kind?tL.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:"date",message:l.message}),o.dirty()):"time"===l.kind?RegExp(`^${tF(l)}$`).test(e.data)||(td(s=this._getOrReturnCtx(e,s),{code:to.invalid_string,validation:"time",message:l.message}),o.dirty()):"duration"===l.kind?tN.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"duration",code:to.invalid_string,message:l.message}),o.dirty()):"ip"===l.kind?(t=e.data,("v4"===(n=l.version)||!n)&&tO.test(t)||("v6"===n||!n)&&tR.test(t)||(td(s=this._getOrReturnCtx(e,s),{validation:"ip",code:to.invalid_string,message:l.message}),o.dirty())):"jwt"===l.kind?!function(e,t){if(!tA.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));if("object"!=typeof a||null===a||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)return!1;return!0}catch{return!1}}(e.data,l.alg)&&(td(s=this._getOrReturnCtx(e,s),{validation:"jwt",code:to.invalid_string,message:l.message}),o.dirty()):"cidr"===l.kind?(a=e.data,("v4"===(i=l.version)||!i)&&tP.test(a)||("v6"===i||!i)&&tj.test(a)||(td(s=this._getOrReturnCtx(e,s),{validation:"cidr",code:to.invalid_string,message:l.message}),o.dirty())):"base64"===l.kind?tD.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"base64",code:to.invalid_string,message:l.message}),o.dirty()):"base64url"===l.kind?tM.test(e.data)||(td(s=this._getOrReturnCtx(e,s),{validation:"base64url",code:to.invalid_string,message:l.message}),o.dirty()):y.assertNever(l);return{status:o.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:to.invalid_string,...b.errToObj(n)})}_addCheck(e){return new tZ({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...b.errToObj(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===e?.precision?null:e?.precision,...b.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...b.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new tZ({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new tZ({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new tZ({...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 isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===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<e)&&(e=t.value);return e}}tZ.create=e=>new tZ({checks:[],typeName:x.ZodString,coerce:e?.coerce??!1,...tw(e)});class tq extends t_{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)!==ti.number){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.number,received:t.parsedType}),th}let n=new tp;for(let r of this._def.checks)"int"===r.kind?y.isInteger(e.data)||(td(t=this._getOrReturnCtx(e,t),{code:to.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.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,a=n>r?n:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}(e.data,r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(td(t=this._getOrReturnCtx(e,t),{code:to.not_finite,message:r.message}),n.dirty()):y.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,r){return new tq({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(r)}]})}_addCheck(e){return new tq({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.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<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&y.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.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}tq.create=e=>new tq({checks:[],typeName:x.ZodNumber,coerce:e?.coerce||!1,...tw(e)});class tU extends t_{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ti.bigint)return this._getInvalidInput(e);let n=new tp;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(td(t=this._getOrReturnCtx(e,t),{code:to.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):y.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.bigint,received:t.parsedType}),th}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,r){return new tU({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(r)}]})}_addCheck(e){return new tU({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.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<e)&&(e=t.value);return e}}tU.create=e=>new tU({checks:[],typeName:x.ZodBigInt,coerce:e?.coerce??!1,...tw(e)});class tV extends t_{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ti.boolean){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.boolean,received:t.parsedType}),th}return tm(e.data)}}tV.create=e=>new tV({typeName:x.ZodBoolean,coerce:e?.coerce||!1,...tw(e)});class tB extends t_{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ti.date){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.date,received:t.parsedType}),th}if(Number.isNaN(e.data.getTime()))return td(this._getOrReturnCtx(e),{code:to.invalid_date}),th;let n=new tp;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(td(t=this._getOrReturnCtx(e,t),{code:to.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):y.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tB({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.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.value<e)&&(e=t.value);return null!=e?new Date(e):null}}tB.create=e=>new tB({checks:[],coerce:e?.coerce||!1,typeName:x.ZodDate,...tw(e)});class tW extends t_{_parse(e){if(this._getType(e)!==ti.symbol){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.symbol,received:t.parsedType}),th}return tm(e.data)}}tW.create=e=>new tW({typeName:x.ZodSymbol,...tw(e)});class tH extends t_{_parse(e){if(this._getType(e)!==ti.undefined){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.undefined,received:t.parsedType}),th}return tm(e.data)}}tH.create=e=>new tH({typeName:x.ZodUndefined,...tw(e)});class tJ extends t_{_parse(e){if(this._getType(e)!==ti.null){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.null,received:t.parsedType}),th}return tm(e.data)}}tJ.create=e=>new tJ({typeName:x.ZodNull,...tw(e)});class tG extends t_{constructor(){super(...arguments),this._any=!0}_parse(e){return tm(e.data)}}tG.create=e=>new tG({typeName:x.ZodAny,...tw(e)});class tK extends t_{constructor(){super(...arguments),this._unknown=!0}_parse(e){return tm(e.data)}}tK.create=e=>new tK({typeName:x.ZodUnknown,...tw(e)});class tY extends t_{_parse(e){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.never,received:t.parsedType}),th}}tY.create=e=>new tY({typeName:x.ZodNever,...tw(e)});class tX extends t_{_parse(e){if(this._getType(e)!==ti.undefined){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.void,received:t.parsedType}),th}return tm(e.data)}}tX.create=e=>new tX({typeName:x.ZodVoid,...tw(e)});class tQ extends t_{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==ti.array)return td(t,{code:to.invalid_type,expected:ti.array,received:t.parsedType}),th;if(null!==r.exactLength){let e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(td(t,{code:e?to.too_big:to.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(td(t,{code:to.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(td(t,{code:to.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 tx(t,e,t.path,n)))).then(e=>tp.mergeArray(n,e));let a=[...t.data].map((e,n)=>r.type._parseSync(new tx(t,e,t.path,n)));return tp.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new tQ({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new tQ({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new tQ({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}tQ.create=(e,t)=>new tQ({type:e,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...tw(t)});class t0 extends t_{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=y.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==ti.object){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.object,received:t.parsedType}),th}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof tY&&"strip"===this._def.unknownKeys))for(let e in n.data)a.includes(e)||i.push(e);let s=[];for(let e of a){let t=r[e],a=n.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new tx(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof tY){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of i)s.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(td(n,{code:to.unrecognized_keys,keys:i}),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 i){let r=n.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new tx(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>tp.mergeObjectSync(t,e)):tp.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new t0({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:b.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t0({...this._def,unknownKeys:"strip"})}passthrough(){return new t0({...this._def,unknownKeys:"passthrough"})}extend(e){return new t0({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t0({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new t0({...this._def,catchall:e})}pick(e){let t={};for(let n of y.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new t0({...this._def,shape:()=>t})}omit(e){let t={};for(let n of y.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new t0({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof t0){let n={};for(let r in t.shape){let a=t.shape[r];n[r]=no.create(e(a))}return new t0({...t._def,shape:()=>n})}return t instanceof tQ?new tQ({...t._def,type:e(t.element)}):t instanceof no?no.create(e(t.unwrap())):t instanceof nl?nl.create(e(t.unwrap())):t instanceof t3?t3.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};for(let n of y.objectKeys(this.shape)){let r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new t0({...this._def,shape:()=>t})}required(e){let t={};for(let n of y.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof no;)e=e._def.innerType;t[n]=e}return new t0({...this._def,shape:()=>t})}keyof(){return nn(y.objectKeys(this.shape))}}t0.create=(e,t)=>new t0({shape:()=>e,unknownKeys:"strip",catchall:tY.create(),typeName:x.ZodObject,...tw(t)}),t0.strictCreate=(e,t)=>new t0({shape:()=>e,unknownKeys:"strict",catchall:tY.create(),typeName:x.ZodObject,...tw(t)}),t0.lazycreate=(e,t)=>new t0({shape:e,unknownKeys:"strip",catchall:tY.create(),typeName:x.ZodObject,...tw(t)});class t1 extends t_{_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 tl(e.ctx.common.issues));return td(t,{code:to.invalid_union,unionErrors:n}),th});{let e;let r=[];for(let a of n){let n={...t,common:{...t.common,issues:[]},parent:null},i=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,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 a=r.map(e=>new tl(e));return td(t,{code:to.invalid_union,unionErrors:a}),th}}get options(){return this._def.options}}t1.create=(e,t)=>new t1({options:e,typeName:x.ZodUnion,...tw(t)});let t2=e=>{if(e instanceof ne)return t2(e.schema);if(e instanceof ns)return t2(e.innerType());if(e instanceof nt)return[e.value];if(e instanceof nr)return e.options;if(e instanceof na)return y.objectValues(e.enum);if(e instanceof nu)return t2(e._def.innerType);if(e instanceof tH)return[void 0];else if(e instanceof tJ)return[null];else if(e instanceof no)return[void 0,...t2(e.unwrap())];else if(e instanceof nl)return[null,...t2(e.unwrap())];else if(e instanceof np)return t2(e.unwrap());else if(e instanceof nf)return t2(e.unwrap());else if(e instanceof nc)return t2(e._def.innerType);else return[]};class t4 extends t_{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ti.object)return td(t,{code:to.invalid_type,expected:ti.object,received:t.parsedType}),th;let n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(td(t,{code:to.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),th)}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=t2(n.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of t){if(r.has(a))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,n)}}return new t4({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...tw(n)})}}class t9 extends t_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(tg(e)||tg(r))return th;let a=function e(t,n){let r=ts(t),a=ts(n);if(t===n)return{valid:!0,data:t};if(r===ti.object&&a===ti.object){let r=y.objectKeys(n),a=y.objectKeys(t).filter(e=>-1!==r.indexOf(e)),i={...t,...n};for(let r of a){let a=e(t[r],n[r]);if(!a.valid)return{valid:!1};i[r]=a.data}return{valid:!0,data:i}}if(r===ti.array&&a===ti.array){if(t.length!==n.length)return{valid:!1};let r=[];for(let a=0;a<t.length;a++){let i=e(t[a],n[a]);if(!i.valid)return{valid:!1};r.push(i.data)}return{valid:!0,data:r}}return r===ti.date&&a===ti.date&&+t==+n?{valid:!0,data:t}:{valid:!1}}(e.value,r.value);return a.valid?((ty(e)||ty(r))&&t.dirty(),{status:t.value,value:a.data}):(td(n,{code:to.invalid_intersection_types}),th)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(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}))}}t9.create=(e,t,n)=>new t9({left:e,right:t,typeName:x.ZodIntersection,...tw(n)});class t3 extends t_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ti.array)return td(n,{code:to.invalid_type,expected:ti.array,received:n.parsedType}),th;if(n.data.length<this._def.items.length)return td(n,{code:to.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),th;!this._def.rest&&n.data.length>this._def.items.length&&(td(n,{code:to.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 tx(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>tp.mergeArray(t,e)):tp.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new t3({...this._def,rest:e})}}t3.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new t3({items:e,typeName:x.ZodTuple,rest:null,...tw(t)})};class t5 extends t_{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!==ti.object)return td(n,{code:to.invalid_type,expected:ti.object,received:n.parsedType}),th;let r=[],a=this._def.keyType,i=this._def.valueType;for(let e in n.data)r.push({key:a._parse(new tx(n,e,n.path,e)),value:i._parse(new tx(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?tp.mergeObjectAsync(t,r):tp.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new t5(t instanceof t_?{keyType:e,valueType:t,typeName:x.ZodRecord,...tw(n)}:{keyType:tZ.create(),valueType:e,typeName:x.ZodRecord,...tw(t)})}}class t6 extends t_{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!==ti.map)return td(n,{code:to.invalid_type,expected:ti.map,received:n.parsedType}),th;let r=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([e,t],i)=>({key:r._parse(new tx(n,e,n.path,[i,"key"])),value:a._parse(new tx(n,t,n.path,[i,"value"]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of i){let r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return th;("dirty"===r.status||"dirty"===a.status)&&t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of i){let r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return th;("dirty"===r.status||"dirty"===a.status)&&t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}t6.create=(e,t,n)=>new t6({valueType:t,keyType:e,typeName:x.ZodMap,...tw(n)});class t8 extends t_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ti.set)return td(n,{code:to.invalid_type,expected:ti.set,received:n.parsedType}),th;let r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(td(n,{code:to.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(td(n,{code:to.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let a=this._def.valueType;function i(e){let n=new Set;for(let r of e){if("aborted"===r.status)return th;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let s=[...n.data.values()].map((e,t)=>a._parse(new tx(n,e,n.path,t)));return n.common.async?Promise.all(s).then(e=>i(e)):i(s)}min(e,t){return new t8({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new t8({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t8.create=(e,t)=>new t8({valueType:e,minSize:null,maxSize:null,typeName:x.ZodSet,...tw(t)});class t7 extends t_{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ti.function)return td(t,{code:to.invalid_type,expected:ti.function,received:t.parsedType}),th;function n(e,n){return tc({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,tu,tu].filter(e=>!!e),issueData:{code:to.invalid_arguments,argumentsError:n}})}function r(e,n){return tc({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,tu,tu].filter(e=>!!e),issueData:{code:to.invalid_return_type,returnTypeError:n}})}let a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ni){let e=this;return tm(async function(...t){let s=new tl([]),o=await e._def.args.parseAsync(t,a).catch(e=>{throw s.addIssue(n(t,e)),s}),l=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(l,a).catch(e=>{throw s.addIssue(r(l,e)),s})})}{let e=this;return tm(function(...t){let s=e._def.args.safeParse(t,a);if(!s.success)throw new tl([n(t,s.error)]);let o=Reflect.apply(i,this,s.data),l=e._def.returns.safeParse(o,a);if(!l.success)throw new tl([r(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t7({...this._def,args:t3.create(e).rest(tK.create())})}returns(e){return new t7({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new t7({args:e||t3.create([]).rest(tK.create()),returns:t||tK.create(),typeName:x.ZodFunction,...tw(n)})}}class ne extends t_{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})}}ne.create=(e,t)=>new ne({getter:e,typeName:x.ZodLazy,...tw(t)});class nt extends t_{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return td(t,{received:t.data,code:to.invalid_literal,expected:this._def.value}),th}return{status:"valid",value:e.data}}get value(){return this._def.value}}function nn(e,t){return new nr({values:e,typeName:x.ZodEnum,...tw(t)})}nt.create=(e,t)=>new nt({value:e,typeName:x.ZodLiteral,...tw(t)});class nr extends t_{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),n=this._def.values;return td(t,{expected:y.joinValues(n),received:t.parsedType,code:to.invalid_type}),th}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return td(t,{received:t.data,code:to.invalid_enum_value,options:n}),th}return tm(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 nr.create(e,{...this._def,...t})}exclude(e,t=this._def){return nr.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}nr.create=nn;class na extends t_{_parse(e){let t=y.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ti.string&&n.parsedType!==ti.number){let e=y.objectValues(t);return td(n,{expected:y.joinValues(e),received:n.parsedType,code:to.invalid_type}),th}if(this._cache||(this._cache=new Set(y.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=y.objectValues(t);return td(n,{received:n.data,code:to.invalid_enum_value,options:e}),th}return tm(e.data)}get enum(){return this._def.values}}na.create=(e,t)=>new na({values:e,typeName:x.ZodNativeEnum,...tw(t)});class ni extends t_{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==ti.promise&&!1===t.common.async?(td(t,{code:to.invalid_type,expected:ti.promise,received:t.parsedType}),th):tm((t.parsedType===ti.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ni.create=(e,t)=>new ni({type:e,typeName:x.ZodPromise,...tw(t)});class ns extends t_{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{td(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){let e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return th;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?th:"dirty"===r.status||"dirty"===t.value?tf(r.value):r});{if("aborted"===t.value)return th;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?th:"dirty"===r.status||"dirty"===t.value?tf(r.value):r}}if("refinement"===r.type){let e=e=>{let t=r.refinement(e,a);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?th:("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?th:("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=>tv(e)?Promise.resolve(r.transform(e.value,a)).then(e=>({status:t.value,value:e})):th);{let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!tv(e))return th;let i=r.transform(e.value,a);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}}y.assertNever(r)}}ns.create=(e,t,n)=>new ns({schema:e,typeName:x.ZodEffects,effect:t,...tw(n)}),ns.createWithPreprocess=(e,t,n)=>new ns({schema:t,effect:{type:"preprocess",transform:e},typeName:x.ZodEffects,...tw(n)});class no extends t_{_parse(e){return this._getType(e)===ti.undefined?tm(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}no.create=(e,t)=>new no({innerType:e,typeName:x.ZodOptional,...tw(t)});class nl extends t_{_parse(e){return this._getType(e)===ti.null?tm(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nl.create=(e,t)=>new nl({innerType:e,typeName:x.ZodNullable,...tw(t)});class nu extends t_{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===ti.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}nu.create=(e,t)=>new nu({innerType:e,typeName:x.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...tw(t)});class nc extends t_{_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 tb(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new tl(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new tl(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}nc.create=(e,t)=>new nc({innerType:e,typeName:x.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...tw(t)});class nd extends t_{_parse(e){if(this._getType(e)!==ti.nan){let t=this._getOrReturnCtx(e);return td(t,{code:to.invalid_type,expected:ti.nan,received:t.parsedType}),th}return{status:"valid",value:e.data}}}nd.create=e=>new nd({typeName:x.ZodNaN,...tw(e)}),Symbol("zod_brand");class np extends t_{_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 nh extends t_{_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?th:"dirty"===e.status?(t.dirty(),tf(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?th:"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 nh({in:e,out:t,typeName:x.ZodPipeline})}}class nf extends t_{_parse(e){let t=this._def.innerType._parse(e),n=e=>(tv(e)&&(e.value=Object.freeze(e.value)),e);return tb(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}nf.create=(e,t)=>new nf({innerType:e,typeName:x.ZodReadonly,...tw(t)}),t0.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(x||(x={}));let nm=tZ.create;tq.create,nd.create,tU.create,tV.create,tB.create,tW.create,tH.create,tJ.create,tG.create,tK.create,tY.create,tX.create,tQ.create;let ng=t0.create;t0.strictCreate,t1.create;let ny=t4.create;t9.create,t3.create,t5.create,t6.create,t8.create,t7.create,ne.create;let nv=nt.create;nr.create,na.create,ni.create,ns.create,no.create,nl.create,ns.createWithPreprocess,nh.create;class nb extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function nx(e){}class nk extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(a){r=function(e){if("function"==typeof e)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=nx,onError:n=nx,onRetry:r=nx,onComment:a}=e,i="",s=!0,o,l="",u="";function c(e){if(""===e){l.length>0&&t({id:o,event:u||void 0,data:l.endsWith(`
|
|
6
6
|
`)?l.slice(0,-1):l}),o=void 0,l="",u="";return}if(e.startsWith(":")){a&&a(e.slice(e.startsWith(": ")?2:1));return}let n=e.indexOf(":");if(-1!==n){let t=e.slice(0,n),r=" "===e[n+1]?2:1;d(t,e.slice(n+r),e);return}d(e,"",e)}function d(e,t,a){switch(e){case"event":u=t;break;case"data":l=`${l}${t}
|
|
7
7
|
`;break;case"id":o=t.includes("\0")?void 0:t;break;case"retry":/^\d+$/.test(t)?r(parseInt(t,10)):n(new nb(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:a}));break;default:n(new nb(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:"unknown-field",field:e,value:t,line:a}))}}return{feed:function(e){let t=s?e.replace(/^\xEF\xBB\xBF/,""):e,[n,r]=function(e){let t=[],n="",r=0;for(;r<e.length;){let a=e.indexOf("\r",r),i=e.indexOf(`
|
|
8
8
|
`,r),s=-1;if(-1!==a&&-1!==i?s=Math.min(a,i):-1!==a?s=a===e.length-1?-1:a:-1!==i&&(s=i),-1===s){n=e.slice(r);break}{let n=e.slice(r,s);t.push(n),"\r"===e[(r=s+1)-1]&&e[r]===`
|
|
@@ -10,7 +10,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10
10
|
]))`;continue}if("$"===a[e]){i+=`($|(?=[\r
|
|
11
11
|
]))`;continue}}if(r.s&&"."===a[e]){i+=o?`${a[e]}\r
|
|
12
12
|
`:`[${a[e]}\r
|
|
13
|
-
]`;continue}i+=a[e],"\\"===a[e]?s=!0:o&&"]"===a[e]?o=!1:o||"["!==a[e]||(o=!0)}try{new RegExp(i)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function n2(e,t){var n,r,a,i,s,o;let l={type:"object",additionalProperties:null!=(n=re(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(r=e.keyType)?void 0:r._def.typeName)===x.ZodString&&(null==(a=e.keyType._def.checks)?void 0:a.length)){let{type:n,...r}=nK(e.keyType._def,t);return{...l,propertyNames:r}}if((null==(i=e.keyType)?void 0:i._def.typeName)===x.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(s=e.keyType)?void 0:s._def.typeName)===x.ZodBranded&&e.keyType._def.type._def.typeName===x.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){let{type:n,...r}=nV(e.keyType._def,t);return{...l,propertyNames:r}}return l}var n4={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},n9=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>re(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},n5=(e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return re(e.innerType._def,t);let r=re(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}},n3=(e,t)=>{if("input"===t.pipeStrategy)return re(e.in._def,t);if("output"===t.pipeStrategy)return re(e.out._def,t);let n=re(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=re(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(e=>void 0!==e)}},n6=(e,t)=>re(e.innerType._def,t),n8=(e,t,n)=>{switch(t){case x.ZodString:return nK(e,n);case x.ZodNumber:return function(e){let t={type:"number"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case x.ZodObject:return function(e,t){let n={type:"object",properties:{}},r=[],a=e.shape();for(let e in a){let i=a[e];if(void 0===i||void 0===i._def)continue;let s=function(e){try{return e.isOptional()}catch(e){return!0}}(i),o=re(i._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,s||r.push(e))}r.length&&(n.required=r);let i=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return re(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==i&&(n.additionalProperties=i),n}(e,n);case x.ZodBigInt:return function(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case x.ZodBoolean:return{type:"boolean"};case x.ZodDate:return function e(t,n,r){let a=null!=r?r:n.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((r,a)=>e(t,n,r))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return nW(t)}}(e,n);case x.ZodUndefined:return{not:{}};case x.ZodNull:return{type:"null"};case x.ZodArray:return function(e,t){var n,r,a;let i={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(a=null==(r=e.type)?void 0:r._def)?void 0:a.typeName)!==x.ZodAny&&(i.items=re(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}(e,n);case x.ZodUnion:case x.ZodDiscriminatedUnion:return function(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in n4&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=n4[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 n9(e,t)}(e,n);case x.ZodIntersection:return function(e,t){let n=[re(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),re(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(nH(e))r.push(...e.allOf);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}(e,n);case x.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,n)=>re(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:re(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>re(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,n);case x.ZodRecord:return n2(e,n);case x.ZodLiteral:return function(e){let t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case x.ZodEnum:return{type:"string",enum:Array.from(e.values)};case x.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.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{type:[n4[e.innerType._def.typeName],"null"]};let n=re(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case x.ZodOptional:return n5(e,n);case x.ZodMap:return function(e,t){return"record"===t.mapStrategy?n2(e,t):{type:"array",maxItems:125,items:{type:"array",items:[re(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},re(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,n);case x.ZodSet:return function(e,t){let n={type:"array",uniqueItems:!0,items:re(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case x.ZodLazy:return()=>e.getter()._def;case x.ZodPromise:return re(e.type._def,n);case x.ZodNaN:case x.ZodNever:return{not:{}};case x.ZodEffects:return function(e,t){return"input"===t.effectStrategy?re(e.schema._def,t):{}}(e,n);case x.ZodAny:case x.ZodUnknown:return{};case x.ZodDefault:return function(e,t){return{...re(e.innerType._def,t),default:e.defaultValue()}}(e,n);case x.ZodBranded:return nV(e,n);case x.ZodReadonly:return n6(e,n);case x.ZodCatch:return nB(e,n);case x.ZodPipeline:return n3(e,n);case x.ZodFunction:case x.ZodVoid:case x.ZodSymbol:default:return}},n7=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function re(e,t,n=!1){var r;let a=t.seen.get(e);if(t.override){let i=null==(r=t.override)?void 0:r.call(t,e,t,a,n);if(i!==nZ)return i}if(a&&!n){let e=rt(a,t);if(void 0!==e)return e}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let s=n8(e,e.typeName,t),o="function"==typeof s?re(s(),t):s;if(o&&rn(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var rt=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:n7(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},rn=(e,t,n)=>(e.description&&(n.description=e.description),n),rr=e=>{let t=nU(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}]))}},ra=(e,t)=>{var n;let r=rr(t),a="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var a;return{...e,[t]:null!=(a=re(n._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0))?a:{}}},{}):void 0,i="string"==typeof t?t:(null==t?void 0:t.nameStrategy)==="title"?void 0:null==t?void 0:t.name,s=null!=(n=re(e._def,void 0===i?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1))?n:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(s.title=o);let l=void 0===i?a?{...s,[r.definitionPath]:a}:s:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...a,[i]:s}};return l.$schema="http://json-schema.org/draft-07/schema#",l},ri=Symbol.for("vercel.ai.schema");function rs(e){let t;return()=>(null==t&&(t=e()),t)}function ro(e,{validate:t}={}){return{[ri]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function rl(e){return null==e?ro({properties:{},additionalProperties:!1}):"object"==typeof e&&null!==e&&ri in e&&!0===e[ri]&&"jsonSchema"in e&&"validate"in e?e:"~standard"in e?"zod"===e["~standard"].vendor?ru(e):ro(()=>nL(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new ek({value:t,cause:n.issues})}}}):e()}function ru(e,t){return"_zod"in e?function(e,t){var n;let r=null!=(n=null==t?void 0:t.useReferences)&&n;return ro(()=>nL(function(e,t){if(e instanceof eT){let n=new eY(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let a={},i={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,s]=r;a[e]=n.emit(s,{...t,external:i})}if(Object.keys(r).length>0){let e="draft-2020-12"===n.target?"$defs":"definitions";a.__shared={[e]:r}}return{schemas:a}}let n=new eY(t);return n.process(e),n.emit(e,t)}(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async t=>{let n=await ta(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e,t):function(e,t){var n;let r=null!=(n=null==t?void 0:t.useReferences)&&n;return ro(()=>ra(e,{$refStrategy:r?"root":"none"}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e,t)}async function rc({value:e,schema:t,context:n}){let r=await rd({value:e,schema:t,context:n});if(!r.success)throw ek.wrap({value:e,cause:r.error,context:n});return r.value}async function rd({value:e,schema:t,context:n}){let r=rl(t);try{if(null==r.validate)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);if(t.success)return{success:!0,value:t.value,rawValue:e};return{success:!1,error:ek.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:ek.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function rp({text:e,schema:t}){try{let n=function(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return n$(e)}try{return n$(e)}finally{Error.stackTraceLimit=t}}(e);if(null==t)return{success:!0,value:n,rawValue:n};return await rd({value:n,schema:t})}catch(t){return{success:!1,error:eh.isInstance(t)?t:new eh({text:e,cause:t}),rawValue:void 0}}}async function rh(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}let rf=/^[cC][^\s-]{8,}$/,rm=/^[0-9a-z]+$/,rg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ry=/^[0-9a-vA-V]{20}$/,rv=/^[A-Za-z0-9]{27}$/,rb=/^[a-zA-Z0-9_-]{21}$/,rx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rw=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,r_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rS=/^(?:(?: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])$/,rI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,rE=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,rT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rA=/^[A-Za-z0-9_-]*$/,rN=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,rz=/^\+(?:[0-9]){6,14}[0-9]$/,rO="(?:(?:\\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])))",rP=RegExp(`^${rO}$`);function rR(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let rj=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},rD=/^\d+$/,rM=/^-?\d+(?:\.\d+)?/i,r$=/true|false/i,rL=/null/i,rF=/^[^A-Z]*$/,rZ=/^[^a-z]*$/,rq=eX("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rU={number:"number",bigint:"bigint",object:"date"},rV=eX("$ZodCheckLessThan",(e,t)=>{rq.init(e,t);let n=rU[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rB=eX("$ZodCheckGreaterThan",(e,t)=>{rq.init(e,t);let n=rU[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rW=eX("$ZodCheckMultipleOf",(e,t)=>{rq.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),rH=eX("$ZodCheckNumberFormat",(e,t)=>{rq.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[a,i]=eV[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=a,r.maximum=i,n&&(r.pattern=rD)}),e._zod.check=s=>{let o=s.value;if(n){if(!Number.isInteger(o)){s.issues.push({expected:r,format:t.format,code:"invalid_type",input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?s.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):s.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}o<a&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),o>i&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:i,inst:e})}}),rJ=eX("$ZodCheckMaxLength",(e,t)=>{var n;rq.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let a=eG(r);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rG=eX("$ZodCheckMinLength",(e,t)=>{var n;rq.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let a=eG(r);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rK=eX("$ZodCheckLengthEquals",(e,t)=>{var n;rq.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,a=r.length;if(a===t.length)return;let i=eG(r),s=a>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rY=eX("$ZodCheckStringFormat",(e,t)=>{var n,r;rq.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),rX=eX("$ZodCheckRegex",(e,t)=>{rY.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rQ=eX("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rF),rY.init(e,t)}),r0=eX("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rZ),rY.init(e,t)}),r1=eX("$ZodCheckIncludes",(e,t)=>{rq.init(e,t);let n=eZ(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),r2=eX("$ZodCheckStartsWith",(e,t)=>{rq.init(e,t);let n=RegExp(`^${eZ(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),r4=eX("$ZodCheckEndsWith",(e,t)=>{rq.init(e,t);let n=RegExp(`.*${eZ(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),r9=eX("$ZodCheckOverwrite",(e,t)=>{rq.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class r5{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let r3={major:4,minor:0,patch:0},r6=eX("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=r3;let r=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&r.unshift(e),r))for(let n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r,a=eB(e);for(let i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new eQ;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,e.issues.length===t||a||(a=eB(e,t))});else{if(e.issues.length===t)continue;a||(a=eB(e,t))}}return r?r.then(()=>e):e};e._zod.run=(n,a)=>{let i=e._zod.parse(n,a);if(i instanceof Promise){if(!1===a.async)throw new eQ;return i.then(e=>t(e,r,a))}return t(i,r,a)}}e["~standard"]={validate:t=>{try{let n=e3(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return e8(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),r8=eX("$ZodString",(e,t)=>{r6.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rj(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),r7=eX("$ZodStringFormat",(e,t)=>{rY.init(e,t),r8.init(e,t)}),ae=eX("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rk),r7.init(e,t)}),at=eX("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=rw(e))}else t.pattern??(t.pattern=rw());r7.init(e,t)}),an=eX("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=r_),r7.init(e,t)}),ar=eX("$ZodURL",(e,t)=>{r7.init(e,t),e._zod.check=n=>{try{let r=n.value,a=new URL(r),i=a.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:rN.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),aa=eX("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),r7.init(e,t)}),ai=eX("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=rb),r7.init(e,t)}),as=eX("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=rf),r7.init(e,t)}),ao=eX("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rm),r7.init(e,t)}),al=eX("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rg),r7.init(e,t)}),au=eX("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ry),r7.init(e,t)}),ac=eX("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=rv),r7.init(e,t)}),ad=eX("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){let t=rR({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");let r=`${t}(?:${n.join("|")})`;return RegExp(`^${rO}T(?:${r})$`)}(t)),r7.init(e,t)}),ap=eX("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=rP),r7.init(e,t)}),ah=eX("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${rR(t)}$`)),r7.init(e,t)}),af=eX("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rx),r7.init(e,t)}),am=eX("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rS),r7.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),ag=eX("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rI),r7.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ay=eX("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=rE),r7.init(e,t)}),av=eX("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rT),r7.init(e,t),e._zod.check=n=>{let[r,a]=n.value.split("/");try{if(!a)throw Error();let e=Number(a);if(`${e}`!==a||e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ab(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ax=eX("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rC),r7.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{ab(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),ak=eX("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rA),r7.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{!function(e){if(!rA.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ab(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),aw=eX("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rz),r7.init(e,t)}),a_=eX("$ZodJWT",(e,t)=>{r7.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let a=JSON.parse(atob(r));if("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),aS=eX("$ZodNumber",(e,t)=>{r6.init(e,t),e._zod.pattern=e._zod.bag.pattern??rM,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let a=n.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return n;let i="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),n}}),aI=eX("$ZodNumber",(e,t)=>{rH.init(e,t),aS.init(e,t)}),aE=eX("$ZodBoolean",(e,t)=>{r6.init(e,t),e._zod.pattern=r$,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let a=n.value;return"boolean"==typeof a||n.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),n}}),aT=eX("$ZodNull",(e,t)=>{r6.init(e,t),e._zod.pattern=rL,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),aC=eX("$ZodUnknown",(e,t)=>{r6.init(e,t),e._zod.parse=e=>e}),aA=eX("$ZodNever",(e,t)=>{r6.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function aN(e,t,n){e.issues.length&&t.issues.push(...eW(n,e.issues)),t.value[n]=e.value}let az=eX("$ZodArray",(e,t)=>{r6.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),n;n.value=Array(a.length);let i=[];for(let e=0;e<a.length;e++){let s=a[e],o=t.element._zod.run({value:s,issues:[]},r);o instanceof Promise?i.push(o.then(t=>aN(t,n,e))):aN(o,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function aO(e,t,n){e.issues.length&&t.issues.push(...eW(n,e.issues)),t.value[n]=e.value}function aP(e,t,n,r){e.issues.length?void 0===r[n]?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...eW(n,e.issues)):void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}let aR=eX("$ZodObject",(e,t)=>{let n,r;r6.init(e,t);let a=ez(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof r6))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=function(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});eP(e._zod,"propValues",()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values)for(let e of(n[t]??(n[t]=new Set),r.values))n[t].add(e)}return n});let i=e=>{let t=new r5(["shape","payload","ctx"]),n=a.value,r=e=>{let t=ej(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),s=0;for(let e of n.keys)i[e]=`key_${s++}`;for(let e of(t.write("const newResult = {}"),n.keys))if(n.optionalKeys.has(e)){let n=i[e];t.write(`const ${n} = ${r(e)};`);let a=ej(e);t.write(`
|
|
13
|
+
]`;continue}i+=a[e],"\\"===a[e]?s=!0:o&&"]"===a[e]?o=!1:o||"["!==a[e]||(o=!0)}try{new RegExp(i)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function n2(e,t){var n,r,a,i,s,o;let l={type:"object",additionalProperties:null!=(n=re(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(r=e.keyType)?void 0:r._def.typeName)===x.ZodString&&(null==(a=e.keyType._def.checks)?void 0:a.length)){let{type:n,...r}=nK(e.keyType._def,t);return{...l,propertyNames:r}}if((null==(i=e.keyType)?void 0:i._def.typeName)===x.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(s=e.keyType)?void 0:s._def.typeName)===x.ZodBranded&&e.keyType._def.type._def.typeName===x.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){let{type:n,...r}=nV(e.keyType._def,t);return{...l,propertyNames:r}}return l}var n4={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},n9=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>re(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},n3=(e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return re(e.innerType._def,t);let r=re(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}},n5=(e,t)=>{if("input"===t.pipeStrategy)return re(e.in._def,t);if("output"===t.pipeStrategy)return re(e.out._def,t);let n=re(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=re(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(e=>void 0!==e)}},n6=(e,t)=>re(e.innerType._def,t),n8=(e,t,n)=>{switch(t){case x.ZodString:return nK(e,n);case x.ZodNumber:return function(e){let t={type:"number"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case x.ZodObject:return function(e,t){let n={type:"object",properties:{}},r=[],a=e.shape();for(let e in a){let i=a[e];if(void 0===i||void 0===i._def)continue;let s=function(e){try{return e.isOptional()}catch(e){return!0}}(i),o=re(i._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,s||r.push(e))}r.length&&(n.required=r);let i=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return re(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==i&&(n.additionalProperties=i),n}(e,n);case x.ZodBigInt:return function(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case x.ZodBoolean:return{type:"boolean"};case x.ZodDate:return function e(t,n,r){let a=null!=r?r:n.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((r,a)=>e(t,n,r))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return nW(t)}}(e,n);case x.ZodUndefined:return{not:{}};case x.ZodNull:return{type:"null"};case x.ZodArray:return function(e,t){var n,r,a;let i={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(a=null==(r=e.type)?void 0:r._def)?void 0:a.typeName)!==x.ZodAny&&(i.items=re(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}(e,n);case x.ZodUnion:case x.ZodDiscriminatedUnion:return function(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in n4&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=n4[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 n9(e,t)}(e,n);case x.ZodIntersection:return function(e,t){let n=[re(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),re(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(nH(e))r.push(...e.allOf);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}(e,n);case x.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,n)=>re(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:re(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>re(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,n);case x.ZodRecord:return n2(e,n);case x.ZodLiteral:return function(e){let t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case x.ZodEnum:return{type:"string",enum:Array.from(e.values)};case x.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.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{type:[n4[e.innerType._def.typeName],"null"]};let n=re(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case x.ZodOptional:return n3(e,n);case x.ZodMap:return function(e,t){return"record"===t.mapStrategy?n2(e,t):{type:"array",maxItems:125,items:{type:"array",items:[re(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},re(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,n);case x.ZodSet:return function(e,t){let n={type:"array",uniqueItems:!0,items:re(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case x.ZodLazy:return()=>e.getter()._def;case x.ZodPromise:return re(e.type._def,n);case x.ZodNaN:case x.ZodNever:return{not:{}};case x.ZodEffects:return function(e,t){return"input"===t.effectStrategy?re(e.schema._def,t):{}}(e,n);case x.ZodAny:case x.ZodUnknown:return{};case x.ZodDefault:return function(e,t){return{...re(e.innerType._def,t),default:e.defaultValue()}}(e,n);case x.ZodBranded:return nV(e,n);case x.ZodReadonly:return n6(e,n);case x.ZodCatch:return nB(e,n);case x.ZodPipeline:return n5(e,n);case x.ZodFunction:case x.ZodVoid:case x.ZodSymbol:default:return}},n7=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function re(e,t,n=!1){var r;let a=t.seen.get(e);if(t.override){let i=null==(r=t.override)?void 0:r.call(t,e,t,a,n);if(i!==nZ)return i}if(a&&!n){let e=rt(a,t);if(void 0!==e)return e}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let s=n8(e,e.typeName,t),o="function"==typeof s?re(s(),t):s;if(o&&rn(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var rt=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:n7(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},rn=(e,t,n)=>(e.description&&(n.description=e.description),n),rr=e=>{let t=nU(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}]))}},ra=(e,t)=>{var n;let r=rr(t),a="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var a;return{...e,[t]:null!=(a=re(n._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0))?a:{}}},{}):void 0,i="string"==typeof t?t:(null==t?void 0:t.nameStrategy)==="title"?void 0:null==t?void 0:t.name,s=null!=(n=re(e._def,void 0===i?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1))?n:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(s.title=o);let l=void 0===i?a?{...s,[r.definitionPath]:a}:s:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...a,[i]:s}};return l.$schema="http://json-schema.org/draft-07/schema#",l},ri=Symbol.for("vercel.ai.schema");function rs(e){let t;return()=>(null==t&&(t=e()),t)}function ro(e,{validate:t}={}){return{[ri]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function rl(e){return null==e?ro({properties:{},additionalProperties:!1}):"object"==typeof e&&null!==e&&ri in e&&!0===e[ri]&&"jsonSchema"in e&&"validate"in e?e:"~standard"in e?"zod"===e["~standard"].vendor?ru(e):ro(()=>nL(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new ek({value:t,cause:n.issues})}}}):e()}function ru(e,t){return"_zod"in e?function(e,t){var n;let r=null!=(n=null==t?void 0:t.useReferences)&&n;return ro(()=>nL(function(e,t){if(e instanceof eT){let n=new eY(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let a={},i={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,s]=r;a[e]=n.emit(s,{...t,external:i})}if(Object.keys(r).length>0){let e="draft-2020-12"===n.target?"$defs":"definitions";a.__shared={[e]:r}}return{schemas:a}}let n=new eY(t);return n.process(e),n.emit(e,t)}(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async t=>{let n=await ta(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e,t):function(e,t){var n;let r=null!=(n=null==t?void 0:t.useReferences)&&n;return ro(()=>ra(e,{$refStrategy:r?"root":"none"}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e,t)}async function rc({value:e,schema:t,context:n}){let r=await rd({value:e,schema:t,context:n});if(!r.success)throw ek.wrap({value:e,cause:r.error,context:n});return r.value}async function rd({value:e,schema:t,context:n}){let r=rl(t);try{if(null==r.validate)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);if(t.success)return{success:!0,value:t.value,rawValue:e};return{success:!1,error:ek.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:ek.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function rp({text:e,schema:t}){try{let n=function(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return n$(e)}try{return n$(e)}finally{Error.stackTraceLimit=t}}(e);if(null==t)return{success:!0,value:n,rawValue:n};return await rd({value:n,schema:t})}catch(t){return{success:!1,error:eh.isInstance(t)?t:new eh({text:e,cause:t}),rawValue:void 0}}}async function rh(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}let rf=/^[cC][^\s-]{8,}$/,rm=/^[0-9a-z]+$/,rg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ry=/^[0-9a-vA-V]{20}$/,rv=/^[A-Za-z0-9]{27}$/,rb=/^[a-zA-Z0-9_-]{21}$/,rx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rw=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,r_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rS=/^(?:(?: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])$/,rI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,rE=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,rT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rA=/^[A-Za-z0-9_-]*$/,rN=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,rz=/^\+(?:[0-9]){6,14}[0-9]$/,rO="(?:(?:\\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])))",rP=RegExp(`^${rO}$`);function rR(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let rj=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},rD=/^\d+$/,rM=/^-?\d+(?:\.\d+)?/i,r$=/true|false/i,rL=/null/i,rF=/^[^A-Z]*$/,rZ=/^[^a-z]*$/,rq=eX("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rU={number:"number",bigint:"bigint",object:"date"},rV=eX("$ZodCheckLessThan",(e,t)=>{rq.init(e,t);let n=rU[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rB=eX("$ZodCheckGreaterThan",(e,t)=>{rq.init(e,t);let n=rU[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rW=eX("$ZodCheckMultipleOf",(e,t)=>{rq.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),rH=eX("$ZodCheckNumberFormat",(e,t)=>{rq.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[a,i]=eV[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=a,r.maximum=i,n&&(r.pattern=rD)}),e._zod.check=s=>{let o=s.value;if(n){if(!Number.isInteger(o)){s.issues.push({expected:r,format:t.format,code:"invalid_type",input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?s.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):s.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}o<a&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),o>i&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:i,inst:e})}}),rJ=eX("$ZodCheckMaxLength",(e,t)=>{var n;rq.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let a=eG(r);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rG=eX("$ZodCheckMinLength",(e,t)=>{var n;rq.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let a=eG(r);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rK=eX("$ZodCheckLengthEquals",(e,t)=>{var n;rq.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,a=r.length;if(a===t.length)return;let i=eG(r),s=a>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rY=eX("$ZodCheckStringFormat",(e,t)=>{var n,r;rq.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),rX=eX("$ZodCheckRegex",(e,t)=>{rY.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rQ=eX("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rF),rY.init(e,t)}),r0=eX("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rZ),rY.init(e,t)}),r1=eX("$ZodCheckIncludes",(e,t)=>{rq.init(e,t);let n=eZ(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),r2=eX("$ZodCheckStartsWith",(e,t)=>{rq.init(e,t);let n=RegExp(`^${eZ(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),r4=eX("$ZodCheckEndsWith",(e,t)=>{rq.init(e,t);let n=RegExp(`.*${eZ(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),r9=eX("$ZodCheckOverwrite",(e,t)=>{rq.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class r3{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let r5={major:4,minor:0,patch:0},r6=eX("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=r5;let r=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&r.unshift(e),r))for(let n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r,a=eB(e);for(let i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new eQ;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,e.issues.length===t||a||(a=eB(e,t))});else{if(e.issues.length===t)continue;a||(a=eB(e,t))}}return r?r.then(()=>e):e};e._zod.run=(n,a)=>{let i=e._zod.parse(n,a);if(i instanceof Promise){if(!1===a.async)throw new eQ;return i.then(e=>t(e,r,a))}return t(i,r,a)}}e["~standard"]={validate:t=>{try{let n=e5(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return e8(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),r8=eX("$ZodString",(e,t)=>{r6.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rj(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),r7=eX("$ZodStringFormat",(e,t)=>{rY.init(e,t),r8.init(e,t)}),ae=eX("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rk),r7.init(e,t)}),at=eX("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=rw(e))}else t.pattern??(t.pattern=rw());r7.init(e,t)}),an=eX("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=r_),r7.init(e,t)}),ar=eX("$ZodURL",(e,t)=>{r7.init(e,t),e._zod.check=n=>{try{let r=n.value,a=new URL(r),i=a.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:rN.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),aa=eX("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),r7.init(e,t)}),ai=eX("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=rb),r7.init(e,t)}),as=eX("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=rf),r7.init(e,t)}),ao=eX("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rm),r7.init(e,t)}),al=eX("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rg),r7.init(e,t)}),au=eX("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ry),r7.init(e,t)}),ac=eX("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=rv),r7.init(e,t)}),ad=eX("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){let t=rR({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");let r=`${t}(?:${n.join("|")})`;return RegExp(`^${rO}T(?:${r})$`)}(t)),r7.init(e,t)}),ap=eX("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=rP),r7.init(e,t)}),ah=eX("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${rR(t)}$`)),r7.init(e,t)}),af=eX("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rx),r7.init(e,t)}),am=eX("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rS),r7.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),ag=eX("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rI),r7.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ay=eX("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=rE),r7.init(e,t)}),av=eX("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rT),r7.init(e,t),e._zod.check=n=>{let[r,a]=n.value.split("/");try{if(!a)throw Error();let e=Number(a);if(`${e}`!==a||e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ab(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ax=eX("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rC),r7.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{ab(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),ak=eX("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rA),r7.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{!function(e){if(!rA.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ab(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),aw=eX("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rz),r7.init(e,t)}),a_=eX("$ZodJWT",(e,t)=>{r7.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let a=JSON.parse(atob(r));if("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),aS=eX("$ZodNumber",(e,t)=>{r6.init(e,t),e._zod.pattern=e._zod.bag.pattern??rM,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let a=n.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return n;let i="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),n}}),aI=eX("$ZodNumber",(e,t)=>{rH.init(e,t),aS.init(e,t)}),aE=eX("$ZodBoolean",(e,t)=>{r6.init(e,t),e._zod.pattern=r$,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let a=n.value;return"boolean"==typeof a||n.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),n}}),aT=eX("$ZodNull",(e,t)=>{r6.init(e,t),e._zod.pattern=rL,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),aC=eX("$ZodUnknown",(e,t)=>{r6.init(e,t),e._zod.parse=e=>e}),aA=eX("$ZodNever",(e,t)=>{r6.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function aN(e,t,n){e.issues.length&&t.issues.push(...eW(n,e.issues)),t.value[n]=e.value}let az=eX("$ZodArray",(e,t)=>{r6.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),n;n.value=Array(a.length);let i=[];for(let e=0;e<a.length;e++){let s=a[e],o=t.element._zod.run({value:s,issues:[]},r);o instanceof Promise?i.push(o.then(t=>aN(t,n,e))):aN(o,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function aO(e,t,n){e.issues.length&&t.issues.push(...eW(n,e.issues)),t.value[n]=e.value}function aP(e,t,n,r){e.issues.length?void 0===r[n]?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...eW(n,e.issues)):void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}let aR=eX("$ZodObject",(e,t)=>{let n,r;r6.init(e,t);let a=ez(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof r6))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=function(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});eP(e._zod,"propValues",()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values)for(let e of(n[t]??(n[t]=new Set),r.values))n[t].add(e)}return n});let i=e=>{let t=new r3(["shape","payload","ctx"]),n=a.value,r=e=>{let t=ej(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),s=0;for(let e of n.keys)i[e]=`key_${s++}`;for(let e of(t.write("const newResult = {}"),n.keys))if(n.optionalKeys.has(e)){let n=i[e];t.write(`const ${n} = ${r(e)};`);let a=ej(e);t.write(`
|
|
14
14
|
if (${n}.issues.length) {
|
|
15
15
|
if (input[${a}] === undefined) {
|
|
16
16
|
if (${a} in input) {
|
|
@@ -33,6 +33,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33
33
|
if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
34
34
|
...iss,
|
|
35
35
|
path: iss.path ? [${ej(e)}, ...iss.path] : [${ej(e)}]
|
|
36
|
-
})));`),t.write(`newResult[${ej(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");let o=t.compile();return(t,n)=>o(e,t,n)},s=!e0.jitless,o=s&&e$.value,l=t.catchall;e._zod.parse=(u,c)=>{r??(r=a.value);let d=u.value;if(!eM(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;let p=[];if(s&&o&&c?.async===!1&&!0!==c.jitless)n||(n=i(t.shape)),u=n(u,c);else{u.value={};let e=r.shape;for(let t of r.keys){let n=e[t],r=n._zod.run({value:d[t],issues:[]},c),a="optional"===n._zod.optin&&"optional"===n._zod.optout;r instanceof Promise?p.push(r.then(e=>a?aP(e,u,t,d):aO(e,u,t))):a?aP(r,u,t,d):aO(r,u,t)}}if(!l)return p.length?Promise.all(p).then(()=>u):u;let h=[],f=r.keySet,m=l._zod,g=m.def.type;for(let e of Object.keys(d)){if(f.has(e))continue;if("never"===g){h.push(e);continue}let t=m.run({value:d[e],issues:[]},c);t instanceof Promise?p.push(t.then(t=>aO(t,u,e))):aO(t,u,e)}return(h.length&&u.issues.push({code:"unrecognized_keys",keys:h,input:d,inst:e}),p.length)?Promise.all(p).then(()=>u):u}});function aj(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>eJ(e,r,e1())))}),t}let aD=eX("$ZodUnion",(e,t)=>{r6.init(e,t),eP(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),eP(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eP(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),eP(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>eO(e.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let a=!1,i=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)i.push(t),a=!0;else{if(0===t.issues.length)return t;i.push(t)}}return a?Promise.all(i).then(t=>aj(t,n,e,r)):aj(i,n,e,r)}}),aM=eX("$ZodDiscriminatedUnion",(e,t)=>{aD.init(e,t);let n=e._zod.parse;eP(e._zod,"propValues",()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r))for(let r of(e[t]||(e[t]=new Set),n))e[t].add(r)}return e});let r=ez(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(a,i)=>{let s=a.value;if(!eM(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),a;let o=r.value.get(s?.[t.discriminator]);return o?o._zod.run(a,i):t.unionFallback?n(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),a)}}),a$=eX("$ZodIntersection",(e,t)=>{r6.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,a=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([t,n])=>aL(e,t,n)):aL(e,a,i)}});function aL(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),eB(e))return e;let r=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(eL(t)&&eL(n)){let r=Object.keys(n),a=Object.keys(t).filter(e=>-1!==r.indexOf(e)),i={...t,...n};for(let r of a){let a=e(t[r],n[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};i[r]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let a=0;a<t.length;a++){let i=e(t[a],n[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}let aF=eX("$ZodRecord",(e,t)=>{r6.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!eL(a))return n.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),n;let i=[];if(t.keyType._zod.values){let s;let o=t.keyType._zod.values;for(let e of(n.value={},o))if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){let s=t.valueType._zod.run({value:a[e],issues:[]},r);s instanceof Promise?i.push(s.then(t=>{t.issues.length&&n.issues.push(...eW(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...eW(e,s.issues)),n.value[e]=s.value)}for(let e in a)o.has(e)||(s=s??[]).push(e);s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:s})}else for(let s of(n.value={},Reflect.ownKeys(a))){if("__proto__"===s)continue;let o=t.keyType._zod.run({value:s,issues:[]},r);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(e=>eJ(e,r,e1())),input:s,path:[s],inst:e}),n.value[o.value]=o.value;continue}let l=t.valueType._zod.run({value:a[s],issues:[]},r);l instanceof Promise?i.push(l.then(e=>{e.issues.length&&n.issues.push(...eW(s,e.issues)),n.value[o.value]=e.value})):(l.issues.length&&n.issues.push(...eW(s,l.issues)),n.value[o.value]=l.value)}return i.length?Promise.all(i).then(()=>n):n}}),aZ=eX("$ZodEnum",(e,t)=>{r6.init(e,t);let n=eA(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>eF.has(typeof e)).map(e=>"string"==typeof e?eZ(e):e.toString()).join("|")})$`),e._zod.parse=(t,r)=>{let a=t.value;return e._zod.values.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),aq=eX("$ZodLiteral",(e,t)=>{r6.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eZ(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(n,r)=>{let a=n.value;return e._zod.values.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),aU=eX("$ZodTransform",(e,t)=>{r6.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new eQ;return e.value=r,e}}),aV=eX("$ZodOptional",(e,t)=>{r6.init(e,t),e._zod.optin="optional",e._zod.optout="optional",eP(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),eP(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eO(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)}),aB=eX("$ZodNullable",(e,t)=>{r6.init(e,t),eP(e._zod,"optin",()=>t.innerType._zod.optin),eP(e._zod,"optout",()=>t.innerType._zod.optout),eP(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eO(e.source)}|null)$`):void 0}),eP(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),aW=eX("$ZodDefault",(e,t)=>{r6.init(e,t),e._zod.optin="optional",eP(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>aH(e,t)):aH(r,t)}});function aH(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let aJ=eX("$ZodPrefault",(e,t)=>{r6.init(e,t),e._zod.optin="optional",eP(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),aG=eX("$ZodNonOptional",(e,t)=>{r6.init(e,t),eP(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(t=>aK(t,e)):aK(a,e)}});function aK(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let aY=eX("$ZodCatch",(e,t)=>{r6.init(e,t),e._zod.optin="optional",eP(e._zod,"optout",()=>t.innerType._zod.optout),eP(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>eJ(e,n,e1()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>eJ(e,n,e1()))},input:e.value}),e.issues=[]),e)}}),aX=eX("$ZodPipe",(e,t)=>{r6.init(e,t),eP(e._zod,"values",()=>t.in._zod.values),eP(e._zod,"optin",()=>t.in._zod.optin),eP(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>aQ(e,t,n)):aQ(r,t,n)}});function aQ(e,t,n){return eB(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}let a0=eX("$ZodReadonly",(e,t)=>{r6.init(e,t),eP(e._zod,"propValues",()=>t.innerType._zod.propValues),eP(e._zod,"values",()=>t.innerType._zod.values),eP(e._zod,"optin",()=>t.innerType._zod.optin),eP(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(a1):a1(r)}});function a1(e){return e.value=Object.freeze(e.value),e}let a2=eX("$ZodLazy",(e,t)=>{r6.init(e,t),eP(e._zod,"innerType",()=>t.getter()),eP(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),eP(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),eP(e._zod,"optin",()=>e._zod.innerType._zod.optin),eP(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),a4=eX("$ZodCustom",(e,t)=>{rq.init(e,t),r6.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(t=>a9(t,n,r,e));a9(a,n,r,e)}});function a9(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(eK(e))}}function a5(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...eU(t)})}function a3(e,t){return new rV({check:"less_than",...eU(t),value:e,inclusive:!1})}function a6(e,t){return new rV({check:"less_than",...eU(t),value:e,inclusive:!0})}function a8(e,t){return new rB({check:"greater_than",...eU(t),value:e,inclusive:!1})}function a7(e,t){return new rB({check:"greater_than",...eU(t),value:e,inclusive:!0})}function ie(e,t){return new rW({check:"multiple_of",...eU(t),value:e})}function it(e,t){return new rJ({check:"max_length",...eU(t),maximum:e})}function ir(e,t){return new rG({check:"min_length",...eU(t),minimum:e})}function ia(e,t){return new rK({check:"length_equals",...eU(t),length:e})}function ii(e){return new r9({check:"overwrite",tx:e})}let is=eX("ZodISODateTime",(e,t)=>{ad.init(e,t),im.init(e,t)}),io=eX("ZodISODate",(e,t)=>{ap.init(e,t),im.init(e,t)}),il=eX("ZodISOTime",(e,t)=>{ah.init(e,t),im.init(e,t)}),iu=eX("ZodISODuration",(e,t)=>{af.init(e,t),im.init(e,t)}),ic=eX("ZodType",(e,t)=>(r6.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>eq(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>tt(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>tr(e,t,n),e.parseAsync=async(t,n)=>tn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ta(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return new su({type:"custom",check:"custom",fn:e,...eU(t)})}(t,n)),e.superRefine=t=>e.check(function(e){let t=function(e){let t=new rq({check:"custom"});return t._zod.check=e,t}(n=>(n.addIssue=e=>{"string"==typeof e?n.issues.push(eK(e,n.value,t._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=n.value),e.inst??(e.inst=t),e.continue??(e.continue=!t._zod.def.abort),n.issues.push(eK(e)))},e(n.value,n)));return t}(t)),e.overwrite=t=>e.check(ii(t)),e.optional=()=>i8(e),e.nullable=()=>se(e),e.nullish=()=>i8(se(e)),e.nonoptional=t=>new sr({type:"nonoptional",innerType:e,...eU(t)}),e.array=()=>iW(e),e.or=t=>iY([e,t]),e.and=t=>new iQ({type:"intersection",left:e,right:t}),e.transform=t=>ss(e,new i3({type:"transform",transform:t})),e.default=t=>(function(e,t){return new st({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})})(e,t),e.prefault=t=>(function(e,t){return new sn({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})})(e,t),e.catch=t=>(function(e,t){return new sa({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})})(e,t),e.pipe=t=>ss(e,t),e.readonly=()=>new so({type:"readonly",innerType:e}),e.describe=t=>{let n=e.clone();return eC.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>eC.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return eC.get(e);let n=e.clone();return eC.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),id=eX("_ZodString",(e,t)=>{r8.init(e,t),ic.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new rX({check:"string_format",format:"regex",...eU(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new r1({check:"string_format",format:"includes",...eU(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new r2({check:"string_format",format:"starts_with",...eU(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new r4({check:"string_format",format:"ends_with",...eU(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ir(...t)),e.max=(...t)=>e.check(it(...t)),e.length=(...t)=>e.check(ia(...t)),e.nonempty=(...t)=>e.check(ir(1,...t)),e.lowercase=t=>e.check(new rQ({check:"string_format",format:"lowercase",...eU(t)})),e.uppercase=t=>e.check(new r0({check:"string_format",format:"uppercase",...eU(t)})),e.trim=()=>e.check(ii(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ii(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ii(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ii(e=>e.toUpperCase()))}),ip=eX("ZodString",(e,t)=>{r8.init(e,t),id.init(e,t),e.email=t=>e.check(new ig({type:"string",format:"email",check:"string_format",abort:!1,...eU(t)})),e.url=t=>e.check(new ib({type:"string",format:"url",check:"string_format",abort:!1,...eU(t)})),e.jwt=t=>e.check(new iR({type:"string",format:"jwt",check:"string_format",abort:!1,...eU(t)})),e.emoji=t=>e.check(new ix({type:"string",format:"emoji",check:"string_format",abort:!1,...eU(t)})),e.guid=t=>e.check(a5(iy,t)),e.uuid=t=>e.check(new iv({type:"string",format:"uuid",check:"string_format",abort:!1,...eU(t)})),e.uuidv4=t=>e.check(new iv({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eU(t)})),e.uuidv6=t=>e.check(new iv({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eU(t)})),e.uuidv7=t=>e.check(new iv({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eU(t)})),e.nanoid=t=>e.check(new ik({type:"string",format:"nanoid",check:"string_format",abort:!1,...eU(t)})),e.guid=t=>e.check(a5(iy,t)),e.cuid=t=>e.check(new iw({type:"string",format:"cuid",check:"string_format",abort:!1,...eU(t)})),e.cuid2=t=>e.check(new i_({type:"string",format:"cuid2",check:"string_format",abort:!1,...eU(t)})),e.ulid=t=>e.check(new iS({type:"string",format:"ulid",check:"string_format",abort:!1,...eU(t)})),e.base64=t=>e.check(new iz({type:"string",format:"base64",check:"string_format",abort:!1,...eU(t)})),e.base64url=t=>e.check(new iO({type:"string",format:"base64url",check:"string_format",abort:!1,...eU(t)})),e.xid=t=>e.check(new iI({type:"string",format:"xid",check:"string_format",abort:!1,...eU(t)})),e.ksuid=t=>e.check(new iE({type:"string",format:"ksuid",check:"string_format",abort:!1,...eU(t)})),e.ipv4=t=>e.check(new iT({type:"string",format:"ipv4",check:"string_format",abort:!1,...eU(t)})),e.ipv6=t=>e.check(new iC({type:"string",format:"ipv6",check:"string_format",abort:!1,...eU(t)})),e.cidrv4=t=>e.check(new iA({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eU(t)})),e.cidrv6=t=>e.check(new iN({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eU(t)})),e.e164=t=>e.check(new iP({type:"string",format:"e164",check:"string_format",abort:!1,...eU(t)})),e.datetime=t=>e.check(new is({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eU(t)})),e.date=t=>e.check(new io({type:"string",format:"date",check:"string_format",...eU(t)})),e.time=t=>e.check(new il({type:"string",format:"time",check:"string_format",precision:null,...eU(t)})),e.duration=t=>e.check(new iu({type:"string",format:"duration",check:"string_format",...eU(t)}))});function ih(e){return new ip({type:"string",...eU(e)})}let im=eX("ZodStringFormat",(e,t)=>{r7.init(e,t),id.init(e,t)}),ig=eX("ZodEmail",(e,t)=>{an.init(e,t),im.init(e,t)}),iy=eX("ZodGUID",(e,t)=>{ae.init(e,t),im.init(e,t)}),iv=eX("ZodUUID",(e,t)=>{at.init(e,t),im.init(e,t)}),ib=eX("ZodURL",(e,t)=>{ar.init(e,t),im.init(e,t)}),ix=eX("ZodEmoji",(e,t)=>{aa.init(e,t),im.init(e,t)}),ik=eX("ZodNanoID",(e,t)=>{ai.init(e,t),im.init(e,t)}),iw=eX("ZodCUID",(e,t)=>{as.init(e,t),im.init(e,t)}),i_=eX("ZodCUID2",(e,t)=>{ao.init(e,t),im.init(e,t)}),iS=eX("ZodULID",(e,t)=>{al.init(e,t),im.init(e,t)}),iI=eX("ZodXID",(e,t)=>{au.init(e,t),im.init(e,t)}),iE=eX("ZodKSUID",(e,t)=>{ac.init(e,t),im.init(e,t)}),iT=eX("ZodIPv4",(e,t)=>{am.init(e,t),im.init(e,t)}),iC=eX("ZodIPv6",(e,t)=>{ag.init(e,t),im.init(e,t)}),iA=eX("ZodCIDRv4",(e,t)=>{ay.init(e,t),im.init(e,t)}),iN=eX("ZodCIDRv6",(e,t)=>{av.init(e,t),im.init(e,t)}),iz=eX("ZodBase64",(e,t)=>{ax.init(e,t),im.init(e,t)}),iO=eX("ZodBase64URL",(e,t)=>{ak.init(e,t),im.init(e,t)}),iP=eX("ZodE164",(e,t)=>{aw.init(e,t),im.init(e,t)}),iR=eX("ZodJWT",(e,t)=>{a_.init(e,t),im.init(e,t)}),ij=eX("ZodNumber",(e,t)=>{aS.init(e,t),ic.init(e,t),e.gt=(t,n)=>e.check(a8(t,n)),e.gte=(t,n)=>e.check(a7(t,n)),e.min=(t,n)=>e.check(a7(t,n)),e.lt=(t,n)=>e.check(a3(t,n)),e.lte=(t,n)=>e.check(a6(t,n)),e.max=(t,n)=>e.check(a6(t,n)),e.int=t=>e.check(iM(t)),e.safe=t=>e.check(iM(t)),e.positive=t=>e.check(a8(0,t)),e.nonnegative=t=>e.check(a7(0,t)),e.negative=t=>e.check(a3(0,t)),e.nonpositive=t=>e.check(a6(0,t)),e.multipleOf=(t,n)=>e.check(ie(t,n)),e.step=(t,n)=>e.check(ie(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),iD=eX("ZodNumberFormat",(e,t)=>{aI.init(e,t),ij.init(e,t)});function iM(e){return new iD({type:"number",check:"number_format",abort:!1,format:"safeint",...eU(e)})}let i$=eX("ZodBoolean",(e,t)=>{aE.init(e,t),ic.init(e,t)});function iL(e){return new i$({type:"boolean",...eU(e)})}let iF=eX("ZodNull",(e,t)=>{aT.init(e,t),ic.init(e,t)}),iZ=eX("ZodUnknown",(e,t)=>{aC.init(e,t),ic.init(e,t)});function iq(){return new iZ({type:"unknown"})}let iU=eX("ZodNever",(e,t)=>{aA.init(e,t),ic.init(e,t)});function iV(e){return new iU({type:"never",...eU(e)})}let iB=eX("ZodArray",(e,t)=>{az.init(e,t),ic.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ir(t,n)),e.nonempty=t=>e.check(ir(1,t)),e.max=(t,n)=>e.check(it(t,n)),e.length=(t,n)=>e.check(ia(t,n)),e.unwrap=()=>e.element});function iW(e,t){return new iB({type:"array",element:e,...eU(t)})}let iH=eX("ZodObject",(e,t)=>{aR.init(e,t),ic.init(e,t),eP(e,"shape",()=>t.shape),e.keyof=()=>i4(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:iq()}),e.loose=()=>e.clone({...e._zod.def,catchall:iq()}),e.strict=()=>e.clone({...e._zod.def,catchall:iV()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>(function(e,t){if(!eL(t))throw Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return eR(this,"shape",n),n},checks:[]};return eq(e,n)})(e,t),e.merge=t=>(function(e,t){return eq(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return eR(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})})(e,t),e.pick=t=>(function(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return eq(e,{...e._zod.def,shape:n,checks:[]})})(e,t),e.omit=t=>(function(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return eq(e,{...e._zod.def,shape:n,checks:[]})})(e,t),e.partial=(...t)=>(function(e,t,n){let r=t._zod.def.shape,a={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)a[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return eq(t,{...t._zod.def,shape:a,checks:[]})})(i6,e,t[0]),e.required=(...t)=>(function(e,t,n){let r=t._zod.def.shape,a={...r};if(n)for(let t in n){if(!(t in a))throw Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(let t in r)a[t]=new e({type:"nonoptional",innerType:r[t]});return eq(t,{...t._zod.def,shape:a,checks:[]})})(sr,e,t[0])});function iJ(e,t){return new iH({type:"object",get shape(){return eR(this,"shape",{...e}),this.shape},...eU(t)})}function iG(e,t){return new iH({type:"object",get shape(){return eR(this,"shape",{...e}),this.shape},catchall:iV(),...eU(t)})}let iK=eX("ZodUnion",(e,t)=>{aD.init(e,t),ic.init(e,t),e.options=t.options});function iY(e,t){return new iK({type:"union",options:e,...eU(t)})}let iX=eX("ZodDiscriminatedUnion",(e,t)=>{iK.init(e,t),aM.init(e,t)}),iQ=eX("ZodIntersection",(e,t)=>{a$.init(e,t),ic.init(e,t)}),i0=eX("ZodRecord",(e,t)=>{aF.init(e,t),ic.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function i1(e,t,n){return new i0({type:"record",keyType:e,valueType:t,...eU(n)})}let i2=eX("ZodEnum",(e,t)=>{aZ.init(e,t),ic.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let a={};for(let r of e)if(n.has(r))a[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new i2({...t,checks:[],...eU(r),entries:a})},e.exclude=(e,r)=>{let a={...t.entries};for(let t of e)if(n.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new i2({...t,checks:[],...eU(r),entries:a})}});function i4(e,t){return new i2({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eU(t)})}let i9=eX("ZodLiteral",(e,t)=>{aq.init(e,t),ic.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function i5(e,t){return new i9({type:"literal",values:Array.isArray(e)?e:[e],...eU(t)})}let i3=eX("ZodTransform",(e,t)=>{aU.init(e,t),ic.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{"string"==typeof r?n.issues.push(eK(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),r.continue??(r.continue=!0),n.issues.push(eK(r)))};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}}),i6=eX("ZodOptional",(e,t)=>{aV.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType});function i8(e){return new i6({type:"optional",innerType:e})}let i7=eX("ZodNullable",(e,t)=>{aB.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType});function se(e){return new i7({type:"nullable",innerType:e})}let st=eX("ZodDefault",(e,t)=>{aW.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),sn=eX("ZodPrefault",(e,t)=>{aJ.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType}),sr=eX("ZodNonOptional",(e,t)=>{aG.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType}),sa=eX("ZodCatch",(e,t)=>{aY.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),si=eX("ZodPipe",(e,t)=>{aX.init(e,t),ic.init(e,t),e.in=t.in,e.out=t.out});function ss(e,t){return new si({type:"pipe",in:e,out:t})}let so=eX("ZodReadonly",(e,t)=>{a0.init(e,t),ic.init(e,t)}),sl=eX("ZodLazy",(e,t)=>{a2.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.getter()}),su=eX("ZodCustom",(e,t)=>{a4.init(e,t),ic.init(e,t)});function sc(e,t){return function(e,t,n){let r=eU(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}(su,e??(()=>!0),t)}function sd(e,t={error:`Input not instance of ${e.name}`}){let n=new su({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...eU(t)});return n._zod.bag.Class=e,n}var sp=Object.defineProperty,sh="AI_InvalidArgumentError",sf=`vercel.ai.error.${sh}`,sm=Symbol.for(sf),sg=class extends ea{constructor({parameter:e,value:t,message:n}){super({name:sh,message:`Invalid argument for parameter ${e}: ${n}`}),this[_]=!0,this.parameter=e,this.value=t}static isInstance(e){return ea.hasMarker(e,sf)}};_=sm,Symbol.for("vercel.ai.error.AI_InvalidStreamPartError");var sy="AI_InvalidToolApprovalError",sv=`vercel.ai.error.${sy}`,sb=Symbol.for(sv),sx=class extends ea{constructor({approvalId:e}){super({name:sy,message:`Tool approval response references unknown approvalId: "${e}". No matching tool-approval-request found in message history.`}),this[S]=!0,this.approvalId=e}static isInstance(e){return ea.hasMarker(e,sv)}};S=sb;var sk="AI_InvalidToolInputError",sw=`vercel.ai.error.${sk}`,s_=Symbol.for(sw),sS=class extends ea{constructor({toolInput:e,toolName:t,cause:n,message:r=`Invalid input for tool ${t}: ${ei(n)}`}){super({name:sk,message:r,cause:n}),this[I]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return ea.hasMarker(e,sw)}};I=s_;var sI="AI_ToolCallNotFoundForApprovalError",sE=`vercel.ai.error.${sI}`,sT=Symbol.for(sE),sC=class extends ea{constructor({toolCallId:e,approvalId:t}){super({name:sI,message:`Tool call "${e}" not found for approval request "${t}".`}),this[E]=!0,this.toolCallId=e,this.approvalId=t}static isInstance(e){return ea.hasMarker(e,sE)}};E=sT;var sA="AI_MissingToolResultsError",sN=`vercel.ai.error.${sA}`,sz=Symbol.for(sN),sO=class extends ea{constructor({toolCallIds:e}){super({name:sA,message:`Tool result${e.length>1?"s are":" is"} missing for tool call${e.length>1?"s":""} ${e.join(", ")}.`}),this[T]=!0,this.toolCallIds=e}static isInstance(e){return ea.hasMarker(e,sN)}};T=sz,Symbol.for("vercel.ai.error.AI_NoImageGeneratedError");var sP="AI_NoObjectGeneratedError",sR=`vercel.ai.error.${sP}`,sj=Symbol.for(sR),sD=class extends ea{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:a,finishReason:i}){super({name:sP,message:e,cause:t}),this[A]=!0,this.text=n,this.response=r,this.usage=a,this.finishReason=i}static isInstance(e){return ea.hasMarker(e,sR)}};A=sj;var sM="AI_NoOutputGeneratedError",s$=`vercel.ai.error.${sM}`,sL=Symbol.for(s$),sF=class extends ea{constructor({message:e="No output generated.",cause:t}={}){super({name:sM,message:e,cause:t}),this[N]=!0}static isInstance(e){return ea.hasMarker(e,s$)}};N=sL,Symbol.for("vercel.ai.error.AI_NoSpeechGeneratedError"),Symbol.for("vercel.ai.error.AI_NoTranscriptGeneratedError"),Symbol.for("vercel.ai.error.AI_NoVideoGeneratedError");var sZ="AI_NoSuchToolError",sq=`vercel.ai.error.${sZ}`,sU=Symbol.for(sq),sV=class extends ea{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({name:sZ,message:n}),this[R]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return ea.hasMarker(e,sq)}};R=sU;var sB="AI_ToolCallRepairError",sW=`vercel.ai.error.${sB}`,sH=Symbol.for(sW),sJ=class extends ea{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${ei(e)}`}){super({name:sB,message:n,cause:e}),this[j]=!0,this.originalError=t}static isInstance(e){return ea.hasMarker(e,sW)}};j=sH;var sG=class extends ea{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},sK="AI_UIMessageStreamError",sY=`vercel.ai.error.${sK}`,sX=Symbol.for(sY),sQ=class extends ea{constructor({chunkType:e,chunkId:t,message:n}){super({name:sK,message:n}),this[D]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return ea.hasMarker(e,sY)}};D=sX;var s0="AI_InvalidDataContentError",s1=`vercel.ai.error.${s0}`;M=Symbol.for(s1);var s2="AI_InvalidMessageRoleError",s4=`vercel.ai.error.${s2}`,s9=Symbol.for(s4),s5=class extends ea{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:s2,message:t}),this[$]=!0,this.role=e}static isInstance(e){return ea.hasMarker(e,s4)}};$=s9;var s3="AI_MessageConversionError",s6=`vercel.ai.error.${s3}`,s8=Symbol.for(s6),s7=class extends ea{constructor({originalMessage:e,message:t}){super({name:s3,message:t}),this[L]=!0,this.originalMessage=e}static isInstance(e){return ea.hasMarker(e,s6)}};L=s8;var oe="AI_RetryError",ot=`vercel.ai.error.${oe}`,on=Symbol.for(ot),or=class extends ea{constructor({message:e,reason:t,errors:n}){super({name:oe,message:e}),this[F]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return ea.hasMarker(e,ot)}};function oa(e){return void 0===e?[]:Array.isArray(e)?e:[e]}async function oi(e){for(let t of oa(e.callbacks))if(null!=t)try{await t(e.event)}catch(e){}}F=on;var os=!1,oo=e=>{if(0===e.warnings.length)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(!1!==t){if("function"==typeof t){t(e);return}for(let t of(os||(os=!0,console.info("AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.")),e.warnings))console.warn(function({warning:e,provider:t,model:n}){let r=`AI SDK Warning (${t} / ${n}):`;switch(e.type){case"unsupported":{let t=`${r} The feature "${e.feature}" is not supported.`;return e.details&&(t+=` ${e.details}`),t}case"compatibility":{let t=`${r} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(t+=` ${e.details}`),t}case"other":return`${r} ${e.message}`;default:return`${r} ${JSON.stringify(e,null,2)}`}}({warning:t,provider:e.provider,model:e.model}))}};function ol({provider:e,modelId:t}){oo({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}function ou(e){return{unified:"unknown"===e?"other":e,raw:void 0}}function oc(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}var od=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}],op=e=>{let t="string"==typeof e?convertBase64ToUint8Array(e):e,n=(127&t[6])<<21|(127&t[7])<<14|(127&t[8])<<7|127&t[9];return t.slice(n+10)},oh="6.0.116",of=async({url:e,maxBytes:t,abortSignal:n})=>{var r;let a=e.toString();(function(e){let t;try{t=new URL(e)}catch(t){throw new nT({url:e,message:`Invalid URL: ${e}`})}if("http:"!==t.protocol&&"https:"!==t.protocol)throw new nT({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let n=t.hostname;if(!n)throw new nT({url:e,message:"URL must have a hostname"});if("localhost"===n||n.endsWith(".local")||n.endsWith(".localhost"))throw new nT({url:e,message:`URL with hostname ${n} is not allowed`});if(n.startsWith("[")&&n.endsWith("]")){if(function(e){let t=e.toLowerCase();if("::1"===t||"::"===t)return!0;if(t.startsWith("::ffff:")){let e=t.slice(7);if(nA(e))return nN(e);let n=e.split(":");if(2===n.length){let e=parseInt(n[0],16),t=parseInt(n[1],16);if(!isNaN(e)&&!isNaN(t))return nN(`${e>>8&255}.${255&e}.${t>>8&255}.${255&t}`)}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}(n.slice(1,-1)))throw new nT({url:e,message:`URL with IPv6 address ${n} is not allowed`});return}if(nA(n)&&nN(n))throw new nT({url:e,message:`URL with IP address ${n} is not allowed`})})(a);try{let e=await fetch(a,{headers:nj({},`ai-sdk/${oh}`,nP()),signal:n});if(!e.ok)throw new nT({url:a,statusCode:e.status,statusText:e.statusText});return{data:await nC({response:e,url:a,maxBytes:null!=t?t:2147483648}),mediaType:null!=(r=e.headers.get("content-type"))?r:void 0}}catch(e){if(nT.isInstance(e))throw e;throw new nT({url:a,cause:e})}},om=(e=of)=>t=>Promise.all(t.map(async t=>t.isUrlSupportedByModel?null:e(t))),og=iY([ih(),sd(Uint8Array),sd(ArrayBuffer),sc(e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n},{message:"Must be a Buffer"})]);function oy(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if("string"==typeof e)try{e=new URL(e)}catch(e){}if(e instanceof URL&&"data:"===e.protocol){let{mediaType:t,base64Content:n}=function(e){try{let[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch(e){return{mediaType:void 0,base64Content:void 0}}}(e.toString());if(null==t||null==n)throw new AISDKError22({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}async function ov(e,t,n){let r=e.filter(e=>"user"===e.role).map(e=>e.content).filter(e=>Array.isArray(e)).flat().filter(e=>"image"===e.type||"file"===e.type).map(e=>{var t;let n=null!=(t=e.mediaType)?t:"image"===e.type?"image/*":void 0,r="image"===e.type?e.image:e.data;if("string"==typeof r)try{r=new URL(r)}catch(e){}return{mediaType:n,data:r}}).filter(e=>e.data instanceof URL).map(e=>({url:e.data,isUrlSupportedByModel:null!=e.mediaType&&isUrlSupported({url:e.data.toString(),mediaType:e.mediaType,supportedUrls:n})}));return Object.fromEntries((await t(r)).map((e,t)=>null==e?null:[r[t].url.toString(),{data:e.data,mediaType:e.mediaType}]).filter(e=>null!=e))}function ob(e){return"content"!==e.type?e:{type:"content",value:e.value.map(e=>"media"!==e.type?e:e.mediaType.startsWith("image/")?{type:"image-data",data:e.data,mediaType:e.mediaType}:{type:"file-data",data:e.data,mediaType:e.mediaType})}}async function ox({toolCallId:e,input:t,output:n,tool:r,errorMode:a}){return"text"===a?{type:"error-text",value:getErrorMessage3(n)}:"json"===a?{type:"error-json",value:ok(n)}:(null==r?void 0:r.toModelOutput)?await r.toModelOutput({toolCallId:e,input:t,output:n}):"string"==typeof n?{type:"text",value:n}:{type:"json",value:ok(n)}}function ok(e){return void 0===e?null:e}var ow=new sl({type:"lazy",getter:()=>iY([new iF({type:"null",...eU(void 0)}),ih(),new ij({type:"number",checks:[],...eU(void 0)}),iL(),i1(ih(),ow.optional()),iW(ow)])}),o_=i1(ih(),i1(ih(),ow.optional())),oS=iJ({type:i5("text"),text:ih(),providerOptions:o_.optional()}),oI=iJ({type:i5("image"),image:iY([og,sd(URL)]),mediaType:ih().optional(),providerOptions:o_.optional()}),oE=iJ({type:i5("file"),data:iY([og,sd(URL)]),filename:ih().optional(),mediaType:ih(),providerOptions:o_.optional()}),oT=iJ({type:i5("reasoning"),text:ih(),providerOptions:o_.optional()}),oC=iJ({type:i5("tool-call"),toolCallId:ih(),toolName:ih(),input:iq(),providerOptions:o_.optional(),providerExecuted:iL().optional()}),oA=(a="type",new iX({type:"union",options:[iJ({type:i5("text"),value:ih(),providerOptions:o_.optional()}),iJ({type:i5("json"),value:ow,providerOptions:o_.optional()}),iJ({type:i5("execution-denied"),reason:ih().optional(),providerOptions:o_.optional()}),iJ({type:i5("error-text"),value:ih(),providerOptions:o_.optional()}),iJ({type:i5("error-json"),value:ow,providerOptions:o_.optional()}),iJ({type:i5("content"),value:iW(iY([iJ({type:i5("text"),text:ih(),providerOptions:o_.optional()}),iJ({type:i5("media"),data:ih(),mediaType:ih()}),iJ({type:i5("file-data"),data:ih(),mediaType:ih(),filename:ih().optional(),providerOptions:o_.optional()}),iJ({type:i5("file-url"),url:ih(),providerOptions:o_.optional()}),iJ({type:i5("file-id"),fileId:iY([ih(),i1(ih(),ih())]),providerOptions:o_.optional()}),iJ({type:i5("image-data"),data:ih(),mediaType:ih(),providerOptions:o_.optional()}),iJ({type:i5("image-url"),url:ih(),providerOptions:o_.optional()}),iJ({type:i5("image-file-id"),fileId:iY([ih(),i1(ih(),ih())]),providerOptions:o_.optional()}),iJ({type:i5("custom"),providerOptions:o_.optional()})]))})],discriminator:a,...eU(void 0)})),oN=iJ({type:i5("tool-result"),toolCallId:ih(),toolName:ih(),output:oA,providerOptions:o_.optional()}),oz=iJ({type:i5("tool-approval-request"),approvalId:ih(),toolCallId:ih()}),oO=iJ({type:i5("tool-approval-response"),approvalId:ih(),approved:iL(),reason:ih().optional()}),oP=iJ({role:i5("system"),content:ih(),providerOptions:o_.optional()}),oR=iJ({role:i5("user"),content:iY([ih(),iW(iY([oS,oI,oE]))]),providerOptions:o_.optional()}),oj=iJ({role:i5("assistant"),content:iY([ih(),iW(iY([oS,oE,oT,oC,oN,oz]))]),providerOptions:o_.optional()}),oD=iJ({role:i5("tool"),content:iW(iY([oN,oO])),providerOptions:o_.optional()}),oM=iY([oP,oR,oj,oD]),o$={startSpan:()=>oL,startActiveSpan:(e,t,n,r)=>"function"==typeof t?t(oL):"function"==typeof n?n(oL):"function"==typeof r?r(oL):void 0},oL={spanContext:()=>oF,setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording:()=>!1,recordException(){return this}},oF={traceId:"",spanId:"",traceFlags:0};async function oZ({name:e,tracer:t,attributes:n,fn:r,endWhenDone:a=!0}){return t.startActiveSpan(e,{attributes:await n},async e=>{let t=context.active();try{let n=await context.with(t,()=>r(e));return a&&e.end(),n}catch(t){try{oq(e,t)}finally{e.end()}throw t}})}function oq(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:SpanStatusCode.ERROR,message:t.message})):e.setStatus({code:SpanStatusCode.ERROR})}async function oU({telemetry:e,attributes:t}){if((null==e?void 0:e.isEnabled)!==!0)return{};let n={};for(let[r,a]of Object.entries(t))if(null!=a){if("object"==typeof a&&"input"in a&&"function"==typeof a.input){if((null==e?void 0:e.recordInputs)===!1)continue;let t=await a.input();null!=t&&(n[r]=t);continue}if("object"==typeof a&&"output"in a&&"function"==typeof a.output){if((null==e?void 0:e.recordOutputs)===!1)continue;let t=await a.output();null!=t&&(n[r]=t);continue}n[r]=a}return n}function oV(e,t){return null==e&&null==t?void 0:(null!=e?e:0)+(null!=t?t:0)}var oB=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:r}={})=>async a=>oW(a,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:r});async function oW(e,{maxRetries:t,delayInMs:n,backoffFactor:r,abortSignal:a},i=[]){try{return await e()}catch(u){if(isAbortError(u)||0===t)throw u;let s=getErrorMessage4(u),o=[...i,u],l=o.length;if(l>t)throw new or({message:`Failed after ${l} attempts. Last error: ${s}`,reason:"maxRetriesExceeded",errors:o});if(u instanceof Error&&APICallError2.isInstance(u)&&!0===u.isRetryable&&l<=t)return await delay(function({error:e,exponentialBackoffDelay:t}){let n;let r=e.responseHeaders;if(!r)return t;let a=r["retry-after-ms"];if(a){let e=parseFloat(a);Number.isNaN(e)||(n=e)}let i=r["retry-after"];if(i&&void 0===n){let e=parseFloat(i);n=Number.isNaN(e)?Date.parse(i)-Date.now():1e3*e}return null!=n&&!Number.isNaN(n)&&0<=n&&(n<6e4||n<t)?n:t}({error:u,exponentialBackoffDelay:n}),{abortSignal:a}),oW(e,{maxRetries:t,delayInMs:r*n,backoffFactor:r,abortSignal:a},o);if(1===l)throw u;throw new or({message:`Failed after ${l} attempts with non-retryable error: '${s}'`,reason:"errorNotRetryable",errors:o})}}function oH(){var e,t;return null!=(t=null==(e=null==globalThis?void 0:globalThis.performance)?void 0:e.now())?t:Date.now()}async function oJ({toolCall:e,tools:t,tracer:n,telemetry:r,messages:a,abortSignal:i,experimental_context:s,stepNumber:o,model:l,onPreliminaryToolResult:u,onToolCallStart:c,onToolCallFinish:d}){let{toolName:p,toolCallId:h,input:f}=e,m=null==t?void 0:t[p];if((null==m?void 0:m.execute)==null)return;let g={stepNumber:o,model:l,toolCall:e,messages:a,abortSignal:i,functionId:null==r?void 0:r.functionId,metadata:null==r?void 0:r.metadata,experimental_context:s};return oZ({name:"ai.toolCall",attributes:oU({telemetry:r,attributes:{...function({operationId:e,telemetry:t}){return{"operation.name":`${e}${(null==t?void 0:t.functionId)!=null?` ${t.functionId}`:""}`,"resource.name":null==t?void 0:t.functionId,"ai.operationId":e,"ai.telemetry.functionId":null==t?void 0:t.functionId}}({operationId:"ai.toolCall",telemetry:r}),"ai.toolCall.name":p,"ai.toolCall.id":h,"ai.toolCall.args":{output:()=>JSON.stringify(f)}}}),tracer:n,fn:async t=>{let n;await oi({event:g,callbacks:c});let o=oH();try{for await(let t of executeTool({execute:m.execute.bind(m),input:f,options:{toolCallId:h,messages:a,abortSignal:i,experimental_context:s}}))"preliminary"===t.type?null==u||u({...e,type:"tool-result",output:t.output,preliminary:!0}):n=t.output}catch(r){let n=oH()-o;return await oi({event:{...g,success:!1,error:r,durationMs:n},callbacks:d}),oq(t,r),{type:"tool-error",toolCallId:h,toolName:p,input:f,error:r,dynamic:"dynamic"===m.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}let l=oH()-o;await oi({event:{...g,success:!0,output:n,durationMs:l},callbacks:d});try{t.setAttributes(await oU({telemetry:r,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(n)}}}))}catch(e){}return{type:"tool-result",toolCallId:h,toolName:p,input:f,output:n,dynamic:"dynamic"===m.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}})}var oG=class{constructor({data:e,mediaType:t}){let n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return null==this.base64Data&&(this.base64Data=function(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return nw(t)}(this.uint8ArrayData)),this.base64Data}get uint8Array(){return null==this.uint8ArrayData&&(this.uint8ArrayData=function(e){let t=n_(e.replace(/-/g,"+").replace(/_/g,"/"));return Uint8Array.from(t,e=>e.codePointAt(0))}(this.base64Data)),this.uint8ArrayData}};async function oK(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await rp({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await rp({text:function(e){let t=["ROOT"],n=-1,r=null;function a(e,a,i){switch(e){case'"':n=a,t.pop(),t.push(i),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=a,r=a,t.pop(),t.push(i),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=a,t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"{":n=a,t.pop(),t.push(i),t.push("INSIDE_OBJECT_START");break;case"[":n=a,t.pop(),t.push(i),t.push("INSIDE_ARRAY_START")}}function i(e,r){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=r,t.pop()}}function s(e,r){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=r,t.pop()}}for(let o=0;o<e.length;o++){let l=e[o];switch(t[t.length-1]){case"ROOT":a(l,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===l&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":a(l,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":i(l,o);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":"]"===l?(n=o,t.pop()):(n=o,a(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":a(l,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{let a=e.substring(r,o+1);"false".startsWith(a)||"true".startsWith(a)||"null".startsWith(a)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?i(l,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o))}}}let o=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{let t=e.substring(r,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}return o}(e)})).success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"}}((e,t)=>{for(var n in t)sp(e,n,{get:t[n],enumerable:!0})})({},{array:()=>oQ,choice:()=>o0,json:()=>o1,object:()=>oX,text:()=>oY});var oY=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e}),createElementStreamTransform(){}}),oX=({schema:e,name:t,description:n})=>{let r=rl(e);return{name:"object",responseFormat:rh(r.jsonSchema).then(e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=n&&{description:n}})),async parseCompleteOutput({text:e},t){let n=await rp({text:e});if(!n.success)throw new sD({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=await rd({value:n.value,schema:r});if(!a.success)throw new sD({message:"No object generated: response did not match schema.",cause:a.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return a.value},async parsePartialOutput({text:e}){let t=await oK(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}},createElementStreamTransform(){}}},oQ=({element:e,name:t,description:n})=>{let r=rl(e);return{name:"array",responseFormat:rh(r.jsonSchema).then(e=>{let{$schema:r,...a}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}}),async parseCompleteOutput({text:e},t){let n=await rp({text:e});if(!n.success)throw new sD({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=n.value;if(null==a||"object"!=typeof a||!("elements"in a)||!Array.isArray(a.elements))throw new sD({message:"No object generated: response did not match schema.",cause:new ek({value:a,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(let n of a.elements){let a=await rd({value:n,schema:r});if(!a.success)throw new sD({message:"No object generated: response did not match schema.",cause:a.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return a.elements},async parsePartialOutput({text:e}){let t=await oK(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;let n="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,a=[];for(let e of n){let t=await rd({value:e,schema:r});t.success&&a.push(t.value)}return{partial:a}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(null!=t)for(;e<t.length;e++)n.enqueue(t[e])}})}}},o0=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}),async parseCompleteOutput({text:t},n){let r=await rp({text:t});if(!r.success)throw new sD({message:"No object generated: could not parse the response.",cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});let a=r.value;if(null==a||"object"!=typeof a||!("result"in a)||"string"!=typeof a.result||!e.includes(a.result))throw new sD({message:"No object generated: response did not match schema.",cause:new ek({value:a,cause:"response must be an object that contains a choice value."}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return a.result},async parsePartialOutput({text:t}){let n=await oK(t);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let t=n.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;let r=e.filter(e=>e.startsWith(t.result));if("successful-parse"===n.state)return r.includes(t.result)?{partial:t.result}:void 0;return 1===r.length?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),o1=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){let n=await rp({text:e});if(!n.success)throw new sD({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await oK(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}},createElementStreamTransform(){}});async function o2(e){let t=""===e.input.trim()?{success:!0,value:{}}:await safeParseJSON3({text:e.input});if(!1===t.success)throw new sS({toolName:e.toolName,toolInput:e.input,cause:t.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}}async function o4({toolCall:e,tools:t}){let n=e.toolName,r=t[n];if(null==r){if(e.providerExecuted&&e.dynamic)return await o2(e);throw new sV({toolName:e.toolName,availableTools:Object.keys(t)})}let a=asSchema3(r.inputSchema),i=""===e.input.trim()?await safeValidateTypes3({value:{},schema:a}):await safeParseJSON3({text:e.input,schema:a});if(!1===i.success)throw new sS({toolName:n,toolInput:e.input,cause:i.error});return"dynamic"===r.type?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,dynamic:!0,title:r.title}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:r.title}}nz({prefix:"aitxt",size:24});function o9(e,t){let n=new Headers(null!=e?e:{});for(let[e,r]of Object.entries(t))n.has(e)||n.set(e,r);return n}TransformStream;var o5=rs(()=>ru(iY([iG({type:i5("text-start"),id:ih(),providerMetadata:o_.optional()}),iG({type:i5("text-delta"),id:ih(),delta:ih(),providerMetadata:o_.optional()}),iG({type:i5("text-end"),id:ih(),providerMetadata:o_.optional()}),iG({type:i5("error"),errorText:ih()}),iG({type:i5("tool-input-start"),toolCallId:ih(),toolName:ih(),providerExecuted:iL().optional(),providerMetadata:o_.optional(),dynamic:iL().optional(),title:ih().optional()}),iG({type:i5("tool-input-delta"),toolCallId:ih(),inputTextDelta:ih()}),iG({type:i5("tool-input-available"),toolCallId:ih(),toolName:ih(),input:iq(),providerExecuted:iL().optional(),providerMetadata:o_.optional(),dynamic:iL().optional(),title:ih().optional()}),iG({type:i5("tool-input-error"),toolCallId:ih(),toolName:ih(),input:iq(),providerExecuted:iL().optional(),providerMetadata:o_.optional(),dynamic:iL().optional(),errorText:ih(),title:ih().optional()}),iG({type:i5("tool-approval-request"),approvalId:ih(),toolCallId:ih()}),iG({type:i5("tool-output-available"),toolCallId:ih(),output:iq(),providerExecuted:iL().optional(),dynamic:iL().optional(),preliminary:iL().optional()}),iG({type:i5("tool-output-error"),toolCallId:ih(),errorText:ih(),providerExecuted:iL().optional(),dynamic:iL().optional()}),iG({type:i5("tool-output-denied"),toolCallId:ih()}),iG({type:i5("reasoning-start"),id:ih(),providerMetadata:o_.optional()}),iG({type:i5("reasoning-delta"),id:ih(),delta:ih(),providerMetadata:o_.optional()}),iG({type:i5("reasoning-end"),id:ih(),providerMetadata:o_.optional()}),iG({type:i5("source-url"),sourceId:ih(),url:ih(),title:ih().optional(),providerMetadata:o_.optional()}),iG({type:i5("source-document"),sourceId:ih(),mediaType:ih(),title:ih(),filename:ih().optional(),providerMetadata:o_.optional()}),iG({type:i5("file"),url:ih(),mediaType:ih(),providerMetadata:o_.optional()}),iG({type:sc(e=>"string"==typeof e&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:ih().optional(),data:iq(),transient:iL().optional()}),iG({type:i5("start-step")}),iG({type:i5("finish-step")}),iG({type:i5("start"),messageId:ih().optional(),messageMetadata:iq().optional()}),iG({type:i5("finish"),finishReason:i4(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:iq().optional()}),iG({type:i5("abort"),reason:ih().optional()}),iG({type:i5("message-metadata"),messageMetadata:iq()})])));function o3(e){return e.type.startsWith("data-")}function o6(e){return"text"===e.type}function o8(e){return"file"===e.type}function o7(e){return"reasoning"===e.type}function le(e){return e.type.startsWith("tool-")}function lt(e){return"dynamic-tool"===e.type}function ln(e){return le(e)||lt(e)}function lr(e){return e.type.split("-").slice(1).join("-")}function la(e){return lt(e)?e.toolName:lr(e)}async function li({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}function ls(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}nz({prefix:"aitxt",size:24});var lo=rs(()=>ru(iW(iJ({id:ih(),role:i4(["system","user","assistant"]),metadata:iq().optional(),parts:iW(iY([iJ({type:i5("text"),text:ih(),state:i4(["streaming","done"]).optional(),providerMetadata:o_.optional()}),iJ({type:i5("reasoning"),text:ih(),state:i4(["streaming","done"]).optional(),providerMetadata:o_.optional()}),iJ({type:i5("source-url"),sourceId:ih(),url:ih(),title:ih().optional(),providerMetadata:o_.optional()}),iJ({type:i5("source-document"),sourceId:ih(),mediaType:ih(),title:ih(),filename:ih().optional(),providerMetadata:o_.optional()}),iJ({type:i5("file"),mediaType:ih(),filename:ih().optional(),url:ih(),providerMetadata:o_.optional()}),iJ({type:i5("step-start")}),iJ({type:ih().startsWith("data-"),id:ih().optional(),data:iq()}),iJ({type:i5("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i5("input-streaming"),input:iq().optional(),providerExecuted:iL().optional(),callProviderMetadata:o_.optional(),output:iV().optional(),errorText:iV().optional(),approval:iV().optional()}),iJ({type:i5("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i5("input-available"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iV().optional()}),iJ({type:i5("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i5("approval-requested"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:iV().optional(),reason:iV().optional()})}),iJ({type:i5("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i5("approval-responded"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:iL(),reason:ih().optional()})}),iJ({type:i5("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i5("output-available"),input:iq(),providerExecuted:iL().optional(),output:iq(),errorText:iV().optional(),callProviderMetadata:o_.optional(),preliminary:iL().optional(),approval:iJ({id:ih(),approved:i5(!0),reason:ih().optional()}).optional()}),iJ({type:i5("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i5("output-error"),input:iq(),rawInput:iq().optional(),providerExecuted:iL().optional(),output:iV().optional(),errorText:ih(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:i5(!0),reason:ih().optional()}).optional()}),iJ({type:i5("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i5("output-denied"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:i5(!1),reason:ih().optional()})}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i5("input-streaming"),providerExecuted:iL().optional(),callProviderMetadata:o_.optional(),input:iq().optional(),output:iV().optional(),errorText:iV().optional(),approval:iV().optional()}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i5("input-available"),providerExecuted:iL().optional(),input:iq(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iV().optional()}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i5("approval-requested"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:iV().optional(),reason:iV().optional()})}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i5("approval-responded"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:iL(),reason:ih().optional()})}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i5("output-available"),providerExecuted:iL().optional(),input:iq(),output:iq(),errorText:iV().optional(),callProviderMetadata:o_.optional(),preliminary:iL().optional(),approval:iJ({id:ih(),approved:i5(!0),reason:ih().optional()}).optional()}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i5("output-error"),providerExecuted:iL().optional(),input:iq(),rawInput:iq().optional(),output:iV().optional(),errorText:ih(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:i5(!0),reason:ih().optional()}).optional()}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i5("output-denied"),providerExecuted:iL().optional(),input:iq(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:i5(!1),reason:ih().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));async function ll({messages:e,metadataSchema:t,dataSchemas:n,tools:r}){try{if(null==e)return{success:!1,error:new sg({parameter:"messages",value:e,message:"messages parameter must be provided"})};let a=await validateTypes2({value:e,schema:lo});if(t)for(let[e,n]of a.entries())await validateTypes2({value:n.metadata,schema:t,context:{field:`messages[${e}].metadata`,entityId:n.id}});if(n||r)for(let[e,t]of a.entries())for(let[a,i]of t.parts.entries()){if(n&&i.type.startsWith("data-")){let t=i.type.slice(5),r=n[t];if(!r)return{success:!1,error:new TypeValidationError3({value:i.data,cause:`No data schema found for data part ${t}`,context:{field:`messages[${e}].parts[${a}].data`,entityName:t,entityId:i.id}})};await validateTypes2({value:i.data,schema:r,context:{field:`messages[${e}].parts[${a}].data`,entityName:t,entityId:i.id}})}if(r&&i.type.startsWith("tool-")){let t=i.type.slice(5),n=r[t];if(!n)return{success:!1,error:new TypeValidationError3({value:i.input,cause:`No tool schema found for tool part ${t}`,context:{field:`messages[${e}].parts[${a}].input`,entityName:t,entityId:i.toolCallId}})};("input-available"===i.state||"output-available"===i.state||"output-error"===i.state&&void 0!==i.input)&&await validateTypes2({value:i.input,schema:n.inputSchema,context:{field:`messages[${e}].parts[${a}].input`,entityName:t,entityId:i.toolCallId}}),"output-available"===i.state&&n.outputSchema&&await validateTypes2({value:i.output,schema:n.outputSchema,context:{field:`messages[${e}].parts[${a}].output`,entityName:t,entityId:i.toolCallId}})}}return{success:!0,data:a}}catch(e){return{success:!1,error:e}}}async function lu(e,t,n){let r=await safeParseJSON4({text:e});if(!r.success)throw new sD({message:"No object generated: could not parse the response.",cause:r.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});let a=await t.validateFinalResult(r.value,{text:e,response:n.response,usage:n.usage});if(!a.success)throw new sD({message:"No object generated: response did not match schema.",cause:a.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});return a.value}function lc(e){return({url:t,abortSignal:n})=>of({url:t,maxBytes:null==e?void 0:e.maxBytes,abortSignal:n})}nz({prefix:"aiobj",size:24});var ld=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}};nz({prefix:"aiobj",size:24}),lc();var lp=({model:e,middleware:{transformParams:t,wrapGenerate:n,wrapStream:r,overrideProvider:a,overrideModelId:i,overrideSupportedUrls:s},modelId:o,providerId:l})=>{var u,c,d;async function p({params:n,type:r}){return t?await t({params:n,type:r,model:e}):n}return{specificationVersion:"v3",provider:null!=(u=null!=l?l:null==a?void 0:a({model:e}))?u:e.provider,modelId:null!=(c=null!=o?o:null==i?void 0:i({model:e}))?c:e.modelId,supportedUrls:null!=(d=null==s?void 0:s({model:e}))?d:e.supportedUrls,async doGenerate(t){let r=await p({params:t,type:"generate"}),a=async()=>e.doGenerate(r),i=async()=>e.doStream(r);return n?n({doGenerate:a,doStream:i,params:r,model:e}):a()},async doStream(t){let n=await p({params:t,type:"stream"}),a=async()=>e.doGenerate(n),i=async()=>e.doStream(n);return r?r({doGenerate:a,doStream:i,params:n,model:e}):i()}}},lh=({model:e,middleware:{transformParams:t,wrapGenerate:n,overrideProvider:r,overrideModelId:a,overrideMaxImagesPerCall:i},modelId:s,providerId:o})=>{var l,u,c;async function d({params:n}){return t?await t({params:n,model:e}):n}let p=null!=(l=null==i?void 0:i({model:e}))?l:e.maxImagesPerCall,h=p instanceof Function?p.bind(e):p;return{specificationVersion:"v3",provider:null!=(u=null!=o?o:null==r?void 0:r({model:e}))?u:e.provider,modelId:null!=(c=null!=s?s:null==a?void 0:a({model:e}))?c:e.modelId,maxImagesPerCall:h,async doGenerate(t){let r=await d({params:t}),a=async()=>e.doGenerate(r);return n?n({doGenerate:a,params:r,model:e}):a()}}},lf="AI_NoSuchProviderError",lm=`vercel.ai.error.${lf}`;async function lg(e){if(null==e)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:"file",mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{var n;t(null==(n=e.target)?void 0:n.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}Z=Symbol.for(lm),lc();var ly=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:a,prepareSendMessagesRequest:i,prepareReconnectToStreamRequest:s}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=a,this.prepareSendMessagesRequest=i,this.prepareReconnectToStreamRequest=s}async sendMessages({abortSignal:e,...t}){var n,r,a,i,s;let o=await rh(this.body),l=await rh(this.headers),u=await rh(this.credentials),c={...nR(l),...nR(t.headers)},d=await (null==(n=this.prepareSendMessagesRequest)?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),p=null!=(r=null==d?void 0:d.api)?r:this.api,h=(null==d?void 0:d.headers)!==void 0?nR(d.headers):c,f=(null==d?void 0:d.body)!==void 0?d.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},m=null!=(a=null==d?void 0:d.credentials)?a:u,g=null!=(i=this.fetch)?i:globalThis.fetch,y=await g(p,{method:"POST",headers:nj({"Content-Type":"application/json",...h},`ai-sdk/${oh}`,nP()),body:JSON.stringify(f),credentials:m,signal:e});if(!y.ok)throw Error(null!=(s=await y.text())?s:"Failed to fetch the chat response.");if(!y.body)throw Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,n,r,a,i;let s=await rh(this.body),o=await rh(this.headers),l=await rh(this.credentials),u={...nR(o),...nR(e.headers)},c=await (null==(t=this.prepareReconnectToStreamRequest)?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...s,...e.body},headers:u,credentials:l,requestMetadata:e.metadata})),d=null!=(n=null==c?void 0:c.api)?n:`${this.api}/${e.chatId}/stream`,p=(null==c?void 0:c.headers)!==void 0?nR(c.headers):u,h=null!=(r=null==c?void 0:c.credentials)?r:l,f=null!=(a=this.fetch)?a:globalThis.fetch,m=await f(d,{method:"GET",headers:nj(p,`ai-sdk/${oh}`,nP()),credentials:h});if(204===m.status)return null;if(!m.ok)throw Error(null!=(i=await m.text())?i:"Failed to fetch the chat response.");if(!m.body)throw Error("The response body is empty.");return this.processResponseStream(m.body)}},lv=class extends ly{constructor(e={}){super(e)}processResponseStream(e){return(function({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new nk).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await rp({text:e,schema:t}))}}))})({stream:e,schema:o5}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},lb=class{constructor({generateId:e=nO,id:t=e(),transport:n=new lv,messageMetadataSchema:r,dataPartSchemas:a,state:i,onError:s,onToolCall:o,onFinish:l,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new ld,this.sendMessage=async(e,t)=>{var n,r,a,i;let s;if(null==e){await this.makeRequest({trigger:"submit-message",messageId:null==(n=this.lastMessage)?void 0:n.id,...t});return}if(s="text"in e||"files"in e?{parts:[...Array.isArray(e.files)?e.files:await lg(e.files),..."text"in e&&null!=e.text?[{type:"text",text:e.text}]:[]]}:e,null!=e.messageId){let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(-1===t)throw Error(`message with id ${e.messageId} not found`);if("user"!==this.state.messages[t].role)throw Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...s,id:e.messageId,role:null!=(r=s.role)?r:"user",metadata:e.metadata})}else this.state.pushMessage({...s,id:null!=(a=s.id)?a:this.generateId(),role:null!=(i=s.role)?i:"user",metadata:e.metadata});await this.makeRequest({trigger:"submit-message",messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{let n=null==e?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(-1===n)throw Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,"assistant"===this.messages[n].role?n:n+1),await this.makeRequest({trigger:"regenerate-message",messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:"resume-stream",...e})},this.clearError=()=>{"error"===this.status&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n})=>this.jobExecutor.run(async()=>{let r=this.state.messages,a=r[r.length-1],i=r=>ln(r)&&"approval-requested"===r.state&&r.approval.id===e?{...r,state:"approval-responded",approval:{id:e,approved:t,reason:n}}:r;this.state.replaceMessage(r.length-1,{...a,parts:a.parts.map(i)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(i)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id})})}),this.addToolOutput=async({state:e="output-available",tool:t,toolCallId:n,output:r,errorText:a})=>this.jobExecutor.run(async()=>{let t=this.state.messages,i=t[t.length-1],s=t=>ln(t)&&t.toolCallId===n?{...t,state:e,output:r,errorText:a}:t;this.state.replaceMessage(t.length-1,{...i,parts:i.parts.map(s)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e;("streaming"===this.status||"submitted"===this.status)&&(null==(e=this.activeResponse)?void 0:e.abortController)&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=a,this.state=i,this.onError=s,this.onToolCall=o,this.onFinish=l,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&"object"==typeof e&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:a}){var i,s,o;let l;if("resume-stream"===e)try{let e=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(null==e)return;l=e}catch(e){this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,p=!1;try{let i;let s={state:function({lastMessage:e,messageId:t}){return{message:(null==e?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};s.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=s,i="resume-stream"===e?l:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:s.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:a}),await li({stream:function({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:a,onToolCall:i,onData:s}){return e.pipeThrough(new TransformStream({async transform(e,o){await r(async({state:r,write:l})=>{var u,c,d,p;function h(e){let t=r.message.parts.filter(ln).find(t=>t.toolCallId===e);if(null==t)throw new sQ({chunkType:"tool-invocation",chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function f(e){var t;let n=r.message.parts.find(t=>le(t)&&t.toolCallId===e.toolCallId);null!=n?(n.state=e.state,n.input=e.input,n.output=e.output,n.errorText=e.errorText,n.rawInput=e.rawInput,n.preliminary=e.preliminary,void 0!==e.title&&(n.title=e.title),n.providerExecuted=null!=(t=e.providerExecuted)?t:n.providerExecuted,null!=e.providerMetadata&&(n.callProviderMetadata=e.providerMetadata)):r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,input:e.input,output:e.output,rawInput:e.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,preliminary:e.preliminary,...null!=e.providerMetadata?{callProviderMetadata:e.providerMetadata}:{}})}function m(e){var t,n;let a=r.message.parts.find(t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId);null!=a?(a.state=e.state,a.toolName=e.toolName,a.input=e.input,a.output=e.output,a.errorText=e.errorText,a.rawInput=null!=(t=e.rawInput)?t:a.rawInput,a.preliminary=e.preliminary,void 0!==e.title&&(a.title=e.title),a.providerExecuted=null!=(n=e.providerExecuted)?n:a.providerExecuted,null!=e.providerMetadata&&(a.callProviderMetadata=e.providerMetadata)):r.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:e.input,output:e.output,errorText:e.errorText,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:e.title,...null!=e.providerMetadata?{callProviderMetadata:e.providerMetadata}:{}})}async function g(e){if(null!=e){let n=null!=r.message.metadata?function e(t,n){if(void 0===t&&void 0===n)return;if(void 0===t)return n;if(void 0===n)return t;let r={...t};for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a)){let i=n[a];if(void 0===i)continue;let s=a in t?t[a]:void 0,o=null!==i&&"object"==typeof i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),l=null!=s&&"object"==typeof s&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);o&&l?r[a]=e(s,i):r[a]=i}return r}(r.message.metadata,e):e;null!=t&&await rc({value:n,schema:t,context:{field:"message.metadata",entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case"text-start":{let t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeTextParts[e.id]=t,r.message.parts.push(t),l();break}case"text-delta":{let t=r.activeTextParts[e.id];if(null==t)throw new sQ({chunkType:"text-delta",chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(u=e.providerMetadata)?u:t.providerMetadata,l();break}case"text-end":{let t=r.activeTextParts[e.id];if(null==t)throw new sQ({chunkType:"text-end",chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state="done",t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,delete r.activeTextParts[e.id],l();break}case"reasoning-start":{let t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),l();break}case"reasoning-delta":{let t=r.activeReasoningParts[e.id];if(null==t)throw new sQ({chunkType:"reasoning-delta",chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,l();break}case"reasoning-end":{let t=r.activeReasoningParts[e.id];if(null==t)throw new sQ({chunkType:"reasoning-end",chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=null!=(p=e.providerMetadata)?p:t.providerMetadata,t.state="done",delete r.activeReasoningParts[e.id],l();break}case"file":r.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}),l();break;case"source-url":r.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case"source-document":r.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case"tool-input-start":{let t=r.message.parts.filter(le);r.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title},e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,providerMetadata:e.providerMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,providerMetadata:e.providerMetadata}),l();break}case"tool-input-delta":{let t=r.partialToolCalls[e.toolCallId];if(null==t)throw new sQ({chunkType:"tool-input-delta",chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let{value:n}=await oK(t.text);t.dynamic?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}):f({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}),l();break}case"tool-input-available":e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}),l(),i&&!e.providerExecuted&&await i({toolCall:e});break;case"tool-input-error":{let t=r.message.parts.filter(ln).find(t=>t.toolCallId===e.toolCallId);(null!=t?"dynamic-tool"===t.type:e.dynamic)?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),l();break}case"tool-approval-request":{let t=h(e.toolCallId);t.state="approval-requested",t.approval={id:e.approvalId},l();break}case"tool-output-denied":h(e.toolCallId).state="output-denied",l();break;case"tool-output-available":{let t=h(e.toolCallId);"dynamic-tool"===t.type?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:t.title}):f({toolCallId:e.toolCallId,toolName:lr(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,title:t.title}),l();break}case"tool-output-error":{let t=h(e.toolCallId);"dynamic-tool"===t.type?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}):f({toolCallId:e.toolCallId,toolName:lr(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}),l();break}case"start-step":r.message.parts.push({type:"step-start"});break;case"finish-step":r.activeTextParts={},r.activeReasoningParts={};break;case"start":null!=e.messageId&&(r.message.id=e.messageId),await g(e.messageMetadata),(null!=e.messageId||null!=e.messageMetadata)&&l();break;case"finish":null!=e.finishReason&&(r.finishReason=e.finishReason),await g(e.messageMetadata),null!=e.messageMetadata&&l();break;case"message-metadata":await g(e.messageMetadata),null!=e.messageMetadata&&l();break;case"error":null==a||a(Error(e.errorText));break;default:if(e.type.startsWith("data-")){if((null==n?void 0:n[e.type])!=null){let t=r.message.parts.findIndex(t=>"id"in t&&"data"in t&&t.id===e.id&&t.type===e.type),a=t>=0?t:r.message.parts.length;await rc({value:e.data,schema:n[e.type],context:{field:`message.parts[${a}].data`,entityName:e.type,entityId:e.id}})}if(e.transient){null==s||s(e);break}let t=null!=e.id?r.message.parts.find(t=>e.type===t.type&&e.id===t.id):void 0;null!=t?t.data=e.data:r.message.parts.push(e),null==s||s(e),l()}}o.enqueue(e)})}}))}({stream:i,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:e=>this.jobExecutor.run(()=>e({state:s.state,write:()=>{var e;this.setStatus({status:"streaming"}),s.state.message.id===(null==(e=this.lastMessage)?void 0:e.id)?this.state.replaceMessage(this.state.messages.length-1,s.state.message):this.state.pushMessage(s.state.message)}})),onError:e=>{throw e}}),onError:e=>{throw e}}),this.setStatus({status:"ready"})}catch(e){if(c||"AbortError"===e.name)return c=!0,this.setStatus({status:"ready"}),null;p=!0,e instanceof TypeError&&(e.message.toLowerCase().includes("fetch")||e.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e})}finally{try{null==(s=this.onFinish)||s.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:p,finishReason:null==(i=this.activeResponse)?void 0:i.state.finishReason})}catch(e){console.error(e)}this.activeResponse=void 0}!p&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:null==(o=this.lastMessage)?void 0:o.id,metadata:t,headers:n,body:r})}},lx=n(5987),lk=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},lw=(e,t,n)=>(lk(e,t,"read from private field"),n?n.call(e):t.get(e)),l_=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},lS=(e,t,n,r)=>(lk(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),lI=class{constructor(e=[]){l_(this,q,void 0),l_(this,U,"ready"),l_(this,V,void 0),l_(this,B,new Set),l_(this,W,new Set),l_(this,H,new Set),this.pushMessage=e=>{lS(this,q,lw(this,q).concat(e)),lw(this,J).call(this)},this.popMessage=()=>{lS(this,q,lw(this,q).slice(0,-1)),lw(this,J).call(this)},this.replaceMessage=(e,t)=>{lS(this,q,[...lw(this,q).slice(0,e),this.snapshot(t),...lw(this,q).slice(e+1)]),lw(this,J).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,t)=>{let n=t?function(e,t){return null!=t?lx(e,t):e}(e,t):e;return lw(this,B).add(n),()=>{lw(this,B).delete(n)}},this["~registerStatusCallback"]=e=>(lw(this,W).add(e),()=>{lw(this,W).delete(e)}),this["~registerErrorCallback"]=e=>(lw(this,H).add(e),()=>{lw(this,H).delete(e)}),l_(this,J,()=>{lw(this,B).forEach(e=>e())}),l_(this,G,()=>{lw(this,W).forEach(e=>e())}),l_(this,K,()=>{lw(this,H).forEach(e=>e())}),lS(this,q,e)}get status(){return lw(this,U)}set status(e){lS(this,U,e),lw(this,G).call(this)}get error(){return lw(this,V)}set error(e){lS(this,V,e),lw(this,K).call(this)}get messages(){return lw(this,q)}set messages(e){lS(this,q,[...e]),lw(this,J).call(this)}};q=new WeakMap,U=new WeakMap,V=new WeakMap,B=new WeakMap,W=new WeakMap,H=new WeakMap,J=new WeakMap,G=new WeakMap,K=new WeakMap;var lE=class extends lb{constructor({messages:e,...t}){let n=new lI(e);super({...t,state:n}),l_(this,Y,void 0),this["~registerMessagesCallback"]=(e,t)=>lw(this,Y)["~registerMessagesCallback"](e,t),this["~registerStatusCallback"]=e=>lw(this,Y)["~registerStatusCallback"](e),this["~registerErrorCallback"]=e=>lw(this,Y)["~registerErrorCallback"](e),lS(this,Y,n)}};Y=new WeakMap;let lT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lA={};function lN(e,t){return((t||lA).jsx?lC:lT).test(e)}let lz=/[ \t\n\f\r]/g;function lO(e){return""===e.replace(lz,"")}class lP{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function lR(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new lP(n,r,t)}function lj(e){return e.toLowerCase()}lP.prototype.normal={},lP.prototype.property={},lP.prototype.space=void 0;class lD{constructor(e,t){this.attribute=t,this.property=e}}lD.prototype.attribute="",lD.prototype.booleanish=!1,lD.prototype.boolean=!1,lD.prototype.commaOrSpaceSeparated=!1,lD.prototype.commaSeparated=!1,lD.prototype.defined=!1,lD.prototype.mustUseProperty=!1,lD.prototype.number=!1,lD.prototype.overloadedBoolean=!1,lD.prototype.property="",lD.prototype.spaceSeparated=!1,lD.prototype.space=void 0;let lM=0,l$=lB(),lL=lB(),lF=lB(),lZ=lB(),lq=lB(),lU=lB(),lV=lB();function lB(){return 2**++lM}let lW=Object.keys(X);class lH extends lD{constructor(e,t,n,r){let a=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++a<lW.length;){let e=lW[a];(function(e,t,n){n&&(e[t]=n)})(this,lW[a],(n&X[e])===X[e])}}}function lJ(e){let t={},n={};for(let[r,a]of Object.entries(e.properties)){let i=new lH(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[lj(r)]=r,n[lj(i.attribute)]=r}return new lP(t,n,e.space)}lH.prototype.defined=!0;let lG=lJ({properties:{ariaActiveDescendant:null,ariaAtomic:lL,ariaAutoComplete:null,ariaBusy:lL,ariaChecked:lL,ariaColCount:lZ,ariaColIndex:lZ,ariaColSpan:lZ,ariaControls:lq,ariaCurrent:null,ariaDescribedBy:lq,ariaDetails:null,ariaDisabled:lL,ariaDropEffect:lq,ariaErrorMessage:null,ariaExpanded:lL,ariaFlowTo:lq,ariaGrabbed:lL,ariaHasPopup:null,ariaHidden:lL,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lq,ariaLevel:lZ,ariaLive:null,ariaModal:lL,ariaMultiLine:lL,ariaMultiSelectable:lL,ariaOrientation:null,ariaOwns:lq,ariaPlaceholder:null,ariaPosInSet:lZ,ariaPressed:lL,ariaReadOnly:lL,ariaRelevant:null,ariaRequired:lL,ariaRoleDescription:lq,ariaRowCount:lZ,ariaRowIndex:lZ,ariaRowSpan:lZ,ariaSelected:lL,ariaSetSize:lZ,ariaSort:null,ariaValueMax:lZ,ariaValueMin:lZ,ariaValueNow:lZ,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function lK(e,t){return t in e?e[t]:t}function lY(e,t){return lK(e,t.toLowerCase())}let lX=lJ({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:lU,acceptCharset:lq,accessKey:lq,action:null,allow:null,allowFullScreen:l$,allowPaymentRequest:l$,allowUserMedia:l$,alt:null,as:null,async:l$,autoCapitalize:null,autoComplete:lq,autoFocus:l$,autoPlay:l$,blocking:lq,capture:null,charSet:null,checked:l$,cite:null,className:lq,cols:lZ,colSpan:null,content:null,contentEditable:lL,controls:l$,controlsList:lq,coords:lZ|lU,crossOrigin:null,data:null,dateTime:null,decoding:null,default:l$,defer:l$,dir:null,dirName:null,disabled:l$,download:lF,draggable:lL,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:l$,formTarget:null,headers:lq,height:lZ,hidden:lF,high:lZ,href:null,hrefLang:null,htmlFor:lq,httpEquiv:lq,id:null,imageSizes:null,imageSrcSet:null,inert:l$,inputMode:null,integrity:null,is:null,isMap:l$,itemId:null,itemProp:lq,itemRef:lq,itemScope:l$,itemType:lq,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:l$,low:lZ,manifest:null,max:null,maxLength:lZ,media:null,method:null,min:null,minLength:lZ,multiple:l$,muted:l$,name:null,nonce:null,noModule:l$,noValidate:l$,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:l$,optimum:lZ,pattern:null,ping:lq,placeholder:null,playsInline:l$,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:l$,referrerPolicy:null,rel:lq,required:l$,reversed:l$,rows:lZ,rowSpan:lZ,sandbox:lq,scope:null,scoped:l$,seamless:l$,selected:l$,shadowRootClonable:l$,shadowRootDelegatesFocus:l$,shadowRootMode:null,shape:null,size:lZ,sizes:null,slot:null,span:lZ,spellCheck:lL,src:null,srcDoc:null,srcLang:null,srcSet:null,start:lZ,step:null,style:null,tabIndex:lZ,target:null,title:null,translate:null,type:null,typeMustMatch:l$,useMap:null,value:lL,width:lZ,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lq,axis:null,background:null,bgColor:null,border:lZ,borderColor:null,bottomMargin:lZ,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:l$,declare:l$,event:null,face:null,frame:null,frameBorder:null,hSpace:lZ,leftMargin:lZ,link:null,longDesc:null,lowSrc:null,marginHeight:lZ,marginWidth:lZ,noResize:l$,noHref:l$,noShade:l$,noWrap:l$,object:null,profile:null,prompt:null,rev:null,rightMargin:lZ,rules:null,scheme:null,scrolling:lL,standby:null,summary:null,text:null,topMargin:lZ,valueType:null,version:null,vAlign:null,vLink:null,vSpace:lZ,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:l$,disableRemotePlayback:l$,prefix:null,property:null,results:lZ,security:null,unselectable:null},space:"html",transform:lY}),lQ=lJ({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"},properties:{about:lV,accentHeight:lZ,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:lZ,amplitude:lZ,arabicForm:null,ascent:lZ,attributeName:null,attributeType:null,azimuth:lZ,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:lZ,by:null,calcMode:null,capHeight:lZ,className:lq,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:lZ,diffuseConstant:lZ,direction:null,display:null,dur:null,divisor:lZ,dominantBaseline:null,download:l$,dx:null,dy:null,edgeMode:null,editable:null,elevation:lZ,enableBackground:null,end:null,event:null,exponent:lZ,externalResourcesRequired:null,fill:null,fillOpacity:lZ,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:lU,g2:lU,glyphName:lU,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:lZ,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:lZ,horizOriginX:lZ,horizOriginY:lZ,id:null,ideographic:lZ,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:lZ,k:lZ,k1:lZ,k2:lZ,k3:lZ,k4:lZ,kernelMatrix:lV,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:lZ,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:lZ,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:lZ,overlineThickness:lZ,paintOrder:null,panose1:null,path:null,pathLength:lZ,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lq,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:lZ,pointsAtY:lZ,pointsAtZ:lZ,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lV,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lV,rev:lV,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lV,requiredFeatures:lV,requiredFonts:lV,requiredFormats:lV,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:lZ,specularExponent:lZ,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:lZ,strikethroughThickness:lZ,string:null,stroke:null,strokeDashArray:lV,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:lZ,strokeOpacity:lZ,strokeWidth:null,style:null,surfaceScale:lZ,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:lV,tabIndex:lZ,tableValues:null,target:null,targetX:lZ,targetY:lZ,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:lV,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:lZ,underlineThickness:lZ,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:lZ,values:null,vAlphabetic:lZ,vMathematical:lZ,vectorEffect:null,vHanging:lZ,vIdeographic:lZ,version:null,vertAdvY:lZ,vertOriginX:lZ,vertOriginY:lZ,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:lZ,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lK}),l0=lJ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),l1=lJ({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:lY}),l2=lJ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),l4=lR([lG,lX,l0,l1,l2],"html"),l9=lR([lG,lQ,l0,l1,l2],"svg"),l5=/[A-Z]/g,l3=/-[a-z]/g,l6=/^data[-\w.:]+$/i;function l8(e){return"-"+e.toLowerCase()}function l7(e){return e.charAt(1).toUpperCase()}let ue={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 ut=n(393);let un=ua("end"),ur=ua("start");function ua(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 ui(e){return e&&"object"==typeof e?"position"in e||"type"in e?uo(e.position):"start"in e||"end"in e?uo(e):"line"in e||"column"in e?us(e):"":""}function us(e){return ul(e&&e.line)+":"+ul(e&&e.column)}function uo(e){return us(e&&e.start)+"-"+us(e&&e.end)}function ul(e){return e&&"number"==typeof e?e:1}class uu extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",a={},i=!1;if(t&&(a="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:!a.cause&&e&&(i=!0,r=e.message,a.cause=e),!a.ruleId&&!a.source&&"string"==typeof n){let e=n.indexOf(":");-1===e?a.ruleId=n:(a.source=n.slice(0,e),a.ruleId=n.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=ui(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&"string"==typeof a.cause.stack?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}uu.prototype.file="",uu.prototype.name="",uu.prototype.reason="",uu.prototype.message="",uu.prototype.stack="",uu.prototype.column=void 0,uu.prototype.line=void 0,uu.prototype.ancestors=void 0,uu.prototype.cause=void 0,uu.prototype.fatal=void 0,uu.prototype.place=void 0,uu.prototype.ruleId=void 0,uu.prototype.source=void 0;let uc={}.hasOwnProperty,ud=new Map,up=/[A-Z]/g,uh=new Set(["table","tbody","thead","tfoot","tr"]),uf=new Set(["td","th"]),um="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ug(e,t,n){return"element"===t.type?function(e,t,n){let r=e.schema,a=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(a=l9,e.schema=a),e.ancestors.push(t);let i=ux(e,t.tagName,!1),s=function(e,t){let n,r;let a={};for(r in t.properties)if("children"!==r&&uc.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=lj(t),r=t,a=lD;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&l6.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(l3,l7);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!l3.test(e)){let n=e.replace(l5,l8);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}a=lH}return new a(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){try{return ut(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new uu("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=um+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t;let n={};for(t in e)uc.call(e,t)&&(n[function(e){let t=e.replace(up,uw);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?ue[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,s]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&uf.has(t.tagName)?n=s:a[r]=s}}return n&&((a.style||(a.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),a}(e,t),o=ub(e,t);return uh.has(t.tagName)&&(o=o.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&lO(e.value):lO(e))})),uy(e,s,i,t),uv(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,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 n.type,e.evaluater.evaluateExpression(n.expression)}uk(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){let r=e.schema,a=r;"svg"===t.name&&"html"===r.space&&(a=l9,e.schema=a),e.ancestors.push(t);let i=null===t.name?e.Fragment:ux(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];t.type;let a=t.expression;a.type;let i=a.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else uk(e,t.position)}else{let a;let i=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];t.type,a=e.evaluater.evaluateExpression(t.expression)}else uk(e,t.position)}else a=null===r.value||r.value;n[i]=a}return n}(e,t),o=ub(e,t);return uy(e,s,i,t),uv(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,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);uk(e,t.position)}(e,t):"root"===t.type?function(e,t,n){let r={};return uv(r,ub(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?t.value:void 0}function uy(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function uv(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ub(e,t){let n=[],r=-1,a=e.passKeys?new Map:ud;for(;++r<t.children.length;){let i;let s=t.children[r];if(e.passKeys){let e="element"===s.type?s.tagName:"mdxJsxFlowElement"===s.type||"mdxJsxTextElement"===s.type?s.name:void 0;if(e){let t=a.get(e)||0;i=e+"-"+t,a.set(e,t+1)}}let o=ug(e,s,i);void 0!==o&&n.push(o)}return n}function ux(e,t,n){let r;if(n){if(t.includes(".")){let e;let n=t.split("."),a=-1;for(;++a<n.length;){let t=lN(n[a])?{type:"Identifier",name:n[a]}:{type:"Literal",value:n[a]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(a&&"Literal"===t.type),optional:!1}:t}r=e}else r=lN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t}}else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return uc.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);uk(e)}function uk(e,t){let n=new uu("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=um+"#cannot-handle-mdx-estrees-without-createevaluater",n}function uw(e){return"-"+e.toLowerCase()}let u_={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},uS={};function uI(e,t){let n=t||uS;return uE(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function uE(e,t,n){if(e&&"object"==typeof e){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return uT(e.children,t,n)}return Array.isArray(e)?uT(e,t,n):""}function uT(e,t,n){let r=[],a=-1;for(;++a<e.length;)r[a]=uE(e[a],t,n);return r.join("")}function uC(e,t,n,r){let a;let i=e.length,s=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(a=Array.from(r)).unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)(a=r.slice(s,s+1e4)).unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function uA(e,t){return e.length>0?(uC(e,e.length,0,t),e):t}class uN{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=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 e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.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&&uz(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),uz(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),uz(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(e<this.left.length){let t=this.left.splice(e,Number.POSITIVE_INFINITY);uz(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);uz(this.left,t.reverse())}}}}function uz(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uO(e){let t,n,r,a,i,s,o;let l={},u=-1,c=new uN(e);for(;++u<c.length;){for(;(u in l);)u=l[u];if(t=c.get(u),u&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&((r=0)<(s=t[1]._tokenizer.events).length&&"lineEndingBlank"===s[r][1].type&&(r+=2),r<s.length&&"content"===s[r][1].type))for(;++r<s.length&&"content"!==s[r][1].type;)"chunkText"===s[r][1].type&&(s[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(l,function(e,t){let n,r;let a=e.get(t)[1],i=e.get(t)[2],s=t-1,o=[],l=a._tokenizer;!l&&(l=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));let u=l.events,c=[],d={},p=-1,h=a,f=0,m=0,g=[0];for(;h;){for(;e.get(++s)[1]!==h;);o.push(s),!h._tokenizer&&(n=i.sliceStream(h),h.next||n.push(null),r&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(n),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),r=h,h=h.next}for(h=a;++p<u.length;)"exit"===u[p][0]&&"enter"===u[p-1][0]&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(m=p+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),p=g.length;p--;){let t=u.slice(g[p],g[p+1]),n=o.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),p=-1;++p<c.length;)d[f+c[p][0]]=f+c[p][1],f+=c[p][1]-c[p][0]-1;return d}(c,u)),u=l[u],o=!0);else if(t[1]._container){for(r=u,n=void 0;r--;)if("lineEnding"===(a=c.get(r))[1].type||"lineEndingBlank"===a[1].type)"enter"===a[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),a[1].type="lineEnding",n=r);else if("linePrefix"===a[1].type||"listItemIndent"===a[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(i=c.slice(n,u)).unshift(t),c.splice(n,u-n+1,i))}}return uC(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!o}let uP={}.hasOwnProperty;function uR(e){let t={},n=-1;for(;++n<e.length;)(function(e,t){let n;for(n in t){let r;let a=(uP.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];if(i)for(r in i){uP.call(a,r)||(a[r]=[]);let e=i[r];(function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);uC(e,0,0,r)})(a[r],Array.isArray(e)?e:e?[e]:[])}}})(t,e[n]);return t}let uj=uH(/[A-Za-z]/),uD=uH(/[\dA-Za-z]/),uM=uH(/[#-'*+\--9=?A-Z^-~]/);function u$(e){return null!==e&&(e<32||127===e)}let uL=uH(/\d/),uF=uH(/[\dA-Fa-f]/),uZ=uH(/[!-/:-@[-`{-~]/);function uq(e){return null!==e&&e<-2}function uU(e){return null!==e&&(e<0||32===e)}function uV(e){return -2===e||-1===e||32===e}let uB=uH(/\p{P}|\p{S}/u),uW=uH(/\s/);function uH(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function uJ(e,t,n,r){let a=r?r-1:Number.POSITIVE_INFINITY,i=0;return function(r){return uV(r)?(e.enter(n),function r(s){return uV(s)&&i++<a?(e.consume(s),r):(e.exit(n),t(s))}(r)):t(r)}}let uG={tokenize:function(e){let t;let n=e.attempt(this.parser.constructs.contentInitial,function(t){if(null===t){e.consume(t);return}return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),uJ(e,n,"linePrefix")},function(n){return e.enter("paragraph"),function n(r){let a=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=a),t=a,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return uq(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},uK={tokenize:function(e){let t,n,r;let a=this,i=[],s=0;return o;function o(t){if(s<i.length){let n=i[s];return a.containerState=n[1],e.attempt(n[0].continuation,l,u)(t)}return u(t)}function l(e){if(s++,a.containerState._closeFlow){let n;a.containerState._closeFlow=void 0,t&&y();let r=a.events.length,i=r;for(;i--;)if("exit"===a.events[i][0]&&"chunkFlow"===a.events[i][1].type){n=a.events[i][1].end;break}g(s);let o=r;for(;o<a.events.length;)a.events[o][1].end={...n},o++;return uC(a.events,i+1,0,a.events.slice(r)),a.events.length=o,u(e)}return o(e)}function u(n){if(s===i.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);a.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return a.containerState={},e.check(uY,c,d)(n)}function c(e){return t&&y(),g(s),p(e)}function d(e){return a.parser.lazy[a.now().line]=s!==i.length,r=a.now().offset,f(e)}function p(t){return a.containerState={},e.attempt(uY,h,f)(t)}function h(e){return s++,i.push([a.currentConstruct,a.containerState]),p(e)}function f(r){if(null===r){t&&y(),g(0),e.consume(r);return}return t=t||a.parser.flow(a.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return uq(n)?(e.consume(n),m(e.exit("chunkFlow")),s=0,a.interrupt=void 0,o):(e.consume(n),t)}(r)}function m(e,i){let o=a.sliceStream(e);if(i&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),a.parser.lazy[e.start.line]){let e,n,i=t.events.length;for(;i--;)if(t.events[i][1].start.offset<r&&(!t.events[i][1].end||t.events[i][1].end.offset>r))return;let o=a.events.length,l=o;for(;l--;)if("exit"===a.events[l][0]&&"chunkFlow"===a.events[l][1].type){if(e){n=a.events[l][1].end;break}e=!0}for(g(s),i=o;i<a.events.length;)a.events[i][1].end={...n},i++;uC(a.events,l+1,0,a.events.slice(o)),a.events.length=i}}function g(t){let n=i.length;for(;n-- >t;){let t=i[n];a.containerState=t[1],t[0].exit.call(a,e)}i.length=t}function y(){t.write([null]),n=void 0,t=void 0,a.containerState._closeFlow=void 0}}},uY={tokenize:function(e,t,n){return uJ(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},uX={partial:!0,tokenize:function(e,t,n){return function(t){return uV(t)?uJ(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||uq(e)?t(e):n(e)}}},uQ={resolve:function(e){return uO(e),e},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?a(t):uq(t)?e.check(u0,i,a)(t):(e.consume(t),r)}function a(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},u0={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),uJ(e,a,"linePrefix")};function a(a){if(null===a||uq(a))return n(a);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}},u1={tokenize:function(e){let t=this,n=e.attempt(uX,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,uJ(e,e.attempt(this.parser.constructs.flow,r,e.attempt(uQ,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}}},u2={resolveAll:u3()},u4=u5("string"),u9=u5("text");function u5(e){return{resolveAll:u3("text"===e?u6:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],a=t.attempt(r,i,s);return i;function i(e){return l(e)?a(e):s(e)}function s(e){if(null===e){t.consume(e);return}return t.enter("data"),t.consume(e),o}function o(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),o)}function l(e){if(null===e)return!0;let t=r[e],a=-1;if(t)for(;++a<t.length;){let e=t[a];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function u3(e){return function(t,n){let r,a=-1;for(;++a<=t.length;)void 0===r?t[a]&&"data"===t[a][1].type&&(r=a,a++):t[a]&&"data"===t[a][1].type||(a!==r+2&&(t[r][1].end=t[a-1][1].end,t.splice(r+2,a-r-2),a=r+2),r=void 0);return e?e(t,n):t}}function u6(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r;let a=e[n-1][1],i=t.sliceStream(a),s=i.length,o=-1,l=0;for(;s--;){let e=i[s];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)l++,o--;if(o)break;o=-1}else if(-2===e)r=!0,l++;else if(-1===e);else{s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){let i={type:n===e.length||r||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:a.start._bufferIndex+o,_index:a.start._index+s,line:a.end.line,column:a.end.column-l,offset:a.end.offset-l},end:{...a.end}};a.end={...i.start},a.start.offset===a.end.offset?Object.assign(a,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}let u8={name:"thematicBreak",tokenize:function(e,t,n){let r,a=0;return function(i){return e.enter("thematicBreak"),r=i,function i(s){return s===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),a++,t):(e.exit("thematicBreakSequence"),uV(n)?uJ(e,i,"whitespace")(n):i(n))}(s)):a>=3&&(null===s||uq(s))?(e.exit("thematicBreak"),t(s)):n(s)}(i)}}},u7={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(uX,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,uJ(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!uV(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ct,t,a)(n))});function a(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,uJ(e,e.attempt(u7,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,a=r.events[r.events.length-1],i=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,s=0;return function(t){let a=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!r.containerState.marker||t===r.containerState.marker:uL(t)){if(r.containerState.type||(r.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(u8,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(a){return uL(a)&&++s<10?(e.consume(a),t):(!r.interrupt||s<2)&&(r.containerState.marker?a===r.containerState.marker:41===a||46===a)?(e.exit("listItemValue"),o(a)):n(a)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(uX,r.interrupt?n:l,e.attempt(ce,c,u))}function l(e){return r.containerState.initialBlankLine=!0,i++,c(e)}function u(t){return uV(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},ce={partial:!0,tokenize:function(e,t,n){let r=this;return uJ(e,function(e){let a=r.events[r.events.length-1];return!uV(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},ct={partial:!0,tokenize:function(e,t,n){let r=this;return uJ(e,function(e){let a=r.events[r.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},cn={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return uV(t)?uJ(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(r){return e.attempt(cn,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},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"),a}return n(t)};function a(n){return uV(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function cr(e,t,n,r,a,i,s,o,l){let u=l||Number.POSITIVE_INFINITY,c=0;return function(t){return 60===t?(e.enter(r),e.enter(a),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||u$(t)?n(t):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(o),d(t)):null===t||60===t||uq(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(a){return!c&&(null===a||41===a||uU(a))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(a)):c<u&&40===a?(e.consume(a),c++,f):41===a?(e.consume(a),c--,f):null===a||32===a||40===a||u$(a)?n(a):(e.consume(a),92===a?m:f)}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function ca(e,t,n,r,a,i){let s;let o=this,l=0;return function(t){return e.enter(r),e.enter(a),e.consume(t),e.exit(a),e.enter(i),u};function u(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(d):93===d?(e.exit(i),e.enter(a),e.consume(d),e.exit(a),e.exit(r),t):uq(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||uq(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),s||(s=!uV(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function ci(e,t,n,r,a,i){let s;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(a),e.consume(t),e.exit(a),s=40===t?41:t,o):n(t)};function o(n){return n===s?(e.enter(a),e.consume(n),e.exit(a),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===s?(e.exit(i),o(s)):null===t?n(t):uq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),uJ(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===s||null===t||uq(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return t===s||92===t?(e.consume(t),u):u(t)}}function cs(e,t){let n;return function r(a){return uq(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):uV(a)?uJ(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}function co(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let cl={partial:!0,tokenize:function(e,t,n){return function(t){return uU(t)?cs(e,r)(t):n(t)};function r(t){return ci(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return uV(t)?uJ(e,i,"whitespace")(t):i(t)}function i(e){return null===e||uq(e)?t(e):n(e)}}},cu={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),uJ(e,a,"linePrefix",5)(t)};function a(t){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?function t(n){return null===n?i(n):uq(n)?e.attempt(cc,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||uq(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},cc={partial:!0,tokenize:function(e,t,n){let r=this;return a;function a(t){return r.parser.lazy[r.now().line]?n(t):uq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):uJ(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):uq(e)?a(e):n(e)}}},cd={name:"setextUnderline",resolveTo:function(e,t){let n,r,a,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),a||"definition"!==e[i][1].type||(a=i);let s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",a?(e.splice(r,0,["enter",s,t]),e.splice(a+1,0,["exit",e[n][1],t]),e[n][1].end={...e[a][1].end}):e[n][1]=s,e.push(["exit",s,t]),e},tokenize:function(e,t,n){let r;let a=this;return function(t){let s,o=a.events.length;for(;o--;)if("lineEnding"!==a.events[o][1].type&&"linePrefix"!==a.events[o][1].type&&"content"!==a.events[o][1].type){s="paragraph"===a.events[o][1].type;break}return!a.parser.lazy[a.now().line]&&(a.interrupt||s)?(e.enter("setextHeadingLine"),r=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),uV(n)?uJ(e,i,"lineSuffix")(n):i(n))}(t)):n(t)};function i(r){return null===r||uq(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}},cp=["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"],ch=["pre","script","style","textarea"],cf={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(uX,t,n)}}},cm={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return uq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):n(t)};function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},cg={partial:!0,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"),a)};function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},cy={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r;let a=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),uV(t)?uJ(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(a){return a===r?(i++,e.consume(a),t):i>=o?(e.exit("codeFencedFenceSequence"),uV(a)?uJ(e,u,"whitespace")(a):u(a)):n(a)}(t)):n(t)}function u(r){return null===r||uq(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},s=0,o=0;return function(t){return function(t){let i=a.events[a.events.length-1];return s=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,r=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(a){return a===r?(o++,e.consume(a),t):o<3?n(a):(e.exit("codeFencedFenceSequence"),uV(a)?uJ(e,l,"whitespace")(a):l(a))}(t)}(t)};function l(i){return null===i||uq(i)?(e.exit("codeFencedFence"),a.interrupt?t(i):e.check(cg,c,f)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||uq(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(a)):uV(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),uJ(e,u,"whitespace")(a)):96===a&&a===r?n(a):(e.consume(a),t)}(i))}function u(t){return null===t||uq(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||uq(a)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(a)):96===a&&a===r?n(a):(e.consume(a),t)}(t))}function c(t){return e.attempt(i,f,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return s>0&&uV(t)?uJ(e,h,"linePrefix",s+1)(t):h(t)}function h(t){return null===t||uq(t)?e.check(cg,c,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||uq(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},cv={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"Ă",Acirc:"\xc2",Acy:"А",Afr:"\uD835\uDD04",Agrave:"\xc0",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"\uD835\uDD38",ApplyFunction:"",Aring:"\xc5",Ascr:"\uD835\uDC9C",Assign:"≔",Atilde:"\xc3",Auml:"\xc4",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"\xa9",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"\xc7",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"\uD835\uDC9E",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"\uD835\uDD3B",Dot:"\xa8",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"\uD835\uDC9F",Dstrok:"Đ",ENG:"Ŋ",ETH:"\xd0",Eacute:"\xc9",Ecaron:"Ě",Ecirc:"\xca",Ecy:"Э",Edot:"Ė",Efr:"\uD835\uDD08",Egrave:"\xc8",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"\uD835\uDD3C",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"\xcb",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"\uD835\uDD09",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"\uD835\uDD3D",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"\uD835\uDD0A",Gg:"⋙",Gopf:"\uD835\uDD3E",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"\xcd",Icirc:"\xce",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"\xcc",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"",InvisibleTimes:"",Iogon:"Į",Iopf:"\uD835\uDD40",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"\xcf",Jcirc:"Ĵ",Jcy:"Й",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"\uD835\uDD0F",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"\uD835\uDD43",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",MinusPlus:"∓",Mopf:"\uD835\uDD44",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"\uD835\uDD11",NoBreak:"",NonBreakingSpace:"\xa0",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"\uD835\uDCA9",Ntilde:"\xd1",Nu:"Ν",OElig:"Œ",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"О",Odblac:"Ő",Ofr:"\uD835\uDD12",Ograve:"\xd2",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"\uD835\uDCAA",Oslash:"\xd8",Otilde:"\xd5",Otimes:"⨷",Ouml:"\xd6",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"\uD835\uDD13",Phi:"Φ",Pi:"Π",PlusMinus:"\xb1",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"\uD835\uDCAB",Psi:"Ψ",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"ℚ",Qscr:"\uD835\uDCAC",RBarr:"⤐",REG:"\xae",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"\uD835\uDD16",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"\uD835\uDD4A",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"\uD835\uDCAE",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"\xde",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"\uD835\uDD17",Therefore:"∴",Theta:"Θ",ThickSpace:" ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"\uD835\uDD4B",TripleDot:"⃛",Tscr:"\uD835\uDCAF",Tstrok:"Ŧ",Uacute:"\xda",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"\xdb",Ucy:"У",Udblac:"Ű",Ufr:"\uD835\uDD18",Ugrave:"\xd9",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"\uD835\uDD4C",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"\uD835\uDCB0",Utilde:"Ũ",Uuml:"\xdc",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"Ξ",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"\xdd",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"\uD835\uDCB5",aacute:"\xe1",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"\xe2",acute:"\xb4",acy:"а",aelig:"\xe6",af:"",afr:"\uD835\uDD1E",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",aogon:"ą",aopf:"\uD835\uDD52",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"\xe5",ascr:"\uD835\uDCB6",ast:"*",asymp:"≈",asympeq:"≍",atilde:"\xe3",auml:"\xe4",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"\xa6",bscr:"\uD835\uDCB7",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"\xe7",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"\xb8",cemptyv:"⦲",cent:"\xa2",centerdot:"\xb7",cfr:"\uD835\uDD20",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"\xae",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"\uD835\uDD54",coprod:"∐",copy:"\xa9",copysr:"℗",crarr:"↵",cross:"✗",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"\xb0",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"\uD835\uDD21",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"\uD835\uDD55",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"\uD835\uDCB9",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"\xe9",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"\xea",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"\uD835\uDD22",eg:"⪚",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"\xf0",euml:"\xeb",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"\uD835\uDD23",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"\uD835\uDD57",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"\uD835\uDCBB",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"\uD835\uDD24",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"\uD835\uDD58",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"\xbd",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"\uD835\uDD25",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"\uD835\uDD59",horbar:"―",hscr:"\uD835\uDCBD",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"\xed",ic:"",icirc:"\xee",icy:"и",iecy:"е",iexcl:"\xa1",iff:"⇔",ifr:"\uD835\uDD26",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"\uD835\uDD5A",iota:"ι",iprod:"⨼",iquest:"\xbf",iscr:"\uD835\uDCBE",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",itilde:"ĩ",iukcy:"і",iuml:"\xef",jcirc:"ĵ",jcy:"й",jfr:"\uD835\uDD27",jmath:"ȷ",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"\uD835\uDD28",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"\xab",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"\uD835\uDCC1",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",mid:"∣",midast:"*",midcir:"⫰",middot:"\xb7",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"\uD835\uDD5E",mp:"∓",mscr:"\uD835\uDCC2",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"\uD835\uDD5F",not:"\xac",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"\xf3",oast:"⊛",ocir:"⊚",ocirc:"\xf4",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"\uD835\uDD2C",ogon:"˛",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"\uD835\uDD60",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"\xf8",osol:"⊘",otilde:"\xf5",otimes:"⊗",otimesas:"⨶",ouml:"\xf6",ovbar:"⌽",par:"∥",para:"\xb6",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"\uD835\uDD2D",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",pointint:"⨕",popf:"\uD835\uDD61",pound:"\xa3",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"\uD835\uDCC5",psi:"ψ",puncsp:" ",qfr:"\uD835\uDD2E",qint:"⨌",qopf:"\uD835\uDD62",qprime:"⁗",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"\xae",rfisht:"⥽",rfloor:"⌋",rfr:"\uD835\uDD2F",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"\uD835\uDCC7",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"\xad",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"\uD835\uDD31",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"\xfe",tilde:"˜",times:"\xd7",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"\uD835\uDCC9",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"\xfa",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"\xfb",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"\uD835\uDD32",ugrave:"\xf9",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"\xa8",uogon:"ų",uopf:"\uD835\uDD66",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"\uD835\uDCCA",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"\xfc",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"\uD835\uDD35",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"\xfd",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"\xa5",yfr:"\uD835\uDD36",yicy:"ї",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"ю",yuml:"\xff",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"\uD835\uDD37",zhcy:"ж",zigrarr:"⇝",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"",zwnj:""},cb={}.hasOwnProperty;function cx(e){return!!cb.call(cv,e)&&cv[e]}let ck={name:"characterReference",tokenize:function(e,t,n){let r,a;let i=this,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,a=uD,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,a=uF,u):(e.enter("characterReferenceValue"),r=7,a=uL,u(t))}function u(o){if(59===o&&s){let r=e.exit("characterReferenceValue");return a!==uD||cx(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return a(o)&&s++<r?(e.consume(o),u):n(o)}}},cw={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return uZ(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},c_={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),uJ(e,t,"linePrefix")}}};function cS(e,t,n){let r=[],a=-1;for(;++a<e.length;){let i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}let cI={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&uC(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,a,i,s=e.length,o=0;for(;s--;)if(n=e[s][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(a){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=s,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(a=s);let l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[a][1].end}},c={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[a-2][1].start}};return i=uA(i=[["enter",l,t],["enter",u,t]],e.slice(r+1,r+o+3)),i=uA(i,[["enter",c,t]]),i=uA(i,cS(t.parser.constructs.insideSpan.null,e.slice(r+o+4,a-3),t)),i=uA(i,[["exit",c,t],e[a-2],e[a-1],["exit",u,t]]),i=uA(i,e.slice(a+1)),i=uA(i,[["exit",l,t]]),uC(e,r,e.length,i),e},tokenize:function(e,t,n){let r,a;let i=this,s=i.events.length;for(;s--;)if(("labelImage"===i.events[s][1].type||"labelLink"===i.events[s][1].type)&&!i.events[s][1]._balanced){r=i.events[s][1];break}return function(t){return r?r._inactive?c(t):(a=i.parser.defined.includes(co(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(cE,u,a?u:c)(t):91===t?e.attempt(cT,u,a?l:c)(t):a?u(t):c(t)}function l(t){return e.attempt(cC,u,c)(t)}function u(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},cE={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return uU(t)?cs(e,a)(t):a(t)}function a(t){return 41===t?u(t):cr(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return uU(t)?cs(e,o)(t):u(t)}function s(e){return n(e)}function o(t){return 34===t||39===t||40===t?ci(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function l(t){return uU(t)?cs(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},cT={tokenize:function(e,t,n){let r=this;return function(t){return ca.call(r,e,a,i,"reference","referenceMarker","referenceString")(t)};function a(e){return r.parser.defined.includes(co(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},cC={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},cA={name:"labelStartImage",resolveAll:cI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),a};function a(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};function cN(e){return null===e||uU(e)||uW(e)?1:uB(e)?2:void 0}let cz={name:"attention",resolveAll:function(e,t){let n,r,a,i,s,o,l,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[c][1].start};cO(d,-o),cO(p,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:p},a={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...s.end}},e[n][1].end={...i.start},e[c][1].start={...s.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=uA(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=uA(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",a,t]]),l=uA(l,cS(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=uA(l,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,l=uA(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,uC(e,n-1,c-n+3,l),c=n+l.length-u-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n;let r=this.parser.constructs.attentionMarkers.null,a=this.previous,i=cN(a);return function(s){return n=s,e.enter("attentionSequence"),function s(o){if(o===n)return e.consume(o),s;let l=e.exit("attentionSequence"),u=cN(o),c=!u||2===u&&i||r.includes(o),d=!i||2===i&&u||r.includes(a);return l._open=!!(42===n?c:c&&(i||!d)),l._close=!!(42===n?d:d&&(u||!c)),t(o)}(s)}}};function cO(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let cP={name:"labelStartLink",resolveAll:cI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),a};function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},cR={42:u7,43:u7,45:u7,48:u7,49:u7,50:u7,51:u7,52:u7,53:u7,54:u7,55:u7,56:u7,57:u7,62:cn},cj={91:{name:"definition",tokenize:function(e,t,n){let r;let a=this;return function(t){return e.enter("definition"),ca.call(a,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function i(t){return(r=co(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return uU(t)?cs(e,o)(t):o(t)}function o(t){return cr(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(cl,u,u)(t)}function u(t){return uV(t)?uJ(e,c,"whitespace")(t):c(t)}function c(i){return null===i||uq(i)?(e.exit("definition"),a.parser.defined.push(r),t(i)):n(i)}}}},cD={[-2]:cu,[-1]:cu,32:cu},cM={35:{name:"headingAtx",resolve:function(e,t){let n,r,a=e.length-2,i=3;return"whitespace"===e[3][1].type&&(i+=2),a-2>i&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(i===a-1||a-4>i&&"whitespace"===e[a-2][1].type)&&(a-=i+1===a?2:4),a>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},r={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},uC(e,i,a-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(a){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),function a(i){return 35===i&&r++<6?(e.consume(i),a):null===i||uU(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||uq(r)?(e.exit("atxHeading"),t(r)):uV(r)?uJ(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||uU(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(a)}}},42:u8,45:[cd,u8],60:{concrete:!0,name:"htmlFlow",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},tokenize:function(e,t,n){let r,a,i,s,o;let l=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u};function u(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),a=!0,h):63===s?(e.consume(s),r=3,l.interrupt?t:O):uj(s)?(e.consume(s),i=String.fromCharCode(s),f):n(s)}function c(a){return 45===a?(e.consume(a),r=2,d):91===a?(e.consume(a),r=5,s=0,p):uj(a)?(e.consume(a),r=4,l.interrupt?t:O):n(a)}function d(r){return 45===r?(e.consume(r),l.interrupt?t:O):n(r)}function p(r){let a="CDATA[";return r===a.charCodeAt(s++)?(e.consume(r),s===a.length)?l.interrupt?t:S:p:n(r)}function h(t){return uj(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||uU(s)){let o=47===s,u=i.toLowerCase();return!o&&!a&&ch.includes(u)?(r=1,l.interrupt?t(s):S(s)):cp.includes(i.toLowerCase())?(r=6,o)?(e.consume(s),m):l.interrupt?t(s):S(s):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(s):a?function t(n){return uV(n)?(e.consume(n),t):w(n)}(s):g(s))}return 45===s||uD(s)?(e.consume(s),i+=String.fromCharCode(s),f):n(s)}function m(r){return 62===r?(e.consume(r),l.interrupt?t:S):n(r)}function g(t){return 47===t?(e.consume(t),w):58===t||95===t||uj(t)?(e.consume(t),y):uV(t)?(e.consume(t),g):w(t)}function y(t){return 45===t||46===t||58===t||95===t||uD(t)?(e.consume(t),y):v(t)}function v(t){return 61===t?(e.consume(t),b):uV(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),o=t,x):uV(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||uU(n)?v(n):(e.consume(n),t)}(t)}function x(t){return t===o?(e.consume(t),o=null,k):null===t||uq(t)?n(t):(e.consume(t),x)}function k(e){return 47===e||62===e||uV(e)?g(e):n(e)}function w(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||uq(t)?S(t):uV(t)?(e.consume(t),_):n(t)}function S(t){return 45===t&&2===r?(e.consume(t),C):60===t&&1===r?(e.consume(t),A):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),O):93===t&&5===r?(e.consume(t),z):uq(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(cf,R,I)(t)):null===t||uq(t)?(e.exit("htmlFlowData"),I(t)):(e.consume(t),S)}function I(t){return e.check(cm,E,R)(t)}function E(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return null===t||uq(t)?I(t):(e.enter("htmlFlowData"),S(t))}function C(t){return 45===t?(e.consume(t),O):S(t)}function A(t){return 47===t?(e.consume(t),i="",N):S(t)}function N(t){if(62===t){let n=i.toLowerCase();return ch.includes(n)?(e.consume(t),P):S(t)}return uj(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),N):S(t)}function z(t){return 93===t?(e.consume(t),O):S(t)}function O(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),O):S(t)}function P(t){return null===t||uq(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),P)}function R(n){return e.exit("htmlFlow"),t(n)}}},61:cd,95:u8,96:cy,126:cy},c$={38:ck,92:cw},cL={[-5]:c_,[-4]:c_,[-3]:c_,33:cA,38:ck,42:cz,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"),a};function a(t){return uj(t)?(e.consume(t),i):64===t?n(t):o(t)}function i(t){return 43===t||45===t||46===t||uD(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,s):(43===n||45===n||46===n||uD(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function s(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||u$(r)?n(r):(e.consume(r),s)}function o(t){return 64===t?(e.consume(t),l):uM(t)?(e.consume(t),o):n(t)}function l(a){return uD(a)?function a(i){return 46===i?(e.consume(i),r=0,l):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||uD(i))&&r++<63){let n=45===i?t:a;return e.consume(i),n}return n(i)}(i)}(a):n(a)}}},{name:"htmlText",tokenize:function(e,t,n){let r,a,i;let s=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),v):uj(t)?(e.consume(t),w):n(t)}function l(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),a=0,h):uj(t)?(e.consume(t),y):n(t)}function u(t){return 45===t?(e.consume(t),p):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):uq(t)?(i=c,N(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),p):c(t)}function p(e){return 62===e?A(e):45===e?d(e):c(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(a++)?(e.consume(t),a===r.length?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):uq(t)?(i=f,N(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?A(t):93===t?(e.consume(t),g):f(t)}function y(t){return null===t||62===t?A(t):uq(t)?(i=y,N(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):uq(t)?(i=v,N(t)):(e.consume(t),v)}function b(e){return 62===e?A(e):v(e)}function x(t){return uj(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||uD(t)?(e.consume(t),k):function t(n){return uq(n)?(i=t,N(n)):uV(n)?(e.consume(n),t):A(n)}(t)}function w(t){return 45===t||uD(t)?(e.consume(t),w):47===t||62===t||uU(t)?_(t):n(t)}function _(t){return 47===t?(e.consume(t),A):58===t||95===t||uj(t)?(e.consume(t),S):uq(t)?(i=_,N(t)):uV(t)?(e.consume(t),_):A(t)}function S(t){return 45===t||46===t||58===t||95===t||uD(t)?(e.consume(t),S):function t(n){return 61===n?(e.consume(n),I):uq(n)?(i=t,N(n)):uV(n)?(e.consume(n),t):_(n)}(t)}function I(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,E):uq(t)?(i=I,N(t)):uV(t)?(e.consume(t),I):(e.consume(t),T)}function E(t){return t===r?(e.consume(t),r=void 0,C):null===t?n(t):uq(t)?(i=E,N(t)):(e.consume(t),E)}function T(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||uU(t)?_(t):(e.consume(t),T)}function C(e){return 47===e||62===e||uU(e)?_(e):n(e)}function A(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function N(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),z}function z(t){return uV(t)?uJ(e,O,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}}],91:cP,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return uq(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},cw],93:cI,95:cz,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=a;++t<r;)if("codeTextData"===e[t][1].type){e[a][1].type="codeTextPadding",e[r][1].type="codeTextPadding",a+=2,r-=2;break}}for(t=a-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,a,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),i++,t):(e.exit("codeTextSequence"),s(n))}(t)};function s(l){return null===l?n(l):32===l?(e.enter("space"),e.consume(l),e.exit("space"),s):96===l?(a=e.enter("codeTextSequence"),r=0,function n(s){return 96===s?(e.consume(s),r++,n):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(s)):(a.type="codeTextData",o(s))}(l)):uq(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):(e.enter("codeTextData"),o(l))}function o(t){return null===t||32===t||96===t||uq(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),o)}}}},cF={null:[cz,u2]},cZ={null:[42,95]},cq={null:[]},cU=/[\0\t\n\r]/g;function cV(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&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 cB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cW(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return cV(n.slice(t?2:1),t?16:10)}return cx(n)||e}let cH={}.hasOwnProperty;function cJ(e){return{line:e.line,column:e.column,offset:e.offset}}function cG(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+ui({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ui({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+ui({start:t.start,end:t.end})+") is still open")}function cK(e){let t=this;t.parser=function(n){var r,a;let i,s,o,l;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(a=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(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(h),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:r(h,a),codeText:r(function(){return{type:"inlineCode",value:""}},a),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,a),htmlFlowData:u,htmlText:r(g,a),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:a,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:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];if(!t.depth){let n=this.sliceSerialize(e).length;t.depth=n}},autolink:s(),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:s(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t;let n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=cV(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=cx(n);let a=this.stack[this.stack.length-1];a.value+=t},characterReference:function(e){this.stack.pop().position.end=cJ(e.end)},codeFenced:s(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:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:s(),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=co(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(d),hardBreakTrailing:s(d),htmlFlow:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:s(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(cB,cW),n.identifier=co(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=cJ(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:s(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:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=co(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:s(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:s(),thematicBreak:s()}};(function e(t,n){let r=-1;for(;++r<n.length;){let a=n[r];Array.isArray(a)?e(t,a):function(e,t){let n;for(n in t)if(cH.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,a)}})(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},s={stack:[r],tokenStack:[],config:t,enter:i,exit:o,buffer:a,resume:l,data:n},u=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?u.push(c):c=function(e,t,n){let r,a,i,s,o=t-1,l=-1,u=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,s=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||s||l||i||(i=o),s=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:s=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let s=o;for(a=void 0;s--;){let t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;a&&(e[a][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",a=s}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!a||i<a)&&(r._spread=!0),r.end=Object.assign({},a?e[a][1].start:t[1].end),e.splice(a||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let a={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=a,e.splice(o,0,["enter",a,t[2]]),o++,n++,i=void 0,s=!0}}}return e[t][1]._spread=u,n}(e,u.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];cH.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},s),e[c][1])}if(s.tokenStack.length>0){let e=s.tokenStack[s.tokenStack.length-1];(e[1]||cG).call(s,void 0,e[0])}for(r.position={start:cJ(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:cJ(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){i.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function i(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:cJ(t.start),end:void 0}}function s(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||cG).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ui({start:e.start,end:e.end})+"): it’s not open");n.position.end=cJ(e.end)}function l(){return uI(this.stack.pop())}function u(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:cJ(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=cJ(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function h(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function y(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(a)(function(e){for(;!uO(e););return e}((function(e){let t={constructs:uR([Q,...(e||{}).extensions||[]]),content:n(uG),defined:[],document:n(uK),flow:n(u1),lazy:{},string:n(u4),text:n(u9)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},a={},i=[],s=[],o=[],l={attempt:f(function(e,t){m(e,t.from)}),check:f(h),consume:function(e){uq(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),u.events.push(["enter",n,u]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=p(),u.events.push(["exit",t,u]),t},interrupt:f(h,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){a[e.line]=e.column,g()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,a=[];for(;++r<e.length;){let i;let s=e[r];if("string"==typeof s)i=s;else switch(s){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&n)continue;i=" ";break;default:i=String.fromCharCode(s)}n=-2===s,a.push(i)}return a.join("")}(d(e),t)},sliceStream:d,write:function(e){return(s=uA(s,e),function(){let e;for(;r._index<s.length;){let n=s[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==s[s.length-1])?[]:(m(t,0),u.events=cS(i,u.events,u),u.events)}},c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function d(e){return function(e,t){let n;let r=t.start._index,a=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;if(r===i)n=[e[r].slice(a,s)];else{if(n=e.slice(r,i),a>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(a):n.shift()}s>0&&n.push(e[i].slice(0,s))}return n}(s,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:a,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:a,offset:i}}function h(e,t){t.restore()}function f(e,t){return function(n,a,i){let s,c,d,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){let t=null!==e&&n[e],r=null!==e&&n.null;return f([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)};function f(e){return(s=e,c=0,0===e.length)?i:m(e[c])}function m(e){return function(n){return(h=function(){let e=p(),t=u.previous,n=u.currentConstruct,a=u.events.length,i=Array.from(o);return{from:a,restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=a,o=i,g()}}}(),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),a}function v(e){return(h.restore(),++c<s.length)?m(s[c]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&uC(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function g(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}(t,e,n)}}})(a).document().write((s=1,o="",l=!0,function(e,t,n){let r,a,u,c,d;let p=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),u=0,o="",l&&(65279===e.charCodeAt(0)&&u++,l=void 0);u<e.length;){if(cU.lastIndex=u,c=(r=cU.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(c),!r){o=e.slice(u);break}if(10===d&&u===c&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),u<c&&(p.push(e.slice(u,c)),s+=c-u),d){case 0:p.push(65533),s++;break;case 9:for(a=4*Math.ceil(s/4),p.push(-2);s++<a;)p.push(-1);break;case 10:p.push(-4),s=1;break;default:i=!0,s=1}u=c+1}return n&&(i&&p.push(-5),o&&p.push(o),p.push(null)),p})(n,r,!0))))}}let cY="object"==typeof self?self:globalThis,cX=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=a=>{if(e.has(a))return e.get(a);let[i,s]=t[a];switch(i){case 0:case -1:return n(s,a);case 1:{let e=n([],a);for(let t of s)e.push(r(t));return e}case 2:{let e=n({},a);for(let[t,n]of s)e[r(t)]=r(n);return e}case 3:return n(new Date(s),a);case 4:{let{source:e,flags:t}=s;return n(new RegExp(e,t),a)}case 5:{let e=n(new Map,a);for(let[t,n]of s)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,a);for(let t of s)e.add(r(t));return e}case 7:{let{name:e,message:t}=s;return n(new cY[e](t),a)}case 8:return n(BigInt(s),a);case"BigInt":return n(Object(BigInt(s)),a);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:e}=new Uint8Array(s);return n(new DataView(e),s)}}return n(new cY[i](s),a)};return r},cQ=e=>cX(new Map,e)(0),{toString:c0}={},{keys:c1}=Object,c2=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=c0.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,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},c4=([e,t])=>0===e&&("function"===t||"symbol"===t),c9=(e,t,n,r)=>{let a=(e,t)=>{let a=r.push(e)-1;return n.set(t,a),a},i=r=>{if(n.has(r))return n.get(r);let[s,o]=c2(r);switch(s){case 0:{let t=r;switch(o){case"bigint":s=8,t=r.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+o);t=null;break;case"undefined":return a([-1],r)}return a([s,t],r)}case 1:{if(o){let e=r;return"DataView"===o?e=new Uint8Array(r.buffer):"ArrayBuffer"===o&&(e=new Uint8Array(r)),a([o,[...e]],r)}let e=[],t=a([s,e],r);for(let t of r)e.push(i(t));return t}case 2:{if(o)switch(o){case"BigInt":return a([o,r.toString()],r);case"Boolean":case"Number":case"String":return a([o,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());let n=[],l=a([s,n],r);for(let t of c1(r))(e||!c4(c2(r[t])))&&n.push([i(t),i(r[t])]);return l}case 3:return a([s,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return a([s,{source:e,flags:t}],r)}case 5:{let t=[],n=a([s,t],r);for(let[n,a]of r)(e||!(c4(c2(n))||c4(c2(a))))&&t.push([i(n),i(a)]);return n}case 6:{let t=[],n=a([s,t],r);for(let n of r)(e||!c4(c2(n)))&&t.push(i(n));return n}}let{message:l}=r;return a([s,{name:o,message:l}],r)};return i},c5=(e,{json:t,lossy:n}={})=>{let r=[];return c9(!(t||n),!!t,new Map,r)(e),r},c3="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?cQ(c5(e,t)):structuredClone(e):(e,t)=>cQ(c5(e,t));function c6(e){let t=[],n=-1,r=0,a=0;for(;++n<e.length;){let i=e.charCodeAt(n),s="";if(37===i&&uD(e.charCodeAt(n+1))&&uD(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(s=String.fromCharCode(i,t),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+a+1,s=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function c8(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 c7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let de=function(e){if(null==e)return dn;if("function"==typeof e)return dt(e);if("object"==typeof e)return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=de(e[n]);return dt(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):dt(function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0});if("string"==typeof e)return dt(function(t){return t&&t.type===e});throw Error("Expected function, string, or object as test")};function dt(e){return function(t,n,r){var a;return!!(null!==(a=t)&&"object"==typeof a&&"type"in a&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function dn(){return!0}let dr=[];function da(e,t,n,r){let a;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):a=t;let i=de(a),s=r?-1:1;(function e(a,o,l){let u=a&&"object"==typeof a?a:{};if("string"==typeof u.type){let e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(c,"name",{value:"node (\x1b[33m"+a.type+(e?"<"+e+">":"")+"\x1b[39m)"})}return c;function c(){var u;let c,d,p,h=dr;if((!t||i(a,o,l[l.length-1]||void 0))&&!1===(h=Array.isArray(u=n(a,l))?u:"number"==typeof u?[!0,u]:null==u?dr:[u])[0])return h;if("children"in a&&a.children&&a.children&&"skip"!==h[0])for(d=(r?a.children.length:-1)+s,p=l.concat(a);d>-1&&d<a.children.length;){if(!1===(c=e(a.children[d],d,p)())[0])return c;d="number"==typeof c[1]?c[1]:d+s}return h}})(e,void 0,[])()}function di(e,t,n,r){let a,i,s;"function"==typeof t&&"function"!=typeof n?(i=void 0,s=t,a=n):(i=t,s=n,a=r),da(e,i,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return s(e,r,n)},a)}function ds(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 a=e.all(t),i=a[0];i&&"text"===i.type?i.value="["+i.value:a.unshift({type:"text",value:"["});let s=a[a.length-1];return s&&"text"===s.type?s.value+=r:a.push({type:"text",value:r}),a}function dl(e){let t=e.spread;return null==t?e.children.length>1:t}function du(e,t,n){let r=0,a=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(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}let dc={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={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);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-",a=String(t.identifier).toUpperCase(),i=c6(a.toLowerCase()),s=e.footnoteOrder.indexOf(a),o=e.footnoteCounts.get(a);void 0===o?(o=0,e.footnoteOrder.push(a),n=e.footnoteOrder.length):n=s+1,o+=1,e.footnoteCounts.set(a,o);let l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),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 ds(e,t);let a={src:c6(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(a.title=r.title);let i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:c6(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 ds(e,t);let a={href:c6(r.url||"")};null!==r.title&&void 0!==r.title&&(a.title=r.title);let i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:c6(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),a=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=dl(n[r])}return t}(n):dl(t),i={},s=[];if("boolean"==typeof t.checked){let e;let n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(a||0!==o||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||a?s.push(e):s.push(...e.children)}let l=r[r.length-1];l&&(a||"element"!==l.type||"p"!==l.tagName)&&s.push({type:"text",value:"\n"});let u={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){let n={},r=e.all(t),a=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++a<r.length;){let e=r[a];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),a=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),a.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=ur(t.children[1]),s=un(t.children[t.children.length-1]);i&&s&&(r.position={start:i,end:s}),a.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)},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,a=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,s=i?i.length:t.children.length,o=-1,l=[];for(;++o<s;){let n=t.children[o],r={},s=i?i[o]:void 0;s&&(r.align=s);let u={type:"element",tagName:a,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),l.push(u)}let u={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),a=0,i=[];for(;r;)i.push(du(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(du(t.slice(a),a>0,!1)),i.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:dd,yaml:dd,definition:dd,footnoteDefinition:dd};function dd(){}let dp={}.hasOwnProperty,dh={};function df(e,t){e.position&&(t.position=function(e){let t=ur(e),n=un(e);if(t&&n)return{start:t,end:n}}(e))}function dm(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,a=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&&a&&Object.assign(n.properties,c3(a)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function dg(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function dy(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function dv(e,t){let n=function(e,t){let n=t||dh,r=new Map,a=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let a=i.one(n[r],e);if(a){if(r&&"break"===n[r-1].type&&(Array.isArray(a)||"text"!==a.type||(a.value=dy(a.value)),!Array.isArray(a)&&"element"===a.type)){let e=a.children[0];e&&"text"===e.type&&(e.value=dy(e.value))}Array.isArray(a)?t.push(...a):t.push(a)}}}return t},applyData:dm,definitionById:r,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],handlers:{...dc,...n.handlers},one:function(e,t){let n=e.type,r=i.handlers[n];if(dp.call(i.handlers,n)&&r)return r(i,e,t);if(i.options.passThrough&&i.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=c3(n);return r.children=i.all(e),r}return c3(e)}return(i.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(dp.call(n,"hProperties")||dp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(i,e,t)},options:n,patch:df,wrap:dg};return di(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),i}(e,t),r=n.one(e,void 0),a=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||c8,r=e.options.footnoteBackLabel||c7,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],l=-1;for(;++l<e.footnoteOrder.length;){let a=e.footnoteById.get(e.footnoteOrder[l]);if(!a)continue;let i=e.all(a),s=String(a.identifier).toUpperCase(),u=c6(s.toLowerCase()),c=0,d=[],p=e.footnoteCounts.get(s);for(;void 0!==p&&++c<=p;){d.length>0&&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=i[i.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 i.push(...d);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(i,!0)};e.patch(a,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...c3(s),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:"\n"},a),i}function db(e,t){return e&&"run"in e?async function(n,r){let a=dv(n,{file:r,...t});await e.run(a,r)}:function(n,r){return dv(n,{file:r,...e||t})}}function dx(e){if(e)throw e}var dk=n(1345);function dw(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 d_=require("node:path"),dS=require("node:process");function dI(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let dE=require("node:url"),dT=["history","path","basename","stem","extname","dirname"];class dC{constructor(e){let t,n;t=e?dI(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":dS.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<dT.length;){let e=dT[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)dT.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?d_.basename(this.path):void 0}set basename(e){dN(e,"basename"),dA(e,"basename"),this.path=d_.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?d_.dirname(this.path):void 0}set dirname(e){dz(this.basename,"dirname"),this.path=d_.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?d_.extname(this.path):void 0}set extname(e){if(dA(e,"extname"),dz(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=d_.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){dI(e)&&(e=(0,dE.fileURLToPath)(e)),dN(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?d_.basename(this.path,this.extname):void 0}set stem(e){dN(e,"stem"),dA(e,"stem"),this.path=d_.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new uu(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function dA(e,t){if(e&&e.includes(d_.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+d_.sep+"`")}function dN(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function dz(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let dO=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},dP={}.hasOwnProperty;class dR extends dO{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);(function a(i,...s){let o=e[++n],l=-1;if(i){r(i);return}for(;++l<t.length;)(null===s[l]||void 0===s[l])&&(s[l]=t[l]);t=s,o?(function(e,t){let n;return function(...t){let i;let s=e.length>t.length;s&&t.push(r);try{i=e.apply(this,t)}catch(e){if(s&&n)throw e;return r(e)}s||(i&&i.then&&"function"==typeof i.then?i.then(a,r):i instanceof Error?r(i):a(i))};function r(e,...a){n||(n=!0,t(e,...a))}function a(e){r(null,e)}})(o,a)(...s):r(null,...s)})(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 dR,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data(dk(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(d$("data",this.frozen),this.namespace[e]=t,this):dP.call(this.namespace,e)&&this.namespace[e]||void 0:e?(d$("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let t=dZ(e),n=this.parser||this.Parser;return dD("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),dD("process",this.parser||this.Parser),dM("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,a){let i=dZ(e),s=n.parse(i);function o(e,n){e||!n?a(e):r?r(n):t(void 0,n)}n.run(s,i,function(e,t,r){if(e||!t||!r)return o(e);let a=n.stringify(t,r);"string"==typeof a||a&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?r.value=a:r.result=a,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),dD("processSync",this.parser||this.Parser),dM("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,dx(e),t=r}),dF("processSync","process",n),t}run(e,t,n){dL(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?a(void 0,n):new Promise(a);function a(a,i){let s=dZ(t);r.run(e,s,function(t,r,s){let o=r||e;t?i(t):a?a(o):n(void 0,o,s)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){dx(e),n=t,r=!0}),dF("runSync","run",r),n}stringify(e,t){this.freeze();let n=dZ(t),r=this.compiler||this.Compiler;return dM("stringify",r),dL(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(d$("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else if("object"==typeof e)Array.isArray(e)?i(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function a(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(e.plugins),e.settings&&(r.settings=dk(!0,r.settings,e.settings))}function i(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)s(e,[]);else if("object"==typeof e){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,a=-1;for(;++r<n.length;)if(n[r][0]===e){a=r;break}if(-1===a)n.push([e,...t]);else if(t.length>0){let[r,...i]=t,s=n[a][1];dw(s)&&dw(r)&&(r=dk(!0,s,r)),n[a]=[e,r,...i]}}}}let dj=new dR().freeze();function dD(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function dM(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function d$(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 dL(e){if(!dw(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function dF(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function dZ(e){return e&&"object"==typeof e&&"message"in e&&"messages"in e?e:new dC(e)}let dq=[],dU={allowDangerousHtml:!0},dV=/^(https?|ircs?|mailto|xmpp)$/i,dB=[{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:"className",id:"remove-classname"},{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 dW(e){let t=function(e){let t=e.rehypePlugins||dq,n=e.remarkPlugins||dq,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dU}:dU;return dj().use(cK).use(n).use(db,r).use(t)}(e),n=function(e){let t=e.children||"",n=new dC;return"string"==typeof t&&(n.value=t),n}(e);return function(e,t){let n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||dH;for(let e of dB)Object.hasOwn(t,e.from)&&(e.from,e.to&&e.to,e.id);return di(e,function(e,t,a){if("raw"===e.type&&a&&"number"==typeof t)return s?a.children.splice(t,1):a.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in u_)if(Object.hasOwn(u_,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=u_[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let s=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!s&&r&&"number"==typeof t&&(s=!r(e,t,a)),s&&a&&"number"==typeof t)return o&&e.children?a.children.splice(t,1,...e.children):a.children.splice(t,1),t}}),function(e,t){var n,r,a;let i;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let s=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=t.jsxDEV,i=function(e,t,r,a){let i=Array.isArray(r.children),o=ur(e);return n(t,r,a,i,{columnNumber:o?o.column-1:void 0,fileName:s,lineNumber:o?o.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,a=t.jsxs,i=function(e,t,n,i){let s=Array.isArray(n.children)?a:r;return i?s(t,n,i):s(t,n)}}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?l9:l4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},l=ug(o,e,void 0);return l&&"string"!=typeof l?l:o.create(e,o.Fragment,{children:l||void 0},void 0)}(e,{Fragment:ee.Fragment,components:a,ignoreInvalidStyle:!0,jsx:ee.jsx,jsxs:ee.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(n),n),e)}function dH(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return -1===t||-1!==a&&t>a||-1!==n&&t>n||-1!==r&&t>r||dV.test(e.slice(0,t))?e:""}function dJ(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,a=n.indexOf(t);for(;-1!==a;)r++,a=n.indexOf(t,a+t.length);return r}let dG="phrasing",dK=["autolink","link","image","label"];function dY(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function dX(e){this.config.enter.autolinkProtocol.call(this,e)}function dQ(e){this.config.exit.autolinkProtocol.call(this,e)}function d0(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function d1(e){this.config.exit.autolinkEmail.call(this,e)}function d2(e){this.exit(e)}function d4(e){!function(e,t,n){let r=de((n||{}).ignore||[]),a=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(;++r<n.length;){var a;let e=n[r];t.push(["string"==typeof(a=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(a),"g"):a,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),i=-1;for(;++i<a.length;)da(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){let e=t[s],a=n?n.children:void 0;if(r(e,a?a.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=a[i][0],s=a[i][1],o=0,l=n.children.indexOf(e),u=!1,c=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,a={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,a);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(o!==n&&c.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(i)?c.push(...i):i&&c.push(i),o=n+d[0].length,u=!0),!r.global)break;d=r.exec(e.value)}return u?(o<e.value.length&&c.push({type:"text",value:e.value.slice(o)}),n.children.splice(l,1,...c)):c=[e],l+c.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,d9],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,d5]],{ignore:["link","linkReference"]})}function d9(e,t,n,r,a){let i="";if(!d3(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}(n)))return!1;let s=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),a=dJ(e,"("),i=dJ(e,")");for(;-1!==r&&a>i;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),i++;return[e,n]}(n+r);if(!s[0])return!1;let o={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function d5(e,t,n,r){return!(!d3(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function d3(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||uW(n)||uB(n))&&(!t||47!==n)}function d6(){this.buffer()}function d8(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function d7(){this.buffer()}function pe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function pt(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=co(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pn(e){this.exit(e)}function pr(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=co(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pa(e){this.exit(e)}function pi(e,t,n,r){let a=n.createTracker(r),i=a.move("[^"),s=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),s(),i+=a.move("]")}function ps(e,t,n){return 0===t?e:po(e,t,n)}function po(e,t,n){return(n?"":" ")+e}pi.peek=function(){return"["};let pl=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function pu(e){this.enter({type:"delete",children:[]},e)}function pc(e){this.exit(e)}function pd(e,t,n,r){let a=n.createTracker(r),i=n.enter("strikethrough"),s=a.move("~~");return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"})+a.move("~~"),i(),s}function pp(e){return e.length}function ph(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}pd.peek=function(){return"~"};function pf(e,t,n){let r=e.value||"",a="`",i=-1;for(;RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){let e;let t=n.unsafe[i],a=n.compilePattern(t);if(t.atBreak)for(;e=a.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return a+r+a}pf.peek=function(){return"`"},de(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let pm={inlineCode:pf,listItem:function(e,t,n,r){let a=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),i=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let s=i.length+1;("tab"===a||"mixed"===a&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));let o=n.createTracker(r);o.move(i+" ".repeat(s-i.length)),o.shift(s);let l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?i:i+" ".repeat(s-i.length))+e});return l(),u}};function pg(e){let t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function py(e){this.exit(e),this.data.inTable=void 0}function pv(e){this.enter({type:"tableRow",children:[]},e)}function pb(e){this.exit(e)}function px(e){this.enter({type:"tableCell",children:[]},e)}function pk(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pw));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pw(e,t){return"|"===t?t:e}function p_(e){let t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function pS(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];e.type;let n=e.children[0];if(n&&"text"===n.type){let r;let a=t.children,i=-1;for(;++i<a.length;){let e=a[i];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function pI(e,t,n,r){let a=e.children[0],i="boolean"==typeof e.checked&&a&&"paragraph"===a.type,s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(s);let l=pm.listItem(e,t,n,{...r,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}let pE={tokenize:function(e,t,n){let r=0;return function t(i){return(87===i||119===i)&&r<3?(r++,e.consume(i),t):46===i&&3===r?(e.consume(i),a):n(i)};function a(e){return null===e?n(e):t(e)}},partial:!0},pT={tokenize:function(e,t,n){let r,a,i;return s;function s(t){return 46===t||95===t?e.check(pA,l,o)(t):null===t||uU(t)||uW(t)||45!==t&&uB(t)?l(t):(i=!0,e.consume(t),s)}function o(t){return 95===t?r=!0:(a=r,r=void 0),e.consume(t),s}function l(e){return a||r||!i?n(e):t(e)}},partial:!0},pC={tokenize:function(e,t){let n=0,r=0;return a;function a(s){return 40===s?(n++,e.consume(s),a):41===s&&r<n?i(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(pA,t,i)(s):null===s||uU(s)||uW(s)?t(s):(e.consume(s),a)}function i(t){return 41===t&&r++,e.consume(t),a}},partial:!0},pA={tokenize:function(e,t,n){return r;function r(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),r):38===s?(e.consume(s),i):93===s?(e.consume(s),a):60===s||null===s||uU(s)||uW(s)?t(s):n(s)}function a(e){return null===e||40===e||91===e||uU(e)||uW(e)?t(e):r(e)}function i(t){return uj(t)?function t(a){return 59===a?(e.consume(a),r):uj(a)?(e.consume(a),t):n(a)}(t):n(t)}},partial:!0},pN={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return uD(e)?n(e):t(e)}},partial:!0},pz={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!pD.call(r,r.previous)||pF(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(pE,e.attempt(pT,e.attempt(pC,a),n),n)(t))};function a(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:pD},pO={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,a="",i=!1;return function(t){return(72===t||104===t)&&pM.call(r,r.previous)&&!pF(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(t),e.consume(t),s):n(t)};function s(t){if(uj(t)&&a.length<5)return a+=String.fromCodePoint(t),e.consume(t),s;if(58===t){let n=a.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),i)?l:(i=!0,o):n(t)}function l(t){return null===t||u$(t)||uU(t)||uW(t)||uB(t)?n(t):e.attempt(pT,e.attempt(pC,u),n)(t)}function u(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:pM},pP={name:"emailAutolink",tokenize:function(e,t,n){let r,a;let i=this;return function(t){return!pL(t)||!p$.call(i,i.previous)||pF(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return pL(r)?(e.consume(r),t):64===r?(e.consume(r),s):n(r)}(t))};function s(t){return 46===t?e.check(pN,l,o)(t):45===t||95===t||uD(t)?(a=!0,e.consume(t),s):l(t)}function o(t){return e.consume(t),r=!0,s}function l(s){return a&&r&&uj(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:p$},pR={},pj=48;for(;pj<123;)pR[pj]=pP,58==++pj?pj=65:91===pj&&(pj=97);function pD(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||uU(e)}function pM(e){return!uj(e)}function p$(e){return!(47===e||pL(e))}function pL(e){return 43===e||45===e||46===e||95===e||uD(e)}function pF(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}pR[43]=pP,pR[45]=pP,pR[46]=pP,pR[95]=pP,pR[72]=[pP,pO],pR[104]=[pP,pO],pR[87]=[pP,pz],pR[119]=[pP,pz];let pZ={tokenize:function(e,t,n){let r=this;return uJ(e,function(e){let a=r.events[r.events.length-1];return a&&"gfmFootnoteDefinitionIndent"===a[1].type&&4===a[2].sliceSerialize(a[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function pq(e,t,n){let r;let a=this,i=a.events.length,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);for(;i--;){let e=a.events[i][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(i){if(!r||!r._balanced)return n(i);let o=co(a.sliceSerialize({start:r.end,end:a.now()}));return 94===o.codePointAt(0)&&s.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)):n(i)}}function pU(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)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function pV(e,t,n){let r;let a=this,i=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(o){if(s>999||93===o&&!r||null===o||91===o||uU(o))return n(o);if(93===o){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return i.includes(co(a.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return uU(o)||(r=!0),s++,e.consume(o),92===o?u:l}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function pB(e,t,n){let r,a;let i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(t)}function u(t){if(o>999||93===t&&!a||null===t||91===t||uU(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=co(i.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return uU(t)||(a=!0),o++,e.consume(t),92===t?c:u}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,u):u(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(r)||s.push(r),uJ(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function pW(e,t,n){return e.check(uX,t,e.attempt(pZ,t,n))}function pH(e){e.exit("gfmFootnoteDefinition")}class pJ{constructor(){this.map=[]}add(e,t,n){(function(e,t,n,r){let a=0;if(0!==n||0!==r.length){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}})(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)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.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function pG(e,t,n){let r;let a=this,i=0,s=0;return function(e){let t=a.events.length-1;for(;t>-1;){let e=a.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?a.events[t][1].type:null,i="tableHead"===r||"tableRow"===r?v:o;return i===v&&a.parser.lazy[a.now().line]?n(e):i(e)};function o(t){return e.enter("tableHead"),e.enter("tableRow"),124===t||(r=!0,s+=1),l(t)}function l(t){return null===t?n(t):uq(t)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):uV(t)?uJ(e,l,"whitespace")(t):(s+=1,r&&(r=!1,i+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,l):(e.enter("data"),u(t))}function u(t){return null===t||124===t||uU(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return 92===t||124===t?(e.consume(t),u):u(t)}function d(t){return(a.interrupt=!1,a.parser.lazy[a.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,uV(t))?uJ(e,p,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t)}function p(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):n(t)}function h(t){return uV(t)?uJ(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(s+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(s+=1,m(t)):null===t||uq(t)?y(t):n(t)}function m(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"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return uV(t)?uJ(e,y,"whitespace")(t):y(t)}function y(a){return 124===a?p(a):null===a||uq(a)?r&&i===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(a)):n(a):n(a)}function v(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||uq(n)?(e.exit("tableRow"),t(n)):uV(n)?uJ(e,b,"whitespace")(n):(e.enter("data"),x(n))}function x(t){return null===t||124===t||uU(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?k:x)}function k(t){return 92===t||124===t?(e.consume(t),x):x(t)}}function pK(e,t){let n,r,a,i=-1,s=!0,o=0,l=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,p=new pJ;for(;++i<e.length;){let h=e[i],f=h[1];"enter"===h[0]?"tableHead"===f.type?(c=!1,0!==d&&(pX(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,a=void 0,l=[0,0,0,0],u=[0,i+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",r,t]])),o="tableDelimiterRow"===f.type?2:r?3:1):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(s=!1,0===u[2]&&(0!==l[1]&&(u[0]=u[1],a=pY(p,t,l,o,void 0,a),l=[0,0,0,0]),u[2]=i)):"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(u[0]=u[1],a=pY(p,t,l,o,void 0,a)),u=[(l=u)[1],i,0,0])):"tableHead"===f.type?(c=!0,d=i):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=i,0!==l[1]?(u[0]=u[1],a=pY(p,t,l,o,i,a)):0!==u[1]&&(a=pY(p,t,u,o,i,a)),o=0):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(u[3]=i)}for(0!==d&&pX(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){let e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let a=e[t];if(n){if("enter"===a[0])"tableContent"===a[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===a[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===a[1].type)break}else"enter"===a[0]&&"tableDelimiterRow"===a[1].type&&(n=!0);t+=1}return r}(t.events,i))}return e}function pY(e,t,n,r,a,i){0!==n[0]&&(i.end=Object.assign({},pQ(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));let s=pQ(t.events,n[1]);if(i={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){let a=pQ(t.events,n[2]),i=pQ(t.events,n[3]),s={type:"tableContent",start:Object.assign({},a),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",s,t]]),2!==r){let r=t.events[n[2]],a=t.events[n[3]];if(r[1].end=Object.assign({},a[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==a&&(i.end=Object.assign({},pQ(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function pX(e,t,n,r,a){let i=[],s=pQ(t.events,n);a&&(a.end=Object.assign({},s),i.push(["exit",a,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(n+1,0,i)}function pQ(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let p0={name:"tasklistCheck",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"),a):n(t)};function a(t){return uU(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return uq(r)?t(r):uV(r)?e.check({tokenize:p1},t,n)(r):n(r)}}};function p1(e,t,n){return uJ(e,function(e){return null===e?n(e):t(e)},"whitespace")}let p2={};function p4(e){let t;let n=e||p2,r=this.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(uR([{text:pR},{document:{91:{name:"gfmFootnoteDefinition",tokenize:pB,continuation:{tokenize:pW},exit:pH}},text:{91:{name:"gfmFootnoteCall",tokenize:pV},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pq,resolveTo:pU}}},function(e){let t=(e||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let a=this.previous,i=this.events,s=0;return function(o){return 126===a&&"characterEscape"!==i[i.length-1][1].type?r(o):(e.enter("strikethroughSequenceTemporary"),function i(o){let l=cN(a);if(126===o)return s>1?r(o):(e.consume(o),s++,i);if(s<2&&!t)return r(o);let u=e.exit("strikethroughSequenceTemporary"),c=cN(o);return u._open=!c||2===c&&!!l,u._close=!l||2===l&&!!c,n(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let a={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",a,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],o=t.parser.constructs.insideSpan.null;o&&uC(s,s.length,0,cS(o,e.slice(r+1,n),t)),uC(s,s.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",a,t]]),uC(e,r-1,n-r+3,s),n=r+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}(n),{flow:{null:{name:"table",tokenize:pG,resolveAll:pK}}},{text:{91:p0}}])),i.push([{transforms:[d4],enter:{literalAutolink:dY,literalAutolinkEmail:dX,literalAutolinkHttp:dX,literalAutolinkWww:dX},exit:{literalAutolink:d2,literalAutolinkEmail:d1,literalAutolinkHttp:dQ,literalAutolinkWww:d0}},{enter:{gfmFootnoteCallString:d6,gfmFootnoteCall:d8,gfmFootnoteDefinitionLabelString:d7,gfmFootnoteDefinition:pe},exit:{gfmFootnoteCallString:pt,gfmFootnoteCall:pn,gfmFootnoteDefinitionLabelString:pr,gfmFootnoteDefinition:pa}},{canContainEols:["delete"],enter:{strikethrough:pu},exit:{strikethrough:pc}},{enter:{table:pg,tableData:px,tableHeader:px,tableRow:pv},exit:{codeText:pk,table:py,tableData:pb,tableHeader:pb,tableRow:pb}},{exit:{taskListCheckValueChecked:p_,taskListCheckValueUnchecked:p_,paragraph:pS}}]),s.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dG,notInConstruct:dK},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dG,notInConstruct:dK},{character:":",before:"[ps]",after:"\\/",inConstruct:dG,notInConstruct:dK}]},(t=!1,n&&n.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,a){let i=r.createTracker(a),s=i.move("[^"),o=r.enter("footnoteDefinition"),l=r.enter("label");return s+=i.move(r.safe(r.associationId(e),{before:s,after:"]"})),l(),s+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),s+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?po:ps))),o(),s},footnoteReference:pi},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:pl}],handlers:{delete:pd}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=pm.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){let r=e.children,a=-1,i=[],s=t.enter("table");for(;++a<r.length;)i[a]=l(r[a],t,n);return s(),i}(e,n,r),e.align)},tableCell:s,tableRow:function(e,t,n,r){let a=o([l(e,n,r)]);return a.slice(0,a.indexOf("\n"))}}};function s(e,t,n,r){let a=n.enter("tableCell"),s=n.enter("phrasing"),o=n.containerPhrasing(e,{...r,before:i,after:i});return s(),a(),o}function o(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),a=n.stringLength||pp,i=[],s=[],o=[],l=[],u=0,c=-1;for(;++c<e.length;){let t=[],r=[],i=-1;for(e[c].length>u&&(u=e[c].length);++i<e[c].length;){var d;let s=null==(d=e[c][i])?"":String(d);if(!1!==n.alignDelimiters){let e=a(s);r[i]=e,(void 0===l[i]||e>l[i])&&(l[i]=e)}t.push(s)}s[c]=t,o[c]=r}let p=-1;if("object"==typeof r&&"length"in r)for(;++p<u;)i[p]=ph(r[p]);else{let e=ph(r);for(;++p<u;)i[p]=e}p=-1;let h=[],f=[];for(;++p<u;){let e=i[p],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let a=!1===n.alignDelimiters?1:Math.max(1,l[p]-t.length-r.length),s=t+"-".repeat(a)+r;!1!==n.alignDelimiters&&((a=t.length+a+r.length)>l[p]&&(l[p]=a),f[p]=a),h[p]=s}s.splice(1,0,h),o.splice(1,0,f),c=-1;let m=[];for(;++c<s.length;){let e=s[c],t=o[c];p=-1;let r=[];for(;++p<u;){let a=e[p]||"",s="",o="";if(!1!==n.alignDelimiters){let e=l[p]-(t[p]||0),n=i[p];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=s=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||p||r.push("|"),!1!==n.padding&&!(!1===n.alignDelimiters&&""===a)&&(!1!==n.delimiterStart||p)&&r.push(" "),!1!==n.alignDelimiters&&r.push(s),r.push(a),!1!==n.alignDelimiters&&r.push(o),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||p!==u-1)&&r.push("|")}m.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return m.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:a})}function l(e,t,n){let r=e.children,a=-1,i=[],o=t.enter("tableRow");for(;++a<r.length;)i[a]=s(r[a],e,t,n);return o(),i}}(n),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:pI}}]})}function p9({agentId:e}){let t=(0,et.useRef)(null),n=(0,et.useRef)({x:0,y:0,clicking:!1,lastActiveTs:0,hasPos:!1,ripples:[],rafId:0});return(0,et.useCallback)(()=>{n.current.lastActiveTs=Date.now()},[]),ee.jsx("canvas",{ref:t,className:"pointer-events-none absolute inset-0 z-20"})}let p5=ny("type",[ng({type:nv("not_changed")}),ng({type:nv("changed"),base64:nm()})]);ng({textOutput:nm(),imageOutput:p5.nullable()}),Promise.resolve();class p3{constructor(e){this.clips=[],this.currentFrames=[],this.cursorPos={x:0,y:0},this.clicking=!1,this.recording=!1,this.currentTabId=0,this.clipStartTime=0,this.cdpCleanup=null,this.ripples=[],this.cursorTrail=[],this.currentUrl="",this.agentId=e}async captureFrame(){let e=window.bangonit;try{let t=await e.capturePage(this.agentId),{result:n}=await e.cdpSend(this.agentId,"Runtime.evaluate",{expression:"JSON.stringify({w:window.innerWidth,h:window.innerHeight})",returnByValue:!0}),r=JSON.parse(n.value);this.currentFrames.push({imageData:t,cursor:{...this.cursorPos},clicking:this.clicking,ts:Date.now(),sessionId:0,deviceWidth:r.w,deviceHeight:r.h,scrollOffsetX:0,scrollOffsetY:0})}catch(e){console.warn("Failed to capture frame:",e)}}async startClip(e,t){this.currentUrl=t||"",this.recording&&await this.cancelClip(),this.recording=!0,this.currentTabId=e,this.currentFrames=[],this.cursorTrail=[],this.clipStartTime=Date.now(),await this.captureFrame();let n=window.bangonit;this.cdpCleanup=n.onCdpEvent(e=>{if(e.agentId!==this.agentId||"Page.screencastFrame"!==e.method||!this.recording)return;let{data:t,metadata:r,sessionId:a}=e.params;this.currentFrames.push({imageData:t,cursor:{...this.cursorPos},clicking:this.clicking,ts:Date.now(),sessionId:a,deviceWidth:r?.deviceWidth||0,deviceHeight:r?.deviceHeight||0,scrollOffsetX:r?.scrollOffsetX||0,scrollOffsetY:r?.scrollOffsetY||0}),n.cdpSend(this.agentId,"Page.screencastFrameAck",{sessionId:a}).catch(e=>console.error(e))}),await n.cdpSend(this.agentId,"Page.startScreencast",{format:"png",quality:100,maxWidth:1920,maxHeight:1080})}async stopClip(){if(!this.recording)return null;await this.captureFrame(),this.recording=!1;let e=Date.now();await window.bangonit.cdpSend(this.agentId,"Page.stopScreencast").catch(e=>console.error(e)),this.cdpCleanup&&(this.cdpCleanup(),this.cdpCleanup=null);let t=this.currentFrames;if(this.currentFrames=[],0===t.length)return null;let n=await this.compositeAndEncode(t);if(!n||0===n.size)return null;let r=new Uint8Array(await n.arrayBuffer()),a="";for(let e=0;e<r.length;e++)a+=String.fromCharCode(r[e]);let i=btoa(a),s={agentId:this.agentId,tabId:this.currentTabId,index:this.clips.length,startTime:this.clipStartTime,endTime:e,url:this.currentUrl||void 0,data:i};return this.clips.push(s),{meta:s}}async cancelClip(){this.recording=!1,this.currentFrames=[],this.cursorTrail=[],this.cdpCleanup&&(this.cdpCleanup(),this.cdpCleanup=null),await window.bangonit?.cdpSend(this.agentId,"Page.stopScreencast").catch(e=>console.error(e))}async compositeAndEncode(e){if(0===e.length)return null;let t=await this.decodeFrame(e[0].imageData);if(!t)return null;let n=t.width,r=t.height,a=document.createElement("canvas");a.width=n,a.height=r;let i=a.getContext("2d"),s=a.captureStream(0),o=s.getVideoTracks()[0],l=new MediaRecorder(s,{mimeType:"video/webm;codecs=vp8",videoBitsPerSecond:8e6}),u=[];l.ondataavailable=e=>{e.data.size>0&&u.push(e.data)};let c=new Promise(e=>{l.onstop=()=>{e(new Blob(u,{type:"video/webm"}))}});l.start();let d=[],p=this.cursorTrail,h=0,f=(e,t,a,s,l,u,c)=>{let p=t*u,h=a*c;s&&(!d.length||d[d.length-1].x!==p||d[d.length-1].y!==h)&&d.push({x:p,y:h,startTs:l}),i.clearRect(0,0,n,r),i.drawImage(e,0,0,n,r);for(let e=d.length-1;e>=0;e--){var f,m,g;let t=d[e],n=l-t.startTs;if(n>=400){d.splice(e,1);continue}f=t.x,m=t.y,(g=n/400)>=1||(i.save(),i.beginPath(),i.arc(f,m,24*g,0,2*Math.PI),i.fillStyle=`rgba(96, 165, 250, ${.8*(1-g)})`,i.fill(),i.restore(),i.save(),i.beginPath(),i.arc(f,m,32*g,0,2*Math.PI),i.strokeStyle=`rgba(96, 165, 250, ${.9*(1-g)})`,i.lineWidth=2,i.stroke(),i.restore())}(function(e,t,n,r,a=1){if(a<=0)return;e.save(),e.globalAlpha=a;let i=r?.8:1;e.save(),e.translate(t-2,n-1),e.scale(28/24*i,28/24*i);let s=new Path2D("M5 3l14 8.5-6.5 1.5-3.5 6z");e.shadowColor="rgba(0,0,0,0.5)",e.shadowBlur=2,e.shadowOffsetY=1,e.fillStyle="white",e.strokeStyle="black",e.lineWidth=1.5,e.lineJoin="round",e.fill(s),e.stroke(s),e.restore(),e.restore()})(i,p,h,s),o&&"function"==typeof o.requestFrame&&o.requestFrame()};for(let a=0;a<e.length;a++){let i=e[a],s=0===a?t:await this.decodeFrame(i.imageData);if(!s)continue;let o=i.deviceWidth>0?n/i.deviceWidth:1,l=i.deviceHeight>0?r/i.deviceHeight:1,u=a<e.length-1?e[a+1].ts:i.ts+100;for(f(s,i.cursor.x,i.cursor.y,i.clicking,i.ts,o,l);h<p.length&&p[h].ts<=i.ts;)h++;let c=i.ts;for(;h<p.length&&p[h].ts<u;){let e=p[h],t=e.ts-c;t>0&&await new Promise(e=>setTimeout(e,Math.min(t,16))),f(s,e.x,e.y,e.clicking,e.ts,o,l),c=e.ts,h++}if(a<e.length-1){let e=u-c;e>0&&await new Promise(t=>setTimeout(t,Math.min(e,100)))}}return await new Promise(e=>setTimeout(e,100)),l.stop(),c}async decodeFrame(e){try{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);let r=new Blob([n],{type:"image/png"});return createImageBitmap(r)}catch(e){return console.warn("Failed to decode frame:",e),null}}updateCursor(e,t){this.cursorPos={x:e,y:t},this.recording&&this.cursorTrail.push({ts:Date.now(),x:e,y:t,clicking:this.clicking})}setCursorDown(){this.clicking=!0,this.recording&&this.cursorTrail.push({ts:Date.now(),...this.cursorPos,clicking:!0})}setCursorUp(){this.clicking=!1,this.recording&&this.cursorTrail.push({ts:Date.now(),...this.cursorPos,clicking:!1})}getClipsMeta(){return[...this.clips]}}function p6({agentId:e,agentName:t,initialPrompt:n,onStatusChange:r,onRerun:a,initialMessages:i,initialTabs:s,initialActiveTabId:o,initialTodos:l,record:u,sessionRecorder:c,onRegisterRecorder:d,planDir:p}){let[h,f]=(0,et.useState)(s?.map(e=>({...e,initialUrl:e.url}))||[{id:0,url:"about:blank",title:"",initialUrl:"about:blank"}]),[m,g]=(0,et.useState)(o??0),[y,v]=(0,et.useState)(()=>{let e=s?.find(e=>e.id===(o??0));return e?.url||""}),[b,x]=(0,et.useState)(null),[k,w]=(0,et.useState)(!1),[_,S]=(0,et.useState)(!1),I=(0,et.useRef)(new Map),[E,T]=(0,et.useState)(l||[]),C=(0,et.useRef)(null);(0,et.useRef)(!1);let A=(0,et.useRef)(s?Math.max(...s.map(e=>e.id))+1:1),N=(0,et.useRef)(new Set),[z,O]=(0,et.useState)(0);(0,et.useRef)(null);let P=(0,et.useRef)(null);P.current;let R=(0,et.useRef)(null);u&&!R.current&&P.current&&(R.current=new p3(e),P.current.enableRecording(R.current),d?.(e,R.current));let j=(0,et.useRef)(c);j.current=c;let D=(0,et.useMemo)(()=>new lv({api:"/api/chat",headers:()=>({"X-Client-Platform":navigator.platform})}),[]),M=(0,et.useRef)(!1),$=(0,et.useCallback)((n,r)=>{window.bangonit?.emitAgentOutput?.({agentId:e,type:n,text:r,name:t})},[e,t]),{messages:L,sendMessage:F,addToolOutput:Z,status:q,error:U}=function({experimental_throttle:e,resume:t=!1,...n}={}){let r=(0,et.useRef)("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});let a={...n,onToolCall:e=>{var t,n;return null==(n=(t=r.current).onToolCall)?void 0:n.call(t,e)},onData:e=>{var t,n;return null==(n=(t=r.current).onData)?void 0:n.call(t,e)},onFinish:e=>{var t,n;return null==(n=(t=r.current).onFinish)?void 0:n.call(t,e)},onError:e=>{var t,n;return null==(n=(t=r.current).onError)?void 0:n.call(t,e)},sendAutomaticallyWhen:e=>{var t,n,a;return null!=(a=null==(n=(t=r.current).sendAutomaticallyWhen)?void 0:n.call(t,e))&&a}},i=(0,et.useRef)("chat"in n?n.chat:new lE(a));("chat"in n&&n.chat!==i.current||"id"in n&&i.current.id!==n.id)&&(i.current="chat"in n?n.chat:new lE(a));let s=(0,et.useCallback)(t=>i.current["~registerMessagesCallback"](t,e),[e,i.current.id]),o=(0,et.useSyncExternalStore)(s,()=>i.current.messages,()=>i.current.messages),l=(0,et.useSyncExternalStore)(i.current["~registerStatusCallback"],()=>i.current.status,()=>i.current.status),u=(0,et.useSyncExternalStore)(i.current["~registerErrorCallback"],()=>i.current.error,()=>i.current.error),c=(0,et.useCallback)(e=>{"function"==typeof e&&(e=e(i.current.messages)),i.current.messages=e},[i]);return(0,et.useEffect)(()=>{t&&i.current.resumeStream()},[t,i]),{id:i.current.id,messages:o,setMessages:c,sendMessage:i.current.sendMessage,regenerate:i.current.regenerate,clearError:i.current.clearError,stop:i.current.stop,error:u,resumeStream:i.current.resumeStream,status:l,addToolResult:i.current.addToolOutput,addToolOutput:i.current.addToolOutput,addToolApprovalResponse:i.current.addToolApprovalResponse}}({transport:D,messages:i,sendAutomaticallyWhen:({messages:e})=>!M.current&&!k&&function({messages:e}){let t=e[e.length-1];if(!t||"assistant"!==t.role)return!1;let n=t.parts.reduce((e,t,n)=>"step-start"===t.type?n:e,-1),r=t.parts.slice(n+1).filter(ln).filter(e=>!e.providerExecuted);return r.length>0&&r.every(e=>"output-available"===e.state||"output-error"===e.state)}({messages:e}),async onToolCall({toolCall:n}){if("report_result"===n.toolName){let a=n.input,i=a?.result==="pass"?"pass":"fail",s=a?.summary||"";if($("status",`${i.toUpperCase()}: ${s}`),x({result:i,summary:s}),j.current){j.current.addEvent({ts:Date.now(),agentId:e,type:"result",data:{result:i,summary:s}});try{let n=await window.bangonit?.getRunDir?.();if(n){let r=R.current?.getClipsMeta()||[],a=[{id:e,name:t,result:i,summary:s}],o=j.current.toJSON(a,r);await window.bangonit?.generateReplayHtml?.({runDir:n,data:JSON.stringify(o)})}}catch(e){console.error(e)}}await r?.(e,"idle",i),W.current=!0,window.bangonit?.reportTestResult?.({agentId:e,status:i,summary:s}),Z({tool:n.toolName,toolCallId:n.toolCallId,output:`Test result recorded: ${i}`});return}if("todos"===n.toolName){let e=n.input,t=e?.todos||E;e?.todos&&T(e.todos),Z({tool:n.toolName,toolCallId:n.toolCallId,output:JSON.stringify(t)});return}if("browser"===n.toolName){try{let t=n.input,r=(t?.actions||[]).map(e=>"navigate"===e.action?`navigate ${e.url}`:"type"===e.action?`type "${(e.text||"").slice(0,30)}"`:"press"===e.action?`press ${e.key}`:"mouse"===e.action?`mouse ${(e.mouseActions||[]).map(e=>`${e.action} ${e.ref||`${e.x},${e.y}`}`).join(" > ")}`:e.action).join(", ");$("tool",`browser: ${r}${t?.observe?` [${t.observe}]`:""}`),j.current?.addEvent({ts:Date.now(),agentId:e,type:"tool-start",data:{tool:"browser",label:r}});let a=P.current,i=a?await a.exec({actions:t?.actions||[],observe:t?.observe||"snapshot",prompts:t?.prompts,forceFull:t?.forceFull}):{error:"Error: browser tools not available"};j.current?.addEvent({ts:Date.now(),agentId:e,type:"tool-end",data:{tool:"browser"}}),Z({tool:n.toolName,toolCallId:n.toolCallId,output:M.current?{error:"[Stopped by user]"}:JSON.stringify(i)})}catch(e){Z({tool:n.toolName,toolCallId:n.toolCallId,...M.current?{output:"[Stopped by user]"}:{state:"output-error",errorText:e.message}})}return}}}),V=L.length>0,B=null!==b;(0,et.useRef)(null),(0,et.useRef)(0),(0,et.useRef)("submitted"===q||"streaming"===q);let W=(0,et.useRef)(!1);(0,et.useRef)(!1),(0,et.useRef)(null);let H=(0,et.useCallback)(t=>{let n=A.current++;f(e=>[...e,{id:n,url:"about:blank",title:"",initialUrl:t}]),g(n),v("about:blank"===t?"":t),window.bangonit?.setActiveTab(e,n)},[e]),J=(0,et.useCallback)(t=>{f(n=>{let r=n.findIndex(e=>e.id===t);if(-1===r)return n;let a=n.filter(e=>e.id!==t);return 0===a.length?n:(g(n=>{if(n===t){let t=a[Math.max(0,r-1)].id,n=a.find(e=>e.id===t);return n&&v("about:blank"===n.url?"":n.url),window.bangonit?.setActiveTab(e,t),t}return n}),a)})},[e]),G=(0,et.useCallback)(t=>{g(t),window.bangonit?.setActiveTab(e,t),f(e=>{let n=e.find(e=>e.id===t);return n&&v("about:blank"===n.url?"":n.url),e})},[e]),K=(0,et.useRef)(H),Y=(0,et.useRef)(J),X=(0,et.useRef)(G);K.current=H,Y.current=J,X.current=G;let Q=(0,et.useCallback)((t,n,r)=>{if(!t)return;I.current.set(n,t);let a=()=>{if(!N.current.has(n))try{let a=t.getWebContentsId?.();a&&(N.current.add(n),window.bangonit?.registerTab(e,n,a,r,p),n===m&&window.bangonit?.setActiveTab(e,n))}catch(e){console.error(e)}};a(),t.addEventListener("did-attach",a),t.addEventListener("close",()=>Y.current(n)),t._consoleListenerAttached||(t._consoleListenerAttached=!0,t.addEventListener("console-message",t=>{window.bangonit?.emitConsoleMessage?.({agentId:e,level:t.level,message:t.message,url:t.sourceId||"",line:t.lineNumber||0}),j.current?.addConsoleLog(e,t.level,t.message,t.sourceId||"",t.lineNumber||0)}))},[e,m]),en=e=>`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`;return(0,ee.jsxs)("div",{className:"flex h-full w-full bg-zinc-950 overflow-hidden",children:[(0,ee.jsxs)("div",{className:"flex-1 flex flex-col border-r border-zinc-800 min-w-0",children:[ee.jsx("div",{className:"flex items-center bg-zinc-900 border-b border-zinc-800 overflow-x-auto",children:h.map(e=>ee.jsx("button",{onClick:()=>G(e.id),className:`flex items-center gap-1.5 px-3 py-2 text-xs border-r border-zinc-800 min-w-0 max-w-[200px] shrink-0
|
|
36
|
+
})));`),t.write(`newResult[${ej(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");let o=t.compile();return(t,n)=>o(e,t,n)},s=!e0.jitless,o=s&&e$.value,l=t.catchall;e._zod.parse=(u,c)=>{r??(r=a.value);let d=u.value;if(!eM(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;let p=[];if(s&&o&&c?.async===!1&&!0!==c.jitless)n||(n=i(t.shape)),u=n(u,c);else{u.value={};let e=r.shape;for(let t of r.keys){let n=e[t],r=n._zod.run({value:d[t],issues:[]},c),a="optional"===n._zod.optin&&"optional"===n._zod.optout;r instanceof Promise?p.push(r.then(e=>a?aP(e,u,t,d):aO(e,u,t))):a?aP(r,u,t,d):aO(r,u,t)}}if(!l)return p.length?Promise.all(p).then(()=>u):u;let h=[],f=r.keySet,m=l._zod,g=m.def.type;for(let e of Object.keys(d)){if(f.has(e))continue;if("never"===g){h.push(e);continue}let t=m.run({value:d[e],issues:[]},c);t instanceof Promise?p.push(t.then(t=>aO(t,u,e))):aO(t,u,e)}return(h.length&&u.issues.push({code:"unrecognized_keys",keys:h,input:d,inst:e}),p.length)?Promise.all(p).then(()=>u):u}});function aj(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>eJ(e,r,e1())))}),t}let aD=eX("$ZodUnion",(e,t)=>{r6.init(e,t),eP(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),eP(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eP(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),eP(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>eO(e.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let a=!1,i=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)i.push(t),a=!0;else{if(0===t.issues.length)return t;i.push(t)}}return a?Promise.all(i).then(t=>aj(t,n,e,r)):aj(i,n,e,r)}}),aM=eX("$ZodDiscriminatedUnion",(e,t)=>{aD.init(e,t);let n=e._zod.parse;eP(e._zod,"propValues",()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r))for(let r of(e[t]||(e[t]=new Set),n))e[t].add(r)}return e});let r=ez(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(a,i)=>{let s=a.value;if(!eM(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),a;let o=r.value.get(s?.[t.discriminator]);return o?o._zod.run(a,i):t.unionFallback?n(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),a)}}),a$=eX("$ZodIntersection",(e,t)=>{r6.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,a=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([t,n])=>aL(e,t,n)):aL(e,a,i)}});function aL(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),eB(e))return e;let r=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(eL(t)&&eL(n)){let r=Object.keys(n),a=Object.keys(t).filter(e=>-1!==r.indexOf(e)),i={...t,...n};for(let r of a){let a=e(t[r],n[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};i[r]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let a=0;a<t.length;a++){let i=e(t[a],n[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}let aF=eX("$ZodRecord",(e,t)=>{r6.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!eL(a))return n.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),n;let i=[];if(t.keyType._zod.values){let s;let o=t.keyType._zod.values;for(let e of(n.value={},o))if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){let s=t.valueType._zod.run({value:a[e],issues:[]},r);s instanceof Promise?i.push(s.then(t=>{t.issues.length&&n.issues.push(...eW(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...eW(e,s.issues)),n.value[e]=s.value)}for(let e in a)o.has(e)||(s=s??[]).push(e);s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:s})}else for(let s of(n.value={},Reflect.ownKeys(a))){if("__proto__"===s)continue;let o=t.keyType._zod.run({value:s,issues:[]},r);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(e=>eJ(e,r,e1())),input:s,path:[s],inst:e}),n.value[o.value]=o.value;continue}let l=t.valueType._zod.run({value:a[s],issues:[]},r);l instanceof Promise?i.push(l.then(e=>{e.issues.length&&n.issues.push(...eW(s,e.issues)),n.value[o.value]=e.value})):(l.issues.length&&n.issues.push(...eW(s,l.issues)),n.value[o.value]=l.value)}return i.length?Promise.all(i).then(()=>n):n}}),aZ=eX("$ZodEnum",(e,t)=>{r6.init(e,t);let n=eA(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>eF.has(typeof e)).map(e=>"string"==typeof e?eZ(e):e.toString()).join("|")})$`),e._zod.parse=(t,r)=>{let a=t.value;return e._zod.values.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),aq=eX("$ZodLiteral",(e,t)=>{r6.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eZ(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(n,r)=>{let a=n.value;return e._zod.values.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),aU=eX("$ZodTransform",(e,t)=>{r6.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new eQ;return e.value=r,e}}),aV=eX("$ZodOptional",(e,t)=>{r6.init(e,t),e._zod.optin="optional",e._zod.optout="optional",eP(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),eP(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eO(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)}),aB=eX("$ZodNullable",(e,t)=>{r6.init(e,t),eP(e._zod,"optin",()=>t.innerType._zod.optin),eP(e._zod,"optout",()=>t.innerType._zod.optout),eP(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eO(e.source)}|null)$`):void 0}),eP(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),aW=eX("$ZodDefault",(e,t)=>{r6.init(e,t),e._zod.optin="optional",eP(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>aH(e,t)):aH(r,t)}});function aH(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let aJ=eX("$ZodPrefault",(e,t)=>{r6.init(e,t),e._zod.optin="optional",eP(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),aG=eX("$ZodNonOptional",(e,t)=>{r6.init(e,t),eP(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(t=>aK(t,e)):aK(a,e)}});function aK(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let aY=eX("$ZodCatch",(e,t)=>{r6.init(e,t),e._zod.optin="optional",eP(e._zod,"optout",()=>t.innerType._zod.optout),eP(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>eJ(e,n,e1()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>eJ(e,n,e1()))},input:e.value}),e.issues=[]),e)}}),aX=eX("$ZodPipe",(e,t)=>{r6.init(e,t),eP(e._zod,"values",()=>t.in._zod.values),eP(e._zod,"optin",()=>t.in._zod.optin),eP(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>aQ(e,t,n)):aQ(r,t,n)}});function aQ(e,t,n){return eB(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}let a0=eX("$ZodReadonly",(e,t)=>{r6.init(e,t),eP(e._zod,"propValues",()=>t.innerType._zod.propValues),eP(e._zod,"values",()=>t.innerType._zod.values),eP(e._zod,"optin",()=>t.innerType._zod.optin),eP(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(a1):a1(r)}});function a1(e){return e.value=Object.freeze(e.value),e}let a2=eX("$ZodLazy",(e,t)=>{r6.init(e,t),eP(e._zod,"innerType",()=>t.getter()),eP(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),eP(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),eP(e._zod,"optin",()=>e._zod.innerType._zod.optin),eP(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),a4=eX("$ZodCustom",(e,t)=>{rq.init(e,t),r6.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(t=>a9(t,n,r,e));a9(a,n,r,e)}});function a9(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(eK(e))}}function a3(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...eU(t)})}function a5(e,t){return new rV({check:"less_than",...eU(t),value:e,inclusive:!1})}function a6(e,t){return new rV({check:"less_than",...eU(t),value:e,inclusive:!0})}function a8(e,t){return new rB({check:"greater_than",...eU(t),value:e,inclusive:!1})}function a7(e,t){return new rB({check:"greater_than",...eU(t),value:e,inclusive:!0})}function ie(e,t){return new rW({check:"multiple_of",...eU(t),value:e})}function it(e,t){return new rJ({check:"max_length",...eU(t),maximum:e})}function ir(e,t){return new rG({check:"min_length",...eU(t),minimum:e})}function ia(e,t){return new rK({check:"length_equals",...eU(t),length:e})}function ii(e){return new r9({check:"overwrite",tx:e})}let is=eX("ZodISODateTime",(e,t)=>{ad.init(e,t),im.init(e,t)}),io=eX("ZodISODate",(e,t)=>{ap.init(e,t),im.init(e,t)}),il=eX("ZodISOTime",(e,t)=>{ah.init(e,t),im.init(e,t)}),iu=eX("ZodISODuration",(e,t)=>{af.init(e,t),im.init(e,t)}),ic=eX("ZodType",(e,t)=>(r6.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>eq(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>tt(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>tr(e,t,n),e.parseAsync=async(t,n)=>tn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ta(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return new su({type:"custom",check:"custom",fn:e,...eU(t)})}(t,n)),e.superRefine=t=>e.check(function(e){let t=function(e){let t=new rq({check:"custom"});return t._zod.check=e,t}(n=>(n.addIssue=e=>{"string"==typeof e?n.issues.push(eK(e,n.value,t._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=n.value),e.inst??(e.inst=t),e.continue??(e.continue=!t._zod.def.abort),n.issues.push(eK(e)))},e(n.value,n)));return t}(t)),e.overwrite=t=>e.check(ii(t)),e.optional=()=>i8(e),e.nullable=()=>se(e),e.nullish=()=>i8(se(e)),e.nonoptional=t=>new sr({type:"nonoptional",innerType:e,...eU(t)}),e.array=()=>iW(e),e.or=t=>iY([e,t]),e.and=t=>new iQ({type:"intersection",left:e,right:t}),e.transform=t=>ss(e,new i5({type:"transform",transform:t})),e.default=t=>(function(e,t){return new st({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})})(e,t),e.prefault=t=>(function(e,t){return new sn({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})})(e,t),e.catch=t=>(function(e,t){return new sa({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})})(e,t),e.pipe=t=>ss(e,t),e.readonly=()=>new so({type:"readonly",innerType:e}),e.describe=t=>{let n=e.clone();return eC.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>eC.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return eC.get(e);let n=e.clone();return eC.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),id=eX("_ZodString",(e,t)=>{r8.init(e,t),ic.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new rX({check:"string_format",format:"regex",...eU(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new r1({check:"string_format",format:"includes",...eU(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new r2({check:"string_format",format:"starts_with",...eU(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new r4({check:"string_format",format:"ends_with",...eU(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ir(...t)),e.max=(...t)=>e.check(it(...t)),e.length=(...t)=>e.check(ia(...t)),e.nonempty=(...t)=>e.check(ir(1,...t)),e.lowercase=t=>e.check(new rQ({check:"string_format",format:"lowercase",...eU(t)})),e.uppercase=t=>e.check(new r0({check:"string_format",format:"uppercase",...eU(t)})),e.trim=()=>e.check(ii(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ii(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ii(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ii(e=>e.toUpperCase()))}),ip=eX("ZodString",(e,t)=>{r8.init(e,t),id.init(e,t),e.email=t=>e.check(new ig({type:"string",format:"email",check:"string_format",abort:!1,...eU(t)})),e.url=t=>e.check(new ib({type:"string",format:"url",check:"string_format",abort:!1,...eU(t)})),e.jwt=t=>e.check(new iR({type:"string",format:"jwt",check:"string_format",abort:!1,...eU(t)})),e.emoji=t=>e.check(new ix({type:"string",format:"emoji",check:"string_format",abort:!1,...eU(t)})),e.guid=t=>e.check(a3(iy,t)),e.uuid=t=>e.check(new iv({type:"string",format:"uuid",check:"string_format",abort:!1,...eU(t)})),e.uuidv4=t=>e.check(new iv({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eU(t)})),e.uuidv6=t=>e.check(new iv({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eU(t)})),e.uuidv7=t=>e.check(new iv({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eU(t)})),e.nanoid=t=>e.check(new ik({type:"string",format:"nanoid",check:"string_format",abort:!1,...eU(t)})),e.guid=t=>e.check(a3(iy,t)),e.cuid=t=>e.check(new iw({type:"string",format:"cuid",check:"string_format",abort:!1,...eU(t)})),e.cuid2=t=>e.check(new i_({type:"string",format:"cuid2",check:"string_format",abort:!1,...eU(t)})),e.ulid=t=>e.check(new iS({type:"string",format:"ulid",check:"string_format",abort:!1,...eU(t)})),e.base64=t=>e.check(new iz({type:"string",format:"base64",check:"string_format",abort:!1,...eU(t)})),e.base64url=t=>e.check(new iO({type:"string",format:"base64url",check:"string_format",abort:!1,...eU(t)})),e.xid=t=>e.check(new iI({type:"string",format:"xid",check:"string_format",abort:!1,...eU(t)})),e.ksuid=t=>e.check(new iE({type:"string",format:"ksuid",check:"string_format",abort:!1,...eU(t)})),e.ipv4=t=>e.check(new iT({type:"string",format:"ipv4",check:"string_format",abort:!1,...eU(t)})),e.ipv6=t=>e.check(new iC({type:"string",format:"ipv6",check:"string_format",abort:!1,...eU(t)})),e.cidrv4=t=>e.check(new iA({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eU(t)})),e.cidrv6=t=>e.check(new iN({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eU(t)})),e.e164=t=>e.check(new iP({type:"string",format:"e164",check:"string_format",abort:!1,...eU(t)})),e.datetime=t=>e.check(new is({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eU(t)})),e.date=t=>e.check(new io({type:"string",format:"date",check:"string_format",...eU(t)})),e.time=t=>e.check(new il({type:"string",format:"time",check:"string_format",precision:null,...eU(t)})),e.duration=t=>e.check(new iu({type:"string",format:"duration",check:"string_format",...eU(t)}))});function ih(e){return new ip({type:"string",...eU(e)})}let im=eX("ZodStringFormat",(e,t)=>{r7.init(e,t),id.init(e,t)}),ig=eX("ZodEmail",(e,t)=>{an.init(e,t),im.init(e,t)}),iy=eX("ZodGUID",(e,t)=>{ae.init(e,t),im.init(e,t)}),iv=eX("ZodUUID",(e,t)=>{at.init(e,t),im.init(e,t)}),ib=eX("ZodURL",(e,t)=>{ar.init(e,t),im.init(e,t)}),ix=eX("ZodEmoji",(e,t)=>{aa.init(e,t),im.init(e,t)}),ik=eX("ZodNanoID",(e,t)=>{ai.init(e,t),im.init(e,t)}),iw=eX("ZodCUID",(e,t)=>{as.init(e,t),im.init(e,t)}),i_=eX("ZodCUID2",(e,t)=>{ao.init(e,t),im.init(e,t)}),iS=eX("ZodULID",(e,t)=>{al.init(e,t),im.init(e,t)}),iI=eX("ZodXID",(e,t)=>{au.init(e,t),im.init(e,t)}),iE=eX("ZodKSUID",(e,t)=>{ac.init(e,t),im.init(e,t)}),iT=eX("ZodIPv4",(e,t)=>{am.init(e,t),im.init(e,t)}),iC=eX("ZodIPv6",(e,t)=>{ag.init(e,t),im.init(e,t)}),iA=eX("ZodCIDRv4",(e,t)=>{ay.init(e,t),im.init(e,t)}),iN=eX("ZodCIDRv6",(e,t)=>{av.init(e,t),im.init(e,t)}),iz=eX("ZodBase64",(e,t)=>{ax.init(e,t),im.init(e,t)}),iO=eX("ZodBase64URL",(e,t)=>{ak.init(e,t),im.init(e,t)}),iP=eX("ZodE164",(e,t)=>{aw.init(e,t),im.init(e,t)}),iR=eX("ZodJWT",(e,t)=>{a_.init(e,t),im.init(e,t)}),ij=eX("ZodNumber",(e,t)=>{aS.init(e,t),ic.init(e,t),e.gt=(t,n)=>e.check(a8(t,n)),e.gte=(t,n)=>e.check(a7(t,n)),e.min=(t,n)=>e.check(a7(t,n)),e.lt=(t,n)=>e.check(a5(t,n)),e.lte=(t,n)=>e.check(a6(t,n)),e.max=(t,n)=>e.check(a6(t,n)),e.int=t=>e.check(iM(t)),e.safe=t=>e.check(iM(t)),e.positive=t=>e.check(a8(0,t)),e.nonnegative=t=>e.check(a7(0,t)),e.negative=t=>e.check(a5(0,t)),e.nonpositive=t=>e.check(a6(0,t)),e.multipleOf=(t,n)=>e.check(ie(t,n)),e.step=(t,n)=>e.check(ie(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),iD=eX("ZodNumberFormat",(e,t)=>{aI.init(e,t),ij.init(e,t)});function iM(e){return new iD({type:"number",check:"number_format",abort:!1,format:"safeint",...eU(e)})}let i$=eX("ZodBoolean",(e,t)=>{aE.init(e,t),ic.init(e,t)});function iL(e){return new i$({type:"boolean",...eU(e)})}let iF=eX("ZodNull",(e,t)=>{aT.init(e,t),ic.init(e,t)}),iZ=eX("ZodUnknown",(e,t)=>{aC.init(e,t),ic.init(e,t)});function iq(){return new iZ({type:"unknown"})}let iU=eX("ZodNever",(e,t)=>{aA.init(e,t),ic.init(e,t)});function iV(e){return new iU({type:"never",...eU(e)})}let iB=eX("ZodArray",(e,t)=>{az.init(e,t),ic.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ir(t,n)),e.nonempty=t=>e.check(ir(1,t)),e.max=(t,n)=>e.check(it(t,n)),e.length=(t,n)=>e.check(ia(t,n)),e.unwrap=()=>e.element});function iW(e,t){return new iB({type:"array",element:e,...eU(t)})}let iH=eX("ZodObject",(e,t)=>{aR.init(e,t),ic.init(e,t),eP(e,"shape",()=>t.shape),e.keyof=()=>i4(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:iq()}),e.loose=()=>e.clone({...e._zod.def,catchall:iq()}),e.strict=()=>e.clone({...e._zod.def,catchall:iV()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>(function(e,t){if(!eL(t))throw Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return eR(this,"shape",n),n},checks:[]};return eq(e,n)})(e,t),e.merge=t=>(function(e,t){return eq(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return eR(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})})(e,t),e.pick=t=>(function(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return eq(e,{...e._zod.def,shape:n,checks:[]})})(e,t),e.omit=t=>(function(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return eq(e,{...e._zod.def,shape:n,checks:[]})})(e,t),e.partial=(...t)=>(function(e,t,n){let r=t._zod.def.shape,a={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)a[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return eq(t,{...t._zod.def,shape:a,checks:[]})})(i6,e,t[0]),e.required=(...t)=>(function(e,t,n){let r=t._zod.def.shape,a={...r};if(n)for(let t in n){if(!(t in a))throw Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(let t in r)a[t]=new e({type:"nonoptional",innerType:r[t]});return eq(t,{...t._zod.def,shape:a,checks:[]})})(sr,e,t[0])});function iJ(e,t){return new iH({type:"object",get shape(){return eR(this,"shape",{...e}),this.shape},...eU(t)})}function iG(e,t){return new iH({type:"object",get shape(){return eR(this,"shape",{...e}),this.shape},catchall:iV(),...eU(t)})}let iK=eX("ZodUnion",(e,t)=>{aD.init(e,t),ic.init(e,t),e.options=t.options});function iY(e,t){return new iK({type:"union",options:e,...eU(t)})}let iX=eX("ZodDiscriminatedUnion",(e,t)=>{iK.init(e,t),aM.init(e,t)}),iQ=eX("ZodIntersection",(e,t)=>{a$.init(e,t),ic.init(e,t)}),i0=eX("ZodRecord",(e,t)=>{aF.init(e,t),ic.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function i1(e,t,n){return new i0({type:"record",keyType:e,valueType:t,...eU(n)})}let i2=eX("ZodEnum",(e,t)=>{aZ.init(e,t),ic.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let a={};for(let r of e)if(n.has(r))a[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new i2({...t,checks:[],...eU(r),entries:a})},e.exclude=(e,r)=>{let a={...t.entries};for(let t of e)if(n.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new i2({...t,checks:[],...eU(r),entries:a})}});function i4(e,t){return new i2({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eU(t)})}let i9=eX("ZodLiteral",(e,t)=>{aq.init(e,t),ic.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function i3(e,t){return new i9({type:"literal",values:Array.isArray(e)?e:[e],...eU(t)})}let i5=eX("ZodTransform",(e,t)=>{aU.init(e,t),ic.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{"string"==typeof r?n.issues.push(eK(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),r.continue??(r.continue=!0),n.issues.push(eK(r)))};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}}),i6=eX("ZodOptional",(e,t)=>{aV.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType});function i8(e){return new i6({type:"optional",innerType:e})}let i7=eX("ZodNullable",(e,t)=>{aB.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType});function se(e){return new i7({type:"nullable",innerType:e})}let st=eX("ZodDefault",(e,t)=>{aW.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),sn=eX("ZodPrefault",(e,t)=>{aJ.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType}),sr=eX("ZodNonOptional",(e,t)=>{aG.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType}),sa=eX("ZodCatch",(e,t)=>{aY.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),si=eX("ZodPipe",(e,t)=>{aX.init(e,t),ic.init(e,t),e.in=t.in,e.out=t.out});function ss(e,t){return new si({type:"pipe",in:e,out:t})}let so=eX("ZodReadonly",(e,t)=>{a0.init(e,t),ic.init(e,t)}),sl=eX("ZodLazy",(e,t)=>{a2.init(e,t),ic.init(e,t),e.unwrap=()=>e._zod.def.getter()}),su=eX("ZodCustom",(e,t)=>{a4.init(e,t),ic.init(e,t)});function sc(e,t){return function(e,t,n){let r=eU(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}(su,e??(()=>!0),t)}function sd(e,t={error:`Input not instance of ${e.name}`}){let n=new su({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...eU(t)});return n._zod.bag.Class=e,n}var sp=Object.defineProperty,sh="AI_InvalidArgumentError",sf=`vercel.ai.error.${sh}`,sm=Symbol.for(sf),sg=class extends ea{constructor({parameter:e,value:t,message:n}){super({name:sh,message:`Invalid argument for parameter ${e}: ${n}`}),this[_]=!0,this.parameter=e,this.value=t}static isInstance(e){return ea.hasMarker(e,sf)}};_=sm,Symbol.for("vercel.ai.error.AI_InvalidStreamPartError");var sy="AI_InvalidToolApprovalError",sv=`vercel.ai.error.${sy}`,sb=Symbol.for(sv),sx=class extends ea{constructor({approvalId:e}){super({name:sy,message:`Tool approval response references unknown approvalId: "${e}". No matching tool-approval-request found in message history.`}),this[S]=!0,this.approvalId=e}static isInstance(e){return ea.hasMarker(e,sv)}};S=sb;var sk="AI_InvalidToolInputError",sw=`vercel.ai.error.${sk}`,s_=Symbol.for(sw),sS=class extends ea{constructor({toolInput:e,toolName:t,cause:n,message:r=`Invalid input for tool ${t}: ${ei(n)}`}){super({name:sk,message:r,cause:n}),this[I]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return ea.hasMarker(e,sw)}};I=s_;var sI="AI_ToolCallNotFoundForApprovalError",sE=`vercel.ai.error.${sI}`,sT=Symbol.for(sE),sC=class extends ea{constructor({toolCallId:e,approvalId:t}){super({name:sI,message:`Tool call "${e}" not found for approval request "${t}".`}),this[E]=!0,this.toolCallId=e,this.approvalId=t}static isInstance(e){return ea.hasMarker(e,sE)}};E=sT;var sA="AI_MissingToolResultsError",sN=`vercel.ai.error.${sA}`,sz=Symbol.for(sN),sO=class extends ea{constructor({toolCallIds:e}){super({name:sA,message:`Tool result${e.length>1?"s are":" is"} missing for tool call${e.length>1?"s":""} ${e.join(", ")}.`}),this[T]=!0,this.toolCallIds=e}static isInstance(e){return ea.hasMarker(e,sN)}};T=sz,Symbol.for("vercel.ai.error.AI_NoImageGeneratedError");var sP="AI_NoObjectGeneratedError",sR=`vercel.ai.error.${sP}`,sj=Symbol.for(sR),sD=class extends ea{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:a,finishReason:i}){super({name:sP,message:e,cause:t}),this[A]=!0,this.text=n,this.response=r,this.usage=a,this.finishReason=i}static isInstance(e){return ea.hasMarker(e,sR)}};A=sj;var sM="AI_NoOutputGeneratedError",s$=`vercel.ai.error.${sM}`,sL=Symbol.for(s$),sF=class extends ea{constructor({message:e="No output generated.",cause:t}={}){super({name:sM,message:e,cause:t}),this[N]=!0}static isInstance(e){return ea.hasMarker(e,s$)}};N=sL,Symbol.for("vercel.ai.error.AI_NoSpeechGeneratedError"),Symbol.for("vercel.ai.error.AI_NoTranscriptGeneratedError"),Symbol.for("vercel.ai.error.AI_NoVideoGeneratedError");var sZ="AI_NoSuchToolError",sq=`vercel.ai.error.${sZ}`,sU=Symbol.for(sq),sV=class extends ea{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({name:sZ,message:n}),this[R]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return ea.hasMarker(e,sq)}};R=sU;var sB="AI_ToolCallRepairError",sW=`vercel.ai.error.${sB}`,sH=Symbol.for(sW),sJ=class extends ea{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${ei(e)}`}){super({name:sB,message:n,cause:e}),this[j]=!0,this.originalError=t}static isInstance(e){return ea.hasMarker(e,sW)}};j=sH;var sG=class extends ea{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},sK="AI_UIMessageStreamError",sY=`vercel.ai.error.${sK}`,sX=Symbol.for(sY),sQ=class extends ea{constructor({chunkType:e,chunkId:t,message:n}){super({name:sK,message:n}),this[D]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return ea.hasMarker(e,sY)}};D=sX;var s0="AI_InvalidDataContentError",s1=`vercel.ai.error.${s0}`;M=Symbol.for(s1);var s2="AI_InvalidMessageRoleError",s4=`vercel.ai.error.${s2}`,s9=Symbol.for(s4),s3=class extends ea{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:s2,message:t}),this[$]=!0,this.role=e}static isInstance(e){return ea.hasMarker(e,s4)}};$=s9;var s5="AI_MessageConversionError",s6=`vercel.ai.error.${s5}`,s8=Symbol.for(s6),s7=class extends ea{constructor({originalMessage:e,message:t}){super({name:s5,message:t}),this[L]=!0,this.originalMessage=e}static isInstance(e){return ea.hasMarker(e,s6)}};L=s8;var oe="AI_RetryError",ot=`vercel.ai.error.${oe}`,on=Symbol.for(ot),or=class extends ea{constructor({message:e,reason:t,errors:n}){super({name:oe,message:e}),this[F]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return ea.hasMarker(e,ot)}};function oa(e){return void 0===e?[]:Array.isArray(e)?e:[e]}async function oi(e){for(let t of oa(e.callbacks))if(null!=t)try{await t(e.event)}catch(e){}}F=on;var os=!1,oo=e=>{if(0===e.warnings.length)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(!1!==t){if("function"==typeof t){t(e);return}for(let t of(os||(os=!0,console.info("AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.")),e.warnings))console.warn(function({warning:e,provider:t,model:n}){let r=`AI SDK Warning (${t} / ${n}):`;switch(e.type){case"unsupported":{let t=`${r} The feature "${e.feature}" is not supported.`;return e.details&&(t+=` ${e.details}`),t}case"compatibility":{let t=`${r} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(t+=` ${e.details}`),t}case"other":return`${r} ${e.message}`;default:return`${r} ${JSON.stringify(e,null,2)}`}}({warning:t,provider:e.provider,model:e.model}))}};function ol({provider:e,modelId:t}){oo({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}function ou(e){return{unified:"unknown"===e?"other":e,raw:void 0}}function oc(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}var od=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}],op=e=>{let t="string"==typeof e?convertBase64ToUint8Array(e):e,n=(127&t[6])<<21|(127&t[7])<<14|(127&t[8])<<7|127&t[9];return t.slice(n+10)},oh="6.0.116",of=async({url:e,maxBytes:t,abortSignal:n})=>{var r;let a=e.toString();(function(e){let t;try{t=new URL(e)}catch(t){throw new nT({url:e,message:`Invalid URL: ${e}`})}if("http:"!==t.protocol&&"https:"!==t.protocol)throw new nT({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let n=t.hostname;if(!n)throw new nT({url:e,message:"URL must have a hostname"});if("localhost"===n||n.endsWith(".local")||n.endsWith(".localhost"))throw new nT({url:e,message:`URL with hostname ${n} is not allowed`});if(n.startsWith("[")&&n.endsWith("]")){if(function(e){let t=e.toLowerCase();if("::1"===t||"::"===t)return!0;if(t.startsWith("::ffff:")){let e=t.slice(7);if(nA(e))return nN(e);let n=e.split(":");if(2===n.length){let e=parseInt(n[0],16),t=parseInt(n[1],16);if(!isNaN(e)&&!isNaN(t))return nN(`${e>>8&255}.${255&e}.${t>>8&255}.${255&t}`)}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}(n.slice(1,-1)))throw new nT({url:e,message:`URL with IPv6 address ${n} is not allowed`});return}if(nA(n)&&nN(n))throw new nT({url:e,message:`URL with IP address ${n} is not allowed`})})(a);try{let e=await fetch(a,{headers:nj({},`ai-sdk/${oh}`,nP()),signal:n});if(!e.ok)throw new nT({url:a,statusCode:e.status,statusText:e.statusText});return{data:await nC({response:e,url:a,maxBytes:null!=t?t:2147483648}),mediaType:null!=(r=e.headers.get("content-type"))?r:void 0}}catch(e){if(nT.isInstance(e))throw e;throw new nT({url:a,cause:e})}},om=(e=of)=>t=>Promise.all(t.map(async t=>t.isUrlSupportedByModel?null:e(t))),og=iY([ih(),sd(Uint8Array),sd(ArrayBuffer),sc(e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n},{message:"Must be a Buffer"})]);function oy(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if("string"==typeof e)try{e=new URL(e)}catch(e){}if(e instanceof URL&&"data:"===e.protocol){let{mediaType:t,base64Content:n}=function(e){try{let[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch(e){return{mediaType:void 0,base64Content:void 0}}}(e.toString());if(null==t||null==n)throw new AISDKError22({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}async function ov(e,t,n){let r=e.filter(e=>"user"===e.role).map(e=>e.content).filter(e=>Array.isArray(e)).flat().filter(e=>"image"===e.type||"file"===e.type).map(e=>{var t;let n=null!=(t=e.mediaType)?t:"image"===e.type?"image/*":void 0,r="image"===e.type?e.image:e.data;if("string"==typeof r)try{r=new URL(r)}catch(e){}return{mediaType:n,data:r}}).filter(e=>e.data instanceof URL).map(e=>({url:e.data,isUrlSupportedByModel:null!=e.mediaType&&isUrlSupported({url:e.data.toString(),mediaType:e.mediaType,supportedUrls:n})}));return Object.fromEntries((await t(r)).map((e,t)=>null==e?null:[r[t].url.toString(),{data:e.data,mediaType:e.mediaType}]).filter(e=>null!=e))}function ob(e){return"content"!==e.type?e:{type:"content",value:e.value.map(e=>"media"!==e.type?e:e.mediaType.startsWith("image/")?{type:"image-data",data:e.data,mediaType:e.mediaType}:{type:"file-data",data:e.data,mediaType:e.mediaType})}}async function ox({toolCallId:e,input:t,output:n,tool:r,errorMode:a}){return"text"===a?{type:"error-text",value:getErrorMessage3(n)}:"json"===a?{type:"error-json",value:ok(n)}:(null==r?void 0:r.toModelOutput)?await r.toModelOutput({toolCallId:e,input:t,output:n}):"string"==typeof n?{type:"text",value:n}:{type:"json",value:ok(n)}}function ok(e){return void 0===e?null:e}var ow=new sl({type:"lazy",getter:()=>iY([new iF({type:"null",...eU(void 0)}),ih(),new ij({type:"number",checks:[],...eU(void 0)}),iL(),i1(ih(),ow.optional()),iW(ow)])}),o_=i1(ih(),i1(ih(),ow.optional())),oS=iJ({type:i3("text"),text:ih(),providerOptions:o_.optional()}),oI=iJ({type:i3("image"),image:iY([og,sd(URL)]),mediaType:ih().optional(),providerOptions:o_.optional()}),oE=iJ({type:i3("file"),data:iY([og,sd(URL)]),filename:ih().optional(),mediaType:ih(),providerOptions:o_.optional()}),oT=iJ({type:i3("reasoning"),text:ih(),providerOptions:o_.optional()}),oC=iJ({type:i3("tool-call"),toolCallId:ih(),toolName:ih(),input:iq(),providerOptions:o_.optional(),providerExecuted:iL().optional()}),oA=(a="type",new iX({type:"union",options:[iJ({type:i3("text"),value:ih(),providerOptions:o_.optional()}),iJ({type:i3("json"),value:ow,providerOptions:o_.optional()}),iJ({type:i3("execution-denied"),reason:ih().optional(),providerOptions:o_.optional()}),iJ({type:i3("error-text"),value:ih(),providerOptions:o_.optional()}),iJ({type:i3("error-json"),value:ow,providerOptions:o_.optional()}),iJ({type:i3("content"),value:iW(iY([iJ({type:i3("text"),text:ih(),providerOptions:o_.optional()}),iJ({type:i3("media"),data:ih(),mediaType:ih()}),iJ({type:i3("file-data"),data:ih(),mediaType:ih(),filename:ih().optional(),providerOptions:o_.optional()}),iJ({type:i3("file-url"),url:ih(),providerOptions:o_.optional()}),iJ({type:i3("file-id"),fileId:iY([ih(),i1(ih(),ih())]),providerOptions:o_.optional()}),iJ({type:i3("image-data"),data:ih(),mediaType:ih(),providerOptions:o_.optional()}),iJ({type:i3("image-url"),url:ih(),providerOptions:o_.optional()}),iJ({type:i3("image-file-id"),fileId:iY([ih(),i1(ih(),ih())]),providerOptions:o_.optional()}),iJ({type:i3("custom"),providerOptions:o_.optional()})]))})],discriminator:a,...eU(void 0)})),oN=iJ({type:i3("tool-result"),toolCallId:ih(),toolName:ih(),output:oA,providerOptions:o_.optional()}),oz=iJ({type:i3("tool-approval-request"),approvalId:ih(),toolCallId:ih()}),oO=iJ({type:i3("tool-approval-response"),approvalId:ih(),approved:iL(),reason:ih().optional()}),oP=iJ({role:i3("system"),content:ih(),providerOptions:o_.optional()}),oR=iJ({role:i3("user"),content:iY([ih(),iW(iY([oS,oI,oE]))]),providerOptions:o_.optional()}),oj=iJ({role:i3("assistant"),content:iY([ih(),iW(iY([oS,oE,oT,oC,oN,oz]))]),providerOptions:o_.optional()}),oD=iJ({role:i3("tool"),content:iW(iY([oN,oO])),providerOptions:o_.optional()}),oM=iY([oP,oR,oj,oD]),o$={startSpan:()=>oL,startActiveSpan:(e,t,n,r)=>"function"==typeof t?t(oL):"function"==typeof n?n(oL):"function"==typeof r?r(oL):void 0},oL={spanContext:()=>oF,setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording:()=>!1,recordException(){return this}},oF={traceId:"",spanId:"",traceFlags:0};async function oZ({name:e,tracer:t,attributes:n,fn:r,endWhenDone:a=!0}){return t.startActiveSpan(e,{attributes:await n},async e=>{let t=context.active();try{let n=await context.with(t,()=>r(e));return a&&e.end(),n}catch(t){try{oq(e,t)}finally{e.end()}throw t}})}function oq(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:SpanStatusCode.ERROR,message:t.message})):e.setStatus({code:SpanStatusCode.ERROR})}async function oU({telemetry:e,attributes:t}){if((null==e?void 0:e.isEnabled)!==!0)return{};let n={};for(let[r,a]of Object.entries(t))if(null!=a){if("object"==typeof a&&"input"in a&&"function"==typeof a.input){if((null==e?void 0:e.recordInputs)===!1)continue;let t=await a.input();null!=t&&(n[r]=t);continue}if("object"==typeof a&&"output"in a&&"function"==typeof a.output){if((null==e?void 0:e.recordOutputs)===!1)continue;let t=await a.output();null!=t&&(n[r]=t);continue}n[r]=a}return n}function oV(e,t){return null==e&&null==t?void 0:(null!=e?e:0)+(null!=t?t:0)}var oB=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:r}={})=>async a=>oW(a,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:r});async function oW(e,{maxRetries:t,delayInMs:n,backoffFactor:r,abortSignal:a},i=[]){try{return await e()}catch(u){if(isAbortError(u)||0===t)throw u;let s=getErrorMessage4(u),o=[...i,u],l=o.length;if(l>t)throw new or({message:`Failed after ${l} attempts. Last error: ${s}`,reason:"maxRetriesExceeded",errors:o});if(u instanceof Error&&APICallError2.isInstance(u)&&!0===u.isRetryable&&l<=t)return await delay(function({error:e,exponentialBackoffDelay:t}){let n;let r=e.responseHeaders;if(!r)return t;let a=r["retry-after-ms"];if(a){let e=parseFloat(a);Number.isNaN(e)||(n=e)}let i=r["retry-after"];if(i&&void 0===n){let e=parseFloat(i);n=Number.isNaN(e)?Date.parse(i)-Date.now():1e3*e}return null!=n&&!Number.isNaN(n)&&0<=n&&(n<6e4||n<t)?n:t}({error:u,exponentialBackoffDelay:n}),{abortSignal:a}),oW(e,{maxRetries:t,delayInMs:r*n,backoffFactor:r,abortSignal:a},o);if(1===l)throw u;throw new or({message:`Failed after ${l} attempts with non-retryable error: '${s}'`,reason:"errorNotRetryable",errors:o})}}function oH(){var e,t;return null!=(t=null==(e=null==globalThis?void 0:globalThis.performance)?void 0:e.now())?t:Date.now()}async function oJ({toolCall:e,tools:t,tracer:n,telemetry:r,messages:a,abortSignal:i,experimental_context:s,stepNumber:o,model:l,onPreliminaryToolResult:u,onToolCallStart:c,onToolCallFinish:d}){let{toolName:p,toolCallId:h,input:f}=e,m=null==t?void 0:t[p];if((null==m?void 0:m.execute)==null)return;let g={stepNumber:o,model:l,toolCall:e,messages:a,abortSignal:i,functionId:null==r?void 0:r.functionId,metadata:null==r?void 0:r.metadata,experimental_context:s};return oZ({name:"ai.toolCall",attributes:oU({telemetry:r,attributes:{...function({operationId:e,telemetry:t}){return{"operation.name":`${e}${(null==t?void 0:t.functionId)!=null?` ${t.functionId}`:""}`,"resource.name":null==t?void 0:t.functionId,"ai.operationId":e,"ai.telemetry.functionId":null==t?void 0:t.functionId}}({operationId:"ai.toolCall",telemetry:r}),"ai.toolCall.name":p,"ai.toolCall.id":h,"ai.toolCall.args":{output:()=>JSON.stringify(f)}}}),tracer:n,fn:async t=>{let n;await oi({event:g,callbacks:c});let o=oH();try{for await(let t of executeTool({execute:m.execute.bind(m),input:f,options:{toolCallId:h,messages:a,abortSignal:i,experimental_context:s}}))"preliminary"===t.type?null==u||u({...e,type:"tool-result",output:t.output,preliminary:!0}):n=t.output}catch(r){let n=oH()-o;return await oi({event:{...g,success:!1,error:r,durationMs:n},callbacks:d}),oq(t,r),{type:"tool-error",toolCallId:h,toolName:p,input:f,error:r,dynamic:"dynamic"===m.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}let l=oH()-o;await oi({event:{...g,success:!0,output:n,durationMs:l},callbacks:d});try{t.setAttributes(await oU({telemetry:r,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(n)}}}))}catch(e){}return{type:"tool-result",toolCallId:h,toolName:p,input:f,output:n,dynamic:"dynamic"===m.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}})}var oG=class{constructor({data:e,mediaType:t}){let n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return null==this.base64Data&&(this.base64Data=function(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return nw(t)}(this.uint8ArrayData)),this.base64Data}get uint8Array(){return null==this.uint8ArrayData&&(this.uint8ArrayData=function(e){let t=n_(e.replace(/-/g,"+").replace(/_/g,"/"));return Uint8Array.from(t,e=>e.codePointAt(0))}(this.base64Data)),this.uint8ArrayData}};async function oK(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await rp({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await rp({text:function(e){let t=["ROOT"],n=-1,r=null;function a(e,a,i){switch(e){case'"':n=a,t.pop(),t.push(i),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=a,r=a,t.pop(),t.push(i),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=a,t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"{":n=a,t.pop(),t.push(i),t.push("INSIDE_OBJECT_START");break;case"[":n=a,t.pop(),t.push(i),t.push("INSIDE_ARRAY_START")}}function i(e,r){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=r,t.pop()}}function s(e,r){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=r,t.pop()}}for(let o=0;o<e.length;o++){let l=e[o];switch(t[t.length-1]){case"ROOT":a(l,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===l&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":a(l,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":i(l,o);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":"]"===l?(n=o,t.pop()):(n=o,a(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":a(l,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{let a=e.substring(r,o+1);"false".startsWith(a)||"true".startsWith(a)||"null".startsWith(a)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?i(l,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o))}}}let o=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{let t=e.substring(r,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}return o}(e)})).success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"}}((e,t)=>{for(var n in t)sp(e,n,{get:t[n],enumerable:!0})})({},{array:()=>oQ,choice:()=>o0,json:()=>o1,object:()=>oX,text:()=>oY});var oY=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e}),createElementStreamTransform(){}}),oX=({schema:e,name:t,description:n})=>{let r=rl(e);return{name:"object",responseFormat:rh(r.jsonSchema).then(e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=n&&{description:n}})),async parseCompleteOutput({text:e},t){let n=await rp({text:e});if(!n.success)throw new sD({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=await rd({value:n.value,schema:r});if(!a.success)throw new sD({message:"No object generated: response did not match schema.",cause:a.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return a.value},async parsePartialOutput({text:e}){let t=await oK(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}},createElementStreamTransform(){}}},oQ=({element:e,name:t,description:n})=>{let r=rl(e);return{name:"array",responseFormat:rh(r.jsonSchema).then(e=>{let{$schema:r,...a}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}}),async parseCompleteOutput({text:e},t){let n=await rp({text:e});if(!n.success)throw new sD({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=n.value;if(null==a||"object"!=typeof a||!("elements"in a)||!Array.isArray(a.elements))throw new sD({message:"No object generated: response did not match schema.",cause:new ek({value:a,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(let n of a.elements){let a=await rd({value:n,schema:r});if(!a.success)throw new sD({message:"No object generated: response did not match schema.",cause:a.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return a.elements},async parsePartialOutput({text:e}){let t=await oK(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;let n="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,a=[];for(let e of n){let t=await rd({value:e,schema:r});t.success&&a.push(t.value)}return{partial:a}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(null!=t)for(;e<t.length;e++)n.enqueue(t[e])}})}}},o0=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}),async parseCompleteOutput({text:t},n){let r=await rp({text:t});if(!r.success)throw new sD({message:"No object generated: could not parse the response.",cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});let a=r.value;if(null==a||"object"!=typeof a||!("result"in a)||"string"!=typeof a.result||!e.includes(a.result))throw new sD({message:"No object generated: response did not match schema.",cause:new ek({value:a,cause:"response must be an object that contains a choice value."}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return a.result},async parsePartialOutput({text:t}){let n=await oK(t);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let t=n.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;let r=e.filter(e=>e.startsWith(t.result));if("successful-parse"===n.state)return r.includes(t.result)?{partial:t.result}:void 0;return 1===r.length?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),o1=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){let n=await rp({text:e});if(!n.success)throw new sD({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await oK(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}},createElementStreamTransform(){}});async function o2(e){let t=""===e.input.trim()?{success:!0,value:{}}:await safeParseJSON3({text:e.input});if(!1===t.success)throw new sS({toolName:e.toolName,toolInput:e.input,cause:t.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}}async function o4({toolCall:e,tools:t}){let n=e.toolName,r=t[n];if(null==r){if(e.providerExecuted&&e.dynamic)return await o2(e);throw new sV({toolName:e.toolName,availableTools:Object.keys(t)})}let a=asSchema3(r.inputSchema),i=""===e.input.trim()?await safeValidateTypes3({value:{},schema:a}):await safeParseJSON3({text:e.input,schema:a});if(!1===i.success)throw new sS({toolName:n,toolInput:e.input,cause:i.error});return"dynamic"===r.type?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,dynamic:!0,title:r.title}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:r.title}}nz({prefix:"aitxt",size:24});function o9(e,t){let n=new Headers(null!=e?e:{});for(let[e,r]of Object.entries(t))n.has(e)||n.set(e,r);return n}TransformStream;var o3=rs(()=>ru(iY([iG({type:i3("text-start"),id:ih(),providerMetadata:o_.optional()}),iG({type:i3("text-delta"),id:ih(),delta:ih(),providerMetadata:o_.optional()}),iG({type:i3("text-end"),id:ih(),providerMetadata:o_.optional()}),iG({type:i3("error"),errorText:ih()}),iG({type:i3("tool-input-start"),toolCallId:ih(),toolName:ih(),providerExecuted:iL().optional(),providerMetadata:o_.optional(),dynamic:iL().optional(),title:ih().optional()}),iG({type:i3("tool-input-delta"),toolCallId:ih(),inputTextDelta:ih()}),iG({type:i3("tool-input-available"),toolCallId:ih(),toolName:ih(),input:iq(),providerExecuted:iL().optional(),providerMetadata:o_.optional(),dynamic:iL().optional(),title:ih().optional()}),iG({type:i3("tool-input-error"),toolCallId:ih(),toolName:ih(),input:iq(),providerExecuted:iL().optional(),providerMetadata:o_.optional(),dynamic:iL().optional(),errorText:ih(),title:ih().optional()}),iG({type:i3("tool-approval-request"),approvalId:ih(),toolCallId:ih()}),iG({type:i3("tool-output-available"),toolCallId:ih(),output:iq(),providerExecuted:iL().optional(),dynamic:iL().optional(),preliminary:iL().optional()}),iG({type:i3("tool-output-error"),toolCallId:ih(),errorText:ih(),providerExecuted:iL().optional(),dynamic:iL().optional()}),iG({type:i3("tool-output-denied"),toolCallId:ih()}),iG({type:i3("reasoning-start"),id:ih(),providerMetadata:o_.optional()}),iG({type:i3("reasoning-delta"),id:ih(),delta:ih(),providerMetadata:o_.optional()}),iG({type:i3("reasoning-end"),id:ih(),providerMetadata:o_.optional()}),iG({type:i3("source-url"),sourceId:ih(),url:ih(),title:ih().optional(),providerMetadata:o_.optional()}),iG({type:i3("source-document"),sourceId:ih(),mediaType:ih(),title:ih(),filename:ih().optional(),providerMetadata:o_.optional()}),iG({type:i3("file"),url:ih(),mediaType:ih(),providerMetadata:o_.optional()}),iG({type:sc(e=>"string"==typeof e&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:ih().optional(),data:iq(),transient:iL().optional()}),iG({type:i3("start-step")}),iG({type:i3("finish-step")}),iG({type:i3("start"),messageId:ih().optional(),messageMetadata:iq().optional()}),iG({type:i3("finish"),finishReason:i4(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:iq().optional()}),iG({type:i3("abort"),reason:ih().optional()}),iG({type:i3("message-metadata"),messageMetadata:iq()})])));function o5(e){return e.type.startsWith("data-")}function o6(e){return"text"===e.type}function o8(e){return"file"===e.type}function o7(e){return"reasoning"===e.type}function le(e){return e.type.startsWith("tool-")}function lt(e){return"dynamic-tool"===e.type}function ln(e){return le(e)||lt(e)}function lr(e){return e.type.split("-").slice(1).join("-")}function la(e){return lt(e)?e.toolName:lr(e)}async function li({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}function ls(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}nz({prefix:"aitxt",size:24});var lo=rs(()=>ru(iW(iJ({id:ih(),role:i4(["system","user","assistant"]),metadata:iq().optional(),parts:iW(iY([iJ({type:i3("text"),text:ih(),state:i4(["streaming","done"]).optional(),providerMetadata:o_.optional()}),iJ({type:i3("reasoning"),text:ih(),state:i4(["streaming","done"]).optional(),providerMetadata:o_.optional()}),iJ({type:i3("source-url"),sourceId:ih(),url:ih(),title:ih().optional(),providerMetadata:o_.optional()}),iJ({type:i3("source-document"),sourceId:ih(),mediaType:ih(),title:ih(),filename:ih().optional(),providerMetadata:o_.optional()}),iJ({type:i3("file"),mediaType:ih(),filename:ih().optional(),url:ih(),providerMetadata:o_.optional()}),iJ({type:i3("step-start")}),iJ({type:ih().startsWith("data-"),id:ih().optional(),data:iq()}),iJ({type:i3("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i3("input-streaming"),input:iq().optional(),providerExecuted:iL().optional(),callProviderMetadata:o_.optional(),output:iV().optional(),errorText:iV().optional(),approval:iV().optional()}),iJ({type:i3("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i3("input-available"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iV().optional()}),iJ({type:i3("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i3("approval-requested"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:iV().optional(),reason:iV().optional()})}),iJ({type:i3("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i3("approval-responded"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:iL(),reason:ih().optional()})}),iJ({type:i3("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i3("output-available"),input:iq(),providerExecuted:iL().optional(),output:iq(),errorText:iV().optional(),callProviderMetadata:o_.optional(),preliminary:iL().optional(),approval:iJ({id:ih(),approved:i3(!0),reason:ih().optional()}).optional()}),iJ({type:i3("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i3("output-error"),input:iq(),rawInput:iq().optional(),providerExecuted:iL().optional(),output:iV().optional(),errorText:ih(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:i3(!0),reason:ih().optional()}).optional()}),iJ({type:i3("dynamic-tool"),toolName:ih(),toolCallId:ih(),state:i3("output-denied"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:i3(!1),reason:ih().optional()})}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i3("input-streaming"),providerExecuted:iL().optional(),callProviderMetadata:o_.optional(),input:iq().optional(),output:iV().optional(),errorText:iV().optional(),approval:iV().optional()}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i3("input-available"),providerExecuted:iL().optional(),input:iq(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iV().optional()}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i3("approval-requested"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:iV().optional(),reason:iV().optional()})}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i3("approval-responded"),input:iq(),providerExecuted:iL().optional(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:iL(),reason:ih().optional()})}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i3("output-available"),providerExecuted:iL().optional(),input:iq(),output:iq(),errorText:iV().optional(),callProviderMetadata:o_.optional(),preliminary:iL().optional(),approval:iJ({id:ih(),approved:i3(!0),reason:ih().optional()}).optional()}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i3("output-error"),providerExecuted:iL().optional(),input:iq(),rawInput:iq().optional(),output:iV().optional(),errorText:ih(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:i3(!0),reason:ih().optional()}).optional()}),iJ({type:ih().startsWith("tool-"),toolCallId:ih(),state:i3("output-denied"),providerExecuted:iL().optional(),input:iq(),output:iV().optional(),errorText:iV().optional(),callProviderMetadata:o_.optional(),approval:iJ({id:ih(),approved:i3(!1),reason:ih().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));async function ll({messages:e,metadataSchema:t,dataSchemas:n,tools:r}){try{if(null==e)return{success:!1,error:new sg({parameter:"messages",value:e,message:"messages parameter must be provided"})};let a=await validateTypes2({value:e,schema:lo});if(t)for(let[e,n]of a.entries())await validateTypes2({value:n.metadata,schema:t,context:{field:`messages[${e}].metadata`,entityId:n.id}});if(n||r)for(let[e,t]of a.entries())for(let[a,i]of t.parts.entries()){if(n&&i.type.startsWith("data-")){let t=i.type.slice(5),r=n[t];if(!r)return{success:!1,error:new TypeValidationError3({value:i.data,cause:`No data schema found for data part ${t}`,context:{field:`messages[${e}].parts[${a}].data`,entityName:t,entityId:i.id}})};await validateTypes2({value:i.data,schema:r,context:{field:`messages[${e}].parts[${a}].data`,entityName:t,entityId:i.id}})}if(r&&i.type.startsWith("tool-")){let t=i.type.slice(5),n=r[t];if(!n)return{success:!1,error:new TypeValidationError3({value:i.input,cause:`No tool schema found for tool part ${t}`,context:{field:`messages[${e}].parts[${a}].input`,entityName:t,entityId:i.toolCallId}})};("input-available"===i.state||"output-available"===i.state||"output-error"===i.state&&void 0!==i.input)&&await validateTypes2({value:i.input,schema:n.inputSchema,context:{field:`messages[${e}].parts[${a}].input`,entityName:t,entityId:i.toolCallId}}),"output-available"===i.state&&n.outputSchema&&await validateTypes2({value:i.output,schema:n.outputSchema,context:{field:`messages[${e}].parts[${a}].output`,entityName:t,entityId:i.toolCallId}})}}return{success:!0,data:a}}catch(e){return{success:!1,error:e}}}async function lu(e,t,n){let r=await safeParseJSON4({text:e});if(!r.success)throw new sD({message:"No object generated: could not parse the response.",cause:r.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});let a=await t.validateFinalResult(r.value,{text:e,response:n.response,usage:n.usage});if(!a.success)throw new sD({message:"No object generated: response did not match schema.",cause:a.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});return a.value}function lc(e){return({url:t,abortSignal:n})=>of({url:t,maxBytes:null==e?void 0:e.maxBytes,abortSignal:n})}nz({prefix:"aiobj",size:24});var ld=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}};nz({prefix:"aiobj",size:24}),lc();var lp=({model:e,middleware:{transformParams:t,wrapGenerate:n,wrapStream:r,overrideProvider:a,overrideModelId:i,overrideSupportedUrls:s},modelId:o,providerId:l})=>{var u,c,d;async function p({params:n,type:r}){return t?await t({params:n,type:r,model:e}):n}return{specificationVersion:"v3",provider:null!=(u=null!=l?l:null==a?void 0:a({model:e}))?u:e.provider,modelId:null!=(c=null!=o?o:null==i?void 0:i({model:e}))?c:e.modelId,supportedUrls:null!=(d=null==s?void 0:s({model:e}))?d:e.supportedUrls,async doGenerate(t){let r=await p({params:t,type:"generate"}),a=async()=>e.doGenerate(r),i=async()=>e.doStream(r);return n?n({doGenerate:a,doStream:i,params:r,model:e}):a()},async doStream(t){let n=await p({params:t,type:"stream"}),a=async()=>e.doGenerate(n),i=async()=>e.doStream(n);return r?r({doGenerate:a,doStream:i,params:n,model:e}):i()}}},lh=({model:e,middleware:{transformParams:t,wrapGenerate:n,overrideProvider:r,overrideModelId:a,overrideMaxImagesPerCall:i},modelId:s,providerId:o})=>{var l,u,c;async function d({params:n}){return t?await t({params:n,model:e}):n}let p=null!=(l=null==i?void 0:i({model:e}))?l:e.maxImagesPerCall,h=p instanceof Function?p.bind(e):p;return{specificationVersion:"v3",provider:null!=(u=null!=o?o:null==r?void 0:r({model:e}))?u:e.provider,modelId:null!=(c=null!=s?s:null==a?void 0:a({model:e}))?c:e.modelId,maxImagesPerCall:h,async doGenerate(t){let r=await d({params:t}),a=async()=>e.doGenerate(r);return n?n({doGenerate:a,params:r,model:e}):a()}}},lf="AI_NoSuchProviderError",lm=`vercel.ai.error.${lf}`;async function lg(e){if(null==e)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:"file",mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{var n;t(null==(n=e.target)?void 0:n.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}Z=Symbol.for(lm),lc();var ly=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:a,prepareSendMessagesRequest:i,prepareReconnectToStreamRequest:s}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=a,this.prepareSendMessagesRequest=i,this.prepareReconnectToStreamRequest=s}async sendMessages({abortSignal:e,...t}){var n,r,a,i,s;let o=await rh(this.body),l=await rh(this.headers),u=await rh(this.credentials),c={...nR(l),...nR(t.headers)},d=await (null==(n=this.prepareSendMessagesRequest)?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),p=null!=(r=null==d?void 0:d.api)?r:this.api,h=(null==d?void 0:d.headers)!==void 0?nR(d.headers):c,f=(null==d?void 0:d.body)!==void 0?d.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},m=null!=(a=null==d?void 0:d.credentials)?a:u,g=null!=(i=this.fetch)?i:globalThis.fetch,y=await g(p,{method:"POST",headers:nj({"Content-Type":"application/json",...h},`ai-sdk/${oh}`,nP()),body:JSON.stringify(f),credentials:m,signal:e});if(!y.ok)throw Error(null!=(s=await y.text())?s:"Failed to fetch the chat response.");if(!y.body)throw Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,n,r,a,i;let s=await rh(this.body),o=await rh(this.headers),l=await rh(this.credentials),u={...nR(o),...nR(e.headers)},c=await (null==(t=this.prepareReconnectToStreamRequest)?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...s,...e.body},headers:u,credentials:l,requestMetadata:e.metadata})),d=null!=(n=null==c?void 0:c.api)?n:`${this.api}/${e.chatId}/stream`,p=(null==c?void 0:c.headers)!==void 0?nR(c.headers):u,h=null!=(r=null==c?void 0:c.credentials)?r:l,f=null!=(a=this.fetch)?a:globalThis.fetch,m=await f(d,{method:"GET",headers:nj(p,`ai-sdk/${oh}`,nP()),credentials:h});if(204===m.status)return null;if(!m.ok)throw Error(null!=(i=await m.text())?i:"Failed to fetch the chat response.");if(!m.body)throw Error("The response body is empty.");return this.processResponseStream(m.body)}},lv=class extends ly{constructor(e={}){super(e)}processResponseStream(e){return(function({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new nk).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await rp({text:e,schema:t}))}}))})({stream:e,schema:o3}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},lb=class{constructor({generateId:e=nO,id:t=e(),transport:n=new lv,messageMetadataSchema:r,dataPartSchemas:a,state:i,onError:s,onToolCall:o,onFinish:l,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new ld,this.sendMessage=async(e,t)=>{var n,r,a,i;let s;if(null==e){await this.makeRequest({trigger:"submit-message",messageId:null==(n=this.lastMessage)?void 0:n.id,...t});return}if(s="text"in e||"files"in e?{parts:[...Array.isArray(e.files)?e.files:await lg(e.files),..."text"in e&&null!=e.text?[{type:"text",text:e.text}]:[]]}:e,null!=e.messageId){let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(-1===t)throw Error(`message with id ${e.messageId} not found`);if("user"!==this.state.messages[t].role)throw Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...s,id:e.messageId,role:null!=(r=s.role)?r:"user",metadata:e.metadata})}else this.state.pushMessage({...s,id:null!=(a=s.id)?a:this.generateId(),role:null!=(i=s.role)?i:"user",metadata:e.metadata});await this.makeRequest({trigger:"submit-message",messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{let n=null==e?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(-1===n)throw Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,"assistant"===this.messages[n].role?n:n+1),await this.makeRequest({trigger:"regenerate-message",messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:"resume-stream",...e})},this.clearError=()=>{"error"===this.status&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n})=>this.jobExecutor.run(async()=>{let r=this.state.messages,a=r[r.length-1],i=r=>ln(r)&&"approval-requested"===r.state&&r.approval.id===e?{...r,state:"approval-responded",approval:{id:e,approved:t,reason:n}}:r;this.state.replaceMessage(r.length-1,{...a,parts:a.parts.map(i)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(i)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id})})}),this.addToolOutput=async({state:e="output-available",tool:t,toolCallId:n,output:r,errorText:a})=>this.jobExecutor.run(async()=>{let t=this.state.messages,i=t[t.length-1],s=t=>ln(t)&&t.toolCallId===n?{...t,state:e,output:r,errorText:a}:t;this.state.replaceMessage(t.length-1,{...i,parts:i.parts.map(s)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e;("streaming"===this.status||"submitted"===this.status)&&(null==(e=this.activeResponse)?void 0:e.abortController)&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=a,this.state=i,this.onError=s,this.onToolCall=o,this.onFinish=l,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&"object"==typeof e&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:a}){var i,s,o;let l;if("resume-stream"===e)try{let e=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(null==e)return;l=e}catch(e){this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,p=!1;try{let i;let s={state:function({lastMessage:e,messageId:t}){return{message:(null==e?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};s.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=s,i="resume-stream"===e?l:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:s.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:a}),await li({stream:function({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:a,onToolCall:i,onData:s}){return e.pipeThrough(new TransformStream({async transform(e,o){await r(async({state:r,write:l})=>{var u,c,d,p;function h(e){let t=r.message.parts.filter(ln).find(t=>t.toolCallId===e);if(null==t)throw new sQ({chunkType:"tool-invocation",chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function f(e){var t;let n=r.message.parts.find(t=>le(t)&&t.toolCallId===e.toolCallId);null!=n?(n.state=e.state,n.input=e.input,n.output=e.output,n.errorText=e.errorText,n.rawInput=e.rawInput,n.preliminary=e.preliminary,void 0!==e.title&&(n.title=e.title),n.providerExecuted=null!=(t=e.providerExecuted)?t:n.providerExecuted,null!=e.providerMetadata&&(n.callProviderMetadata=e.providerMetadata)):r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,input:e.input,output:e.output,rawInput:e.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,preliminary:e.preliminary,...null!=e.providerMetadata?{callProviderMetadata:e.providerMetadata}:{}})}function m(e){var t,n;let a=r.message.parts.find(t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId);null!=a?(a.state=e.state,a.toolName=e.toolName,a.input=e.input,a.output=e.output,a.errorText=e.errorText,a.rawInput=null!=(t=e.rawInput)?t:a.rawInput,a.preliminary=e.preliminary,void 0!==e.title&&(a.title=e.title),a.providerExecuted=null!=(n=e.providerExecuted)?n:a.providerExecuted,null!=e.providerMetadata&&(a.callProviderMetadata=e.providerMetadata)):r.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:e.input,output:e.output,errorText:e.errorText,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:e.title,...null!=e.providerMetadata?{callProviderMetadata:e.providerMetadata}:{}})}async function g(e){if(null!=e){let n=null!=r.message.metadata?function e(t,n){if(void 0===t&&void 0===n)return;if(void 0===t)return n;if(void 0===n)return t;let r={...t};for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a)){let i=n[a];if(void 0===i)continue;let s=a in t?t[a]:void 0,o=null!==i&&"object"==typeof i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),l=null!=s&&"object"==typeof s&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);o&&l?r[a]=e(s,i):r[a]=i}return r}(r.message.metadata,e):e;null!=t&&await rc({value:n,schema:t,context:{field:"message.metadata",entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case"text-start":{let t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeTextParts[e.id]=t,r.message.parts.push(t),l();break}case"text-delta":{let t=r.activeTextParts[e.id];if(null==t)throw new sQ({chunkType:"text-delta",chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(u=e.providerMetadata)?u:t.providerMetadata,l();break}case"text-end":{let t=r.activeTextParts[e.id];if(null==t)throw new sQ({chunkType:"text-end",chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state="done",t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,delete r.activeTextParts[e.id],l();break}case"reasoning-start":{let t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),l();break}case"reasoning-delta":{let t=r.activeReasoningParts[e.id];if(null==t)throw new sQ({chunkType:"reasoning-delta",chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,l();break}case"reasoning-end":{let t=r.activeReasoningParts[e.id];if(null==t)throw new sQ({chunkType:"reasoning-end",chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=null!=(p=e.providerMetadata)?p:t.providerMetadata,t.state="done",delete r.activeReasoningParts[e.id],l();break}case"file":r.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}),l();break;case"source-url":r.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case"source-document":r.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case"tool-input-start":{let t=r.message.parts.filter(le);r.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title},e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,providerMetadata:e.providerMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,providerMetadata:e.providerMetadata}),l();break}case"tool-input-delta":{let t=r.partialToolCalls[e.toolCallId];if(null==t)throw new sQ({chunkType:"tool-input-delta",chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let{value:n}=await oK(t.text);t.dynamic?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}):f({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}),l();break}case"tool-input-available":e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}),l(),i&&!e.providerExecuted&&await i({toolCall:e});break;case"tool-input-error":{let t=r.message.parts.filter(ln).find(t=>t.toolCallId===e.toolCallId);(null!=t?"dynamic-tool"===t.type:e.dynamic)?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),l();break}case"tool-approval-request":{let t=h(e.toolCallId);t.state="approval-requested",t.approval={id:e.approvalId},l();break}case"tool-output-denied":h(e.toolCallId).state="output-denied",l();break;case"tool-output-available":{let t=h(e.toolCallId);"dynamic-tool"===t.type?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:t.title}):f({toolCallId:e.toolCallId,toolName:lr(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,title:t.title}),l();break}case"tool-output-error":{let t=h(e.toolCallId);"dynamic-tool"===t.type?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}):f({toolCallId:e.toolCallId,toolName:lr(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}),l();break}case"start-step":r.message.parts.push({type:"step-start"});break;case"finish-step":r.activeTextParts={},r.activeReasoningParts={};break;case"start":null!=e.messageId&&(r.message.id=e.messageId),await g(e.messageMetadata),(null!=e.messageId||null!=e.messageMetadata)&&l();break;case"finish":null!=e.finishReason&&(r.finishReason=e.finishReason),await g(e.messageMetadata),null!=e.messageMetadata&&l();break;case"message-metadata":await g(e.messageMetadata),null!=e.messageMetadata&&l();break;case"error":null==a||a(Error(e.errorText));break;default:if(e.type.startsWith("data-")){if((null==n?void 0:n[e.type])!=null){let t=r.message.parts.findIndex(t=>"id"in t&&"data"in t&&t.id===e.id&&t.type===e.type),a=t>=0?t:r.message.parts.length;await rc({value:e.data,schema:n[e.type],context:{field:`message.parts[${a}].data`,entityName:e.type,entityId:e.id}})}if(e.transient){null==s||s(e);break}let t=null!=e.id?r.message.parts.find(t=>e.type===t.type&&e.id===t.id):void 0;null!=t?t.data=e.data:r.message.parts.push(e),null==s||s(e),l()}}o.enqueue(e)})}}))}({stream:i,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:e=>this.jobExecutor.run(()=>e({state:s.state,write:()=>{var e;this.setStatus({status:"streaming"}),s.state.message.id===(null==(e=this.lastMessage)?void 0:e.id)?this.state.replaceMessage(this.state.messages.length-1,s.state.message):this.state.pushMessage(s.state.message)}})),onError:e=>{throw e}}),onError:e=>{throw e}}),this.setStatus({status:"ready"})}catch(e){if(c||"AbortError"===e.name)return c=!0,this.setStatus({status:"ready"}),null;p=!0,e instanceof TypeError&&(e.message.toLowerCase().includes("fetch")||e.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e})}finally{try{null==(s=this.onFinish)||s.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:p,finishReason:null==(i=this.activeResponse)?void 0:i.state.finishReason})}catch(e){console.error(e)}this.activeResponse=void 0}!p&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:null==(o=this.lastMessage)?void 0:o.id,metadata:t,headers:n,body:r})}},lx=n(5987),lk=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},lw=(e,t,n)=>(lk(e,t,"read from private field"),n?n.call(e):t.get(e)),l_=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},lS=(e,t,n,r)=>(lk(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),lI=class{constructor(e=[]){l_(this,q,void 0),l_(this,U,"ready"),l_(this,V,void 0),l_(this,B,new Set),l_(this,W,new Set),l_(this,H,new Set),this.pushMessage=e=>{lS(this,q,lw(this,q).concat(e)),lw(this,J).call(this)},this.popMessage=()=>{lS(this,q,lw(this,q).slice(0,-1)),lw(this,J).call(this)},this.replaceMessage=(e,t)=>{lS(this,q,[...lw(this,q).slice(0,e),this.snapshot(t),...lw(this,q).slice(e+1)]),lw(this,J).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,t)=>{let n=t?function(e,t){return null!=t?lx(e,t):e}(e,t):e;return lw(this,B).add(n),()=>{lw(this,B).delete(n)}},this["~registerStatusCallback"]=e=>(lw(this,W).add(e),()=>{lw(this,W).delete(e)}),this["~registerErrorCallback"]=e=>(lw(this,H).add(e),()=>{lw(this,H).delete(e)}),l_(this,J,()=>{lw(this,B).forEach(e=>e())}),l_(this,G,()=>{lw(this,W).forEach(e=>e())}),l_(this,K,()=>{lw(this,H).forEach(e=>e())}),lS(this,q,e)}get status(){return lw(this,U)}set status(e){lS(this,U,e),lw(this,G).call(this)}get error(){return lw(this,V)}set error(e){lS(this,V,e),lw(this,K).call(this)}get messages(){return lw(this,q)}set messages(e){lS(this,q,[...e]),lw(this,J).call(this)}};q=new WeakMap,U=new WeakMap,V=new WeakMap,B=new WeakMap,W=new WeakMap,H=new WeakMap,J=new WeakMap,G=new WeakMap,K=new WeakMap;var lE=class extends lb{constructor({messages:e,...t}){let n=new lI(e);super({...t,state:n}),l_(this,Y,void 0),this["~registerMessagesCallback"]=(e,t)=>lw(this,Y)["~registerMessagesCallback"](e,t),this["~registerStatusCallback"]=e=>lw(this,Y)["~registerStatusCallback"](e),this["~registerErrorCallback"]=e=>lw(this,Y)["~registerErrorCallback"](e),lS(this,Y,n)}};Y=new WeakMap;let lT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lA={};function lN(e,t){return((t||lA).jsx?lC:lT).test(e)}let lz=/[ \t\n\f\r]/g;function lO(e){return""===e.replace(lz,"")}class lP{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function lR(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new lP(n,r,t)}function lj(e){return e.toLowerCase()}lP.prototype.normal={},lP.prototype.property={},lP.prototype.space=void 0;class lD{constructor(e,t){this.attribute=t,this.property=e}}lD.prototype.attribute="",lD.prototype.booleanish=!1,lD.prototype.boolean=!1,lD.prototype.commaOrSpaceSeparated=!1,lD.prototype.commaSeparated=!1,lD.prototype.defined=!1,lD.prototype.mustUseProperty=!1,lD.prototype.number=!1,lD.prototype.overloadedBoolean=!1,lD.prototype.property="",lD.prototype.spaceSeparated=!1,lD.prototype.space=void 0;let lM=0,l$=lB(),lL=lB(),lF=lB(),lZ=lB(),lq=lB(),lU=lB(),lV=lB();function lB(){return 2**++lM}let lW=Object.keys(X);class lH extends lD{constructor(e,t,n,r){let a=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++a<lW.length;){let e=lW[a];(function(e,t,n){n&&(e[t]=n)})(this,lW[a],(n&X[e])===X[e])}}}function lJ(e){let t={},n={};for(let[r,a]of Object.entries(e.properties)){let i=new lH(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[lj(r)]=r,n[lj(i.attribute)]=r}return new lP(t,n,e.space)}lH.prototype.defined=!0;let lG=lJ({properties:{ariaActiveDescendant:null,ariaAtomic:lL,ariaAutoComplete:null,ariaBusy:lL,ariaChecked:lL,ariaColCount:lZ,ariaColIndex:lZ,ariaColSpan:lZ,ariaControls:lq,ariaCurrent:null,ariaDescribedBy:lq,ariaDetails:null,ariaDisabled:lL,ariaDropEffect:lq,ariaErrorMessage:null,ariaExpanded:lL,ariaFlowTo:lq,ariaGrabbed:lL,ariaHasPopup:null,ariaHidden:lL,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lq,ariaLevel:lZ,ariaLive:null,ariaModal:lL,ariaMultiLine:lL,ariaMultiSelectable:lL,ariaOrientation:null,ariaOwns:lq,ariaPlaceholder:null,ariaPosInSet:lZ,ariaPressed:lL,ariaReadOnly:lL,ariaRelevant:null,ariaRequired:lL,ariaRoleDescription:lq,ariaRowCount:lZ,ariaRowIndex:lZ,ariaRowSpan:lZ,ariaSelected:lL,ariaSetSize:lZ,ariaSort:null,ariaValueMax:lZ,ariaValueMin:lZ,ariaValueNow:lZ,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function lK(e,t){return t in e?e[t]:t}function lY(e,t){return lK(e,t.toLowerCase())}let lX=lJ({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:lU,acceptCharset:lq,accessKey:lq,action:null,allow:null,allowFullScreen:l$,allowPaymentRequest:l$,allowUserMedia:l$,alt:null,as:null,async:l$,autoCapitalize:null,autoComplete:lq,autoFocus:l$,autoPlay:l$,blocking:lq,capture:null,charSet:null,checked:l$,cite:null,className:lq,cols:lZ,colSpan:null,content:null,contentEditable:lL,controls:l$,controlsList:lq,coords:lZ|lU,crossOrigin:null,data:null,dateTime:null,decoding:null,default:l$,defer:l$,dir:null,dirName:null,disabled:l$,download:lF,draggable:lL,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:l$,formTarget:null,headers:lq,height:lZ,hidden:lF,high:lZ,href:null,hrefLang:null,htmlFor:lq,httpEquiv:lq,id:null,imageSizes:null,imageSrcSet:null,inert:l$,inputMode:null,integrity:null,is:null,isMap:l$,itemId:null,itemProp:lq,itemRef:lq,itemScope:l$,itemType:lq,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:l$,low:lZ,manifest:null,max:null,maxLength:lZ,media:null,method:null,min:null,minLength:lZ,multiple:l$,muted:l$,name:null,nonce:null,noModule:l$,noValidate:l$,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:l$,optimum:lZ,pattern:null,ping:lq,placeholder:null,playsInline:l$,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:l$,referrerPolicy:null,rel:lq,required:l$,reversed:l$,rows:lZ,rowSpan:lZ,sandbox:lq,scope:null,scoped:l$,seamless:l$,selected:l$,shadowRootClonable:l$,shadowRootDelegatesFocus:l$,shadowRootMode:null,shape:null,size:lZ,sizes:null,slot:null,span:lZ,spellCheck:lL,src:null,srcDoc:null,srcLang:null,srcSet:null,start:lZ,step:null,style:null,tabIndex:lZ,target:null,title:null,translate:null,type:null,typeMustMatch:l$,useMap:null,value:lL,width:lZ,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lq,axis:null,background:null,bgColor:null,border:lZ,borderColor:null,bottomMargin:lZ,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:l$,declare:l$,event:null,face:null,frame:null,frameBorder:null,hSpace:lZ,leftMargin:lZ,link:null,longDesc:null,lowSrc:null,marginHeight:lZ,marginWidth:lZ,noResize:l$,noHref:l$,noShade:l$,noWrap:l$,object:null,profile:null,prompt:null,rev:null,rightMargin:lZ,rules:null,scheme:null,scrolling:lL,standby:null,summary:null,text:null,topMargin:lZ,valueType:null,version:null,vAlign:null,vLink:null,vSpace:lZ,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:l$,disableRemotePlayback:l$,prefix:null,property:null,results:lZ,security:null,unselectable:null},space:"html",transform:lY}),lQ=lJ({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"},properties:{about:lV,accentHeight:lZ,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:lZ,amplitude:lZ,arabicForm:null,ascent:lZ,attributeName:null,attributeType:null,azimuth:lZ,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:lZ,by:null,calcMode:null,capHeight:lZ,className:lq,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:lZ,diffuseConstant:lZ,direction:null,display:null,dur:null,divisor:lZ,dominantBaseline:null,download:l$,dx:null,dy:null,edgeMode:null,editable:null,elevation:lZ,enableBackground:null,end:null,event:null,exponent:lZ,externalResourcesRequired:null,fill:null,fillOpacity:lZ,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:lU,g2:lU,glyphName:lU,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:lZ,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:lZ,horizOriginX:lZ,horizOriginY:lZ,id:null,ideographic:lZ,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:lZ,k:lZ,k1:lZ,k2:lZ,k3:lZ,k4:lZ,kernelMatrix:lV,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:lZ,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:lZ,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:lZ,overlineThickness:lZ,paintOrder:null,panose1:null,path:null,pathLength:lZ,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lq,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:lZ,pointsAtY:lZ,pointsAtZ:lZ,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lV,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lV,rev:lV,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lV,requiredFeatures:lV,requiredFonts:lV,requiredFormats:lV,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:lZ,specularExponent:lZ,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:lZ,strikethroughThickness:lZ,string:null,stroke:null,strokeDashArray:lV,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:lZ,strokeOpacity:lZ,strokeWidth:null,style:null,surfaceScale:lZ,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:lV,tabIndex:lZ,tableValues:null,target:null,targetX:lZ,targetY:lZ,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:lV,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:lZ,underlineThickness:lZ,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:lZ,values:null,vAlphabetic:lZ,vMathematical:lZ,vectorEffect:null,vHanging:lZ,vIdeographic:lZ,version:null,vertAdvY:lZ,vertOriginX:lZ,vertOriginY:lZ,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:lZ,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lK}),l0=lJ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),l1=lJ({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:lY}),l2=lJ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),l4=lR([lG,lX,l0,l1,l2],"html"),l9=lR([lG,lQ,l0,l1,l2],"svg"),l3=/[A-Z]/g,l5=/-[a-z]/g,l6=/^data[-\w.:]+$/i;function l8(e){return"-"+e.toLowerCase()}function l7(e){return e.charAt(1).toUpperCase()}let ue={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 ut=n(393);let un=ua("end"),ur=ua("start");function ua(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 ui(e){return e&&"object"==typeof e?"position"in e||"type"in e?uo(e.position):"start"in e||"end"in e?uo(e):"line"in e||"column"in e?us(e):"":""}function us(e){return ul(e&&e.line)+":"+ul(e&&e.column)}function uo(e){return us(e&&e.start)+"-"+us(e&&e.end)}function ul(e){return e&&"number"==typeof e?e:1}class uu extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",a={},i=!1;if(t&&(a="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:!a.cause&&e&&(i=!0,r=e.message,a.cause=e),!a.ruleId&&!a.source&&"string"==typeof n){let e=n.indexOf(":");-1===e?a.ruleId=n:(a.source=n.slice(0,e),a.ruleId=n.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=ui(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&"string"==typeof a.cause.stack?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}uu.prototype.file="",uu.prototype.name="",uu.prototype.reason="",uu.prototype.message="",uu.prototype.stack="",uu.prototype.column=void 0,uu.prototype.line=void 0,uu.prototype.ancestors=void 0,uu.prototype.cause=void 0,uu.prototype.fatal=void 0,uu.prototype.place=void 0,uu.prototype.ruleId=void 0,uu.prototype.source=void 0;let uc={}.hasOwnProperty,ud=new Map,up=/[A-Z]/g,uh=new Set(["table","tbody","thead","tfoot","tr"]),uf=new Set(["td","th"]),um="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ug(e,t,n){return"element"===t.type?function(e,t,n){let r=e.schema,a=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(a=l9,e.schema=a),e.ancestors.push(t);let i=ux(e,t.tagName,!1),s=function(e,t){let n,r;let a={};for(r in t.properties)if("children"!==r&&uc.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=lj(t),r=t,a=lD;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&l6.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(l5,l7);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!l5.test(e)){let n=e.replace(l3,l8);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}a=lH}return new a(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){try{return ut(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new uu("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=um+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t;let n={};for(t in e)uc.call(e,t)&&(n[function(e){let t=e.replace(up,uw);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?ue[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,s]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&uf.has(t.tagName)?n=s:a[r]=s}}return n&&((a.style||(a.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),a}(e,t),o=ub(e,t);return uh.has(t.tagName)&&(o=o.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&lO(e.value):lO(e))})),uy(e,s,i,t),uv(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,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 n.type,e.evaluater.evaluateExpression(n.expression)}uk(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){let r=e.schema,a=r;"svg"===t.name&&"html"===r.space&&(a=l9,e.schema=a),e.ancestors.push(t);let i=null===t.name?e.Fragment:ux(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];t.type;let a=t.expression;a.type;let i=a.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else uk(e,t.position)}else{let a;let i=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];t.type,a=e.evaluater.evaluateExpression(t.expression)}else uk(e,t.position)}else a=null===r.value||r.value;n[i]=a}return n}(e,t),o=ub(e,t);return uy(e,s,i,t),uv(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,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);uk(e,t.position)}(e,t):"root"===t.type?function(e,t,n){let r={};return uv(r,ub(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?t.value:void 0}function uy(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function uv(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ub(e,t){let n=[],r=-1,a=e.passKeys?new Map:ud;for(;++r<t.children.length;){let i;let s=t.children[r];if(e.passKeys){let e="element"===s.type?s.tagName:"mdxJsxFlowElement"===s.type||"mdxJsxTextElement"===s.type?s.name:void 0;if(e){let t=a.get(e)||0;i=e+"-"+t,a.set(e,t+1)}}let o=ug(e,s,i);void 0!==o&&n.push(o)}return n}function ux(e,t,n){let r;if(n){if(t.includes(".")){let e;let n=t.split("."),a=-1;for(;++a<n.length;){let t=lN(n[a])?{type:"Identifier",name:n[a]}:{type:"Literal",value:n[a]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(a&&"Literal"===t.type),optional:!1}:t}r=e}else r=lN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t}}else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return uc.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);uk(e)}function uk(e,t){let n=new uu("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=um+"#cannot-handle-mdx-estrees-without-createevaluater",n}function uw(e){return"-"+e.toLowerCase()}let u_={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},uS={};function uI(e,t){let n=t||uS;return uE(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function uE(e,t,n){if(e&&"object"==typeof e){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return uT(e.children,t,n)}return Array.isArray(e)?uT(e,t,n):""}function uT(e,t,n){let r=[],a=-1;for(;++a<e.length;)r[a]=uE(e[a],t,n);return r.join("")}function uC(e,t,n,r){let a;let i=e.length,s=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(a=Array.from(r)).unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)(a=r.slice(s,s+1e4)).unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function uA(e,t){return e.length>0?(uC(e,e.length,0,t),e):t}class uN{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=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 e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.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&&uz(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),uz(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),uz(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(e<this.left.length){let t=this.left.splice(e,Number.POSITIVE_INFINITY);uz(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);uz(this.left,t.reverse())}}}}function uz(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uO(e){let t,n,r,a,i,s,o;let l={},u=-1,c=new uN(e);for(;++u<c.length;){for(;(u in l);)u=l[u];if(t=c.get(u),u&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&((r=0)<(s=t[1]._tokenizer.events).length&&"lineEndingBlank"===s[r][1].type&&(r+=2),r<s.length&&"content"===s[r][1].type))for(;++r<s.length&&"content"!==s[r][1].type;)"chunkText"===s[r][1].type&&(s[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(l,function(e,t){let n,r;let a=e.get(t)[1],i=e.get(t)[2],s=t-1,o=[],l=a._tokenizer;!l&&(l=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));let u=l.events,c=[],d={},p=-1,h=a,f=0,m=0,g=[0];for(;h;){for(;e.get(++s)[1]!==h;);o.push(s),!h._tokenizer&&(n=i.sliceStream(h),h.next||n.push(null),r&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(n),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),r=h,h=h.next}for(h=a;++p<u.length;)"exit"===u[p][0]&&"enter"===u[p-1][0]&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(m=p+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),p=g.length;p--;){let t=u.slice(g[p],g[p+1]),n=o.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),p=-1;++p<c.length;)d[f+c[p][0]]=f+c[p][1],f+=c[p][1]-c[p][0]-1;return d}(c,u)),u=l[u],o=!0);else if(t[1]._container){for(r=u,n=void 0;r--;)if("lineEnding"===(a=c.get(r))[1].type||"lineEndingBlank"===a[1].type)"enter"===a[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),a[1].type="lineEnding",n=r);else if("linePrefix"===a[1].type||"listItemIndent"===a[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(i=c.slice(n,u)).unshift(t),c.splice(n,u-n+1,i))}}return uC(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!o}let uP={}.hasOwnProperty;function uR(e){let t={},n=-1;for(;++n<e.length;)(function(e,t){let n;for(n in t){let r;let a=(uP.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];if(i)for(r in i){uP.call(a,r)||(a[r]=[]);let e=i[r];(function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);uC(e,0,0,r)})(a[r],Array.isArray(e)?e:e?[e]:[])}}})(t,e[n]);return t}let uj=uH(/[A-Za-z]/),uD=uH(/[\dA-Za-z]/),uM=uH(/[#-'*+\--9=?A-Z^-~]/);function u$(e){return null!==e&&(e<32||127===e)}let uL=uH(/\d/),uF=uH(/[\dA-Fa-f]/),uZ=uH(/[!-/:-@[-`{-~]/);function uq(e){return null!==e&&e<-2}function uU(e){return null!==e&&(e<0||32===e)}function uV(e){return -2===e||-1===e||32===e}let uB=uH(/\p{P}|\p{S}/u),uW=uH(/\s/);function uH(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function uJ(e,t,n,r){let a=r?r-1:Number.POSITIVE_INFINITY,i=0;return function(r){return uV(r)?(e.enter(n),function r(s){return uV(s)&&i++<a?(e.consume(s),r):(e.exit(n),t(s))}(r)):t(r)}}let uG={tokenize:function(e){let t;let n=e.attempt(this.parser.constructs.contentInitial,function(t){if(null===t){e.consume(t);return}return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),uJ(e,n,"linePrefix")},function(n){return e.enter("paragraph"),function n(r){let a=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=a),t=a,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return uq(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},uK={tokenize:function(e){let t,n,r;let a=this,i=[],s=0;return o;function o(t){if(s<i.length){let n=i[s];return a.containerState=n[1],e.attempt(n[0].continuation,l,u)(t)}return u(t)}function l(e){if(s++,a.containerState._closeFlow){let n;a.containerState._closeFlow=void 0,t&&y();let r=a.events.length,i=r;for(;i--;)if("exit"===a.events[i][0]&&"chunkFlow"===a.events[i][1].type){n=a.events[i][1].end;break}g(s);let o=r;for(;o<a.events.length;)a.events[o][1].end={...n},o++;return uC(a.events,i+1,0,a.events.slice(r)),a.events.length=o,u(e)}return o(e)}function u(n){if(s===i.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);a.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return a.containerState={},e.check(uY,c,d)(n)}function c(e){return t&&y(),g(s),p(e)}function d(e){return a.parser.lazy[a.now().line]=s!==i.length,r=a.now().offset,f(e)}function p(t){return a.containerState={},e.attempt(uY,h,f)(t)}function h(e){return s++,i.push([a.currentConstruct,a.containerState]),p(e)}function f(r){if(null===r){t&&y(),g(0),e.consume(r);return}return t=t||a.parser.flow(a.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return uq(n)?(e.consume(n),m(e.exit("chunkFlow")),s=0,a.interrupt=void 0,o):(e.consume(n),t)}(r)}function m(e,i){let o=a.sliceStream(e);if(i&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),a.parser.lazy[e.start.line]){let e,n,i=t.events.length;for(;i--;)if(t.events[i][1].start.offset<r&&(!t.events[i][1].end||t.events[i][1].end.offset>r))return;let o=a.events.length,l=o;for(;l--;)if("exit"===a.events[l][0]&&"chunkFlow"===a.events[l][1].type){if(e){n=a.events[l][1].end;break}e=!0}for(g(s),i=o;i<a.events.length;)a.events[i][1].end={...n},i++;uC(a.events,l+1,0,a.events.slice(o)),a.events.length=i}}function g(t){let n=i.length;for(;n-- >t;){let t=i[n];a.containerState=t[1],t[0].exit.call(a,e)}i.length=t}function y(){t.write([null]),n=void 0,t=void 0,a.containerState._closeFlow=void 0}}},uY={tokenize:function(e,t,n){return uJ(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},uX={partial:!0,tokenize:function(e,t,n){return function(t){return uV(t)?uJ(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||uq(e)?t(e):n(e)}}},uQ={resolve:function(e){return uO(e),e},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?a(t):uq(t)?e.check(u0,i,a)(t):(e.consume(t),r)}function a(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},u0={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),uJ(e,a,"linePrefix")};function a(a){if(null===a||uq(a))return n(a);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}},u1={tokenize:function(e){let t=this,n=e.attempt(uX,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,uJ(e,e.attempt(this.parser.constructs.flow,r,e.attempt(uQ,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}}},u2={resolveAll:u5()},u4=u3("string"),u9=u3("text");function u3(e){return{resolveAll:u5("text"===e?u6:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],a=t.attempt(r,i,s);return i;function i(e){return l(e)?a(e):s(e)}function s(e){if(null===e){t.consume(e);return}return t.enter("data"),t.consume(e),o}function o(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),o)}function l(e){if(null===e)return!0;let t=r[e],a=-1;if(t)for(;++a<t.length;){let e=t[a];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function u5(e){return function(t,n){let r,a=-1;for(;++a<=t.length;)void 0===r?t[a]&&"data"===t[a][1].type&&(r=a,a++):t[a]&&"data"===t[a][1].type||(a!==r+2&&(t[r][1].end=t[a-1][1].end,t.splice(r+2,a-r-2),a=r+2),r=void 0);return e?e(t,n):t}}function u6(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r;let a=e[n-1][1],i=t.sliceStream(a),s=i.length,o=-1,l=0;for(;s--;){let e=i[s];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)l++,o--;if(o)break;o=-1}else if(-2===e)r=!0,l++;else if(-1===e);else{s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){let i={type:n===e.length||r||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:a.start._bufferIndex+o,_index:a.start._index+s,line:a.end.line,column:a.end.column-l,offset:a.end.offset-l},end:{...a.end}};a.end={...i.start},a.start.offset===a.end.offset?Object.assign(a,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}let u8={name:"thematicBreak",tokenize:function(e,t,n){let r,a=0;return function(i){return e.enter("thematicBreak"),r=i,function i(s){return s===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),a++,t):(e.exit("thematicBreakSequence"),uV(n)?uJ(e,i,"whitespace")(n):i(n))}(s)):a>=3&&(null===s||uq(s))?(e.exit("thematicBreak"),t(s)):n(s)}(i)}}},u7={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(uX,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,uJ(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!uV(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ct,t,a)(n))});function a(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,uJ(e,e.attempt(u7,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,a=r.events[r.events.length-1],i=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,s=0;return function(t){let a=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!r.containerState.marker||t===r.containerState.marker:uL(t)){if(r.containerState.type||(r.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(u8,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(a){return uL(a)&&++s<10?(e.consume(a),t):(!r.interrupt||s<2)&&(r.containerState.marker?a===r.containerState.marker:41===a||46===a)?(e.exit("listItemValue"),o(a)):n(a)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(uX,r.interrupt?n:l,e.attempt(ce,c,u))}function l(e){return r.containerState.initialBlankLine=!0,i++,c(e)}function u(t){return uV(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},ce={partial:!0,tokenize:function(e,t,n){let r=this;return uJ(e,function(e){let a=r.events[r.events.length-1];return!uV(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},ct={partial:!0,tokenize:function(e,t,n){let r=this;return uJ(e,function(e){let a=r.events[r.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},cn={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return uV(t)?uJ(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(r){return e.attempt(cn,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},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"),a}return n(t)};function a(n){return uV(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function cr(e,t,n,r,a,i,s,o,l){let u=l||Number.POSITIVE_INFINITY,c=0;return function(t){return 60===t?(e.enter(r),e.enter(a),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||u$(t)?n(t):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(o),d(t)):null===t||60===t||uq(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(a){return!c&&(null===a||41===a||uU(a))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(a)):c<u&&40===a?(e.consume(a),c++,f):41===a?(e.consume(a),c--,f):null===a||32===a||40===a||u$(a)?n(a):(e.consume(a),92===a?m:f)}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function ca(e,t,n,r,a,i){let s;let o=this,l=0;return function(t){return e.enter(r),e.enter(a),e.consume(t),e.exit(a),e.enter(i),u};function u(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(d):93===d?(e.exit(i),e.enter(a),e.consume(d),e.exit(a),e.exit(r),t):uq(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||uq(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),s||(s=!uV(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function ci(e,t,n,r,a,i){let s;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(a),e.consume(t),e.exit(a),s=40===t?41:t,o):n(t)};function o(n){return n===s?(e.enter(a),e.consume(n),e.exit(a),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===s?(e.exit(i),o(s)):null===t?n(t):uq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),uJ(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===s||null===t||uq(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return t===s||92===t?(e.consume(t),u):u(t)}}function cs(e,t){let n;return function r(a){return uq(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):uV(a)?uJ(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}function co(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let cl={partial:!0,tokenize:function(e,t,n){return function(t){return uU(t)?cs(e,r)(t):n(t)};function r(t){return ci(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return uV(t)?uJ(e,i,"whitespace")(t):i(t)}function i(e){return null===e||uq(e)?t(e):n(e)}}},cu={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),uJ(e,a,"linePrefix",5)(t)};function a(t){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?function t(n){return null===n?i(n):uq(n)?e.attempt(cc,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||uq(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},cc={partial:!0,tokenize:function(e,t,n){let r=this;return a;function a(t){return r.parser.lazy[r.now().line]?n(t):uq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):uJ(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):uq(e)?a(e):n(e)}}},cd={name:"setextUnderline",resolveTo:function(e,t){let n,r,a,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),a||"definition"!==e[i][1].type||(a=i);let s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",a?(e.splice(r,0,["enter",s,t]),e.splice(a+1,0,["exit",e[n][1],t]),e[n][1].end={...e[a][1].end}):e[n][1]=s,e.push(["exit",s,t]),e},tokenize:function(e,t,n){let r;let a=this;return function(t){let s,o=a.events.length;for(;o--;)if("lineEnding"!==a.events[o][1].type&&"linePrefix"!==a.events[o][1].type&&"content"!==a.events[o][1].type){s="paragraph"===a.events[o][1].type;break}return!a.parser.lazy[a.now().line]&&(a.interrupt||s)?(e.enter("setextHeadingLine"),r=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),uV(n)?uJ(e,i,"lineSuffix")(n):i(n))}(t)):n(t)};function i(r){return null===r||uq(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}},cp=["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"],ch=["pre","script","style","textarea"],cf={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(uX,t,n)}}},cm={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return uq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):n(t)};function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},cg={partial:!0,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"),a)};function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},cy={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r;let a=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),uV(t)?uJ(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(a){return a===r?(i++,e.consume(a),t):i>=o?(e.exit("codeFencedFenceSequence"),uV(a)?uJ(e,u,"whitespace")(a):u(a)):n(a)}(t)):n(t)}function u(r){return null===r||uq(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},s=0,o=0;return function(t){return function(t){let i=a.events[a.events.length-1];return s=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,r=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(a){return a===r?(o++,e.consume(a),t):o<3?n(a):(e.exit("codeFencedFenceSequence"),uV(a)?uJ(e,l,"whitespace")(a):l(a))}(t)}(t)};function l(i){return null===i||uq(i)?(e.exit("codeFencedFence"),a.interrupt?t(i):e.check(cg,c,f)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||uq(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(a)):uV(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),uJ(e,u,"whitespace")(a)):96===a&&a===r?n(a):(e.consume(a),t)}(i))}function u(t){return null===t||uq(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||uq(a)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(a)):96===a&&a===r?n(a):(e.consume(a),t)}(t))}function c(t){return e.attempt(i,f,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return s>0&&uV(t)?uJ(e,h,"linePrefix",s+1)(t):h(t)}function h(t){return null===t||uq(t)?e.check(cg,c,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||uq(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},cv={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"Ă",Acirc:"\xc2",Acy:"А",Afr:"\uD835\uDD04",Agrave:"\xc0",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"\uD835\uDD38",ApplyFunction:"",Aring:"\xc5",Ascr:"\uD835\uDC9C",Assign:"≔",Atilde:"\xc3",Auml:"\xc4",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"\xa9",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"\xc7",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"\uD835\uDC9E",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"\uD835\uDD3B",Dot:"\xa8",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"\uD835\uDC9F",Dstrok:"Đ",ENG:"Ŋ",ETH:"\xd0",Eacute:"\xc9",Ecaron:"Ě",Ecirc:"\xca",Ecy:"Э",Edot:"Ė",Efr:"\uD835\uDD08",Egrave:"\xc8",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"\uD835\uDD3C",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"\xcb",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"\uD835\uDD09",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"\uD835\uDD3D",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"\uD835\uDD0A",Gg:"⋙",Gopf:"\uD835\uDD3E",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"\xcd",Icirc:"\xce",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"\xcc",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"",InvisibleTimes:"",Iogon:"Į",Iopf:"\uD835\uDD40",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"\xcf",Jcirc:"Ĵ",Jcy:"Й",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"\uD835\uDD0F",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"\uD835\uDD43",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",MinusPlus:"∓",Mopf:"\uD835\uDD44",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"\uD835\uDD11",NoBreak:"",NonBreakingSpace:"\xa0",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"\uD835\uDCA9",Ntilde:"\xd1",Nu:"Ν",OElig:"Œ",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"О",Odblac:"Ő",Ofr:"\uD835\uDD12",Ograve:"\xd2",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"\uD835\uDCAA",Oslash:"\xd8",Otilde:"\xd5",Otimes:"⨷",Ouml:"\xd6",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"\uD835\uDD13",Phi:"Φ",Pi:"Π",PlusMinus:"\xb1",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"\uD835\uDCAB",Psi:"Ψ",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"ℚ",Qscr:"\uD835\uDCAC",RBarr:"⤐",REG:"\xae",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"\uD835\uDD16",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"\uD835\uDD4A",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"\uD835\uDCAE",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"\xde",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"\uD835\uDD17",Therefore:"∴",Theta:"Θ",ThickSpace:" ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"\uD835\uDD4B",TripleDot:"⃛",Tscr:"\uD835\uDCAF",Tstrok:"Ŧ",Uacute:"\xda",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"\xdb",Ucy:"У",Udblac:"Ű",Ufr:"\uD835\uDD18",Ugrave:"\xd9",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"\uD835\uDD4C",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"\uD835\uDCB0",Utilde:"Ũ",Uuml:"\xdc",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"Ξ",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"\xdd",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"\uD835\uDCB5",aacute:"\xe1",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"\xe2",acute:"\xb4",acy:"а",aelig:"\xe6",af:"",afr:"\uD835\uDD1E",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",aogon:"ą",aopf:"\uD835\uDD52",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"\xe5",ascr:"\uD835\uDCB6",ast:"*",asymp:"≈",asympeq:"≍",atilde:"\xe3",auml:"\xe4",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"\xa6",bscr:"\uD835\uDCB7",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"\xe7",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"\xb8",cemptyv:"⦲",cent:"\xa2",centerdot:"\xb7",cfr:"\uD835\uDD20",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"\xae",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"\uD835\uDD54",coprod:"∐",copy:"\xa9",copysr:"℗",crarr:"↵",cross:"✗",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"\xb0",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"\uD835\uDD21",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"\uD835\uDD55",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"\uD835\uDCB9",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"\xe9",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"\xea",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"\uD835\uDD22",eg:"⪚",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"\xf0",euml:"\xeb",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"\uD835\uDD23",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"\uD835\uDD57",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"\uD835\uDCBB",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"\uD835\uDD24",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"\uD835\uDD58",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"\xbd",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"\uD835\uDD25",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"\uD835\uDD59",horbar:"―",hscr:"\uD835\uDCBD",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"\xed",ic:"",icirc:"\xee",icy:"и",iecy:"е",iexcl:"\xa1",iff:"⇔",ifr:"\uD835\uDD26",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"\uD835\uDD5A",iota:"ι",iprod:"⨼",iquest:"\xbf",iscr:"\uD835\uDCBE",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",itilde:"ĩ",iukcy:"і",iuml:"\xef",jcirc:"ĵ",jcy:"й",jfr:"\uD835\uDD27",jmath:"ȷ",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"\uD835\uDD28",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"\xab",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"\uD835\uDCC1",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",mid:"∣",midast:"*",midcir:"⫰",middot:"\xb7",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"\uD835\uDD5E",mp:"∓",mscr:"\uD835\uDCC2",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"\uD835\uDD5F",not:"\xac",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"\xf3",oast:"⊛",ocir:"⊚",ocirc:"\xf4",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"\uD835\uDD2C",ogon:"˛",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"\uD835\uDD60",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"\xf8",osol:"⊘",otilde:"\xf5",otimes:"⊗",otimesas:"⨶",ouml:"\xf6",ovbar:"⌽",par:"∥",para:"\xb6",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"\uD835\uDD2D",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",pointint:"⨕",popf:"\uD835\uDD61",pound:"\xa3",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"\uD835\uDCC5",psi:"ψ",puncsp:" ",qfr:"\uD835\uDD2E",qint:"⨌",qopf:"\uD835\uDD62",qprime:"⁗",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"\xae",rfisht:"⥽",rfloor:"⌋",rfr:"\uD835\uDD2F",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"\uD835\uDCC7",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"\xad",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"\uD835\uDD31",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"\xfe",tilde:"˜",times:"\xd7",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"\uD835\uDCC9",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"\xfa",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"\xfb",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"\uD835\uDD32",ugrave:"\xf9",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"\xa8",uogon:"ų",uopf:"\uD835\uDD66",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"\uD835\uDCCA",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"\xfc",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"\uD835\uDD35",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"\xfd",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"\xa5",yfr:"\uD835\uDD36",yicy:"ї",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"ю",yuml:"\xff",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"\uD835\uDD37",zhcy:"ж",zigrarr:"⇝",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"",zwnj:""},cb={}.hasOwnProperty;function cx(e){return!!cb.call(cv,e)&&cv[e]}let ck={name:"characterReference",tokenize:function(e,t,n){let r,a;let i=this,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,a=uD,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,a=uF,u):(e.enter("characterReferenceValue"),r=7,a=uL,u(t))}function u(o){if(59===o&&s){let r=e.exit("characterReferenceValue");return a!==uD||cx(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return a(o)&&s++<r?(e.consume(o),u):n(o)}}},cw={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return uZ(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},c_={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),uJ(e,t,"linePrefix")}}};function cS(e,t,n){let r=[],a=-1;for(;++a<e.length;){let i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}let cI={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&uC(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,a,i,s=e.length,o=0;for(;s--;)if(n=e[s][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(a){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=s,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(a=s);let l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[a][1].end}},c={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[a-2][1].start}};return i=uA(i=[["enter",l,t],["enter",u,t]],e.slice(r+1,r+o+3)),i=uA(i,[["enter",c,t]]),i=uA(i,cS(t.parser.constructs.insideSpan.null,e.slice(r+o+4,a-3),t)),i=uA(i,[["exit",c,t],e[a-2],e[a-1],["exit",u,t]]),i=uA(i,e.slice(a+1)),i=uA(i,[["exit",l,t]]),uC(e,r,e.length,i),e},tokenize:function(e,t,n){let r,a;let i=this,s=i.events.length;for(;s--;)if(("labelImage"===i.events[s][1].type||"labelLink"===i.events[s][1].type)&&!i.events[s][1]._balanced){r=i.events[s][1];break}return function(t){return r?r._inactive?c(t):(a=i.parser.defined.includes(co(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(cE,u,a?u:c)(t):91===t?e.attempt(cT,u,a?l:c)(t):a?u(t):c(t)}function l(t){return e.attempt(cC,u,c)(t)}function u(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},cE={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return uU(t)?cs(e,a)(t):a(t)}function a(t){return 41===t?u(t):cr(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return uU(t)?cs(e,o)(t):u(t)}function s(e){return n(e)}function o(t){return 34===t||39===t||40===t?ci(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function l(t){return uU(t)?cs(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},cT={tokenize:function(e,t,n){let r=this;return function(t){return ca.call(r,e,a,i,"reference","referenceMarker","referenceString")(t)};function a(e){return r.parser.defined.includes(co(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},cC={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},cA={name:"labelStartImage",resolveAll:cI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),a};function a(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};function cN(e){return null===e||uU(e)||uW(e)?1:uB(e)?2:void 0}let cz={name:"attention",resolveAll:function(e,t){let n,r,a,i,s,o,l,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[c][1].start};cO(d,-o),cO(p,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:p},a={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...s.end}},e[n][1].end={...i.start},e[c][1].start={...s.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=uA(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=uA(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",a,t]]),l=uA(l,cS(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=uA(l,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,l=uA(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,uC(e,n-1,c-n+3,l),c=n+l.length-u-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n;let r=this.parser.constructs.attentionMarkers.null,a=this.previous,i=cN(a);return function(s){return n=s,e.enter("attentionSequence"),function s(o){if(o===n)return e.consume(o),s;let l=e.exit("attentionSequence"),u=cN(o),c=!u||2===u&&i||r.includes(o),d=!i||2===i&&u||r.includes(a);return l._open=!!(42===n?c:c&&(i||!d)),l._close=!!(42===n?d:d&&(u||!c)),t(o)}(s)}}};function cO(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let cP={name:"labelStartLink",resolveAll:cI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),a};function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},cR={42:u7,43:u7,45:u7,48:u7,49:u7,50:u7,51:u7,52:u7,53:u7,54:u7,55:u7,56:u7,57:u7,62:cn},cj={91:{name:"definition",tokenize:function(e,t,n){let r;let a=this;return function(t){return e.enter("definition"),ca.call(a,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function i(t){return(r=co(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return uU(t)?cs(e,o)(t):o(t)}function o(t){return cr(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(cl,u,u)(t)}function u(t){return uV(t)?uJ(e,c,"whitespace")(t):c(t)}function c(i){return null===i||uq(i)?(e.exit("definition"),a.parser.defined.push(r),t(i)):n(i)}}}},cD={[-2]:cu,[-1]:cu,32:cu},cM={35:{name:"headingAtx",resolve:function(e,t){let n,r,a=e.length-2,i=3;return"whitespace"===e[3][1].type&&(i+=2),a-2>i&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(i===a-1||a-4>i&&"whitespace"===e[a-2][1].type)&&(a-=i+1===a?2:4),a>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},r={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},uC(e,i,a-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(a){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),function a(i){return 35===i&&r++<6?(e.consume(i),a):null===i||uU(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||uq(r)?(e.exit("atxHeading"),t(r)):uV(r)?uJ(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||uU(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(a)}}},42:u8,45:[cd,u8],60:{concrete:!0,name:"htmlFlow",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},tokenize:function(e,t,n){let r,a,i,s,o;let l=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u};function u(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),a=!0,h):63===s?(e.consume(s),r=3,l.interrupt?t:O):uj(s)?(e.consume(s),i=String.fromCharCode(s),f):n(s)}function c(a){return 45===a?(e.consume(a),r=2,d):91===a?(e.consume(a),r=5,s=0,p):uj(a)?(e.consume(a),r=4,l.interrupt?t:O):n(a)}function d(r){return 45===r?(e.consume(r),l.interrupt?t:O):n(r)}function p(r){let a="CDATA[";return r===a.charCodeAt(s++)?(e.consume(r),s===a.length)?l.interrupt?t:S:p:n(r)}function h(t){return uj(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||uU(s)){let o=47===s,u=i.toLowerCase();return!o&&!a&&ch.includes(u)?(r=1,l.interrupt?t(s):S(s)):cp.includes(i.toLowerCase())?(r=6,o)?(e.consume(s),m):l.interrupt?t(s):S(s):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(s):a?function t(n){return uV(n)?(e.consume(n),t):w(n)}(s):g(s))}return 45===s||uD(s)?(e.consume(s),i+=String.fromCharCode(s),f):n(s)}function m(r){return 62===r?(e.consume(r),l.interrupt?t:S):n(r)}function g(t){return 47===t?(e.consume(t),w):58===t||95===t||uj(t)?(e.consume(t),y):uV(t)?(e.consume(t),g):w(t)}function y(t){return 45===t||46===t||58===t||95===t||uD(t)?(e.consume(t),y):v(t)}function v(t){return 61===t?(e.consume(t),b):uV(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),o=t,x):uV(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||uU(n)?v(n):(e.consume(n),t)}(t)}function x(t){return t===o?(e.consume(t),o=null,k):null===t||uq(t)?n(t):(e.consume(t),x)}function k(e){return 47===e||62===e||uV(e)?g(e):n(e)}function w(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||uq(t)?S(t):uV(t)?(e.consume(t),_):n(t)}function S(t){return 45===t&&2===r?(e.consume(t),C):60===t&&1===r?(e.consume(t),A):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),O):93===t&&5===r?(e.consume(t),z):uq(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(cf,R,I)(t)):null===t||uq(t)?(e.exit("htmlFlowData"),I(t)):(e.consume(t),S)}function I(t){return e.check(cm,E,R)(t)}function E(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return null===t||uq(t)?I(t):(e.enter("htmlFlowData"),S(t))}function C(t){return 45===t?(e.consume(t),O):S(t)}function A(t){return 47===t?(e.consume(t),i="",N):S(t)}function N(t){if(62===t){let n=i.toLowerCase();return ch.includes(n)?(e.consume(t),P):S(t)}return uj(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),N):S(t)}function z(t){return 93===t?(e.consume(t),O):S(t)}function O(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),O):S(t)}function P(t){return null===t||uq(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),P)}function R(n){return e.exit("htmlFlow"),t(n)}}},61:cd,95:u8,96:cy,126:cy},c$={38:ck,92:cw},cL={[-5]:c_,[-4]:c_,[-3]:c_,33:cA,38:ck,42:cz,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"),a};function a(t){return uj(t)?(e.consume(t),i):64===t?n(t):o(t)}function i(t){return 43===t||45===t||46===t||uD(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,s):(43===n||45===n||46===n||uD(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function s(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||u$(r)?n(r):(e.consume(r),s)}function o(t){return 64===t?(e.consume(t),l):uM(t)?(e.consume(t),o):n(t)}function l(a){return uD(a)?function a(i){return 46===i?(e.consume(i),r=0,l):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||uD(i))&&r++<63){let n=45===i?t:a;return e.consume(i),n}return n(i)}(i)}(a):n(a)}}},{name:"htmlText",tokenize:function(e,t,n){let r,a,i;let s=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),v):uj(t)?(e.consume(t),w):n(t)}function l(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),a=0,h):uj(t)?(e.consume(t),y):n(t)}function u(t){return 45===t?(e.consume(t),p):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):uq(t)?(i=c,N(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),p):c(t)}function p(e){return 62===e?A(e):45===e?d(e):c(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(a++)?(e.consume(t),a===r.length?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):uq(t)?(i=f,N(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?A(t):93===t?(e.consume(t),g):f(t)}function y(t){return null===t||62===t?A(t):uq(t)?(i=y,N(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):uq(t)?(i=v,N(t)):(e.consume(t),v)}function b(e){return 62===e?A(e):v(e)}function x(t){return uj(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||uD(t)?(e.consume(t),k):function t(n){return uq(n)?(i=t,N(n)):uV(n)?(e.consume(n),t):A(n)}(t)}function w(t){return 45===t||uD(t)?(e.consume(t),w):47===t||62===t||uU(t)?_(t):n(t)}function _(t){return 47===t?(e.consume(t),A):58===t||95===t||uj(t)?(e.consume(t),S):uq(t)?(i=_,N(t)):uV(t)?(e.consume(t),_):A(t)}function S(t){return 45===t||46===t||58===t||95===t||uD(t)?(e.consume(t),S):function t(n){return 61===n?(e.consume(n),I):uq(n)?(i=t,N(n)):uV(n)?(e.consume(n),t):_(n)}(t)}function I(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,E):uq(t)?(i=I,N(t)):uV(t)?(e.consume(t),I):(e.consume(t),T)}function E(t){return t===r?(e.consume(t),r=void 0,C):null===t?n(t):uq(t)?(i=E,N(t)):(e.consume(t),E)}function T(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||uU(t)?_(t):(e.consume(t),T)}function C(e){return 47===e||62===e||uU(e)?_(e):n(e)}function A(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function N(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),z}function z(t){return uV(t)?uJ(e,O,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}}],91:cP,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return uq(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},cw],93:cI,95:cz,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=a;++t<r;)if("codeTextData"===e[t][1].type){e[a][1].type="codeTextPadding",e[r][1].type="codeTextPadding",a+=2,r-=2;break}}for(t=a-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,a,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),i++,t):(e.exit("codeTextSequence"),s(n))}(t)};function s(l){return null===l?n(l):32===l?(e.enter("space"),e.consume(l),e.exit("space"),s):96===l?(a=e.enter("codeTextSequence"),r=0,function n(s){return 96===s?(e.consume(s),r++,n):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(s)):(a.type="codeTextData",o(s))}(l)):uq(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):(e.enter("codeTextData"),o(l))}function o(t){return null===t||32===t||96===t||uq(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),o)}}}},cF={null:[cz,u2]},cZ={null:[42,95]},cq={null:[]},cU=/[\0\t\n\r]/g;function cV(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&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 cB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cW(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return cV(n.slice(t?2:1),t?16:10)}return cx(n)||e}let cH={}.hasOwnProperty;function cJ(e){return{line:e.line,column:e.column,offset:e.offset}}function cG(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+ui({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ui({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+ui({start:t.start,end:t.end})+") is still open")}function cK(e){let t=this;t.parser=function(n){var r,a;let i,s,o,l;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(a=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(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(h),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:r(h,a),codeText:r(function(){return{type:"inlineCode",value:""}},a),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,a),htmlFlowData:u,htmlText:r(g,a),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:a,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:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];if(!t.depth){let n=this.sliceSerialize(e).length;t.depth=n}},autolink:s(),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:s(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t;let n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=cV(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=cx(n);let a=this.stack[this.stack.length-1];a.value+=t},characterReference:function(e){this.stack.pop().position.end=cJ(e.end)},codeFenced:s(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:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:s(),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=co(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(d),hardBreakTrailing:s(d),htmlFlow:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:s(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(cB,cW),n.identifier=co(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=cJ(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:s(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:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=co(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:s(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:s(),thematicBreak:s()}};(function e(t,n){let r=-1;for(;++r<n.length;){let a=n[r];Array.isArray(a)?e(t,a):function(e,t){let n;for(n in t)if(cH.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,a)}})(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},s={stack:[r],tokenStack:[],config:t,enter:i,exit:o,buffer:a,resume:l,data:n},u=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?u.push(c):c=function(e,t,n){let r,a,i,s,o=t-1,l=-1,u=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,s=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||s||l||i||(i=o),s=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:s=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let s=o;for(a=void 0;s--;){let t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;a&&(e[a][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",a=s}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!a||i<a)&&(r._spread=!0),r.end=Object.assign({},a?e[a][1].start:t[1].end),e.splice(a||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let a={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=a,e.splice(o,0,["enter",a,t[2]]),o++,n++,i=void 0,s=!0}}}return e[t][1]._spread=u,n}(e,u.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];cH.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},s),e[c][1])}if(s.tokenStack.length>0){let e=s.tokenStack[s.tokenStack.length-1];(e[1]||cG).call(s,void 0,e[0])}for(r.position={start:cJ(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:cJ(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){i.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function i(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:cJ(t.start),end:void 0}}function s(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||cG).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ui({start:e.start,end:e.end})+"): it’s not open");n.position.end=cJ(e.end)}function l(){return uI(this.stack.pop())}function u(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:cJ(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=cJ(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function h(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function y(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(a)(function(e){for(;!uO(e););return e}((function(e){let t={constructs:uR([Q,...(e||{}).extensions||[]]),content:n(uG),defined:[],document:n(uK),flow:n(u1),lazy:{},string:n(u4),text:n(u9)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},a={},i=[],s=[],o=[],l={attempt:f(function(e,t){m(e,t.from)}),check:f(h),consume:function(e){uq(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),u.events.push(["enter",n,u]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=p(),u.events.push(["exit",t,u]),t},interrupt:f(h,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){a[e.line]=e.column,g()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,a=[];for(;++r<e.length;){let i;let s=e[r];if("string"==typeof s)i=s;else switch(s){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&n)continue;i=" ";break;default:i=String.fromCharCode(s)}n=-2===s,a.push(i)}return a.join("")}(d(e),t)},sliceStream:d,write:function(e){return(s=uA(s,e),function(){let e;for(;r._index<s.length;){let n=s[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==s[s.length-1])?[]:(m(t,0),u.events=cS(i,u.events,u),u.events)}},c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function d(e){return function(e,t){let n;let r=t.start._index,a=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;if(r===i)n=[e[r].slice(a,s)];else{if(n=e.slice(r,i),a>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(a):n.shift()}s>0&&n.push(e[i].slice(0,s))}return n}(s,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:a,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:a,offset:i}}function h(e,t){t.restore()}function f(e,t){return function(n,a,i){let s,c,d,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){let t=null!==e&&n[e],r=null!==e&&n.null;return f([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)};function f(e){return(s=e,c=0,0===e.length)?i:m(e[c])}function m(e){return function(n){return(h=function(){let e=p(),t=u.previous,n=u.currentConstruct,a=u.events.length,i=Array.from(o);return{from:a,restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=a,o=i,g()}}}(),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),a}function v(e){return(h.restore(),++c<s.length)?m(s[c]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&uC(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function g(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}(t,e,n)}}})(a).document().write((s=1,o="",l=!0,function(e,t,n){let r,a,u,c,d;let p=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),u=0,o="",l&&(65279===e.charCodeAt(0)&&u++,l=void 0);u<e.length;){if(cU.lastIndex=u,c=(r=cU.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(c),!r){o=e.slice(u);break}if(10===d&&u===c&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),u<c&&(p.push(e.slice(u,c)),s+=c-u),d){case 0:p.push(65533),s++;break;case 9:for(a=4*Math.ceil(s/4),p.push(-2);s++<a;)p.push(-1);break;case 10:p.push(-4),s=1;break;default:i=!0,s=1}u=c+1}return n&&(i&&p.push(-5),o&&p.push(o),p.push(null)),p})(n,r,!0))))}}let cY="object"==typeof self?self:globalThis,cX=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=a=>{if(e.has(a))return e.get(a);let[i,s]=t[a];switch(i){case 0:case -1:return n(s,a);case 1:{let e=n([],a);for(let t of s)e.push(r(t));return e}case 2:{let e=n({},a);for(let[t,n]of s)e[r(t)]=r(n);return e}case 3:return n(new Date(s),a);case 4:{let{source:e,flags:t}=s;return n(new RegExp(e,t),a)}case 5:{let e=n(new Map,a);for(let[t,n]of s)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,a);for(let t of s)e.add(r(t));return e}case 7:{let{name:e,message:t}=s;return n(new cY[e](t),a)}case 8:return n(BigInt(s),a);case"BigInt":return n(Object(BigInt(s)),a);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:e}=new Uint8Array(s);return n(new DataView(e),s)}}return n(new cY[i](s),a)};return r},cQ=e=>cX(new Map,e)(0),{toString:c0}={},{keys:c1}=Object,c2=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=c0.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,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},c4=([e,t])=>0===e&&("function"===t||"symbol"===t),c9=(e,t,n,r)=>{let a=(e,t)=>{let a=r.push(e)-1;return n.set(t,a),a},i=r=>{if(n.has(r))return n.get(r);let[s,o]=c2(r);switch(s){case 0:{let t=r;switch(o){case"bigint":s=8,t=r.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+o);t=null;break;case"undefined":return a([-1],r)}return a([s,t],r)}case 1:{if(o){let e=r;return"DataView"===o?e=new Uint8Array(r.buffer):"ArrayBuffer"===o&&(e=new Uint8Array(r)),a([o,[...e]],r)}let e=[],t=a([s,e],r);for(let t of r)e.push(i(t));return t}case 2:{if(o)switch(o){case"BigInt":return a([o,r.toString()],r);case"Boolean":case"Number":case"String":return a([o,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());let n=[],l=a([s,n],r);for(let t of c1(r))(e||!c4(c2(r[t])))&&n.push([i(t),i(r[t])]);return l}case 3:return a([s,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return a([s,{source:e,flags:t}],r)}case 5:{let t=[],n=a([s,t],r);for(let[n,a]of r)(e||!(c4(c2(n))||c4(c2(a))))&&t.push([i(n),i(a)]);return n}case 6:{let t=[],n=a([s,t],r);for(let n of r)(e||!c4(c2(n)))&&t.push(i(n));return n}}let{message:l}=r;return a([s,{name:o,message:l}],r)};return i},c3=(e,{json:t,lossy:n}={})=>{let r=[];return c9(!(t||n),!!t,new Map,r)(e),r},c5="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?cQ(c3(e,t)):structuredClone(e):(e,t)=>cQ(c3(e,t));function c6(e){let t=[],n=-1,r=0,a=0;for(;++n<e.length;){let i=e.charCodeAt(n),s="";if(37===i&&uD(e.charCodeAt(n+1))&&uD(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(s=String.fromCharCode(i,t),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+a+1,s=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function c8(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 c7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let de=function(e){if(null==e)return dn;if("function"==typeof e)return dt(e);if("object"==typeof e)return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=de(e[n]);return dt(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):dt(function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0});if("string"==typeof e)return dt(function(t){return t&&t.type===e});throw Error("Expected function, string, or object as test")};function dt(e){return function(t,n,r){var a;return!!(null!==(a=t)&&"object"==typeof a&&"type"in a&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function dn(){return!0}let dr=[];function da(e,t,n,r){let a;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):a=t;let i=de(a),s=r?-1:1;(function e(a,o,l){let u=a&&"object"==typeof a?a:{};if("string"==typeof u.type){let e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(c,"name",{value:"node (\x1b[33m"+a.type+(e?"<"+e+">":"")+"\x1b[39m)"})}return c;function c(){var u;let c,d,p,h=dr;if((!t||i(a,o,l[l.length-1]||void 0))&&!1===(h=Array.isArray(u=n(a,l))?u:"number"==typeof u?[!0,u]:null==u?dr:[u])[0])return h;if("children"in a&&a.children&&a.children&&"skip"!==h[0])for(d=(r?a.children.length:-1)+s,p=l.concat(a);d>-1&&d<a.children.length;){if(!1===(c=e(a.children[d],d,p)())[0])return c;d="number"==typeof c[1]?c[1]:d+s}return h}})(e,void 0,[])()}function di(e,t,n,r){let a,i,s;"function"==typeof t&&"function"!=typeof n?(i=void 0,s=t,a=n):(i=t,s=n,a=r),da(e,i,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return s(e,r,n)},a)}function ds(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 a=e.all(t),i=a[0];i&&"text"===i.type?i.value="["+i.value:a.unshift({type:"text",value:"["});let s=a[a.length-1];return s&&"text"===s.type?s.value+=r:a.push({type:"text",value:r}),a}function dl(e){let t=e.spread;return null==t?e.children.length>1:t}function du(e,t,n){let r=0,a=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(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}let dc={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={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);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-",a=String(t.identifier).toUpperCase(),i=c6(a.toLowerCase()),s=e.footnoteOrder.indexOf(a),o=e.footnoteCounts.get(a);void 0===o?(o=0,e.footnoteOrder.push(a),n=e.footnoteOrder.length):n=s+1,o+=1,e.footnoteCounts.set(a,o);let l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),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 ds(e,t);let a={src:c6(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(a.title=r.title);let i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:c6(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 ds(e,t);let a={href:c6(r.url||"")};null!==r.title&&void 0!==r.title&&(a.title=r.title);let i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:c6(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),a=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=dl(n[r])}return t}(n):dl(t),i={},s=[];if("boolean"==typeof t.checked){let e;let n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(a||0!==o||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||a?s.push(e):s.push(...e.children)}let l=r[r.length-1];l&&(a||"element"!==l.type||"p"!==l.tagName)&&s.push({type:"text",value:"\n"});let u={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){let n={},r=e.all(t),a=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++a<r.length;){let e=r[a];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),a=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),a.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=ur(t.children[1]),s=un(t.children[t.children.length-1]);i&&s&&(r.position={start:i,end:s}),a.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)},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,a=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,s=i?i.length:t.children.length,o=-1,l=[];for(;++o<s;){let n=t.children[o],r={},s=i?i[o]:void 0;s&&(r.align=s);let u={type:"element",tagName:a,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),l.push(u)}let u={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),a=0,i=[];for(;r;)i.push(du(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(du(t.slice(a),a>0,!1)),i.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:dd,yaml:dd,definition:dd,footnoteDefinition:dd};function dd(){}let dp={}.hasOwnProperty,dh={};function df(e,t){e.position&&(t.position=function(e){let t=ur(e),n=un(e);if(t&&n)return{start:t,end:n}}(e))}function dm(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,a=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&&a&&Object.assign(n.properties,c5(a)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function dg(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function dy(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function dv(e,t){let n=function(e,t){let n=t||dh,r=new Map,a=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let a=i.one(n[r],e);if(a){if(r&&"break"===n[r-1].type&&(Array.isArray(a)||"text"!==a.type||(a.value=dy(a.value)),!Array.isArray(a)&&"element"===a.type)){let e=a.children[0];e&&"text"===e.type&&(e.value=dy(e.value))}Array.isArray(a)?t.push(...a):t.push(a)}}}return t},applyData:dm,definitionById:r,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],handlers:{...dc,...n.handlers},one:function(e,t){let n=e.type,r=i.handlers[n];if(dp.call(i.handlers,n)&&r)return r(i,e,t);if(i.options.passThrough&&i.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=c5(n);return r.children=i.all(e),r}return c5(e)}return(i.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(dp.call(n,"hProperties")||dp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(i,e,t)},options:n,patch:df,wrap:dg};return di(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),i}(e,t),r=n.one(e,void 0),a=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||c8,r=e.options.footnoteBackLabel||c7,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],l=-1;for(;++l<e.footnoteOrder.length;){let a=e.footnoteById.get(e.footnoteOrder[l]);if(!a)continue;let i=e.all(a),s=String(a.identifier).toUpperCase(),u=c6(s.toLowerCase()),c=0,d=[],p=e.footnoteCounts.get(s);for(;void 0!==p&&++c<=p;){d.length>0&&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=i[i.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 i.push(...d);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(i,!0)};e.patch(a,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...c5(s),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:"\n"},a),i}function db(e,t){return e&&"run"in e?async function(n,r){let a=dv(n,{file:r,...t});await e.run(a,r)}:function(n,r){return dv(n,{file:r,...e||t})}}function dx(e){if(e)throw e}var dk=n(1345);function dw(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 d_=require("node:path"),dS=require("node:process");function dI(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let dE=require("node:url"),dT=["history","path","basename","stem","extname","dirname"];class dC{constructor(e){let t,n;t=e?dI(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":dS.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<dT.length;){let e=dT[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)dT.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?d_.basename(this.path):void 0}set basename(e){dN(e,"basename"),dA(e,"basename"),this.path=d_.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?d_.dirname(this.path):void 0}set dirname(e){dz(this.basename,"dirname"),this.path=d_.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?d_.extname(this.path):void 0}set extname(e){if(dA(e,"extname"),dz(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=d_.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){dI(e)&&(e=(0,dE.fileURLToPath)(e)),dN(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?d_.basename(this.path,this.extname):void 0}set stem(e){dN(e,"stem"),dA(e,"stem"),this.path=d_.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new uu(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function dA(e,t){if(e&&e.includes(d_.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+d_.sep+"`")}function dN(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function dz(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let dO=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},dP={}.hasOwnProperty;class dR extends dO{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);(function a(i,...s){let o=e[++n],l=-1;if(i){r(i);return}for(;++l<t.length;)(null===s[l]||void 0===s[l])&&(s[l]=t[l]);t=s,o?(function(e,t){let n;return function(...t){let i;let s=e.length>t.length;s&&t.push(r);try{i=e.apply(this,t)}catch(e){if(s&&n)throw e;return r(e)}s||(i&&i.then&&"function"==typeof i.then?i.then(a,r):i instanceof Error?r(i):a(i))};function r(e,...a){n||(n=!0,t(e,...a))}function a(e){r(null,e)}})(o,a)(...s):r(null,...s)})(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 dR,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data(dk(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(d$("data",this.frozen),this.namespace[e]=t,this):dP.call(this.namespace,e)&&this.namespace[e]||void 0:e?(d$("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let t=dZ(e),n=this.parser||this.Parser;return dD("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),dD("process",this.parser||this.Parser),dM("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,a){let i=dZ(e),s=n.parse(i);function o(e,n){e||!n?a(e):r?r(n):t(void 0,n)}n.run(s,i,function(e,t,r){if(e||!t||!r)return o(e);let a=n.stringify(t,r);"string"==typeof a||a&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?r.value=a:r.result=a,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),dD("processSync",this.parser||this.Parser),dM("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,dx(e),t=r}),dF("processSync","process",n),t}run(e,t,n){dL(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?a(void 0,n):new Promise(a);function a(a,i){let s=dZ(t);r.run(e,s,function(t,r,s){let o=r||e;t?i(t):a?a(o):n(void 0,o,s)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){dx(e),n=t,r=!0}),dF("runSync","run",r),n}stringify(e,t){this.freeze();let n=dZ(t),r=this.compiler||this.Compiler;return dM("stringify",r),dL(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(d$("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else if("object"==typeof e)Array.isArray(e)?i(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function a(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(e.plugins),e.settings&&(r.settings=dk(!0,r.settings,e.settings))}function i(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)s(e,[]);else if("object"==typeof e){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,a=-1;for(;++r<n.length;)if(n[r][0]===e){a=r;break}if(-1===a)n.push([e,...t]);else if(t.length>0){let[r,...i]=t,s=n[a][1];dw(s)&&dw(r)&&(r=dk(!0,s,r)),n[a]=[e,r,...i]}}}}let dj=new dR().freeze();function dD(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function dM(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function d$(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 dL(e){if(!dw(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function dF(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function dZ(e){return e&&"object"==typeof e&&"message"in e&&"messages"in e?e:new dC(e)}let dq=[],dU={allowDangerousHtml:!0},dV=/^(https?|ircs?|mailto|xmpp)$/i,dB=[{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:"className",id:"remove-classname"},{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 dW(e){let t=function(e){let t=e.rehypePlugins||dq,n=e.remarkPlugins||dq,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dU}:dU;return dj().use(cK).use(n).use(db,r).use(t)}(e),n=function(e){let t=e.children||"",n=new dC;return"string"==typeof t&&(n.value=t),n}(e);return function(e,t){let n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||dH;for(let e of dB)Object.hasOwn(t,e.from)&&(e.from,e.to&&e.to,e.id);return di(e,function(e,t,a){if("raw"===e.type&&a&&"number"==typeof t)return s?a.children.splice(t,1):a.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in u_)if(Object.hasOwn(u_,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=u_[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let s=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!s&&r&&"number"==typeof t&&(s=!r(e,t,a)),s&&a&&"number"==typeof t)return o&&e.children?a.children.splice(t,1,...e.children):a.children.splice(t,1),t}}),function(e,t){var n,r,a;let i;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let s=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=t.jsxDEV,i=function(e,t,r,a){let i=Array.isArray(r.children),o=ur(e);return n(t,r,a,i,{columnNumber:o?o.column-1:void 0,fileName:s,lineNumber:o?o.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,a=t.jsxs,i=function(e,t,n,i){let s=Array.isArray(n.children)?a:r;return i?s(t,n,i):s(t,n)}}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?l9:l4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},l=ug(o,e,void 0);return l&&"string"!=typeof l?l:o.create(e,o.Fragment,{children:l||void 0},void 0)}(e,{Fragment:ee.Fragment,components:a,ignoreInvalidStyle:!0,jsx:ee.jsx,jsxs:ee.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(n),n),e)}function dH(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return -1===t||-1!==a&&t>a||-1!==n&&t>n||-1!==r&&t>r||dV.test(e.slice(0,t))?e:""}function dJ(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,a=n.indexOf(t);for(;-1!==a;)r++,a=n.indexOf(t,a+t.length);return r}let dG="phrasing",dK=["autolink","link","image","label"];function dY(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function dX(e){this.config.enter.autolinkProtocol.call(this,e)}function dQ(e){this.config.exit.autolinkProtocol.call(this,e)}function d0(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function d1(e){this.config.exit.autolinkEmail.call(this,e)}function d2(e){this.exit(e)}function d4(e){!function(e,t,n){let r=de((n||{}).ignore||[]),a=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(;++r<n.length;){var a;let e=n[r];t.push(["string"==typeof(a=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(a),"g"):a,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),i=-1;for(;++i<a.length;)da(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){let e=t[s],a=n?n.children:void 0;if(r(e,a?a.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=a[i][0],s=a[i][1],o=0,l=n.children.indexOf(e),u=!1,c=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,a={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,a);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(o!==n&&c.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(i)?c.push(...i):i&&c.push(i),o=n+d[0].length,u=!0),!r.global)break;d=r.exec(e.value)}return u?(o<e.value.length&&c.push({type:"text",value:e.value.slice(o)}),n.children.splice(l,1,...c)):c=[e],l+c.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,d9],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,d3]],{ignore:["link","linkReference"]})}function d9(e,t,n,r,a){let i="";if(!d5(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}(n)))return!1;let s=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),a=dJ(e,"("),i=dJ(e,")");for(;-1!==r&&a>i;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),i++;return[e,n]}(n+r);if(!s[0])return!1;let o={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function d3(e,t,n,r){return!(!d5(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function d5(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||uW(n)||uB(n))&&(!t||47!==n)}function d6(){this.buffer()}function d8(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function d7(){this.buffer()}function pe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function pt(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=co(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pn(e){this.exit(e)}function pr(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=co(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pa(e){this.exit(e)}function pi(e,t,n,r){let a=n.createTracker(r),i=a.move("[^"),s=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),s(),i+=a.move("]")}function ps(e,t,n){return 0===t?e:po(e,t,n)}function po(e,t,n){return(n?"":" ")+e}pi.peek=function(){return"["};let pl=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function pu(e){this.enter({type:"delete",children:[]},e)}function pc(e){this.exit(e)}function pd(e,t,n,r){let a=n.createTracker(r),i=n.enter("strikethrough"),s=a.move("~~");return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"})+a.move("~~"),i(),s}function pp(e){return e.length}function ph(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}pd.peek=function(){return"~"};function pf(e,t,n){let r=e.value||"",a="`",i=-1;for(;RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){let e;let t=n.unsafe[i],a=n.compilePattern(t);if(t.atBreak)for(;e=a.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return a+r+a}pf.peek=function(){return"`"},de(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let pm={inlineCode:pf,listItem:function(e,t,n,r){let a=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),i=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let s=i.length+1;("tab"===a||"mixed"===a&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));let o=n.createTracker(r);o.move(i+" ".repeat(s-i.length)),o.shift(s);let l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?i:i+" ".repeat(s-i.length))+e});return l(),u}};function pg(e){let t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function py(e){this.exit(e),this.data.inTable=void 0}function pv(e){this.enter({type:"tableRow",children:[]},e)}function pb(e){this.exit(e)}function px(e){this.enter({type:"tableCell",children:[]},e)}function pk(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pw));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pw(e,t){return"|"===t?t:e}function p_(e){let t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function pS(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];e.type;let n=e.children[0];if(n&&"text"===n.type){let r;let a=t.children,i=-1;for(;++i<a.length;){let e=a[i];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function pI(e,t,n,r){let a=e.children[0],i="boolean"==typeof e.checked&&a&&"paragraph"===a.type,s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(s);let l=pm.listItem(e,t,n,{...r,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}let pE={tokenize:function(e,t,n){let r=0;return function t(i){return(87===i||119===i)&&r<3?(r++,e.consume(i),t):46===i&&3===r?(e.consume(i),a):n(i)};function a(e){return null===e?n(e):t(e)}},partial:!0},pT={tokenize:function(e,t,n){let r,a,i;return s;function s(t){return 46===t||95===t?e.check(pA,l,o)(t):null===t||uU(t)||uW(t)||45!==t&&uB(t)?l(t):(i=!0,e.consume(t),s)}function o(t){return 95===t?r=!0:(a=r,r=void 0),e.consume(t),s}function l(e){return a||r||!i?n(e):t(e)}},partial:!0},pC={tokenize:function(e,t){let n=0,r=0;return a;function a(s){return 40===s?(n++,e.consume(s),a):41===s&&r<n?i(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(pA,t,i)(s):null===s||uU(s)||uW(s)?t(s):(e.consume(s),a)}function i(t){return 41===t&&r++,e.consume(t),a}},partial:!0},pA={tokenize:function(e,t,n){return r;function r(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),r):38===s?(e.consume(s),i):93===s?(e.consume(s),a):60===s||null===s||uU(s)||uW(s)?t(s):n(s)}function a(e){return null===e||40===e||91===e||uU(e)||uW(e)?t(e):r(e)}function i(t){return uj(t)?function t(a){return 59===a?(e.consume(a),r):uj(a)?(e.consume(a),t):n(a)}(t):n(t)}},partial:!0},pN={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return uD(e)?n(e):t(e)}},partial:!0},pz={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!pD.call(r,r.previous)||pF(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(pE,e.attempt(pT,e.attempt(pC,a),n),n)(t))};function a(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:pD},pO={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,a="",i=!1;return function(t){return(72===t||104===t)&&pM.call(r,r.previous)&&!pF(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(t),e.consume(t),s):n(t)};function s(t){if(uj(t)&&a.length<5)return a+=String.fromCodePoint(t),e.consume(t),s;if(58===t){let n=a.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),i)?l:(i=!0,o):n(t)}function l(t){return null===t||u$(t)||uU(t)||uW(t)||uB(t)?n(t):e.attempt(pT,e.attempt(pC,u),n)(t)}function u(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:pM},pP={name:"emailAutolink",tokenize:function(e,t,n){let r,a;let i=this;return function(t){return!pL(t)||!p$.call(i,i.previous)||pF(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return pL(r)?(e.consume(r),t):64===r?(e.consume(r),s):n(r)}(t))};function s(t){return 46===t?e.check(pN,l,o)(t):45===t||95===t||uD(t)?(a=!0,e.consume(t),s):l(t)}function o(t){return e.consume(t),r=!0,s}function l(s){return a&&r&&uj(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:p$},pR={},pj=48;for(;pj<123;)pR[pj]=pP,58==++pj?pj=65:91===pj&&(pj=97);function pD(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||uU(e)}function pM(e){return!uj(e)}function p$(e){return!(47===e||pL(e))}function pL(e){return 43===e||45===e||46===e||95===e||uD(e)}function pF(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}pR[43]=pP,pR[45]=pP,pR[46]=pP,pR[95]=pP,pR[72]=[pP,pO],pR[104]=[pP,pO],pR[87]=[pP,pz],pR[119]=[pP,pz];let pZ={tokenize:function(e,t,n){let r=this;return uJ(e,function(e){let a=r.events[r.events.length-1];return a&&"gfmFootnoteDefinitionIndent"===a[1].type&&4===a[2].sliceSerialize(a[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function pq(e,t,n){let r;let a=this,i=a.events.length,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);for(;i--;){let e=a.events[i][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(i){if(!r||!r._balanced)return n(i);let o=co(a.sliceSerialize({start:r.end,end:a.now()}));return 94===o.codePointAt(0)&&s.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)):n(i)}}function pU(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)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function pV(e,t,n){let r;let a=this,i=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(o){if(s>999||93===o&&!r||null===o||91===o||uU(o))return n(o);if(93===o){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return i.includes(co(a.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return uU(o)||(r=!0),s++,e.consume(o),92===o?u:l}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function pB(e,t,n){let r,a;let i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(t)}function u(t){if(o>999||93===t&&!a||null===t||91===t||uU(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=co(i.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return uU(t)||(a=!0),o++,e.consume(t),92===t?c:u}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,u):u(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(r)||s.push(r),uJ(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function pW(e,t,n){return e.check(uX,t,e.attempt(pZ,t,n))}function pH(e){e.exit("gfmFootnoteDefinition")}class pJ{constructor(){this.map=[]}add(e,t,n){(function(e,t,n,r){let a=0;if(0!==n||0!==r.length){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}})(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)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.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function pG(e,t,n){let r;let a=this,i=0,s=0;return function(e){let t=a.events.length-1;for(;t>-1;){let e=a.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?a.events[t][1].type:null,i="tableHead"===r||"tableRow"===r?v:o;return i===v&&a.parser.lazy[a.now().line]?n(e):i(e)};function o(t){return e.enter("tableHead"),e.enter("tableRow"),124===t||(r=!0,s+=1),l(t)}function l(t){return null===t?n(t):uq(t)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):uV(t)?uJ(e,l,"whitespace")(t):(s+=1,r&&(r=!1,i+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,l):(e.enter("data"),u(t))}function u(t){return null===t||124===t||uU(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return 92===t||124===t?(e.consume(t),u):u(t)}function d(t){return(a.interrupt=!1,a.parser.lazy[a.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,uV(t))?uJ(e,p,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t)}function p(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):n(t)}function h(t){return uV(t)?uJ(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(s+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(s+=1,m(t)):null===t||uq(t)?y(t):n(t)}function m(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"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return uV(t)?uJ(e,y,"whitespace")(t):y(t)}function y(a){return 124===a?p(a):null===a||uq(a)?r&&i===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(a)):n(a):n(a)}function v(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||uq(n)?(e.exit("tableRow"),t(n)):uV(n)?uJ(e,b,"whitespace")(n):(e.enter("data"),x(n))}function x(t){return null===t||124===t||uU(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?k:x)}function k(t){return 92===t||124===t?(e.consume(t),x):x(t)}}function pK(e,t){let n,r,a,i=-1,s=!0,o=0,l=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,p=new pJ;for(;++i<e.length;){let h=e[i],f=h[1];"enter"===h[0]?"tableHead"===f.type?(c=!1,0!==d&&(pX(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,a=void 0,l=[0,0,0,0],u=[0,i+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",r,t]])),o="tableDelimiterRow"===f.type?2:r?3:1):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(s=!1,0===u[2]&&(0!==l[1]&&(u[0]=u[1],a=pY(p,t,l,o,void 0,a),l=[0,0,0,0]),u[2]=i)):"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(u[0]=u[1],a=pY(p,t,l,o,void 0,a)),u=[(l=u)[1],i,0,0])):"tableHead"===f.type?(c=!0,d=i):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=i,0!==l[1]?(u[0]=u[1],a=pY(p,t,l,o,i,a)):0!==u[1]&&(a=pY(p,t,u,o,i,a)),o=0):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(u[3]=i)}for(0!==d&&pX(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){let e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let a=e[t];if(n){if("enter"===a[0])"tableContent"===a[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===a[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===a[1].type)break}else"enter"===a[0]&&"tableDelimiterRow"===a[1].type&&(n=!0);t+=1}return r}(t.events,i))}return e}function pY(e,t,n,r,a,i){0!==n[0]&&(i.end=Object.assign({},pQ(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));let s=pQ(t.events,n[1]);if(i={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){let a=pQ(t.events,n[2]),i=pQ(t.events,n[3]),s={type:"tableContent",start:Object.assign({},a),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",s,t]]),2!==r){let r=t.events[n[2]],a=t.events[n[3]];if(r[1].end=Object.assign({},a[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==a&&(i.end=Object.assign({},pQ(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function pX(e,t,n,r,a){let i=[],s=pQ(t.events,n);a&&(a.end=Object.assign({},s),i.push(["exit",a,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(n+1,0,i)}function pQ(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let p0={name:"tasklistCheck",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"),a):n(t)};function a(t){return uU(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return uq(r)?t(r):uV(r)?e.check({tokenize:p1},t,n)(r):n(r)}}};function p1(e,t,n){return uJ(e,function(e){return null===e?n(e):t(e)},"whitespace")}let p2={};function p4(e){let t;let n=e||p2,r=this.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(uR([{text:pR},{document:{91:{name:"gfmFootnoteDefinition",tokenize:pB,continuation:{tokenize:pW},exit:pH}},text:{91:{name:"gfmFootnoteCall",tokenize:pV},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pq,resolveTo:pU}}},function(e){let t=(e||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let a=this.previous,i=this.events,s=0;return function(o){return 126===a&&"characterEscape"!==i[i.length-1][1].type?r(o):(e.enter("strikethroughSequenceTemporary"),function i(o){let l=cN(a);if(126===o)return s>1?r(o):(e.consume(o),s++,i);if(s<2&&!t)return r(o);let u=e.exit("strikethroughSequenceTemporary"),c=cN(o);return u._open=!c||2===c&&!!l,u._close=!l||2===l&&!!c,n(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let a={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",a,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],o=t.parser.constructs.insideSpan.null;o&&uC(s,s.length,0,cS(o,e.slice(r+1,n),t)),uC(s,s.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",a,t]]),uC(e,r-1,n-r+3,s),n=r+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}(n),{flow:{null:{name:"table",tokenize:pG,resolveAll:pK}}},{text:{91:p0}}])),i.push([{transforms:[d4],enter:{literalAutolink:dY,literalAutolinkEmail:dX,literalAutolinkHttp:dX,literalAutolinkWww:dX},exit:{literalAutolink:d2,literalAutolinkEmail:d1,literalAutolinkHttp:dQ,literalAutolinkWww:d0}},{enter:{gfmFootnoteCallString:d6,gfmFootnoteCall:d8,gfmFootnoteDefinitionLabelString:d7,gfmFootnoteDefinition:pe},exit:{gfmFootnoteCallString:pt,gfmFootnoteCall:pn,gfmFootnoteDefinitionLabelString:pr,gfmFootnoteDefinition:pa}},{canContainEols:["delete"],enter:{strikethrough:pu},exit:{strikethrough:pc}},{enter:{table:pg,tableData:px,tableHeader:px,tableRow:pv},exit:{codeText:pk,table:py,tableData:pb,tableHeader:pb,tableRow:pb}},{exit:{taskListCheckValueChecked:p_,taskListCheckValueUnchecked:p_,paragraph:pS}}]),s.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dG,notInConstruct:dK},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dG,notInConstruct:dK},{character:":",before:"[ps]",after:"\\/",inConstruct:dG,notInConstruct:dK}]},(t=!1,n&&n.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,a){let i=r.createTracker(a),s=i.move("[^"),o=r.enter("footnoteDefinition"),l=r.enter("label");return s+=i.move(r.safe(r.associationId(e),{before:s,after:"]"})),l(),s+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),s+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?po:ps))),o(),s},footnoteReference:pi},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:pl}],handlers:{delete:pd}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=pm.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){let r=e.children,a=-1,i=[],s=t.enter("table");for(;++a<r.length;)i[a]=l(r[a],t,n);return s(),i}(e,n,r),e.align)},tableCell:s,tableRow:function(e,t,n,r){let a=o([l(e,n,r)]);return a.slice(0,a.indexOf("\n"))}}};function s(e,t,n,r){let a=n.enter("tableCell"),s=n.enter("phrasing"),o=n.containerPhrasing(e,{...r,before:i,after:i});return s(),a(),o}function o(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),a=n.stringLength||pp,i=[],s=[],o=[],l=[],u=0,c=-1;for(;++c<e.length;){let t=[],r=[],i=-1;for(e[c].length>u&&(u=e[c].length);++i<e[c].length;){var d;let s=null==(d=e[c][i])?"":String(d);if(!1!==n.alignDelimiters){let e=a(s);r[i]=e,(void 0===l[i]||e>l[i])&&(l[i]=e)}t.push(s)}s[c]=t,o[c]=r}let p=-1;if("object"==typeof r&&"length"in r)for(;++p<u;)i[p]=ph(r[p]);else{let e=ph(r);for(;++p<u;)i[p]=e}p=-1;let h=[],f=[];for(;++p<u;){let e=i[p],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let a=!1===n.alignDelimiters?1:Math.max(1,l[p]-t.length-r.length),s=t+"-".repeat(a)+r;!1!==n.alignDelimiters&&((a=t.length+a+r.length)>l[p]&&(l[p]=a),f[p]=a),h[p]=s}s.splice(1,0,h),o.splice(1,0,f),c=-1;let m=[];for(;++c<s.length;){let e=s[c],t=o[c];p=-1;let r=[];for(;++p<u;){let a=e[p]||"",s="",o="";if(!1!==n.alignDelimiters){let e=l[p]-(t[p]||0),n=i[p];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=s=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||p||r.push("|"),!1!==n.padding&&!(!1===n.alignDelimiters&&""===a)&&(!1!==n.delimiterStart||p)&&r.push(" "),!1!==n.alignDelimiters&&r.push(s),r.push(a),!1!==n.alignDelimiters&&r.push(o),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||p!==u-1)&&r.push("|")}m.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return m.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:a})}function l(e,t,n){let r=e.children,a=-1,i=[],o=t.enter("tableRow");for(;++a<r.length;)i[a]=s(r[a],e,t,n);return o(),i}}(n),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:pI}}]})}function p9({agentId:e}){let t=(0,et.useRef)(null),n=(0,et.useRef)({x:0,y:0,clicking:!1,lastActiveTs:0,hasPos:!1,ripples:[],rafId:0});return(0,et.useCallback)(()=>{n.current.lastActiveTs=Date.now()},[]),ee.jsx("canvas",{ref:t,className:"pointer-events-none absolute inset-0 z-20"})}let p3=ny("type",[ng({type:nv("not_changed")}),ng({type:nv("changed"),base64:nm()})]);ng({textOutput:nm(),imageOutput:p3.nullable()}),Promise.resolve();class p5{constructor(e){this.clips=[],this.currentFrames=[],this.cursorPos={x:0,y:0},this.clicking=!1,this.recording=!1,this.currentTabId=0,this.clipStartTime=0,this.cdpCleanup=null,this.ripples=[],this.cursorTrail=[],this.currentUrl="",this.agentId=e}async captureFrame(){let e=window.bangonit;try{let t=await e.capturePage(this.agentId),{result:n}=await e.cdpSend(this.agentId,"Runtime.evaluate",{expression:"JSON.stringify({w:window.innerWidth,h:window.innerHeight})",returnByValue:!0}),r=JSON.parse(n.value);this.currentFrames.push({imageData:t,cursor:{...this.cursorPos},clicking:this.clicking,ts:Date.now(),sessionId:0,deviceWidth:r.w,deviceHeight:r.h,scrollOffsetX:0,scrollOffsetY:0})}catch(e){console.warn("Failed to capture frame:",e)}}async startClip(e,t){this.currentUrl=t||"",this.recording&&await this.cancelClip(),this.recording=!0,this.currentTabId=e,this.currentFrames=[],this.cursorTrail=[],this.clipStartTime=Date.now(),await this.captureFrame();let n=window.bangonit;this.cdpCleanup=n.onCdpEvent(e=>{if(e.agentId!==this.agentId||"Page.screencastFrame"!==e.method||!this.recording)return;let{data:t,metadata:r,sessionId:a}=e.params;this.currentFrames.push({imageData:t,cursor:{...this.cursorPos},clicking:this.clicking,ts:Date.now(),sessionId:a,deviceWidth:r?.deviceWidth||0,deviceHeight:r?.deviceHeight||0,scrollOffsetX:r?.scrollOffsetX||0,scrollOffsetY:r?.scrollOffsetY||0}),n.cdpSend(this.agentId,"Page.screencastFrameAck",{sessionId:a}).catch(e=>console.error(e))}),await n.cdpSend(this.agentId,"Page.startScreencast",{format:"png",quality:100,maxWidth:1920,maxHeight:1080})}async stopClip(){if(!this.recording)return null;await this.captureFrame(),this.recording=!1;let e=Date.now();await window.bangonit.cdpSend(this.agentId,"Page.stopScreencast").catch(e=>console.error(e)),this.cdpCleanup&&(this.cdpCleanup(),this.cdpCleanup=null);let t=this.currentFrames;if(this.currentFrames=[],0===t.length)return null;let n=await this.compositeAndEncode(t);if(!n||0===n.size)return null;let r=new Uint8Array(await n.arrayBuffer()),a="";for(let e=0;e<r.length;e++)a+=String.fromCharCode(r[e]);let i=btoa(a),s={agentId:this.agentId,tabId:this.currentTabId,index:this.clips.length,startTime:this.clipStartTime,endTime:e,url:this.currentUrl||void 0,data:i};return this.clips.push(s),{meta:s}}async cancelClip(){this.recording=!1,this.currentFrames=[],this.cursorTrail=[],this.cdpCleanup&&(this.cdpCleanup(),this.cdpCleanup=null),await window.bangonit?.cdpSend(this.agentId,"Page.stopScreencast").catch(e=>console.error(e))}async compositeAndEncode(e){if(0===e.length)return null;let t=await this.decodeFrame(e[0].imageData);if(!t)return null;let n=t.width,r=t.height,a=document.createElement("canvas");a.width=n,a.height=r;let i=a.getContext("2d"),s=a.captureStream(0),o=s.getVideoTracks()[0],l=new MediaRecorder(s,{mimeType:"video/webm;codecs=vp8",videoBitsPerSecond:8e6}),u=[];l.ondataavailable=e=>{e.data.size>0&&u.push(e.data)};let c=new Promise(e=>{l.onstop=()=>{e(new Blob(u,{type:"video/webm"}))}});l.start();let d=[],p=this.cursorTrail,h=0,f=(e,t,a,s,l,u,c)=>{let p=t*u,h=a*c;s&&(!d.length||d[d.length-1].x!==p||d[d.length-1].y!==h)&&d.push({x:p,y:h,startTs:l}),i.clearRect(0,0,n,r),i.drawImage(e,0,0,n,r);for(let e=d.length-1;e>=0;e--){var f,m,g;let t=d[e],n=l-t.startTs;if(n>=400){d.splice(e,1);continue}f=t.x,m=t.y,(g=n/400)>=1||(i.save(),i.beginPath(),i.arc(f,m,24*g,0,2*Math.PI),i.fillStyle=`rgba(96, 165, 250, ${.8*(1-g)})`,i.fill(),i.restore(),i.save(),i.beginPath(),i.arc(f,m,32*g,0,2*Math.PI),i.strokeStyle=`rgba(96, 165, 250, ${.9*(1-g)})`,i.lineWidth=2,i.stroke(),i.restore())}(function(e,t,n,r,a=1){if(a<=0)return;e.save(),e.globalAlpha=a;let i=r?.8:1;e.save(),e.translate(t-2,n-1),e.scale(28/24*i,28/24*i);let s=new Path2D("M5 3l14 8.5-6.5 1.5-3.5 6z");e.shadowColor="rgba(0,0,0,0.5)",e.shadowBlur=2,e.shadowOffsetY=1,e.fillStyle="white",e.strokeStyle="black",e.lineWidth=1.5,e.lineJoin="round",e.fill(s),e.stroke(s),e.restore(),e.restore()})(i,p,h,s),o&&"function"==typeof o.requestFrame&&o.requestFrame()};for(let a=0;a<e.length;a++){let i=e[a],s=0===a?t:await this.decodeFrame(i.imageData);if(!s)continue;let o=i.deviceWidth>0?n/i.deviceWidth:1,l=i.deviceHeight>0?r/i.deviceHeight:1,u=a<e.length-1?e[a+1].ts:i.ts+100;for(f(s,i.cursor.x,i.cursor.y,i.clicking,i.ts,o,l);h<p.length&&p[h].ts<=i.ts;)h++;let c=i.ts;for(;h<p.length&&p[h].ts<u;){let e=p[h],t=e.ts-c;t>0&&await new Promise(e=>setTimeout(e,Math.min(t,16))),f(s,e.x,e.y,e.clicking,e.ts,o,l),c=e.ts,h++}if(a<e.length-1){let e=u-c;e>0&&await new Promise(t=>setTimeout(t,Math.min(e,100)))}}return await new Promise(e=>setTimeout(e,100)),l.stop(),c}async decodeFrame(e){try{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);let r=new Blob([n],{type:"image/png"});return createImageBitmap(r)}catch(e){return console.warn("Failed to decode frame:",e),null}}updateCursor(e,t){this.cursorPos={x:e,y:t},this.recording&&this.cursorTrail.push({ts:Date.now(),x:e,y:t,clicking:this.clicking})}setCursorDown(){this.clicking=!0,this.recording&&this.cursorTrail.push({ts:Date.now(),...this.cursorPos,clicking:!0})}setCursorUp(){this.clicking=!1,this.recording&&this.cursorTrail.push({ts:Date.now(),...this.cursorPos,clicking:!1})}getClipsMeta(){return[...this.clips]}}function p6({agentId:e,agentName:t,initialPrompt:n,onStatusChange:r,onRerun:a,initialMessages:i,initialTabs:s,initialActiveTabId:o,initialTodos:l,record:u,sessionRecorder:c,onRegisterRecorder:d,planDir:p}){let[h,f]=(0,et.useState)(s?.map(e=>({...e,initialUrl:e.url}))||[{id:0,url:"about:blank",title:"",initialUrl:"about:blank"}]),[m,g]=(0,et.useState)(o??0),[y,v]=(0,et.useState)(()=>{let e=s?.find(e=>e.id===(o??0));return e?.url||""}),[b,x]=(0,et.useState)(null),[k,w]=(0,et.useState)(!1),[_,S]=(0,et.useState)(!1),I=(0,et.useRef)(new Map),[E,T]=(0,et.useState)(l||[]),C=(0,et.useRef)(null);(0,et.useRef)(!1);let A=(0,et.useRef)(s?Math.max(...s.map(e=>e.id))+1:1),N=(0,et.useRef)(new Set),[z,O]=(0,et.useState)(0);(0,et.useRef)(null);let P=(0,et.useRef)(null);P.current;let R=(0,et.useRef)(null);u&&!R.current&&P.current&&(R.current=new p5(e),P.current.enableRecording(R.current),d?.(e,R.current));let j=(0,et.useRef)(c);j.current=c;let D=(0,et.useMemo)(()=>new lv({api:"/api/chat",headers:()=>({"X-Client-Platform":navigator.platform})}),[]),M=(0,et.useRef)(!1),$=(0,et.useCallback)((n,r)=>{window.bangonit?.emitAgentOutput?.({agentId:e,type:n,text:r,name:t})},[e,t]),{messages:L,sendMessage:F,addToolOutput:Z,status:q,error:U}=function({experimental_throttle:e,resume:t=!1,...n}={}){let r=(0,et.useRef)("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});let a={...n,onToolCall:e=>{var t,n;return null==(n=(t=r.current).onToolCall)?void 0:n.call(t,e)},onData:e=>{var t,n;return null==(n=(t=r.current).onData)?void 0:n.call(t,e)},onFinish:e=>{var t,n;return null==(n=(t=r.current).onFinish)?void 0:n.call(t,e)},onError:e=>{var t,n;return null==(n=(t=r.current).onError)?void 0:n.call(t,e)},sendAutomaticallyWhen:e=>{var t,n,a;return null!=(a=null==(n=(t=r.current).sendAutomaticallyWhen)?void 0:n.call(t,e))&&a}},i=(0,et.useRef)("chat"in n?n.chat:new lE(a));("chat"in n&&n.chat!==i.current||"id"in n&&i.current.id!==n.id)&&(i.current="chat"in n?n.chat:new lE(a));let s=(0,et.useCallback)(t=>i.current["~registerMessagesCallback"](t,e),[e,i.current.id]),o=(0,et.useSyncExternalStore)(s,()=>i.current.messages,()=>i.current.messages),l=(0,et.useSyncExternalStore)(i.current["~registerStatusCallback"],()=>i.current.status,()=>i.current.status),u=(0,et.useSyncExternalStore)(i.current["~registerErrorCallback"],()=>i.current.error,()=>i.current.error),c=(0,et.useCallback)(e=>{"function"==typeof e&&(e=e(i.current.messages)),i.current.messages=e},[i]);return(0,et.useEffect)(()=>{t&&i.current.resumeStream()},[t,i]),{id:i.current.id,messages:o,setMessages:c,sendMessage:i.current.sendMessage,regenerate:i.current.regenerate,clearError:i.current.clearError,stop:i.current.stop,error:u,resumeStream:i.current.resumeStream,status:l,addToolResult:i.current.addToolOutput,addToolOutput:i.current.addToolOutput,addToolApprovalResponse:i.current.addToolApprovalResponse}}({transport:D,messages:i,sendAutomaticallyWhen:({messages:e})=>!M.current&&!k&&function({messages:e}){let t=e[e.length-1];if(!t||"assistant"!==t.role)return!1;let n=t.parts.reduce((e,t,n)=>"step-start"===t.type?n:e,-1),r=t.parts.slice(n+1).filter(ln).filter(e=>!e.providerExecuted);return r.length>0&&r.every(e=>"output-available"===e.state||"output-error"===e.state)}({messages:e}),async onToolCall({toolCall:n}){if("report_result"===n.toolName){let a=n.input,i=a?.result==="pass"?"pass":"fail",s=a?.summary||"";if($("status",`${i.toUpperCase()}: ${s}`),x({result:i,summary:s}),j.current){j.current.addEvent({ts:Date.now(),agentId:e,type:"result",data:{result:i,summary:s}});try{let n=await window.bangonit?.getRunDir?.();if(n){let r=R.current?.getClipsMeta()||[],a=[{id:e,name:t,result:i,summary:s}],o=j.current.toJSON(a,r);await window.bangonit?.generateReplayHtml?.({runDir:n,data:JSON.stringify(o)})}}catch(e){console.error(e)}}await r?.(e,"idle",i),W.current=!0,window.bangonit?.reportTestResult?.({agentId:e,status:i,summary:s}),Z({tool:n.toolName,toolCallId:n.toolCallId,output:`Test result recorded: ${i}`});return}if("todos"===n.toolName){let e=n.input,t=e?.todos||E;e?.todos&&T(e.todos),Z({tool:n.toolName,toolCallId:n.toolCallId,output:JSON.stringify(t)});return}if("browser"===n.toolName){try{let t=n.input,r=(t?.actions||[]).map(e=>"navigate"===e.action?`navigate ${e.url}`:"type"===e.action?`type "${(e.text||"").slice(0,30)}"`:"press"===e.action?`press ${e.key}`:"mouse"===e.action?`mouse ${(e.mouseActions||[]).map(e=>`${e.action} ${e.ref||`${e.x},${e.y}`}`).join(" > ")}`:e.action).join(", ");$("tool",`browser: ${r}${t?.observe?` [${t.observe}]`:""}`),j.current?.addEvent({ts:Date.now(),agentId:e,type:"tool-start",data:{tool:"browser",label:r}});let a=P.current,i=a?await a.exec({actions:t?.actions||[],observe:t?.observe||"snapshot",prompts:t?.prompts,forceFull:t?.forceFull}):{error:"Error: browser tools not available"};j.current?.addEvent({ts:Date.now(),agentId:e,type:"tool-end",data:{tool:"browser"}}),Z({tool:n.toolName,toolCallId:n.toolCallId,output:M.current?{error:"[Stopped by user]"}:JSON.stringify(i)})}catch(e){Z({tool:n.toolName,toolCallId:n.toolCallId,...M.current?{output:"[Stopped by user]"}:{state:"output-error",errorText:e.message}})}return}}}),V=L.length>0,B=null!==b;(0,et.useRef)(null),(0,et.useRef)(0),(0,et.useRef)("submitted"===q||"streaming"===q);let W=(0,et.useRef)(!1);(0,et.useRef)(!1),(0,et.useRef)(null);let H=(0,et.useCallback)(t=>{let n=A.current++;f(e=>[...e,{id:n,url:"about:blank",title:"",initialUrl:t}]),g(n),v("about:blank"===t?"":t),window.bangonit?.setActiveTab(e,n)},[e]),J=(0,et.useCallback)(t=>{f(n=>{let r=n.findIndex(e=>e.id===t);if(-1===r)return n;let a=n.filter(e=>e.id!==t);return 0===a.length?n:(g(n=>{if(n===t){let t=a[Math.max(0,r-1)].id,n=a.find(e=>e.id===t);return n&&v("about:blank"===n.url?"":n.url),window.bangonit?.setActiveTab(e,t),t}return n}),a)})},[e]),G=(0,et.useCallback)(t=>{g(t),window.bangonit?.setActiveTab(e,t),f(e=>{let n=e.find(e=>e.id===t);return n&&v("about:blank"===n.url?"":n.url),e})},[e]),K=(0,et.useRef)(H),Y=(0,et.useRef)(J),X=(0,et.useRef)(G);K.current=H,Y.current=J,X.current=G;let Q=(0,et.useCallback)((t,n,r)=>{if(!t)return;I.current.set(n,t);let a=()=>{if(!N.current.has(n))try{let a=t.getWebContentsId?.();a&&(N.current.add(n),window.bangonit?.registerTab(e,n,a,r,p),n===m&&window.bangonit?.setActiveTab(e,n))}catch(e){console.error(e)}};a(),t.addEventListener("did-attach",a),t.addEventListener("close",()=>Y.current(n)),t._consoleListenerAttached||(t._consoleListenerAttached=!0,t.addEventListener("console-message",t=>{window.bangonit?.emitConsoleMessage?.({agentId:e,level:t.level,message:t.message,url:t.sourceId||"",line:t.lineNumber||0}),j.current?.addConsoleLog(e,t.level,t.message,t.sourceId||"",t.lineNumber||0)}))},[e,m]),en=e=>`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`;return(0,ee.jsxs)("div",{className:"flex h-full w-full bg-zinc-950 overflow-hidden",children:[(0,ee.jsxs)("div",{className:"flex-1 flex flex-col border-r border-zinc-800 min-w-0",children:[ee.jsx("div",{className:"flex items-center bg-zinc-900 border-b border-zinc-800 overflow-x-auto",children:h.map(e=>ee.jsx("button",{onClick:()=>G(e.id),className:`flex items-center gap-1.5 px-3 py-2 text-xs border-r border-zinc-800 min-w-0 max-w-[200px] shrink-0
|
|
37
37
|
${e.id===m?"bg-zinc-800 text-zinc-200":"text-zinc-500 hover:text-zinc-300 hover:bg-zinc-850"}`,children:(0,ee.jsxs)("span",{className:"truncate",children:[e.isPopup?"↗ ":"",e.title||(e.url&&"about:blank"!==e.url?e.url:"New Tab")]})},e.id))}),ee.jsx("div",{className:"flex items-center gap-2 px-3 py-2 bg-zinc-900 border-b border-zinc-800",children:ee.jsx("div",{className:"flex-1 px-3 py-1.5 bg-zinc-800 border border-zinc-700 rounded-lg text-xs text-zinc-400 truncate",children:y||"about:blank"})}),(0,ee.jsxs)("div",{className:"flex-1 relative bg-white overflow-hidden",onWheel:e=>e.stopPropagation(),children:[h.map(t=>t.isPopup?t.id===m&&(0,ee.jsxs)("div",{className:"absolute inset-0 flex items-center justify-center bg-zinc-900 text-zinc-400 text-sm z-[1]",children:["Popup window open — ",t.title||t.url]},t.id):ee.jsx("webview",{ref:e=>Q(e,t.id,t.initialUrl),src:"about:blank",partition:`agent-${e}`,allowpopups:"",style:{width:"100%",height:"100%",position:"absolute",backgroundColor:"white",top:0,left:0,pointerEvents:t.id===m?"auto":"none",zIndex:t.id===m?1:0}},t.id)),!h.find(e=>e.id===m)?.isPopup&&ee.jsx(p9,{agentId:e}),!B&&ee.jsx("div",{className:"absolute inset-0 z-10 cursor-not-allowed"})]})]}),(0,ee.jsxs)("div",{className:"w-[420px] flex flex-col h-full shrink-0",children:[(0,ee.jsxs)("div",{className:"flex items-center px-4 py-3 border-b border-zinc-800",children:[ee.jsx("h2",{className:"text-sm font-medium text-zinc-300",children:t}),ee.jsx("div",{className:"flex-1"})]}),b&&(0,ee.jsxs)("div",{className:`px-4 py-2 text-sm border-b flex items-center gap-3 ${"pass"===b.result?"bg-green-950/30 border-green-900/50":"bg-red-950/30 border-red-900/50"}`,children:[ee.jsx("span",{className:`font-medium ${"pass"===b.result?"text-green-400":"text-red-400"}`,children:"pass"===b.result?"PASSED":"FAILED"}),ee.jsx("span",{className:"text-zinc-500 text-xs",children:en(z)}),b.summary&&ee.jsx("span",{className:"text-zinc-400 text-xs truncate flex-1",children:b.summary})]}),E.length>0&&ee.jsx("div",{className:"text-xs space-y-1 px-4 py-2 border-b border-zinc-800 bg-zinc-900/80 shrink-0 max-h-48 overflow-y-auto",children:E.map((e,t)=>(0,ee.jsxs)("div",{className:`flex items-center gap-2 ${"completed"===e.status?"text-zinc-500":"text-zinc-300"}`,children:[ee.jsx("span",{className:"shrink-0",children:"completed"===e.status?"✓":"in_progress"===e.status?ee.jsx("span",{className:"inline-block w-2 h-2 bg-blue-500 rounded-full animate-pulse"}):"○"}),ee.jsx("span",{className:"completed"===e.status?"line-through":"",children:e.content})]},t))}),(0,ee.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-3",children:[L.map(e=>ee.jsx(p8,{message:e,agentName:t},e.id)),U&&ee.jsx("div",{className:"text-sm px-3 py-2 bg-red-950/30 border border-red-900/50 rounded-lg text-red-400",children:U.message}),ee.jsx("div",{ref:C})]}),ee.jsx("div",{className:"px-4 py-2 border-t border-zinc-800 flex items-center gap-3 shrink-0",children:B?(0,ee.jsxs)(ee.Fragment,{children:[ee.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${"pass"===b.result?"bg-green-500":"bg-red-500"}`}),(0,ee.jsxs)("span",{className:`text-xs font-medium ${"pass"===b.result?"text-green-400":"text-red-400"}`,children:["pass"===b.result?"Passed":"Failed"," in ",en(z)]}),ee.jsx("div",{className:"flex-1"}),ee.jsx("button",{onClick:()=>{let e=I.current.get(m);e&&(_?e.closeDevTools():e.openDevTools(),S(!_))},className:`text-xs px-2 py-1 rounded border transition-colors ${_?"border-blue-600 text-blue-400 bg-blue-950/30":"border-zinc-700 hover:border-zinc-500 text-zinc-500 hover:text-zinc-300"}`,title:"Toggle DevTools",children:"DevTools"}),ee.jsx("button",{onClick:()=>{window.bangonit?.emitTestRerun?.(),a?.()},className:"text-xs px-3 py-1 rounded border border-zinc-700 hover:border-zinc-500 text-zinc-400 hover:text-zinc-200 transition-colors",children:"Rerun"})]}):V?(0,ee.jsxs)(ee.Fragment,{children:[ee.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${k?"bg-amber-500":"bg-blue-500 animate-pulse"}`}),(0,ee.jsxs)("span",{className:"text-xs text-zinc-400",children:[k?"Paused":"Working"," ",en(z)]}),ee.jsx("div",{className:"flex-1"}),ee.jsx("button",{onClick:()=>{let e=I.current.get(m);e&&(_?e.closeDevTools():e.openDevTools(),S(!_))},className:`text-xs px-2 py-1 rounded border transition-colors ${_?"border-blue-600 text-blue-400 bg-blue-950/30":"border-zinc-700 hover:border-zinc-500 text-zinc-500 hover:text-zinc-300"}`,title:"Toggle DevTools",children:"DevTools"}),ee.jsx("button",{onClick:()=>w(!k),className:"text-xs px-2 py-1 rounded border border-zinc-700 hover:border-zinc-500 text-zinc-400 hover:text-zinc-200 transition-colors",children:k?"Continue":"Pause"})]}):(0,ee.jsxs)(ee.Fragment,{children:[ee.jsx("span",{className:"inline-block w-2 h-2 bg-zinc-600 rounded-full shrink-0"}),ee.jsx("span",{className:"text-xs text-zinc-500",children:"Queued"})]})})]})]})}function p8({message:e,agentName:t}){if("user"===e.role){let t=e.parts?.find(e=>"text"===e.type);return(0,ee.jsxs)("div",{className:"text-sm",children:[ee.jsx("span",{className:"text-xs text-zinc-500 block mb-1",children:"Test Plan"}),ee.jsx("div",{className:"text-zinc-200 prose prose-invert prose-sm max-w-none",children:ee.jsx(dW,{remarkPlugins:[p4],children:t?.text||""})})]})}return ee.jsx("div",{className:"text-sm space-y-2",children:e.parts?.map((e,n)=>{if("text"===e.type&&e.text)return e.providerMetadata?.anthropic?.type==="compaction"?null:ee.jsxs("div",{children:[ee.jsx("span",{className:"text-xs text-zinc-500 block mb-1",children:t}),ee.jsx("div",{className:"text-zinc-300 prose prose-invert prose-sm max-w-none",children:ee.jsx(dW,{remarkPlugins:[p4],children:e.text})})]},n);if("dynamic-tool"===e.type||"string"==typeof e.type&&e.type.startsWith("tool-")){let t=e.toolName||("string"==typeof e.type?e.type.replace(/^tool-/,""):"");return"todos"===t||"report_result"===t?null:ee.jsx(p7,{part:e},n)}return null})})}function p7({part:e}){let[t,n]=(0,et.useState)(!1),r=e.input||{},a=e.output,i=e.state||"input-available",s=e.toolName||("string"==typeof e.type?e.type.replace(/^tool-/,""):""),o="input-streaming"===i?"":"browser"===s?(()=>{let e=(r.actions||[]).map(e=>{switch(e.action){case"navigate":return`navigate ${e.url||""}`;case"mouse":{let t=(e.mouseActions||[]).map(e=>"wait"===e.action?`wait ${e.ms}ms`:"wheel"===e.action?`wheel ${e.ref||`${e.x},${e.y}`}`:`${e.action} ${e.ref||`${e.x},${e.y}`}`).join(" → ");return`mouse ${t}`}case"type":return`type "${(e.text||"").slice(0,40)}"`;case"press":return`press ${e.key||""}`;case"tabs":return`tabs ${e.tabAction||""}${e.tabId?" "+e.tabId:""}`;default:return e.action||""}});return r.observe&&e.push(r.observe),r.forceFull&&e.push("[full]"),e.join(", ")})():r.command||(Object.keys(r).length>0?JSON.stringify(r):"");return(0,ee.jsxs)("div",{className:"text-sm",children:[(0,ee.jsxs)("button",{onClick:()=>n(!t),className:"flex items-center gap-2 text-xs px-2 py-1.5 bg-zinc-900 border border-zinc-800 rounded-lg hover:border-zinc-700 transition-colors w-full text-left min-w-0",children:["input-streaming"===i||"input-available"===i?ee.jsx("span",{className:"inline-block w-2 h-2 bg-amber-500 rounded-full animate-pulse shrink-0"}):ee.jsx("span",{className:"text-green-500 shrink-0",children:"✓"}),ee.jsx("span",{className:"text-zinc-400 font-mono truncate",children:o}),ee.jsx("span",{className:`ml-auto transition-transform text-zinc-600 shrink-0 ${t?"rotate-90":""}`,children:"▶"})]}),t&&(0,ee.jsxs)("pre",{className:"mt-1 px-3 py-2 bg-zinc-900/50 rounded-lg border border-zinc-800 text-xs whitespace-pre-wrap overflow-x-auto max-h-60 overflow-y-auto",children:[o&&(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)("span",{className:"text-zinc-300 select-all",children:["$ ",o]}),"\n"]}),null!=a&&(()=>{if("browser"===s&&"string"==typeof a)try{let e=JSON.parse(a);if(void 0!==e.textOutput)return(0,ee.jsxs)(ee.Fragment,{children:[ee.jsx("span",{className:"text-zinc-500",children:e.textOutput}),e.imageOutput&&(0,ee.jsxs)(ee.Fragment,{children:["\n",ee.jsx("span",{className:"changed"===e.imageOutput.type?"text-blue-400":"text-zinc-600",children:"changed"===e.imageOutput.type?"[screenshot: changed]":"[screenshot: unchanged]"})]})]})}catch(e){console.error(e)}return ee.jsx("span",{className:"text-zinc-500",children:"string"==typeof a?a:JSON.stringify(a,null,2)})})()]})]})}function he(){let[e,t]=(0,et.useState)([]),[n,r]=(0,et.useState)({}),[a,i]=(0,et.useState)({}),[s,o]=(0,et.useState)(!1),[l,u]=(0,et.useState)({}),c=(0,et.useRef)(new Map),[d,p]=(0,et.useState)(null),[h,f]=(0,et.useState)(!1),[m,g]=(0,et.useState)(!1),y=(0,et.useRef)(null),v=(0,et.useRef)(new Map),b=(0,et.useRef)(e);b.current=e;let x=(0,et.useCallback)(async e=>{await window.bangonit?.clearPartition?.(e);let t=a[e];t&&(r(t=>({...t,[e]:"running"})),u(t=>({...t,[e]:(t[e]||0)+1})),i(n=>({...n,[e]:{initialPrompt:t.initialPrompt}})))},[a]),k=(0,et.useCallback)((e,t)=>{v.current.set(e,t)},[]),w=(0,et.useRef)(n);w.current=n;let _=(0,et.useCallback)(async(e,t)=>{let n=y.current;if(!n)return;let r=await window.bangonit?.getRunDir?.();if(!r)return;let a=[];for(let e of v.current.values())a.push(...e.getClipsMeta());let i={...w.current,[e]:t},s=b.current.map(e=>{let t=i[e.id];return{id:e.id,name:e.name,result:"completed"===t?"pass":"failed"===t?"fail":void 0}}),o=n.toJSON(s,a);await window.bangonit?.generateReplayHtml?.({runDir:r,data:JSON.stringify(o)})},[]),S=(0,et.useCallback)(async(e,t,n)=>{let a;a="running"===t?"running":"pass"===n?"completed":"fail"===n?"failed":"idle",r(t=>({...t,[e]:a}));let i=!1;if("fail"===n){let t=c.current.get(e);t&&t.attempt<t.maxRetries&&(i=!0,t.attempt++,window.bangonit?.emitTestRetry?.({agentId:e,attempt:t.attempt,maxRetries:t.maxRetries}),setTimeout(()=>x(e),1e3))}if(h&&("pass"===n||"fail"===n)&&!i){let t={...w.current,[e]:a};b.current.every(e=>{let n=t[e.id];return"completed"===n||"failed"===n})&&await _(e,a)}},[x,h,_]),I=(0,et.useCallback)((e,n,a)=>{a&&t(t=>t.map(t=>t.id===e?{...t,name:a}:t)),i(t=>({...t,[e]:{initialPrompt:n}})),r(t=>({...t,[e]:"running"})),p(e)},[]),E=(0,et.useCallback)(()=>{let n=crypto.randomUUID(),r={id:n,name:`Test ${e.length+1}`,createdAt:Date.now()};t(e=>[...e,r]),p(n)},[e.length]);if(!s)return ee.jsx("div",{className:"flex h-screen bg-zinc-950"});let T=e.find(e=>e.id===d),C=!!d&&!!a[d];return(0,ee.jsxs)("div",{className:"flex h-screen bg-zinc-950 overflow-hidden",children:[(0,ee.jsxs)("div",{className:"flex flex-col bg-zinc-900 border-r border-zinc-800 shrink-0 w-48 overflow-y-auto",children:[(0,ee.jsxs)("div",{className:"flex items-center px-3 py-2 border-b border-zinc-800",children:[ee.jsx("span",{className:"text-xs font-medium text-zinc-500 uppercase tracking-wider",children:"Tests"}),ee.jsx("div",{className:"flex-1"}),ee.jsx("button",{onClick:E,className:"text-zinc-500 hover:text-zinc-300 transition-colors text-lg leading-none",title:"Add test",children:"+"})]}),e.map(e=>{let t=n[e.id];return ee.jsx("button",{onClick:()=>p(e.id),className:`px-3 py-2 text-xs text-left border-b border-zinc-800 transition-colors
|
|
38
|
-
${e.id===d?"bg-zinc-800 text-zinc-200":"text-zinc-500 hover:text-zinc-300"}`,children:(0,ee.jsxs)("span",{className:"flex items-center gap-2",children:[ee.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${"running"===t?"bg-blue-500 animate-pulse":"completed"===t?"bg-green-500":"failed"===t?"bg-red-500":"bg-zinc-600"}`}),ee.jsx("span",{className:"truncate",children:e.name})]})},e.id)})]}),(0,ee.jsxs)("div",{className:"flex-1 min-w-0 h-full relative",children:[e.map(e=>a[e.id]?ee.jsx("div",{className:"absolute inset-0 z-0",style:{display:"flex",zIndex:e.id===d?1:0,pointerEvents:e.id===d?"auto":"none"},children:ee.jsx(p6,{agentId:e.id,agentName:e.name,initialPrompt:a[e.id].initialPrompt,initialMessages:a[e.id].initialMessages,initialTabs:a[e.id].initialTabs,initialActiveTabId:a[e.id].initialActiveTabId,initialTodos:a[e.id].initialTodos,onStatusChange:S,onRerun:()=>x(e.id),record:h,sessionRecorder:y.current||void 0,onRegisterRecorder:k,planDir:a[e.id].planDir})},`${e.id}-${l[e.id]||0}`):null),T&&!C&&!m&&ee.jsx(ht,{agentId:T.id,agentName:T.name,onSubmit:I})]})]})}function ht({agentId:e,onSubmit:t}){let[n,r]=(0,et.useState)(""),a=(0,et.useRef)(null),i=()=>{let r=n.trim();r&&t(e,r)};return ee.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10 bg-zinc-950",children:(0,ee.jsxs)("div",{className:"w-full max-w-xl px-6",children:[ee.jsx("h2",{className:"text-lg font-medium text-zinc-200 mb-4",children:"What would you like to test?"}),(0,ee.jsxs)("div",{className:"relative",children:[ee.jsx("textarea",{ref:a,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),i())},placeholder:"Describe what to test in plain English...",className:"w-full px-4 py-3 bg-zinc-800 border border-zinc-700 rounded-lg text-sm text-zinc-200 placeholder-zinc-500 resize-none focus:outline-none focus:border-zinc-500 transition-colors",rows:4}),ee.jsx("button",{onClick:i,disabled:!n.trim(),className:"absolute bottom-3 right-3 px-3 py-1.5 bg-blue-600 hover:bg-blue-500 disabled:bg-zinc-700 disabled:text-zinc-500 text-white text-xs font-medium rounded transition-colors",children:"Run"})]}),ee.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Press Enter to run. Shift+Enter for a new line."}),(0,ee.jsxs)("div",{className:"mt-4",children:[ee.jsx("p",{className:"text-xs text-zinc-600 mb-2",children:"Examples:"}),ee.jsx("div",{className:"flex flex-col gap-1.5",children:["Go to example.com and verify the homepage loads with a heading","Navigate to my-app.com/login, sign in with test@example.com / password123, and verify the dashboard loads","Go to localhost:3000, add an item to the cart, proceed to checkout, and verify the order summary"].map((e,t)=>ee.jsx("button",{onClick:()=>r(e),className:"text-left text-xs text-zinc-500 hover:text-zinc-300 bg-zinc-900 hover:bg-zinc-800 px-3 py-2 rounded border border-zinc-800 transition-colors",children:e},t))})]})]})})}function hn(){return ee.jsx(he,{})}},1345:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,a=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!i)return!1;for(r in e);return void 0===r||t.call(e,r)},o=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(a)return a(e,n).value}return e[n]};e.exports=function e(){var t,n,r,a,u,c,d=arguments[0],p=1,h=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<h;++p)if(t=arguments[p],null!=t)for(n in t)r=l(d,n),d!==(a=l(t,n))&&(f&&a&&(s(a)||(u=i(a)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&s(r)?r:{},o(d,{name:n,newValue:e(f,c,a)})):void 0!==a&&o(d,{name:n,newValue:a}));return d}},1627:e=>{"use strict";var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e){return e?e.replace(l,""):""}e.exports=function(e,l){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];l=l||{};var c=1,d=1;function p(e){var t=e.match(n);t&&(c+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function h(){var e={line:c,column:d};return function(t){return t.position=new f(e),g(r),t}}function f(e){this.start=e,this.end={line:c,column:d},this.source=l.source}function m(t){var n=Error(l.source+":"+c+":"+d+": "+t);if(n.reason=t,n.filename=l.source,n.line=c,n.column=d,n.source=e,l.silent);else throw n}function g(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function y(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return d+=2,p(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}return f.prototype.content=e,g(r),function(){var e,n=[];for(y(n);e=function(){var e=h(),n=g(a);if(n){if(v(),!g(i))return m("property missing ':'");var r=g(s),l=e({type:"declaration",property:u(n[0].replace(t,"")),value:r?u(r[0].replace(t,"")):""});return g(o),l}}();)!1!==e&&(n.push(e),y(n));return n}()}},393:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(9514)),a=n(1203);function i(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,a.camelCase)(e,t)]=r)}),n}i.default=i,e.exports=i},1203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var u;return(void 0===t&&(t={}),!(u=e)||a.test(u)||n.test(u))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,l):e.replace(i,l)).replace(r,o))}},9514:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,a.default)(e),i="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:a}=e;i?t(r,a,e):a&&((n=n||{})[r]=a)}),n};let a=r(n(1627))},5987:e=>{e.exports=function(e,t){let n;if("function"!=typeof e)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r=0;return function(...a){clearTimeout(n);let i=Date.now(),s=t-(i-r);s<=0?(r=i,e.apply(this,a)):n=setTimeout(()=>{r=Date.now(),e.apply(this,a)},s)}}},1241:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});let r=(0,n(3189).createProxy)(String.raw`/
|
|
38
|
+
${e.id===d?"bg-zinc-800 text-zinc-200":"text-zinc-500 hover:text-zinc-300"}`,children:(0,ee.jsxs)("span",{className:"flex items-center gap-2",children:[ee.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${"running"===t?"bg-blue-500 animate-pulse":"completed"===t?"bg-green-500":"failed"===t?"bg-red-500":"bg-zinc-600"}`}),ee.jsx("span",{className:"truncate",children:e.name})]})},e.id)})]}),(0,ee.jsxs)("div",{className:"flex-1 min-w-0 h-full relative",children:[e.map(e=>a[e.id]?ee.jsx("div",{className:"absolute inset-0 z-0",style:{display:"flex",zIndex:e.id===d?1:0,pointerEvents:e.id===d?"auto":"none"},children:ee.jsx(p6,{agentId:e.id,agentName:e.name,initialPrompt:a[e.id].initialPrompt,initialMessages:a[e.id].initialMessages,initialTabs:a[e.id].initialTabs,initialActiveTabId:a[e.id].initialActiveTabId,initialTodos:a[e.id].initialTodos,onStatusChange:S,onRerun:()=>x(e.id),record:h,sessionRecorder:y.current||void 0,onRegisterRecorder:k,planDir:a[e.id].planDir})},`${e.id}-${l[e.id]||0}`):null),T&&!C&&!m&&ee.jsx(ht,{agentId:T.id,agentName:T.name,onSubmit:I})]})]})}function ht({agentId:e,onSubmit:t}){let[n,r]=(0,et.useState)(""),a=(0,et.useRef)(null),i=()=>{let r=n.trim();r&&t(e,r)};return ee.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10 bg-zinc-950",children:(0,ee.jsxs)("div",{className:"w-full max-w-xl px-6",children:[ee.jsx("h2",{className:"text-lg font-medium text-zinc-200 mb-4",children:"What would you like to test?"}),(0,ee.jsxs)("div",{className:"relative",children:[ee.jsx("textarea",{ref:a,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),i())},placeholder:"Describe what to test in plain English...",className:"w-full px-4 py-3 bg-zinc-800 border border-zinc-700 rounded-lg text-sm text-zinc-200 placeholder-zinc-500 resize-none focus:outline-none focus:border-zinc-500 transition-colors",rows:4}),ee.jsx("button",{onClick:i,disabled:!n.trim(),className:"absolute bottom-3 right-3 px-3 py-1.5 bg-blue-600 hover:bg-blue-500 disabled:bg-zinc-700 disabled:text-zinc-500 text-white text-xs font-medium rounded transition-colors",children:"Run"})]}),ee.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Press Enter to run. Shift+Enter for a new line."}),(0,ee.jsxs)("div",{className:"mt-4",children:[ee.jsx("p",{className:"text-xs text-zinc-600 mb-2",children:"Examples:"}),ee.jsx("div",{className:"flex flex-col gap-1.5",children:["Go to example.com and verify the homepage loads with a heading","Navigate to my-app.com/login, sign in with test@example.com / password123, and verify the dashboard loads","Go to localhost:3000, add an item to the cart, proceed to checkout, and verify the order summary"].map((e,t)=>ee.jsx("button",{onClick:()=>r(e),className:"text-left text-xs text-zinc-500 hover:text-zinc-300 bg-zinc-900 hover:bg-zinc-800 px-3 py-2 rounded border border-zinc-800 transition-colors",children:e},t))})]})]})})}function hn(){return ee.jsx(he,{})}},1345:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,a=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!i)return!1;for(r in e);return void 0===r||t.call(e,r)},o=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(a)return a(e,n).value}return e[n]};e.exports=function e(){var t,n,r,a,u,c,d=arguments[0],p=1,h=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<h;++p)if(t=arguments[p],null!=t)for(n in t)r=l(d,n),d!==(a=l(t,n))&&(f&&a&&(s(a)||(u=i(a)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&s(r)?r:{},o(d,{name:n,newValue:e(f,c,a)})):void 0!==a&&o(d,{name:n,newValue:a}));return d}},1627:e=>{"use strict";var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e){return e?e.replace(l,""):""}e.exports=function(e,l){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];l=l||{};var c=1,d=1;function p(e){var t=e.match(n);t&&(c+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function h(){var e={line:c,column:d};return function(t){return t.position=new f(e),g(r),t}}function f(e){this.start=e,this.end={line:c,column:d},this.source=l.source}function m(t){var n=Error(l.source+":"+c+":"+d+": "+t);if(n.reason=t,n.filename=l.source,n.line=c,n.column=d,n.source=e,l.silent);else throw n}function g(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function y(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return d+=2,p(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}return f.prototype.content=e,g(r),function(){var e,n=[];for(y(n);e=function(){var e=h(),n=g(a);if(n){if(v(),!g(i))return m("property missing ':'");var r=g(s),l=e({type:"declaration",property:u(n[0].replace(t,"")),value:r?u(r[0].replace(t,"")):""});return g(o),l}}();)!1!==e&&(n.push(e),y(n));return n}()}},393:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(9514)),a=n(1203);function i(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,a.camelCase)(e,t)]=r)}),n}i.default=i,e.exports=i},1203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var u;return(void 0===t&&(t={}),!(u=e)||a.test(u)||n.test(u))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,l):e.replace(i,l)).replace(r,o))}},9514:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,a.default)(e),i="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:a}=e;i?t(r,a,e):a&&((n=n||{})[r]=a)}),n};let a=r(n(1627))},5987:e=>{e.exports=function(e,t){let n;if("function"!=typeof e)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r=0;return function(...a){clearTimeout(n);let i=Date.now(),s=t-(i-r);s<=0?(r=i,e.apply(this,a)):n=setTimeout(()=>{r=Date.now(),e.apply(this,a)},s)}}},1241:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});let r=(0,n(3189).createProxy)(String.raw`/home/floydophone/repos/domyjob/app/webapp/src/app/app/page.tsx#default`)},7718:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i,metadata:()=>a});var r=n(9013);n(5556);let a={title:"Bang On It!"};function i({children:e}){return r.jsx("html",{lang:"en",children:r.jsx("body",{children:e})})}},5556:()=>{}};var t=require("../../webpack-runtime.js");t.C(e);var n=e=>t(t.s=e),r=t.X(0,[522,679],()=>n(7080));module.exports=r})();
|