@botpress/webchat 2.1.13 → 2.1.15
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/.turbo/turbo-build.log +5 -5
- package/dist/client/PushpinClient/index.d.ts +2 -2
- package/dist/client/types.d.ts +6 -7
- package/dist/index.js +2008 -1984
- package/dist/index.umd.cjs +41 -41
- package/dist/schemas/init.d.ts +22 -0
- package/dist/stores/webchatStore.d.ts +2 -0
- package/package.json +1 -1
- package/readme.md +56 -0
package/dist/index.umd.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(Ke,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],w):(Ke=typeof globalThis<"u"?globalThis:Ke||self,w(Ke.Webchat={},Ke.React,Ke.ReactDOM))})(this,function(Ke,w,Ar){"use strict";var QH=Object.defineProperty;var eW=(Ke,w,Ar)=>w in Ke?QH(Ke,w,{enumerable:!0,configurable:!0,writable:!0,value:Ar}):Ke[w]=Ar;var k=(Ke,w,Ar)=>(eW(Ke,typeof w!="symbol"?w+"":w,Ar),Ar);function sy(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=sy(w),qC=sy(Ar);var tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zd(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var ay={exports:{}},LC=Object.create,ko=Object.defineProperty,FC=Object.defineProperties,UC=Object.getOwnPropertyDescriptor,BC=Object.getOwnPropertyDescriptors,zC=Object.getOwnPropertyNames,oc=Object.getOwnPropertySymbols,ZC=Object.getPrototypeOf,Zd=Object.prototype.hasOwnProperty,cy=Object.prototype.propertyIsEnumerable,ly=(e,t,n)=>t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R=(e,t)=>{for(var n in t||(t={}))Zd.call(t,n)&&ly(e,n,t[n]);if(oc)for(var n of oc(t))cy.call(t,n)&&ly(e,n,t[n]);return e},Y=(e,t)=>FC(e,BC(t)),T=(e,t)=>ko(e,"name",{value:t,configurable:!0}),uy=(e,t)=>{var n={};for(var r in e)Zd.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oc)for(var r of oc(e))t.indexOf(r)<0&&cy.call(e,r)&&(n[r]=e[r]);return n},dy=(e,t)=>{for(var n in t)ko(e,n,{get:t[n],enumerable:!0})},fy=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zC(t))!Zd.call(e,i)&&i!==n&&ko(e,i,{get:()=>t[i],enumerable:!(r=UC(t,i))||r.enumerable});return e},sc=(e,t,n)=>(n=e!=null?LC(ZC(e)):{},fy(t||!e||!e.__esModule?ko(n,"default",{value:e,enumerable:!0}):n,e)),VC=e=>fy(ko({},"__esModule",{value:!0}),e),py={};dy(py,{BRAND:()=>Wy,DIRTY:()=>Hi,EMPTY_PATH:()=>Vy,ErrorBoundary:()=>jo,INVALID:()=>Ve,NEVER:()=>Av,OK:()=>kn,ParseInputLazyPath:()=>sr,ParseStatus:()=>jn,Schema:()=>nt,UntitledDeclarationError:()=>Ay,ZodAny:()=>Io,ZodArray:()=>Ro,ZodBigInt:()=>Ns,ZodBoolean:()=>js,ZodBranded:()=>Ms,ZodCatch:()=>_c,ZodDate:()=>Ec,ZodDefault:()=>Cc,ZodDiscriminatedUnion:()=>Gd,ZodEffects:()=>Gr,ZodEnum:()=>Jr,ZodError:()=>Or,ZodFirstPartyTypeKind:()=>Hd,ZodFunction:()=>Qd,ZodIntersection:()=>Oc,ZodIssueCode:()=>me,ZodLazy:()=>Rc,ZodLiteral:()=>Ls,ZodMap:()=>ef,ZodNaN:()=>tf,ZodNativeEnum:()=>Fs,ZodNever:()=>yi,ZodNull:()=>Us,ZodNullable:()=>Yr,ZodNumber:()=>Bs,ZodObject:()=>Ki,ZodOptional:()=>mr,ZodParsedType:()=>ke,ZodPipeline:()=>Uc,ZodPromise:()=>zs,ZodReadonly:()=>Zc,ZodRecord:()=>nf,ZodRef:()=>rf,ZodSchema:()=>nt,ZodSet:()=>of,ZodString:()=>yn,ZodSymbol:()=>af,ZodTemplateLiteral:()=>nl,ZodTemplateLiteralUnsupportedCheckError:()=>hc,ZodTemplateLiteralUnsupportedTypeError:()=>Kd,ZodTransformer:()=>Gr,ZodTuple:()=>Ji,ZodType:()=>nt,ZodUndefined:()=>Hs,ZodUnion:()=>Ws,ZodUnknown:()=>$o,ZodVoid:()=>cf,ZuiForm:()=>UT,addIssueToContext:()=>Ce,agent:()=>Dg,aimodel:()=>Lg,any:()=>Yg,array:()=>ev,bigint:()=>Vg,boolean:()=>hf,coerce:()=>Tv,conversation:()=>Rg,createZodEnum:()=>qs,cuid2Regex:()=>Kc,cuidRegex:()=>Wc,custom:()=>Yd,datasource:()=>Fg,date:()=>Hg,datetimeRegex:()=>Xc,defaultComponentDefinitions:()=>BT,discriminatedUnion:()=>iv,effect:()=>ul,emailRegex:()=>Gc,enum:()=>hv,errorUtil:()=>ze,event:()=>Ng,fromJsonSchema:()=>kv,fromObject:()=>Cv,function:()=>dv,getErrorMap:()=>Ao,getParsedType:()=>Wr,instanceof:()=>zg,intent:()=>qg,intersection:()=>ov,ipv4Regex:()=>Zs,ipv6Regex:()=>Vs,isAborted:()=>mc,isAsync:()=>Ds,isDirty:()=>yc,isEmojiRegex:()=>tg,isValid:()=>Oo,jsonSchemaToZui:()=>Xs,knowledgebase:()=>Ug,late:()=>Bg,lazy:()=>fv,literal:()=>pv,makeIssue:()=>$s,map:()=>lv,message:()=>$g,nan:()=>Zg,nativeEnum:()=>mv,never:()=>Xg,null:()=>Jg,nullable:()=>vv,number:()=>pf,object:()=>tv,objectToZui:()=>Do,objectUtil:()=>fc,oboolean:()=>Ev,onumber:()=>Sv,optional:()=>gv,ostring:()=>_v,pipeline:()=>wv,preprocess:()=>bv,processCreateParams:()=>it,promise:()=>yv,quotelessJson:()=>Uy,record:()=>av,ref:()=>cv,set:()=>uv,setErrorMap:()=>Jd,strictObject:()=>nv,string:()=>ff,symbol:()=>Wg,table:()=>jg,tablerow:()=>Mg,templateLiteral:()=>xv,transformer:()=>ul,transforms:()=>zT,tuple:()=>sv,ulidRegex:()=>Jc,undefined:()=>Kg,union:()=>rv,unknown:()=>Gg,user:()=>Pg,util:()=>gt,uuidRegex:()=>Yc,variable:()=>Ig,void:()=>Qg,withErrorBoundary:()=>Pv,z:()=>mn,zuiToJsonSchema:()=>ll});var ac=VC(py),mn={};dy(mn,{BRAND:()=>Wy,DIRTY:()=>Hi,EMPTY_PATH:()=>Vy,INVALID:()=>Ve,NEVER:()=>Av,OK:()=>kn,ParseInputLazyPath:()=>sr,ParseStatus:()=>jn,Schema:()=>nt,ZodAny:()=>Io,ZodArray:()=>Ro,ZodBigInt:()=>Ns,ZodBoolean:()=>js,ZodBranded:()=>Ms,ZodCatch:()=>_c,ZodDate:()=>Ec,ZodDefault:()=>Cc,ZodDiscriminatedUnion:()=>Gd,ZodEffects:()=>Gr,ZodEnum:()=>Jr,ZodError:()=>Or,ZodFirstPartyTypeKind:()=>Hd,ZodFunction:()=>Qd,ZodIntersection:()=>Oc,ZodIssueCode:()=>me,ZodLazy:()=>Rc,ZodLiteral:()=>Ls,ZodMap:()=>ef,ZodNaN:()=>tf,ZodNativeEnum:()=>Fs,ZodNever:()=>yi,ZodNull:()=>Us,ZodNullable:()=>Yr,ZodNumber:()=>Bs,ZodObject:()=>Ki,ZodOptional:()=>mr,ZodParsedType:()=>ke,ZodPipeline:()=>Uc,ZodPromise:()=>zs,ZodReadonly:()=>Zc,ZodRecord:()=>nf,ZodRef:()=>rf,ZodSchema:()=>nt,ZodSet:()=>of,ZodString:()=>yn,ZodSymbol:()=>af,ZodTemplateLiteral:()=>nl,ZodTemplateLiteralUnsupportedCheckError:()=>hc,ZodTemplateLiteralUnsupportedTypeError:()=>Kd,ZodTransformer:()=>Gr,ZodTuple:()=>Ji,ZodType:()=>nt,ZodUndefined:()=>Hs,ZodUnion:()=>Ws,ZodUnknown:()=>$o,ZodVoid:()=>cf,addIssueToContext:()=>Ce,agent:()=>Dg,aimodel:()=>Lg,any:()=>Yg,array:()=>ev,bigint:()=>Vg,boolean:()=>hf,coerce:()=>Tv,conversation:()=>Rg,createZodEnum:()=>qs,cuid2Regex:()=>Kc,cuidRegex:()=>Wc,custom:()=>Yd,datasource:()=>Fg,date:()=>Hg,datetimeRegex:()=>Xc,discriminatedUnion:()=>iv,effect:()=>ul,emailRegex:()=>Gc,enum:()=>hv,errorUtil:()=>ze,event:()=>Ng,fromJsonSchema:()=>kv,fromObject:()=>Cv,function:()=>dv,getErrorMap:()=>Ao,getParsedType:()=>Wr,instanceof:()=>zg,intent:()=>qg,intersection:()=>ov,ipv4Regex:()=>Zs,ipv6Regex:()=>Vs,isAborted:()=>mc,isAsync:()=>Ds,isDirty:()=>yc,isEmojiRegex:()=>tg,isValid:()=>Oo,jsonSchemaToZui:()=>Xs,knowledgebase:()=>Ug,late:()=>Bg,lazy:()=>fv,literal:()=>pv,makeIssue:()=>$s,map:()=>lv,message:()=>$g,nan:()=>Zg,nativeEnum:()=>mv,never:()=>Xg,null:()=>Jg,nullable:()=>vv,number:()=>pf,object:()=>tv,objectToZui:()=>Do,objectUtil:()=>fc,oboolean:()=>Ev,onumber:()=>Sv,optional:()=>gv,ostring:()=>_v,pipeline:()=>wv,preprocess:()=>bv,processCreateParams:()=>it,promise:()=>yv,quotelessJson:()=>Uy,record:()=>av,ref:()=>cv,set:()=>uv,setErrorMap:()=>Jd,strictObject:()=>nv,string:()=>ff,symbol:()=>Wg,table:()=>jg,tablerow:()=>Mg,templateLiteral:()=>xv,transformer:()=>ul,tuple:()=>sv,ulidRegex:()=>Jc,undefined:()=>Kg,union:()=>rv,unknown:()=>Gg,user:()=>Pg,util:()=>gt,uuidRegex:()=>Yc,variable:()=>Ig,void:()=>Qg,zuiToJsonSchema:()=>ll});var wt="x-zui",hy=w,En=sc(w,1),my=(0,En.createContext)({formData:void 0,formSchema:void 0,setFormData:T(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:T(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:T(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),yy=T((e,t,n)=>{var r;const i=(r=t[wt])==null?void 0:r[e];if(typeof i>"u")return!1;if(typeof i=="boolean")return i;if(typeof i=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;const s=new Function("return "+i)()(n);switch(typeof s){case"object":case"boolean":return s;default:return!1}}return!1},"parseMaskableField"),gy=T((e,t)=>{const n=(0,En.useContext)(my);if(n===void 0)throw new Error("useFormData must be used within a FormDataProvider");const r=(0,En.useMemo)(()=>Vi(n.formData,t),[n.formData,t]),i=(0,En.useMemo)(()=>{var f;return n.validation.formValid===null?{formValid:null,formErrors:null}:n.validation.formValid===!1?{formValid:!1,formErrors:((f=n.validation.formErrors)==null?void 0:f.filter(p=>wy(p.path,t)).map(p=>({message:p.message,code:p.code,path:t})))||null}:{formValid:!0,formErrors:[]}},[n.validation.formValid,n.validation.formErrors,t]),o=n.dataTransform?n.dataTransform(r):r,s=(0,En.useMemo)(()=>yy("hidden",e,o),[e,o]),a=(0,En.useMemo)(()=>yy("disabled",e,o),[e,o]);(0,En.useEffect)(()=>{n.setHiddenState(f=>Co(f,t,s||{})),n.setDisabledState(f=>Co(f,t,a||{}))},[JSON.stringify({fieldSchema:e,data:r})]);const{disabled:c,hidden:l}=(0,En.useMemo)(()=>{const f=s===!0||Vi(n.hiddenState,t),p=a===!0||Vi(n.disabledState,t);return{hidden:f===!0,disabled:p===!0}},[n.hiddenState,n.disabledState,s,a,t]),u=(0,En.useCallback)((f,p)=>{n.setFormData(m=>Co(m,f,p))},[n.setFormData]),d=(0,En.useCallback)((f,p=void 0)=>{const m=To(e.items);n.setFormData(y=>{const v=Vi(y,f)||[];return p===void 0&&(p=m),Co(y,f,Array.isArray(v)?[...v,p]:[p])})},[n.setFormData]),h=(0,En.useCallback)((f,p)=>{n.setFormData(m=>{const y=Vi(m,f)||[];return Array.isArray(y)?(y.splice(p,1),Co(m,f,y)):m})},[n.setFormData]);return R(Y(R({},n),{data:r,disabled:c,hidden:l,handlePropertyChange:u,addArrayItem:d,removeArrayItem:h}),i)},"useFormData");function Co(e,t,n){if(t.length===0)return n;const r=t.length;return t.reduce((i,o,s)=>(s===r-1?i[o]=n:i[o]||(i[o]=isNaN(Number(o))?{}:[]),i[o]),e??{}),R({},e)}T(Co,"setObjectPath");var To=T((e,t)=>{var n,r,i,o;if(Array.isArray(e))return To(e[0]);if(e.default)return e.default;if(e.nullable)return null;if(!t){if((n=e.anyOf)!=null&&n.length)return To(e.anyOf[0]);if(e.type==="object"&&e.properties){const s={};return Object.entries(e.properties).map(([a,c])=>{var l;s[a]=To(c,!((l=e.required)!=null&&l.includes(a))||vy(c)||!1)}),s}if(e.type==="array")return e.minItems&&e.minItems>0?[To(e.items)]:[];if(e.type==="string")return(r=e.enum)!=null&&r.length?e.enum[0]:"";if(e.type==="number")return(i=e.enum)!=null&&i.length?e.enum[0]:0;if(e.type==="boolean")return(o=e.enum)!=null&&o.length?e.enum[0]:!1}},"getDefaultValues"),HC=T(({children:e,setFormData:t,formData:n,formSchema:r,disableValidation:i,onValidation:o,dataTransform:s})=>{const[a,c]=(0,En.useState)({}),[l,u]=(0,En.useState)({}),d=s?s(n):n,h=(0,En.useMemo)(()=>{if(i)return{formValid:null,formErrors:null};if(!r)return{formValid:null,formErrors:null};const f=Xs(r).safeParse(d);return f.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:f.error.issues}},[JSON.stringify({transformedData:d})]);return(0,En.useEffect)(()=>{o&&o(h)},[h]),En.default.createElement(my.Provider,{value:{formData:n,setFormData:t,formSchema:r,validation:h,hiddenState:a,setHiddenState:c,disabledState:l,setDisabledState:u,dataTransform:s}},e)},"FormDataProvider");function Vi(e,t){return t.reduce((n,r)=>n?n[r]:null,e)}T(Vi,"getPathData");function vy(e){var t;return((t=e.anyOf)==null?void 0:t.some(n=>n.not&&Object.keys(n.not).length===0))||!1}T(vy,"isOptional");function cc(e,t){const n=R({},e);for(const r in t)t.hasOwnProperty(r)&&(typeof t[r]=="object"&&t[r]!==null&&!Array.isArray(t[r])?typeof n[r]=="object"&&n[r]!==null&&!Array.isArray(n[r])?n[r]=cc(n[r],t[r]):n[r]=cc({},t[r]):n[r]=t[r]);return n}T(cc,"deepMerge");var WC=T((e,t)=>{const{handlePropertyChange:n,data:r}=gy(e,t),{discriminator:i,value:o,discriminatedSchema:s}=(0,hy.useMemo)(()=>{const a=by(e.anyOf),c=a!=null&&a.key?r==null?void 0:r[a.key]:e.default||null,l=KC((a==null?void 0:a.key)||null,c,e.anyOf);return{discriminator:a,value:c,discriminatedSchema:l}},[e.anyOf,r]);return(0,hy.useEffect)(()=>{i!=null&&i.key&&(i!=null&&i.values.length)&&Object.keys(r||{}).length<1&&!e.default&&n(t,{[i.key]:i.values[0]})},[]),{discriminator:i,discriminatorValue:o,discriminatedSchema:s}},"useDiscriminator"),by=T(e=>{const t=e==null?void 0:e.map(n=>n.type!=="object"||!n.properties?null:Object.entries(n.properties).map(([r,i])=>{var o;return i.type==="string"&&((o=i.enum)!=null&&o.length)?{key:r,value:i.enum[0]}:null}).filter(r=>!!r)).flat().reduce((n,r)=>{if(!r)return n;const{key:i,value:o}=r;return n.key===null&&(n.key=i),n.key===i&&n.values.push(o),n},{key:null,values:[]});return(t==null?void 0:t.key)===null||!(t!=null&&t.values.length)?null:t},"resolveDiscriminator"),KC=T((e,t,n)=>{var r,i;if(!(n!=null&&n.length)||!e||!t)return null;for(const o of n){if(o.type!=="object")continue;const s=(r=o.properties)==null?void 0:r[e];if((s==null?void 0:s.type)==="string"&&((i=s.enum)!=null&&i.length)&&s.enum[0]===t)return Y(R({},o),{properties:Y(R({},o.properties),{[e]:Y(R({},s),{[wt]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),JC=T(e=>{var t;return(t=e.anyOf)!=null&&t.length?by(e.anyOf)?"discriminatedUnion":"object":e.type==="integer"?"number":e.type},"getSchemaType"),YC=T((e,t)=>{var n,r,i;const o=JC(t),s=((n=t[wt])==null?void 0:n.displayAs)||null;if(!s||!Array.isArray(s)||s.length<2){const u=(r=e==null?void 0:e[o])==null?void 0:r.default;return u?{Component:u,type:o,id:"default",params:{}}:null}const a=s[0],c=((i=e==null?void 0:e[o])==null?void 0:i[a])||null;if(!c)return console.warn(`Component ${o}.${a} not found`),null;const l=s[1]||{};return{Component:c,type:o,id:a,params:l}},"resolveComponent");function wy(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}T(wy,"pathMatches");function Vd(e,t){return t||(t=new RegExp("/s|-|_| ","g")),Sy(e).split(t).map(xy).map(Ey).reduce(_y)}T(Vd,"formatTitle");function xy(e){return e.charAt(0).toUpperCase()+e.substring(1)}T(xy,"capitalize");function _y(e,t){return`${e} ${t}`}T(_y,"combine");function Sy(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}T(Sy,"decamelize");function Ey(e,t,n){const r=e.toLowerCase(),i=e.toUpperCase();for(const o of tT)if(o.toLowerCase()===r)return o;return GC.includes(i)?i:t===0||t===n.length-1||e.length>=4?e:eT.includes(r)||QC.includes(r)||XC.includes(r)?r:e}T(Ey,"handleSpecialWords");var GC=["2D","3D","4WD","A2O","API","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],XC=["a","an","the"],QC=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],eT=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],tT=["2FA","3D","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","GitHub","GPT","HD","IBMid","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","M2M","M2O","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","O2M","OpenAI","PDFs","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function lc(e){if(typeof e!="string")return"";const t=String.raw`${e}`;return t.includes("`")?`"${t.replace(/"/g,'\\"')}"`:t.includes("'")?`'${t.replace(/'/g,"\\'")}'`:`'${t}'`}T(lc,"escapeString");var ky=T(e=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e)?e:lc(e),"toPropertyKey"),rn=T(e=>{const t=(e??"").split(`
|
|
1
|
+
(function(Ke,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],w):(Ke=typeof globalThis<"u"?globalThis:Ke||self,w(Ke.Webchat={},Ke.React,Ke.ReactDOM))})(this,function(Ke,w,Ar){"use strict";var QH=Object.defineProperty;var eW=(Ke,w,Ar)=>w in Ke?QH(Ke,w,{enumerable:!0,configurable:!0,writable:!0,value:Ar}):Ke[w]=Ar;var k=(Ke,w,Ar)=>(eW(Ke,typeof w!="symbol"?w+"":w,Ar),Ar);function sy(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=sy(w),qC=sy(Ar);var tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zd(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var ay={exports:{}},LC=Object.create,ko=Object.defineProperty,FC=Object.defineProperties,UC=Object.getOwnPropertyDescriptor,BC=Object.getOwnPropertyDescriptors,zC=Object.getOwnPropertyNames,oc=Object.getOwnPropertySymbols,ZC=Object.getPrototypeOf,Zd=Object.prototype.hasOwnProperty,cy=Object.prototype.propertyIsEnumerable,ly=(e,t,n)=>t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R=(e,t)=>{for(var n in t||(t={}))Zd.call(t,n)&&ly(e,n,t[n]);if(oc)for(var n of oc(t))cy.call(t,n)&&ly(e,n,t[n]);return e},Y=(e,t)=>FC(e,BC(t)),T=(e,t)=>ko(e,"name",{value:t,configurable:!0}),uy=(e,t)=>{var n={};for(var r in e)Zd.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oc)for(var r of oc(e))t.indexOf(r)<0&&cy.call(e,r)&&(n[r]=e[r]);return n},dy=(e,t)=>{for(var n in t)ko(e,n,{get:t[n],enumerable:!0})},fy=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zC(t))!Zd.call(e,i)&&i!==n&&ko(e,i,{get:()=>t[i],enumerable:!(r=UC(t,i))||r.enumerable});return e},sc=(e,t,n)=>(n=e!=null?LC(ZC(e)):{},fy(t||!e||!e.__esModule?ko(n,"default",{value:e,enumerable:!0}):n,e)),VC=e=>fy(ko({},"__esModule",{value:!0}),e),py={};dy(py,{BRAND:()=>Wy,DIRTY:()=>Hi,EMPTY_PATH:()=>Vy,ErrorBoundary:()=>jo,INVALID:()=>Ve,NEVER:()=>Av,OK:()=>kn,ParseInputLazyPath:()=>sr,ParseStatus:()=>jn,Schema:()=>nt,UntitledDeclarationError:()=>Ay,ZodAny:()=>Io,ZodArray:()=>Ro,ZodBigInt:()=>Ns,ZodBoolean:()=>js,ZodBranded:()=>Ms,ZodCatch:()=>_c,ZodDate:()=>Ec,ZodDefault:()=>Cc,ZodDiscriminatedUnion:()=>Gd,ZodEffects:()=>Gr,ZodEnum:()=>Jr,ZodError:()=>Or,ZodFirstPartyTypeKind:()=>Hd,ZodFunction:()=>Qd,ZodIntersection:()=>Oc,ZodIssueCode:()=>me,ZodLazy:()=>Rc,ZodLiteral:()=>Ls,ZodMap:()=>ef,ZodNaN:()=>tf,ZodNativeEnum:()=>Fs,ZodNever:()=>yi,ZodNull:()=>Us,ZodNullable:()=>Yr,ZodNumber:()=>Bs,ZodObject:()=>Ki,ZodOptional:()=>mr,ZodParsedType:()=>ke,ZodPipeline:()=>Uc,ZodPromise:()=>zs,ZodReadonly:()=>Zc,ZodRecord:()=>nf,ZodRef:()=>rf,ZodSchema:()=>nt,ZodSet:()=>of,ZodString:()=>yn,ZodSymbol:()=>af,ZodTemplateLiteral:()=>nl,ZodTemplateLiteralUnsupportedCheckError:()=>hc,ZodTemplateLiteralUnsupportedTypeError:()=>Kd,ZodTransformer:()=>Gr,ZodTuple:()=>Ji,ZodType:()=>nt,ZodUndefined:()=>Hs,ZodUnion:()=>Ws,ZodUnknown:()=>$o,ZodVoid:()=>cf,ZuiForm:()=>UT,addIssueToContext:()=>Ce,agent:()=>Dg,aimodel:()=>Lg,any:()=>Yg,array:()=>ev,bigint:()=>Vg,boolean:()=>hf,coerce:()=>Tv,conversation:()=>Rg,createZodEnum:()=>qs,cuid2Regex:()=>Kc,cuidRegex:()=>Wc,custom:()=>Yd,datasource:()=>Fg,date:()=>Hg,datetimeRegex:()=>Xc,defaultComponentDefinitions:()=>BT,discriminatedUnion:()=>iv,effect:()=>ul,emailRegex:()=>Gc,enum:()=>hv,errorUtil:()=>ze,event:()=>Ng,fromJsonSchema:()=>kv,fromObject:()=>Cv,function:()=>dv,getErrorMap:()=>Ao,getParsedType:()=>Wr,instanceof:()=>zg,intent:()=>qg,intersection:()=>ov,ipv4Regex:()=>Zs,ipv6Regex:()=>Vs,isAborted:()=>mc,isAsync:()=>Ds,isDirty:()=>yc,isEmojiRegex:()=>tg,isValid:()=>Oo,jsonSchemaToZui:()=>Xs,knowledgebase:()=>Ug,late:()=>Bg,lazy:()=>fv,literal:()=>pv,makeIssue:()=>$s,map:()=>lv,message:()=>$g,nan:()=>Zg,nativeEnum:()=>mv,never:()=>Xg,null:()=>Jg,nullable:()=>vv,number:()=>pf,object:()=>tv,objectToZui:()=>Do,objectUtil:()=>fc,oboolean:()=>Ev,onumber:()=>Sv,optional:()=>gv,ostring:()=>_v,pipeline:()=>wv,preprocess:()=>bv,processCreateParams:()=>it,promise:()=>yv,quotelessJson:()=>Uy,record:()=>av,ref:()=>cv,set:()=>uv,setErrorMap:()=>Jd,strictObject:()=>nv,string:()=>ff,symbol:()=>Wg,table:()=>jg,tablerow:()=>Mg,templateLiteral:()=>xv,transformer:()=>ul,transforms:()=>zT,tuple:()=>sv,ulidRegex:()=>Jc,undefined:()=>Kg,union:()=>rv,unknown:()=>Gg,user:()=>Pg,util:()=>gt,uuidRegex:()=>Yc,variable:()=>Ig,void:()=>Qg,withErrorBoundary:()=>Pv,z:()=>mn,zuiToJsonSchema:()=>ll});var ac=VC(py),mn={};dy(mn,{BRAND:()=>Wy,DIRTY:()=>Hi,EMPTY_PATH:()=>Vy,INVALID:()=>Ve,NEVER:()=>Av,OK:()=>kn,ParseInputLazyPath:()=>sr,ParseStatus:()=>jn,Schema:()=>nt,ZodAny:()=>Io,ZodArray:()=>Ro,ZodBigInt:()=>Ns,ZodBoolean:()=>js,ZodBranded:()=>Ms,ZodCatch:()=>_c,ZodDate:()=>Ec,ZodDefault:()=>Cc,ZodDiscriminatedUnion:()=>Gd,ZodEffects:()=>Gr,ZodEnum:()=>Jr,ZodError:()=>Or,ZodFirstPartyTypeKind:()=>Hd,ZodFunction:()=>Qd,ZodIntersection:()=>Oc,ZodIssueCode:()=>me,ZodLazy:()=>Rc,ZodLiteral:()=>Ls,ZodMap:()=>ef,ZodNaN:()=>tf,ZodNativeEnum:()=>Fs,ZodNever:()=>yi,ZodNull:()=>Us,ZodNullable:()=>Yr,ZodNumber:()=>Bs,ZodObject:()=>Ki,ZodOptional:()=>mr,ZodParsedType:()=>ke,ZodPipeline:()=>Uc,ZodPromise:()=>zs,ZodReadonly:()=>Zc,ZodRecord:()=>nf,ZodRef:()=>rf,ZodSchema:()=>nt,ZodSet:()=>of,ZodString:()=>yn,ZodSymbol:()=>af,ZodTemplateLiteral:()=>nl,ZodTemplateLiteralUnsupportedCheckError:()=>hc,ZodTemplateLiteralUnsupportedTypeError:()=>Kd,ZodTransformer:()=>Gr,ZodTuple:()=>Ji,ZodType:()=>nt,ZodUndefined:()=>Hs,ZodUnion:()=>Ws,ZodUnknown:()=>$o,ZodVoid:()=>cf,addIssueToContext:()=>Ce,agent:()=>Dg,aimodel:()=>Lg,any:()=>Yg,array:()=>ev,bigint:()=>Vg,boolean:()=>hf,coerce:()=>Tv,conversation:()=>Rg,createZodEnum:()=>qs,cuid2Regex:()=>Kc,cuidRegex:()=>Wc,custom:()=>Yd,datasource:()=>Fg,date:()=>Hg,datetimeRegex:()=>Xc,discriminatedUnion:()=>iv,effect:()=>ul,emailRegex:()=>Gc,enum:()=>hv,errorUtil:()=>ze,event:()=>Ng,fromJsonSchema:()=>kv,fromObject:()=>Cv,function:()=>dv,getErrorMap:()=>Ao,getParsedType:()=>Wr,instanceof:()=>zg,intent:()=>qg,intersection:()=>ov,ipv4Regex:()=>Zs,ipv6Regex:()=>Vs,isAborted:()=>mc,isAsync:()=>Ds,isDirty:()=>yc,isEmojiRegex:()=>tg,isValid:()=>Oo,jsonSchemaToZui:()=>Xs,knowledgebase:()=>Ug,late:()=>Bg,lazy:()=>fv,literal:()=>pv,makeIssue:()=>$s,map:()=>lv,message:()=>$g,nan:()=>Zg,nativeEnum:()=>mv,never:()=>Xg,null:()=>Jg,nullable:()=>vv,number:()=>pf,object:()=>tv,objectToZui:()=>Do,objectUtil:()=>fc,oboolean:()=>Ev,onumber:()=>Sv,optional:()=>gv,ostring:()=>_v,pipeline:()=>wv,preprocess:()=>bv,processCreateParams:()=>it,promise:()=>yv,quotelessJson:()=>Uy,record:()=>av,ref:()=>cv,set:()=>uv,setErrorMap:()=>Jd,strictObject:()=>nv,string:()=>ff,symbol:()=>Wg,table:()=>jg,tablerow:()=>Mg,templateLiteral:()=>xv,transformer:()=>ul,tuple:()=>sv,ulidRegex:()=>Jc,undefined:()=>Kg,union:()=>rv,unknown:()=>Gg,user:()=>Pg,util:()=>gt,uuidRegex:()=>Yc,variable:()=>Ig,void:()=>Qg,zuiToJsonSchema:()=>ll});var wt="x-zui",hy=w,En=sc(w,1),my=(0,En.createContext)({formData:void 0,formSchema:void 0,setFormData:T(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:T(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:T(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),yy=T((e,t,n)=>{var r;const i=(r=t[wt])==null?void 0:r[e];if(typeof i>"u")return!1;if(typeof i=="boolean")return i;if(typeof i=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;const s=new Function("return "+i)()(n);switch(typeof s){case"object":case"boolean":return s;default:return!1}}return!1},"parseMaskableField"),gy=T((e,t)=>{const n=(0,En.useContext)(my);if(n===void 0)throw new Error("useFormData must be used within a FormDataProvider");const r=(0,En.useMemo)(()=>Vi(n.formData,t),[n.formData,t]),i=(0,En.useMemo)(()=>{var f;return n.validation.formValid===null?{formValid:null,formErrors:null}:n.validation.formValid===!1?{formValid:!1,formErrors:((f=n.validation.formErrors)==null?void 0:f.filter(h=>wy(h.path,t)).map(h=>({message:h.message,code:h.code,path:t})))||null}:{formValid:!0,formErrors:[]}},[n.validation.formValid,n.validation.formErrors,t]),o=n.dataTransform?n.dataTransform(r):r,s=(0,En.useMemo)(()=>yy("hidden",e,o),[e,o]),a=(0,En.useMemo)(()=>yy("disabled",e,o),[e,o]);(0,En.useEffect)(()=>{n.setHiddenState(f=>Co(f,t,s||{})),n.setDisabledState(f=>Co(f,t,a||{}))},[JSON.stringify({fieldSchema:e,data:r})]);const{disabled:c,hidden:l}=(0,En.useMemo)(()=>{const f=s===!0||Vi(n.hiddenState,t),h=a===!0||Vi(n.disabledState,t);return{hidden:f===!0,disabled:h===!0}},[n.hiddenState,n.disabledState,s,a,t]),u=(0,En.useCallback)((f,h)=>{n.setFormData(m=>Co(m,f,h))},[n.setFormData]),d=(0,En.useCallback)((f,h=void 0)=>{const m=To(e.items);n.setFormData(y=>{const g=Vi(y,f)||[];return h===void 0&&(h=m),Co(y,f,Array.isArray(g)?[...g,h]:[h])})},[n.setFormData]),p=(0,En.useCallback)((f,h)=>{n.setFormData(m=>{const y=Vi(m,f)||[];return Array.isArray(y)?(y.splice(h,1),Co(m,f,y)):m})},[n.setFormData]);return R(Y(R({},n),{data:r,disabled:c,hidden:l,handlePropertyChange:u,addArrayItem:d,removeArrayItem:p}),i)},"useFormData");function Co(e,t,n){if(t.length===0)return n;const r=t.length;return t.reduce((i,o,s)=>(s===r-1?i[o]=n:i[o]||(i[o]=isNaN(Number(o))?{}:[]),i[o]),e??{}),R({},e)}T(Co,"setObjectPath");var To=T((e,t)=>{var n,r,i,o;if(Array.isArray(e))return To(e[0]);if(e.default)return e.default;if(e.nullable)return null;if(!t){if((n=e.anyOf)!=null&&n.length)return To(e.anyOf[0]);if(e.type==="object"&&e.properties){const s={};return Object.entries(e.properties).map(([a,c])=>{var l;s[a]=To(c,!((l=e.required)!=null&&l.includes(a))||vy(c)||!1)}),s}if(e.type==="array")return e.minItems&&e.minItems>0?[To(e.items)]:[];if(e.type==="string")return(r=e.enum)!=null&&r.length?e.enum[0]:"";if(e.type==="number")return(i=e.enum)!=null&&i.length?e.enum[0]:0;if(e.type==="boolean")return(o=e.enum)!=null&&o.length?e.enum[0]:!1}},"getDefaultValues"),HC=T(({children:e,setFormData:t,formData:n,formSchema:r,disableValidation:i,onValidation:o,dataTransform:s})=>{const[a,c]=(0,En.useState)({}),[l,u]=(0,En.useState)({}),d=s?s(n):n,p=(0,En.useMemo)(()=>{if(i)return{formValid:null,formErrors:null};if(!r)return{formValid:null,formErrors:null};const f=Xs(r).safeParse(d);return f.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:f.error.issues}},[JSON.stringify({transformedData:d})]);return(0,En.useEffect)(()=>{o&&o(p)},[p]),En.default.createElement(my.Provider,{value:{formData:n,setFormData:t,formSchema:r,validation:p,hiddenState:a,setHiddenState:c,disabledState:l,setDisabledState:u,dataTransform:s}},e)},"FormDataProvider");function Vi(e,t){return t.reduce((n,r)=>n?n[r]:null,e)}T(Vi,"getPathData");function vy(e){var t;return((t=e.anyOf)==null?void 0:t.some(n=>n.not&&Object.keys(n.not).length===0))||!1}T(vy,"isOptional");function cc(e,t){const n=R({},e);for(const r in t)t.hasOwnProperty(r)&&(typeof t[r]=="object"&&t[r]!==null&&!Array.isArray(t[r])?typeof n[r]=="object"&&n[r]!==null&&!Array.isArray(n[r])?n[r]=cc(n[r],t[r]):n[r]=cc({},t[r]):n[r]=t[r]);return n}T(cc,"deepMerge");var WC=T((e,t)=>{const{handlePropertyChange:n,data:r}=gy(e,t),{discriminator:i,value:o,discriminatedSchema:s}=(0,hy.useMemo)(()=>{const a=by(e.anyOf),c=a!=null&&a.key?r==null?void 0:r[a.key]:e.default||null,l=KC((a==null?void 0:a.key)||null,c,e.anyOf);return{discriminator:a,value:c,discriminatedSchema:l}},[e.anyOf,r]);return(0,hy.useEffect)(()=>{i!=null&&i.key&&(i!=null&&i.values.length)&&Object.keys(r||{}).length<1&&!e.default&&n(t,{[i.key]:i.values[0]})},[]),{discriminator:i,discriminatorValue:o,discriminatedSchema:s}},"useDiscriminator"),by=T(e=>{const t=e==null?void 0:e.map(n=>n.type!=="object"||!n.properties?null:Object.entries(n.properties).map(([r,i])=>{var o;return i.type==="string"&&((o=i.enum)!=null&&o.length)?{key:r,value:i.enum[0]}:null}).filter(r=>!!r)).flat().reduce((n,r)=>{if(!r)return n;const{key:i,value:o}=r;return n.key===null&&(n.key=i),n.key===i&&n.values.push(o),n},{key:null,values:[]});return(t==null?void 0:t.key)===null||!(t!=null&&t.values.length)?null:t},"resolveDiscriminator"),KC=T((e,t,n)=>{var r,i;if(!(n!=null&&n.length)||!e||!t)return null;for(const o of n){if(o.type!=="object")continue;const s=(r=o.properties)==null?void 0:r[e];if((s==null?void 0:s.type)==="string"&&((i=s.enum)!=null&&i.length)&&s.enum[0]===t)return Y(R({},o),{properties:Y(R({},o.properties),{[e]:Y(R({},s),{[wt]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),JC=T(e=>{var t;return(t=e.anyOf)!=null&&t.length?by(e.anyOf)?"discriminatedUnion":"object":e.type==="integer"?"number":e.type},"getSchemaType"),YC=T((e,t)=>{var n,r,i;const o=JC(t),s=((n=t[wt])==null?void 0:n.displayAs)||null;if(!s||!Array.isArray(s)||s.length<2){const u=(r=e==null?void 0:e[o])==null?void 0:r.default;return u?{Component:u,type:o,id:"default",params:{}}:null}const a=s[0],c=((i=e==null?void 0:e[o])==null?void 0:i[a])||null;if(!c)return console.warn(`Component ${o}.${a} not found`),null;const l=s[1]||{};return{Component:c,type:o,id:a,params:l}},"resolveComponent");function wy(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}T(wy,"pathMatches");function Vd(e,t){return t||(t=new RegExp("/s|-|_| ","g")),Sy(e).split(t).map(xy).map(Ey).reduce(_y)}T(Vd,"formatTitle");function xy(e){return e.charAt(0).toUpperCase()+e.substring(1)}T(xy,"capitalize");function _y(e,t){return`${e} ${t}`}T(_y,"combine");function Sy(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}T(Sy,"decamelize");function Ey(e,t,n){const r=e.toLowerCase(),i=e.toUpperCase();for(const o of tT)if(o.toLowerCase()===r)return o;return GC.includes(i)?i:t===0||t===n.length-1||e.length>=4?e:eT.includes(r)||QC.includes(r)||XC.includes(r)?r:e}T(Ey,"handleSpecialWords");var GC=["2D","3D","4WD","A2O","API","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],XC=["a","an","the"],QC=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],eT=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],tT=["2FA","3D","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","GitHub","GPT","HD","IBMid","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","M2M","M2O","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","O2M","OpenAI","PDFs","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function lc(e){if(typeof e!="string")return"";const t=String.raw`${e}`;return t.includes("`")?`"${t.replace(/"/g,'\\"')}"`:t.includes("'")?`'${t.replace(/'/g,"\\'")}'`:`'${t}'`}T(lc,"escapeString");var ky=T(e=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e)?e:lc(e),"toPropertyKey"),rn=T(e=>{const t=(e??"").split(`
|
|
2
2
|
`).filter(n=>n.trim().length>0);return t.length===0?"":t.length===1?`/** ${t[0]} */`:`/**
|
|
3
3
|
* ${t.join(`
|
|
4
4
|
* `)}
|
|
5
5
|
*/`},"getMultilineComment"),Cy=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],Ty=class extends Error{constructor(t){super(t),this.name="UntitledDeclarationError"}static isUntitledDeclarationError(t){return t.name==="UntitledDeclarationError"}};T(Ty,"UntitledDeclarationError");var Ay=Ty,nT=T(e=>Cy.includes(e),"isPrimitive"),rT=T(e=>Cy.map(t=>`${t}[]`).includes(e),"isArrayOfPrimitives"),Oy=T(e=>e.replace(/ +/g," ").trim(),"stripSpaces"),Iy=class{constructor(t,n){this.key=t,this.value=n}};T(Iy,"KeyValue");var uc=Iy,Ry=class{constructor(t){this.schema=t}};T(Ry,"FnParameters");var Py=Ry,$y=class{constructor(t){this.schema=t}};T($y,"FnReturn");var Dy=$y,Ny=class{constructor(t,n){this.schema=t,this.identifier=n}};T(Ny,"Declaration");var jy=Ny;function dc(e,t){var n;t??(t={}),(n=t.declaration)!=null||(t.declaration=!1);let r=e;if(t!=null&&t.declaration&&e instanceof He.Schema){const o="title"in e.ui?e.ui.title:null;if(!o)throw new Ay('Only schemas with "title" Zui property can be declared.');r=new jy(e,o)}let i=ht(r,R({},t));return t.formatter&&(i=t.formatter(i)),i}T(dc,"toTypescript");function ht(e,t){var n,r,i;const o=Y(R({},t),{declaration:!1,parent:e});if(e===null)return"";if(e instanceof jy){const c=rn(e.schema.description),l=e.schema.describe(""),u=ht(l,Y(R({},o),{declaration:!0}));return e.schema instanceof He.ZodFunction?Oy(`${c}
|
|
6
6
|
declare function ${e.identifier}${u};`):Oy(`${c}
|
|
7
7
|
declare const ${e.identifier}: ${u};`)}if(e instanceof uc){if(e.value instanceof He.ZodOptional){let d=e.value._def.innerType;return d instanceof He.Schema&&!d.description&&e.value.description&&(d=d==null?void 0:d.describe(e.value.description)),ht(new uc(e.key+"?",d),o)}const c=rn(e.value._def.description),l=(c==null?void 0:c.trim().length)>0?`
|
|
8
|
-
`:"",u=e.value.describe("");return`${l}${c}${l}${e.key}: ${ht(u,o)}${l}`}if(e instanceof Py){if(e.schema instanceof He.ZodTuple){let u="";for(let d=0;d<e.schema.items.length;d++){const
|
|
8
|
+
`:"",u=e.value.describe("");return`${l}${c}${l}${e.key}: ${ht(u,o)}${l}`}if(e instanceof Py){if(e.schema instanceof He.ZodTuple){let u="";for(let d=0;d<e.schema.items.length;d++){const p=(i=(r=(n=e.schema.items[d])==null?void 0:n.ui)==null?void 0:r.title)!=null?i:`arg${d}`,f=e.schema.items[d];u+=`${ht(new uc(ky(p),f),o)}${d<e.schema.items.length-1?", ":""} `}return u}const c=ht(e.schema,o);return c.startsWith("{")&&c.endsWith("}")||c.startsWith("[")&&c.endsWith("]")||c.startsWith("(")&&c.endsWith(")")||c.startsWith("Array<")&&c.endsWith(">")||c.startsWith("Record<")&&c.endsWith(">")||rT(c)?`args: ${c}`:c}if(e instanceof Dy)return e.schema instanceof He.ZodOptional?`${ht(e.schema.unwrap(),o)} | undefined`:ht(e.schema,o);const a=e._def;switch(a.typeName){case He.ZodFirstPartyTypeKind.ZodString:return`${rn(a.description)} string`.trim();case He.ZodFirstPartyTypeKind.ZodNumber:case He.ZodFirstPartyTypeKind.ZodNaN:case He.ZodFirstPartyTypeKind.ZodBigInt:return`${rn(a.description)} number`.trim();case He.ZodFirstPartyTypeKind.ZodBoolean:return`${rn(e._def.description)} boolean`.trim();case He.ZodFirstPartyTypeKind.ZodDate:return`${rn(a.description)} Date`.trim();case He.ZodFirstPartyTypeKind.ZodUndefined:return`${rn(a.description)} undefined`.trim();case He.ZodFirstPartyTypeKind.ZodNull:return`${rn(a.description)} null`.trim();case He.ZodFirstPartyTypeKind.ZodAny:return`${rn(a.description)} any`.trim();case He.ZodFirstPartyTypeKind.ZodUnknown:return`${rn(a.description)} unknown`.trim();case He.ZodFirstPartyTypeKind.ZodNever:return`${rn(a.description)} never`.trim();case He.ZodFirstPartyTypeKind.ZodVoid:return`${rn(a.description)} void`.trim();case He.ZodFirstPartyTypeKind.ZodArray:const c=ht(a.type,o);return nT(c)?`${c}[]`:`Array<${c}>`;case He.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(e.shape).map(([b,S])=>S instanceof He.Schema?ht(new uc(ky(b),S),o):`${b}: unknown`).join("; ")} }`;case He.ZodFirstPartyTypeKind.ZodUnion:const u=e.options.map(b=>ht(b,o));return`${rn(a.description)}
|
|
9
9
|
${u.join(" | ")}`;case He.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:const d=e.options.map(b=>ht(b,o));return`${rn(e._def.description)}
|
|
10
|
-
${d.join(" | ")}`;case He.ZodFirstPartyTypeKind.ZodIntersection:return`${ht(a.left,o)} & ${ht(a.right,o)}`;case He.ZodFirstPartyTypeKind.ZodTuple:return a.items.length===0?"":`[${a.items.map(b=>ht(b,o)).join(", ")}]`;case He.ZodFirstPartyTypeKind.ZodRecord:const f=ht(a.keyType,o),
|
|
10
|
+
${d.join(" | ")}`;case He.ZodFirstPartyTypeKind.ZodIntersection:return`${ht(a.left,o)} & ${ht(a.right,o)}`;case He.ZodFirstPartyTypeKind.ZodTuple:return a.items.length===0?"":`[${a.items.map(b=>ht(b,o)).join(", ")}]`;case He.ZodFirstPartyTypeKind.ZodRecord:const f=ht(a.keyType,o),h=ht(a.valueType,o);return`${rn(a.description)} { [key: ${f}]: ${h} }`;case He.ZodFirstPartyTypeKind.ZodMap:return`Map<${ht(a.keyType,o)}, ${ht(a.valueType,o)}>`;case He.ZodFirstPartyTypeKind.ZodSet:return`Set<${ht(a.valueType,o)}>`;case He.ZodFirstPartyTypeKind.ZodFunction:const m=ht(new Py(a.args),o),y=ht(new Dy(a.returns),o);return t!=null&&t.declaration?`${rn(a.description)}
|
|
11
11
|
(${m}): ${y}`:`${rn(a.description)}
|
|
12
12
|
(${m}) => ${y}`;case He.ZodFirstPartyTypeKind.ZodLazy:return ht(a.getter(),o);case He.ZodFirstPartyTypeKind.ZodLiteral:return`${rn(a.description)}
|
|
13
13
|
${lc(e.value)}`.trim();case He.ZodFirstPartyTypeKind.ZodEnum:return a.values.map(lc).join(" | ");case He.ZodFirstPartyTypeKind.ZodEffects:return ht(a.schema,o);case He.ZodFirstPartyTypeKind.ZodNativeEnum:return ht(a.values,o);case He.ZodFirstPartyTypeKind.ZodOptional:return t!=null&&t.declaration||(t==null?void 0:t.parent)instanceof He.ZodRecord||(t==null?void 0:t.parent)instanceof He.ZodObject?`${ht(a.innerType,o)} | undefined`:(t==null?void 0:t.parent)instanceof He.ZodDefault||(t==null?void 0:t.parent)instanceof He.ZodNullable||(t==null?void 0:t.parent)instanceof He.ZodOptional?`${ht(a.innerType,o)} | undefined`:`${ht(a.innerType,o)}?`;case He.ZodFirstPartyTypeKind.ZodNullable:return`${ht(e.unwrap(),o)} | null`;case He.ZodFirstPartyTypeKind.ZodDefault:return ht(a.innerType,o);case He.ZodFirstPartyTypeKind.ZodCatch:return ht(e.removeCatch(),o);case He.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${ht(e.unwrap(),o)}>`;case He.ZodFirstPartyTypeKind.ZodBranded:return ht(a.type,o);case He.ZodFirstPartyTypeKind.ZodPipeline:return ht(a.in,o);case He.ZodFirstPartyTypeKind.ZodSymbol:return`${rn(a.description)} symbol`.trim();case He.ZodFirstPartyTypeKind.ZodReadonly:return`readonly ${ht(a.innerType,o)}`;case He.ZodFirstPartyTypeKind.ZodRef:throw new Error("ZodRef cannot be transformed to TypeScript yet");case He.ZodFirstPartyTypeKind.ZodTemplateLiteral:return`\`${a.parts.map(b=>typeof b>"u"||b===null?"":typeof b=="string"?b:typeof b=="boolean"||typeof b=="number"?`${b}`:"${"+ht(b,Y(R({},o),{declaration:!1}))+"}").join("")}\``;default:gt.assertNever(a)}}T(ht,"sUnwrapZod");var My=class{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};T(My,"ParseInputLazyPath");var sr=My,qy=T((e,t)=>{if(Oo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Or(e.common.issues);return this._error=n,this._error}}},"handleResult"),Ly=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}dereference(t){return this}getReferences(){return[]}_getType(t){return Wr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Wr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new jn,ctx:{common:t.parent.common,data:t.data,parsedType:Wr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Ds(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!=null?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wr(t)},o=this._parseSync({data:t,path:i.path,parent:i});return qy(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wr(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Ds(i)?i:Promise.resolve(i));return qy(r,o)}refine(t,n){const r=T(i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n,"getIssueProperties");return this._refinement((i,o)=>{const s=t(i),a=T(()=>o.addIssue(R({code:me.custom},r(i))),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Gr({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return mr.create(this,this._def)}nullable(){return Yr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ro.create(this,this._def)}promise(){return zs.create(this,this._def)}or(t){return Ws.create([this,t],this._def)}and(t){return Oc.create(this,t,this._def)}transform(t){return new Gr(Y(R({},it(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:t}}))}default(t){const n=typeof t=="function"?t:()=>t;return new Cc(Y(R({},it(this._def)),{innerType:this,defaultValue:n,typeName:"ZodDefault"}))}brand(){return new Ms(R({typeName:"ZodBranded",type:this},it(this._def)))}catch(t){const n=typeof t=="function"?t:()=>t;return new _c(Y(R({},it(this._def)),{innerType:this,catchValue:n,typeName:"ZodCatch"}))}describe(t){const n=this.constructor;return new n(Y(R({},this._def),{description:t}))}pipe(t){return Uc.create(this,t)}readonly(){return Zc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}_setZuiMeta(t,n){const r=this._def,i=typeof n=="function"?n.toString():n;switch(r.typeName){case"ZodNullable":case"ZodDefault":case"ZodOptional":case"ZodReadonly":r.innerType._def[wt]=Y(R({},r.innerType._def[wt]),{[t]:i});break;case"ZodEffects":r.schema._def[wt]=Y(R({},r.schema._def[wt]),{[t]:i});break;default:r[wt]=Y(R({},r[wt]),{[t]:i})}}get ui(){const t=this._def;switch(t.typeName){case"ZodNullable":case"ZodDefault":case"ZodOptional":case"ZodReadonly":return t.innerType.ui;case"ZodEffects":return t.schema.ui;default:return t[wt]||{}}}displayAs(t){var n,r,i;return(i=(n=this._def)[r=wt])!=null||(n[r]={}),this._def[wt].displayAs=[t.id,t.params],this}title(t){return this._setZuiMeta("title",t),this}hidden(t){return this._setZuiMeta("hidden",typeof t>"u"?!0:t),this}disabled(t){return this._setZuiMeta("disabled",typeof t>"u"?!0:t),this}placeholder(t){return this._setZuiMeta("placeholder",t),this}toJsonSchema(t){return ll(this,t)}toTypescript(t){return dc(this,t)}async toTypescriptAsync(t){let n=dc(this,Y(R({},t),{formatter:void 0}));return t!=null&&t.formatter&&(n=await t.formatter(n)),n}static fromObject(t,n){return Do(t,n)}static fromJsonSchema(t){return Xs(t)}};T(Ly,"ZodType");var nt=Ly,Hd=(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.ZodRef="ZodRef",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.ZodTemplateLiteral="ZodTemplateLiteral",e.ZodReadonly="ZodReadonly",e))(Hd||{}),gt;(e=>{e.assertEqual=T(i=>i,"assertEqual");function t(i){}e.assertIs=t,T(t,"assertIs");function n(i){throw new Error("assertNever called")}e.assertNever=n,T(n,"assertNever"),e.arrayToEnum=T(i=>{const o={};for(const s of i)o[s]=s;return o},"arrayToEnum"),e.getValidEnumValues=T(i=>{const o=(0,e.objectKeys)(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return(0,e.objectValues)(s)},"getValidEnumValues"),e.objectValues=T(i=>(0,e.objectKeys)(i).map(function(o){return i[o]}),"objectValues"),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=T((i,o)=>{for(const s of i)if(o(s))return s},"find"),e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,T(r,"joinValues"),e.jsonStringifyReplacer=T((i,o)=>typeof o=="bigint"?o.toString():o,"jsonStringifyReplacer")})(gt||(gt={}));var fc;(e=>{e.mergeShapes=T((t,n)=>R(R({},t),n),"mergeShapes")})(fc||(fc={}));var ke=gt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wr=T(e=>{switch(typeof e){case"undefined":return ke.undefined;case"string":return ke.string;case"number":return isNaN(e)?ke.nan:ke.number;case"boolean":return ke.boolean;case"function":return ke.function;case"bigint":return ke.bigint;case"symbol":return ke.symbol;case"object":return Array.isArray(e)?ke.array:e===null?ke.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ke.promise:typeof Map<"u"&&e instanceof Map?ke.map:typeof Set<"u"&&e instanceof Set?ke.set:typeof Date<"u"&&e instanceof Date?ke.date:ke.object;default:return ke.unknown}},"getParsedType");function it(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i,[wt]:e==null?void 0:e[wt]}:{errorMap:T((s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},"customMap"),description:i,[wt]:e==null?void 0:e[wt]}}T(it,"processCreateParams");var Wd=T((e,t)=>{let n;switch(e.code){case me.invalid_type:e.received===ke.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case me.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gt.jsonStringifyReplacer)}`;break;case me.unrecognized_keys:n=`Unrecognized key(s) in object: ${gt.joinValues(e.keys,", ")}`;break;case me.invalid_union:n="Invalid input";break;case me.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gt.joinValues(e.options)}`;break;case me.invalid_enum_value:n=`Invalid enum value. Expected ${gt.joinValues(e.options)}, received '${e.received}'`;break;case me.invalid_arguments:n="Invalid function arguments";break;case me.invalid_return_type:n="Invalid function return type";break;case me.invalid_date:n="Invalid date";break;case me.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(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}"`:gt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case me.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case me.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case me.custom:n="Invalid input";break;case me.invalid_intersection_types:n="Intersection results could not be merged";break;case me.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case me.not_finite:n="Number must be finite";break;case me.unresolved_reference:n="Unresolved reference";break;default:n=t.defaultError,gt.assertNever(e)}return{message:n}},"errorMap"),Fy=Wd,me=gt.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","unresolved_reference"]),Uy=T(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),pc=class CC extends Error{constructor(t){super(),this.issues=[],this.addIssue=T(r=>{this.issues=[...this.issues,r]},"addIssue"),this.addIssues=T((r=[])=>{this.issues=[...this.issues,...r]},"addIssues");const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=T(o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,c=0;for(;c<s.path.length;){const l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}},"processError");return i(this),r}static assert(t){if(!(t instanceof CC))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,gt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};T(pc,"ZodError"),pc.create=T(e=>new pc(e),"create");var Or=pc,By=class extends Error{constructor(){super("Unsupported zod type!");const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodTemplateLiteralUnsupportedTypeError"}};T(By,"ZodTemplateLiteralUnsupportedTypeError");var Kd=By,zy=class extends Error{constructor(t,n){super(`${t}'s "${n}" check is not supported in template literals!`);const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodTemplateLiteralUnsupportedCheckError"}};T(zy,"ZodTemplateLiteralUnsupportedCheckError");var hc=zy,Zy=Wd;function Jd(e){Zy=e}T(Jd,"setErrorMap");function Ao(){return Zy}T(Ao,"getErrorMap");var $s=T(e=>{var t;const{data:n,path:r,errorMaps:i,issueData:o}=e,s=[...r,...o.path||[]],a=Y(R({},o),{path:s});let c="";const l=i.filter(u=>!!u).slice().reverse();for(const u of l)c=u(a,{data:n,defaultError:c}).message;return Y(R({},o),{path:s,message:(t=o.message)!=null?t:c})},"makeIssue"),Vy=[];function Ce(e,t){const n=$s({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ao(),Wd].filter(r=>!!r)});e.common.issues.push(n)}T(Ce,"addIssueToContext");var Hy=class TC{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Ve;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return TC.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return Ve;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}};T(Hy,"ParseStatus");var jn=Hy,Ve=Object.freeze({status:"aborted"}),Hi=T(e=>({status:"dirty",value:e}),"DIRTY"),kn=T(e=>({status:"valid",value:e}),"OK"),mc=T(e=>e.status==="aborted","isAborted"),yc=T(e=>e.status==="dirty","isDirty"),Oo=T(e=>e.status==="valid","isValid"),Ds=T(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync"),ze;(e=>{e.errToObj=T(t=>typeof t=="string"?{message:t}:t||{},"errToObj"),e.toString=T(t=>typeof t=="string"?t:t==null?void 0:t.message,"toString")})(ze||(ze={}));var gc=class extends nt{constructor(){super(...arguments),this._any=!0}_parse(t){return kn(t.data)}};T(gc,"ZodAny"),gc.create=T(e=>new gc(R({typeName:"ZodAny"},it(e))),"create");var Io=gc,vc=class tc extends nt{dereference(t){return new tc(Y(R({},this._def),{type:this._def.type.dereference(t)}))}getReferences(){return this._def.type.getReferences()}_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ke.array)return Ce(n,{code:me.invalid_type,expected:ke.array,received:n.parsedType}),Ve;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Ce(n,{code:s?me.too_big:me.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ce(n,{code:me.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ce(n,{code:me.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new sr(n,s,n.path,a)))).then(s=>jn.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new sr(n,s,n.path,a)));return jn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new tc(Y(R({},this._def),{minLength:{value:t,message:ze.toString(n)}}))}max(t,n){return new tc(Y(R({},this._def),{maxLength:{value:t,message:ze.toString(n)}}))}length(t,n){return new tc(Y(R({},this._def),{exactLength:{value:t,message:ze.toString(n)}}))}nonempty(t){return this.min(1,t)}};T(vc,"ZodArray"),vc.create=T((e,t)=>new vc(R({type:e,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},it(t))),"create");var Ro=vc,bc=class ey extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ke.bigint){const o=this._getOrReturnCtx(t);return Ce(o,{code:me.invalid_type,expected:ke.bigint,received:o.parsedType}),Ve}let r;const i=new jn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ce(r,{code:me.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ce(r,{code:me.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ce(r,{code:me.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):gt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ze.toString(n))}setLimit(t,n,r,i){return new ey(Y(R({},this._def),{checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ze.toString(i)}]}))}_addCheck(t){return new ey(Y(R({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};T(bc,"ZodBigInt"),bc.create=T(e=>{var t;return new bc(R({checks:[],typeName:"ZodBigInt",coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},it(e)))},"create");var Ns=bc,wc=class extends nt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ke.boolean){const r=this._getOrReturnCtx(t);return Ce(r,{code:me.invalid_type,expected:ke.boolean,received:r.parsedType}),Ve}return kn(t.data)}};T(wc,"ZodBoolean"),wc.create=T(e=>new wc(R({typeName:"ZodBoolean",coerce:(e==null?void 0:e.coerce)||!1},it(e))),"create");var js=wc,Wy=Symbol("zod_brand"),Ky=class extends nt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}};T(Ky,"ZodBranded");var Ms=Ky,xc=class extends nt{_parse(t){const{ctx:n}=this._processInputParams(t),r=Y(R({},n),{common:Y(R({},n.common),{issues:[]})}),i=this._def.innerType._parse({data:r.data,path:r.path,parent:R({},r)});return Ds(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Or(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Or(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};T(xc,"ZodCatch"),xc.create=T((e,t)=>new xc(R({innerType:e,typeName:"ZodCatch",catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},it(t))),"create");var _c=xc,Yd=T((e,t={},n)=>e?Io.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(s=(o=a.fatal)!=null?o:n)!=null?s:!0,l=typeof a=="string"?{message:a}:a;i.addIssue(Y(R({code:"custom"},l),{fatal:c}))}}):Io.create(),"custom"),Sc=class AC extends nt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ke.date){const o=this._getOrReturnCtx(t);return Ce(o,{code:me.invalid_type,expected:ke.date,received:o.parsedType}),Ve}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ce(o,{code:me.invalid_date}),Ve}const r=new jn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Ce(i,{code:me.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Ce(i,{code:me.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):gt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new AC(Y(R({},this._def),{checks:[...this._def.checks,t]}))}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};T(Sc,"ZodDate"),Sc.create=T(e=>new Sc(R({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:"ZodDate"},it(e))),"create");var Ec=Sc,kc=class extends nt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ke.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};T(kc,"ZodDefault"),kc.create=T((e,t)=>new kc(R({innerType:e,typeName:"ZodDefault",defaultValue:typeof t.default=="function"?t.default:()=>t.default},it(t))),"create");var Cc=kc,Kr=T(e=>e instanceof Rc?Kr(e.schema):e instanceof Gr?Kr(e.innerType()):e instanceof Ls?[e.value]:e instanceof Jr?e.options:e instanceof Fs?gt.objectValues(e.enum):e instanceof Cc?Kr(e._def.innerType):e instanceof Hs?[void 0]:e instanceof Us?[null]:e instanceof mr?[void 0,...Kr(e.unwrap())]:e instanceof Yr?[null,...Kr(e.unwrap())]:e instanceof Ms||e instanceof Zc?Kr(e.unwrap()):e instanceof _c?Kr(e._def.innerType):[],"getDiscriminator"),Jy=class nc extends nt{dereference(t){const n=this.options.map(i=>i.dereference(t)),r=nc._getOptionsMap(this.discriminator,n);return new nc(Y(R({},this._def),{options:n,optionsMap:r}))}getReferences(){return this.options.flatMap(t=>t.getReferences())}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ke.object)return Ce(n,{code:me.invalid_type,expected:ke.object,received:n.parsedType}),Ve;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Ce(n,{code:me.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=nc._getOptionsMap(t,n);return new nc(R({typeName:"ZodDiscriminatedUnion",discriminator:t,options:n,optionsMap:i},it(r)))}static _getOptionsMap(t,n){const r=new Map;for(const i of n){const o=Kr(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(r.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);r.set(s,i)}}return r}};T(Jy,"ZodDiscriminatedUnion");var Gd=Jy;function qs(e,t){return new Jr(R({values:e,typeName:"ZodEnum"},it(t)))}T(qs,"createZodEnum");var Xd=class ty extends nt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ce(n,{expected:gt.joinValues(r),received:n.parsedType,code:me.invalid_type}),Ve}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ce(n,{received:n.data,code:me.invalid_enum_value,options:r}),Ve}return kn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ty.create(t,R(R({},this._def),n))}exclude(t,n=this._def){return ty.create(this.options.filter(r=>!t.includes(r)),R(R({},this._def),n))}};T(Xd,"ZodEnum"),Xd.create=qs;var Jr=Xd,Yy=class rc extends nt{constructor(){super(...arguments),this.validate=this.implement}dereference(t){const n=this._def.args.dereference(t),r=this._def.returns.dereference(t);return new rc(Y(R({},this._def),{args:n,returns:r}))}getReferences(){return[...this._def.args.getReferences(),...this._def.returns.getReferences()]}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ke.function)return Ce(n,{code:me.invalid_type,expected:ke.function,received:n.parsedType}),Ve;function r(a,c){return $s({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),Fy].filter(l=>!!l),issueData:{code:me.invalid_arguments,argumentsError:c}})}T(r,"makeArgsIssue");function i(a,c){return $s({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),Fy].filter(l=>!!l),issueData:{code:me.invalid_return_type,returnTypeError:c}})}T(i,"makeReturnsIssue");const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof zs){const a=this;return kn(async function(...c){const l=new Or([]),u=await a._def.args.parseAsync(c,o).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(i(d,f)),l})})}else{const a=this;return kn(function(...c){const l=a._def.args.safeParse(c,o);if(!l.success)throw new Or([r(c,l.error)]);const u=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Or([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new rc(Y(R({},this._def),{args:Ji.create(t).rest($o.create())}))}returns(t){return new rc(Y(R({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new rc(R({args:t||Ji.create([]).rest($o.create()),returns:n||$o.create(),typeName:"ZodFunction"},it(r)))}};T(Yy,"ZodFunction");var Qd=Yy;function Tc(e,t){const n=Wr(e),r=Wr(t);if(e===t)return{valid:!0,data:e};if(n===ke.object&&r===ke.object){const i=gt.objectKeys(t),o=gt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s=R(R({},e),t);for(const a of o){const c=Tc(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===ke.array&&r===ke.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],c=Tc(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===ke.date&&r===ke.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}T(Tc,"mergeValues");var Ac=class OC extends nt{dereference(t){return new OC(Y(R({},this._def),{left:this._def.left.dereference(t),right:this._def.right.dereference(t)}))}getReferences(){return[...this._def.left.getReferences(),...this._def.right.getReferences()]}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=T((o,s)=>{if(mc(o)||mc(s))return Ve;const a=Tc(o.value,s.value);return a.valid?((yc(o)||yc(s))&&n.dirty(),{status:n.value,value:a.data}):(Ce(r,{code:me.invalid_intersection_types}),Ve)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};T(Ac,"ZodIntersection"),Ac.create=T((e,t,n)=>new Ac(R({left:e,right:t,typeName:"ZodIntersection"},it(n))),"create");var Oc=Ac,Ic=class extends nt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};T(Ic,"ZodLazy"),Ic.create=T((e,t)=>new Ic(R({getter:e,typeName:"ZodLazy"},it(t))),"create");var Rc=Ic,Pc=class extends nt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ce(n,{received:n.data,code:me.invalid_literal,expected:this._def.value}),Ve}return{status:"valid",value:t.data}}get value(){return this._def.value}};T(Pc,"ZodLiteral"),Pc.create=T((e,t)=>new Pc(R({value:e,typeName:"ZodLiteral"},it(t))),"create");var Ls=Pc,$c=class IC extends nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(t){const n=this._def.keyType.dereference(t),r=this._def.valueType.dereference(t);return new IC(Y(R({},this._def),{keyType:n,valueType:r}))}getReferences(){return[...this._def.keyType.getReferences(),...this._def.valueType.getReferences()]}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.map)return Ce(r,{code:me.invalid_type,expected:ke.map,received:r.parsedType}),Ve;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new sr(r,a,r.path,[l,"key"])),value:o._parse(new sr(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Ve;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of s){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Ve;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}};T($c,"ZodMap"),$c.create=T((e,t,n)=>new $c(R({valueType:t,keyType:e,typeName:"ZodMap"},it(n))),"create");var ef=$c,Dc=class extends nt{_parse(t){if(this._getType(t)!==ke.nan){const r=this._getOrReturnCtx(t);return Ce(r,{code:me.invalid_type,expected:ke.nan,received:r.parsedType}),Ve}return{status:"valid",value:t.data}}};T(Dc,"ZodNaN"),Dc.create=T(e=>new Dc(R({typeName:"ZodNaN"},it(e))),"create");var tf=Dc,Nc=class extends nt{_parse(t){const n=gt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ke.string&&r.parsedType!==ke.number){const i=gt.objectValues(n);return Ce(r,{expected:gt.joinValues(i),received:r.parsedType,code:me.invalid_type}),Ve}if(n.indexOf(t.data)===-1){const i=gt.objectValues(n);return Ce(r,{received:r.data,code:me.invalid_enum_value,options:i}),Ve}return kn(t.data)}get enum(){return this._def.values}};T(Nc,"ZodNativeEnum"),Nc.create=T((e,t)=>new Nc(R({values:e,typeName:"ZodNativeEnum"},it(t))),"create");var Fs=Nc,jc=class extends nt{_parse(t){const n=this._getOrReturnCtx(t);return Ce(n,{code:me.invalid_type,expected:ke.never,received:n.parsedType}),Ve}};T(jc,"ZodNever"),jc.create=T(e=>new jc(R({typeName:"ZodNever"},it(e))),"create");var yi=jc,Mc=class extends nt{_parse(t){if(this._getType(t)!==ke.null){const r=this._getOrReturnCtx(t);return Ce(r,{code:me.invalid_type,expected:ke.null,received:r.parsedType}),Ve}return kn(t.data)}};T(Mc,"ZodNull"),Mc.create=T(e=>new Mc(R({typeName:"ZodNull"},it(e))),"create");var Us=Mc,qc=class RC extends nt{dereference(t){return new RC(Y(R({},this._def),{innerType:this._def.innerType.dereference(t)}))}getReferences(){return this._def.innerType.getReferences()}_parse(t){return this._getType(t)===ke.null?kn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};T(qc,"ZodNullable"),qc.create=T((e,t)=>new qc(R({innerType:e,typeName:"ZodNullable"},it(t))),"create");var Yr=qc;function Gy(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}T(Gy,"floatSafeRemainder");var Lc=class ny extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ke.number){const o=this._getOrReturnCtx(t);return Ce(o,{code:me.invalid_type,expected:ke.number,received:o.parsedType}),Ve}let r;const i=new jn;for(const o of this._def.checks)o.kind==="int"?gt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ce(r,{code:me.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ce(r,{code:me.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ce(r,{code:me.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Gy(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ce(r,{code:me.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ce(r,{code:me.not_finite,message:o.message}),i.dirty()):gt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ze.toString(n))}setLimit(t,n,r,i){return new ny(Y(R({},this._def),{checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ze.toString(i)}]}))}_addCheck(t){return new ny(Y(R({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&>.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};T(Lc,"ZodNumber"),Lc.create=T(e=>new Lc(R({checks:[],typeName:"ZodNumber",coerce:(e==null?void 0:e.coerce)||!1},it(e))),"create");var Bs=Lc;function Wi(e){if(e instanceof Ki){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=mr.create(Wi(r))}return new Ki(Y(R({},e._def),{shape:T(()=>t,"shape")}))}else return e instanceof Ro?new Ro(Y(R({},e._def),{type:Wi(e.element)})):e instanceof mr?mr.create(Wi(e.unwrap())):e instanceof Yr?Yr.create(Wi(e.unwrap())):e instanceof Ji?Ji.create(e.items.map(t=>Wi(t))):e}T(Wi,"deepPartialify");var gi=class hr extends nt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=gt.objectKeys(t);return this._cached={shape:t,keys:n}}dereference(t){const n=this._def.shape(),r={};for(const i in n)r[i]=n[i].dereference(t);return new hr(Y(R({},this._def),{shape:T(()=>r,"shape")}))}getReferences(){const t=this._def.shape(),n=[];for(const r in t)n.push(...t[r].getReferences());return n}_parse(t){if(this._getType(t)!==ke.object){const l=this._getOrReturnCtx(t);return Ce(l,{code:me.invalid_type,expected:ke.object,received:l.parsedType}),Ve}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof yi&&this._def.unknownKeys==="strip"))for(const l in i.data)s.includes(l)||a.push(l);const c=[];for(const l of s){const u=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new sr(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof yi){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(Ce(i,{code:me.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new sr(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key;l.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return l}).then(l=>jn.mergeObjectSync(r,l)):jn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return ze.errToObj,new hr(R(Y(R({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:T((n,r)=>{var i,o,s,a;const c=(s=(o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)!=null?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ze.errToObj(t).message)!=null?a:c}:{message:c}},"errorMap")}:{}))}strip(){return new hr(Y(R({},this._def),{unknownKeys:"strip"}))}passthrough(){return new hr(Y(R({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new hr(Y(R({},this._def),{shape:T(()=>R(R({},this._def.shape()),t),"shape")}))}merge(t){return new hr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:T(()=>R(R({},this._def.shape()),t._def.shape()),"shape"),typeName:"ZodObject"})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new hr(Y(R({},this._def),{catchall:t}))}pick(t){const n={};return gt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new hr(Y(R({},this._def),{shape:T(()=>n,"shape")}))}omit(t){const n={};return gt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new hr(Y(R({},this._def),{shape:T(()=>n,"shape")}))}deepPartial(){return Wi(this)}partial(t){const n={};return gt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i==null?void 0:i.optional()}),new hr(Y(R({},this._def),{shape:T(()=>n,"shape")}))}required(t){const n={};return gt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof mr;)o=o._def.innerType;n[r]=o}}),new hr(Y(R({},this._def),{shape:T(()=>n,"shape")}))}keyof(){return qs(gt.objectKeys(this.shape))}};T(gi,"ZodObject"),gi.create=T((e,t)=>new gi(R({shape:T(()=>e,"shape"),unknownKeys:"strip",catchall:yi.create(),typeName:"ZodObject"},it(t))),"create"),gi.strictCreate=T((e,t)=>new gi(R({shape:T(()=>e,"shape"),unknownKeys:"strict",catchall:yi.create(),typeName:"ZodObject"},it(t))),"strictCreate"),gi.lazycreate=T((e,t)=>new gi(R({shape:e,unknownKeys:"strip",catchall:yi.create(),typeName:"ZodObject"},it(t))),"lazycreate");var Ki=gi,Fc=class PC extends nt{dereference(t){return new PC(Y(R({},this._def),{innerType:this._def.innerType.dereference(t)}))}getReferences(){return this._def.innerType.getReferences()}_parse(t){return this._getType(t)===ke.undefined?kn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};T(Fc,"ZodOptional"),Fc.create=T((e,t)=>new Fc(R({innerType:e,typeName:"ZodOptional"},it(t))),"create");var mr=Fc,Xy=class ry extends nt{dereference(t){return new ry(Y(R({},this._def),{in:this._def.in.dereference(t),out:this._def.out.dereference(t)}))}getReferences(){return[...this._def.in.getReferences(),...this._def.out.getReferences()]}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return T(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ve:o.status==="dirty"?(n.dirty(),Hi(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})},"handleAsync")();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ve:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new ry({in:t,out:n,typeName:"ZodPipeline"})}};T(Xy,"ZodPipeline");var Uc=Xy,Bc=class $C extends nt{unwrap(){return this._def.type}dereference(t){return new $C(Y(R({},this._def),{type:this._def.type.dereference(t)}))}getReferences(){return this._def.type.getReferences()}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ke.promise&&n.common.async===!1)return Ce(n,{code:me.invalid_type,expected:ke.promise,received:n.parsedType}),Ve;const r=n.parsedType===ke.promise?n.data:Promise.resolve(n.data);return kn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};T(Bc,"ZodPromise"),Bc.create=T((e,t)=>new Bc(R({type:e,typeName:"ZodPromise"},it(t))),"create");var zs=Bc,zc=class DC extends nt{dereference(t){return new DC(Y(R({},this._def),{innerType:this._def.innerType.dereference(t)}))}getReferences(){return this._def.innerType.getReferences()}_parse(t){const n=this._def.innerType._parse(t);return Oo(n)&&(n.value=Object.freeze(n.value)),n}unwrap(){return this._def.innerType}};T(zc,"ZodReadonly"),zc.create=T((e,t)=>new zc(R({innerType:e,typeName:"ZodReadonly"},it(t))),"create");var Zc=zc,Qy=class Fd extends nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(t){const n=this._def.keyType.dereference(t),r=this._def.valueType.dereference(t);return new Fd(Y(R({},this._def),{keyType:n,valueType:r}))}getReferences(){return[...this._def.keyType.getReferences(),...this._def.valueType.getReferences()]}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.object)return Ce(r,{code:me.invalid_type,expected:ke.object,received:r.parsedType}),Ve;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new sr(r,a,r.path,a)),value:s._parse(new sr(r,r.data[a],r.path,a))});return r.common.async?jn.mergeObjectAsync(n,i):jn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof nt?new Fd(R({keyType:t,valueType:n,typeName:"ZodRecord"},it(r))):new Fd(R({keyType:yn.create(),valueType:t,typeName:"ZodRecord"},it(n)))}};T(Qy,"ZodRecord");var nf=Qy,Vc=class extends nt{dereference(t){const n=t[this._def.uri];return n||this}getReferences(){return[this._def.uri]}_parse(t){const n=this._getOrReturnCtx(t);return Ce(n,{code:me.unresolved_reference}),Ve}isOptional(){return!1}isNullable(){return!1}};T(Vc,"ZodRef"),Vc.create=T(e=>new Vc({typeName:"ZodRef",uri:e}),"create");var rf=Vc,Hc=class Ud extends nt{dereference(t){return new Ud(Y(R({},this._def),{valueType:this._def.valueType.dereference(t)}))}getReferences(){return this._def.valueType.getReferences()}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.set)return Ce(r,{code:me.invalid_type,expected:ke.set,received:r.parsedType}),Ve;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ce(r,{code:me.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ce(r,{code:me.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(c){const l=new Set;for(const u of c){if(u.status==="aborted")return Ve;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}T(s,"finalizeSet");const a=[...r.data.values()].map((c,l)=>o._parse(new sr(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,n){return new Ud(Y(R({},this._def),{minSize:{value:t,message:ze.toString(n)}}))}max(t,n){return new Ud(Y(R({},this._def),{maxSize:{value:t,message:ze.toString(n)}}))}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};T(Hc,"ZodSet"),Hc.create=T((e,t)=>new Hc(R({valueType:e,minSize:null,maxSize:null,typeName:"ZodSet"},it(t))),"create");var of=Hc,Wc=/^c[^\s-]{8,}$/i,Kc=/^[a-z][a-z0-9]*$/,Jc=/^[0-9A-HJKMNP-TV-Z]{26}$/,Yc=/^[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,Gc=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tg=T(e=>e===eg,"isEmojiRegex"),sf,Zs=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Vs=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Xc=T(e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex");function ng(e,t){return!!((t==="v4"||!t)&&Zs.test(e)||(t==="v6"||!t)&&Vs.test(e))}T(ng,"isValidIP");var Qc=class ic extends nt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ke.string){const o=this._getOrReturnCtx(t);return Ce(o,{code:me.invalid_type,expected:ke.string,received:o.parsedType}),Ve}const r=new jn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Ce(i,{code:me.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Ce(i,{code:me.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Ce(i,{code:me.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Ce(i,{code:me.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Gc.test(t.data)||(i=this._getOrReturnCtx(t,i),Ce(i,{validation:"email",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")sf||(sf=new RegExp(eg,"u")),sf.test(t.data)||(i=this._getOrReturnCtx(t,i),Ce(i,{validation:"emoji",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Yc.test(t.data)||(i=this._getOrReturnCtx(t,i),Ce(i,{validation:"uuid",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Wc.test(t.data)||(i=this._getOrReturnCtx(t,i),Ce(i,{validation:"cuid",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Kc.test(t.data)||(i=this._getOrReturnCtx(t,i),Ce(i,{validation:"cuid2",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Jc.test(t.data)||(i=this._getOrReturnCtx(t,i),Ce(i,{validation:"ulid",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ce(i,{validation:"url",code:me.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ce(i,{validation:"regex",code:me.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Ce(i,{code:me.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ce(i,{code:me.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ce(i,{code:me.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Xc(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ce(i,{code:me.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?ng(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ce(i,{validation:"ip",code:me.invalid_string,message:o.message}),r.dirty()):gt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),R({validation:n,code:me.invalid_string},ze.errToObj(r)))}_addCheck(t){return new ic(Y(R({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(R({kind:"email"},ze.errToObj(t)))}url(t){return this._addCheck(R({kind:"url"},ze.errToObj(t)))}emoji(t){return this._addCheck(R({kind:"emoji"},ze.errToObj(t)))}uuid(t){return this._addCheck(R({kind:"uuid"},ze.errToObj(t)))}cuid(t){return this._addCheck(R({kind:"cuid"},ze.errToObj(t)))}cuid2(t){return this._addCheck(R({kind:"cuid2"},ze.errToObj(t)))}ulid(t){return this._addCheck(R({kind:"ulid"},ze.errToObj(t)))}ip(t){return this._addCheck(R({kind:"ip"},ze.errToObj(t)))}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck(R({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!=null?n:!1},ze.errToObj(t==null?void 0:t.message)))}regex(t,n){return this._addCheck(R({kind:"regex",regex:t},ze.errToObj(n)))}includes(t,n){return this._addCheck(R({kind:"includes",value:t,position:n==null?void 0:n.position},ze.errToObj(n==null?void 0:n.message)))}startsWith(t,n){return this._addCheck(R({kind:"startsWith",value:t},ze.errToObj(n)))}endsWith(t,n){return this._addCheck(R({kind:"endsWith",value:t},ze.errToObj(n)))}min(t,n){return this._addCheck(R({kind:"min",value:t},ze.errToObj(n)))}max(t,n){return this._addCheck(R({kind:"max",value:t},ze.errToObj(n)))}length(t,n){return this._addCheck(R({kind:"length",value:t},ze.errToObj(n)))}nonempty(t){return this.min(1,ze.errToObj(t))}trim(){return new ic(Y(R({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[wt]=Y(R({},this._def[wt]),{secret:!0}),this}toLowerCase(){return new ic(Y(R({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new ic(Y(R({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};T(Qc,"ZodString"),Qc.create=T(e=>{var t;return new Qc(R({checks:[],typeName:"ZodString",coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},it(e)))},"create");var yn=Qc,el=class extends nt{_parse(t){if(this._getType(t)!==ke.symbol){const r=this._getOrReturnCtx(t);return Ce(r,{code:me.invalid_type,expected:ke.symbol,received:r.parsedType}),Ve}return kn(t.data)}};T(el,"ZodSymbol"),el.create=T(e=>new el(R({typeName:"ZodSymbol"},it(e))),"create");var af=el,tl=class iy extends nt{interpolated(t){return this._addPart(t)}literal(t){return this._addPart(t)}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ke.string){const r=this._getOrReturnCtx(t);return Ce(r,{code:me.invalid_type,expected:ke.string,received:r.parsedType}),Ve}if(!new RegExp(this._def.regexString).test(t.data)){const r=this._getOrReturnCtx(t);return Ce(r,{code:me.invalid_string,message:`does not match template literal with pattern /${this._def.regexString}/`,path:r.path,validation:"regex"}),Ve}return{status:"valid",value:t.data}}_addPart(t){const n=[...this._def.parts,t];return new iy(Y(R({},this._def),{parts:n,regexString:this._appendToRegexString(this._def.regexString,t)}))}_appendToRegexString(t,n){return`^${this._unwrapRegExp(t)}${this._transformPartToRegexString(n)}$`}_transformPartToRegexString(t){if(!(t instanceof nt))return this._escapeRegExp(t);if(t instanceof Ls)return this._escapeRegExp(t._def.value);if(t instanceof yn)return this._transformZodStringPartToRegexString(t);if(t instanceof Jr||t instanceof Fs)return`(${(t instanceof Jr?t._def.values:gt.getValidEnumValues(t._def.values)).map(this._escapeRegExp).join("|")})`;if(t instanceof Ws)return`(${t._def.options.map(n=>this._transformPartToRegexString(n)).join("|")})`;if(t instanceof Bs)return this._transformZodNumberPartToRegexString(t);if(t instanceof mr)return`(${this._transformPartToRegexString(t.unwrap())})?`;if(t instanceof iy)return this._unwrapRegExp(t._def.regexString);if(t instanceof Ns)return"\\-?\\d+";if(t instanceof js)return"(true|false)";if(t instanceof Yr){do t=t.unwrap();while(t instanceof Yr);return`(${this._transformPartToRegexString(t)}|null)${t instanceof mr?"?":""}`}if(t instanceof Ms)return this._transformPartToRegexString(t.unwrap());if(t instanceof Io)return".*";if(t instanceof Us)return"null";if(t instanceof Hs)return"undefined";throw new Kd}_transformZodStringPartToRegexString(t){let n=1/0,r=0,i="",o="";for(const c of t._def.checks){const l=this._resolveRegexForStringCheck(c);if(l)return this._unwrapRegExp(l);if(c.kind==="endsWith")i=c.value;else if(c.kind==="length")r=n=c.value;else if(c.kind==="max")n=Math.max(0,Math.min(n,c.value));else if(c.kind==="min")r=Math.max(r,c.value);else if(c.kind==="startsWith")o=c.value;else throw new hc("ZodString",c.kind)}const s=Math.max(0,r-o.length-i.length),a=Number.isFinite(n)?Math.max(0,n-o.length-i.length):1/0;return a===0||s>a?`${o}${i}`:`${o}.${this._resolveRegexWildcardLength(s,a)}${i}`}_resolveRegexForStringCheck(t){var n;return(n={[t.kind]:null,cuid:Wc,cuid2:Kc,datetime:t.kind==="datetime"?Xc(t):null,email:Gc,ip:t.kind==="ip"?{any:new RegExp(`^(${this._unwrapRegExp(Zs.source)})|(${this._unwrapRegExp(Vs.source)})$`),v4:Zs,v6:Vs}[t.version||"any"]:null,regex:t.kind==="regex"?t.regex:null,ulid:Jc,uuid:Yc}[t.kind])!=null?n:null}_resolveRegexWildcardLength(t,n){return t===n?t===1?"":`{${t}}`:n!==1/0?`{${t},${n}}`:t===0?"*":t===1?"+":`{${t},}`}_transformZodNumberPartToRegexString(t){let n=!0,r=!0,i=-1/0,o=1/0,s=!0,a=!1,c=!1,l="";for(const u of t._def.checks)if(u.kind==="finite")a=!0;else if(u.kind==="int")c=!0;else if(u.kind==="max")o=Math.min(o,u.value),u.value<=0&&(r=!1,u.value===0&&!u.inclusive&&(s=!1));else if(u.kind==="min")i=Math.max(i,u.value),u.value>=0&&(n=!1,u.value===0&&!u.inclusive&&(s=!1));else throw new hc("ZodNumber",u.kind);if(Number.isFinite(i)&&Number.isFinite(o)&&(a=!0),n)l=`${l}\\-`,r&&(l=`${l}?`);else if(!r)return"0+";return a||(l=`${l}(Infinity|(`),s?c?l=`${l}\\d+`:l=`${l}\\d+(\\.\\d+)?`:c?l=`${l}\\d*[1-9]\\d*`:l=`${l}((\\d*[1-9]\\d*(\\.\\d+)?)|(\\d+\\.\\d*[1-9]\\d*))`,a||(l=`${l}))`),l}_unwrapRegExp(t){const n=typeof t=="string"?"":t.flags,r=typeof t=="string"?t:t.source;return n.includes("i")?this._unwrapRegExp(this._makeRegexStringCaseInsensitive(r)):r.replace(/(^\^)|(\$$)/g,"")}_makeRegexStringCaseInsensitive(t){const n=T(o=>o.match(/[a-z]/i)!=null,"isAlphabetic");let r="",i=!1;for(let o=0;o<t.length;o++){const s=t.charAt(o),a=t.charAt(o+1);if(s==="\\"){r+=`${s}${a}`,o++;continue}if(s==="["?i=!0:i&&s==="]"&&(i=!1),!n(s)){r+=s;continue}if(!i){r+=`[${s.toLowerCase()}${s.toUpperCase()}]`;continue}const c=t.charAt(o+2);if(a!=="-"||!n(c)){r+=`${s.toLowerCase()}${s.toUpperCase()}`;continue}r+=`${s.toLowerCase()}-${c.toLowerCase()}${s.toUpperCase()}-${c.toUpperCase()}`,o+=2}return r}_escapeRegExp(t){return typeof t!="string"&&(t=`${t}`),t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}};T(tl,"ZodTemplateLiteral"),tl.create=T(e=>{var t;return new tl(Y(R({},it(e)),{coerce:(t=e==null?void 0:e.coerce)!=null?t:!1,parts:[],regexString:"^$",typeName:"ZodTemplateLiteral"}))},"create");var nl=tl,Po=class NC extends nt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(t){return new NC(Y(R({},this._def),{schema:this._def.schema.dereference(t)}))}getReferences(){return this._def.schema.getReferences()}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:T(s=>{Ce(r,s),s.fatal?n.abort():n.dirty()},"addIssue"),get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return Ve;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Ve:c.status==="dirty"||n.value==="dirty"?Hi(c.value):c});{if(n.value==="aborted")return Ve;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?Ve:a.status==="dirty"||n.value==="dirty"?Hi(a.value):a}}if(i.type==="refinement"){const s=T(a=>{const c=i.refinement(a,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a},"executeRefinement");if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ve:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ve:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Oo(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Oo(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);gt.assertNever(i)}};T(Po,"ZodEffects"),Po.create=T((e,t,n)=>new Po(R({schema:e,typeName:"ZodEffects",effect:t},it(n))),"create"),Po.createWithPreprocess=T((e,t,n)=>new Po(R({schema:t,effect:{type:"preprocess",transform:e},typeName:"ZodEffects"},it(n))),"createWithPreprocess");var Gr=Po,rl=class oy extends nt{dereference(t){const n=this._def.items.map(i=>i.dereference(t)),r=this._def.rest?this._def.rest.dereference(t):null;return new oy(Y(R({},this._def),{items:n,rest:r}))}getReferences(){return[...this._def.items.flatMap(t=>t.getReferences()),...this._def.rest?this._def.rest.getReferences():[]]}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.array)return Ce(r,{code:me.invalid_type,expected:ke.array,received:r.parsedType}),Ve;if(r.data.length<this._def.items.length)return Ce(r,{code:me.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ve;!this._def.rest&&r.data.length>this._def.items.length&&(Ce(r,{code:me.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new sr(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>jn.mergeArray(n,s)):jn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new oy(Y(R({},this._def),{rest:t}))}};T(rl,"ZodTuple"),rl.create=T((e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rl(R({items:e,typeName:"ZodTuple",rest:null},it(t)))},"create");var Ji=rl,il=class extends nt{_parse(t){if(this._getType(t)!==ke.undefined){const r=this._getOrReturnCtx(t);return Ce(r,{code:me.invalid_type,expected:ke.undefined,received:r.parsedType}),Ve}return kn(t.data)}};T(il,"ZodUndefined"),il.create=T(e=>new il(R({typeName:"ZodUndefined"},it(e))),"create");var Hs=il,ol=class jC extends nt{dereference(t){const n=this._def.options.map(r=>r.dereference(t));return new jC(Y(R({},this._def),{options:n}))}getReferences(){return this._def.options.reduce((t,n)=>[...t,...n.getReferences()],[])}_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Or(a.ctx.common.issues));return Ce(n,{code:me.invalid_union,unionErrors:s}),Ve}if(T(i,"handleResults"),n.common.async)return Promise.all(r.map(async o=>{const s=Y(R({},n),{common:Y(R({},n.common),{issues:[]}),parent:null});return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const c of r){const l=Y(R({},n),{common:Y(R({},n.common),{issues:[]}),parent:null}),u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(c=>new Or(c));return Ce(n,{code:me.invalid_union,unionErrors:a}),Ve}}get options(){return this._def.options}};T(ol,"ZodUnion"),ol.create=T((e,t)=>new ol(R({options:e,typeName:"ZodUnion"},it(t))),"create");var Ws=ol,sl=class extends nt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kn(t.data)}};T(sl,"ZodUnknown"),sl.create=T(e=>new sl(R({typeName:"ZodUnknown"},it(e))),"create");var $o=sl,al=class extends nt{_parse(t){if(this._getType(t)!==ke.undefined){const r=this._getOrReturnCtx(t);return Ce(r,{code:me.invalid_type,expected:ke.void,received:r.parsedType}),Ve}return kn(t.data)}};T(al,"ZodVoid"),al.create=T(e=>new al(R({typeName:"ZodVoid"},it(e))),"create");var cf=al,iT=/^\d{4}-\d{2}-\d{2}(T|\s)?((\d{2}:\d{2}:\d{2}(\.\d{1,3})?)|(\d{2}:\d{2}))?(\s?([+-]\d{2}:\d{2}|Z))?$/,Do=T((e,t,n=!0)=>{if(typeof e!="object")throw new Error("Input must be an object");const r=T(s=>{let a=s;return t!=null&&t.nullable&&(a=a.nullable()),t!=null&&t.optional&&(a=a.optional()),t!=null&&t.passtrough&&typeof a.passthrough=="function"&&(a=a.passthrough()),a},"applyOptions"),i=Object.entries(e).reduce((s,[a,c])=>{if(c===null)s[a]=r(mn.null());else switch(typeof c){case"string":s[a]=iT.test(c)?r(mn.string().datetime()):r(mn.string());break;case"number":s[a]=r(mn.number());break;case"boolean":s[a]=r(mn.boolean());break;case"object":Array.isArray(c)?c.length===0?s[a]=r(mn.array(mn.unknown())):typeof c[0]=="object"?s[a]=r(mn.array(Do(c[0],t,!1))):["string","number","boolean"].includes(typeof c[0])&&(s[a]=r(mn.array(mn[typeof c[0]]()))):s[a]=r(Do(c,t,!1));break;default:throw new Error(`Unsupported type for key ${a}`)}return s},{}),o=Object.keys(i).length>0;return t!=null&&t.passtrough||!n&&!o?mn.object(i).passthrough():mn.object(i)},"objectToZui");function rg(){return{}}T(rg,"parseAnyDef");function lf(e,t,n,r){r!=null&&r.errorMessages&&n&&(e.errorMessage=Y(R({},e.errorMessage),{[t]:n}))}T(lf,"addErrorMessage");function Rt(e,t,n,r,i){e[t]=n,lf(e,t,r,i)}T(Rt,"setResponseValueAndErrors");function ig(e,t){var n,r;const i={type:"array"};return((r=(n=e.type)==null?void 0:n._def)==null?void 0:r.typeName)!=="ZodAny"&&(i.items=Ct(e.type._def,Y(R({},t),{currentPath:[...t.currentPath,"items"]}))),e.minLength&&Rt(i,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Rt(i,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Rt(i,"minItems",e.exactLength.value,e.exactLength.message,t),Rt(i,"maxItems",e.exactLength.value,e.exactLength.message,t)),i}T(ig,"parseArrayDef");function og(e,t){const n=R({type:"integer",format:"int64"},e.coerce?{[wt]:{coerce:e.coerce||void 0}}:{});if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"min":t.target==="jsonSchema7"?r.inclusive?Rt(n,"minimum",r.value,r.message,t):Rt(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),Rt(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?Rt(n,"maximum",r.value,r.message,t):Rt(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),Rt(n,"maximum",r.value,r.message,t));break;case"multipleOf":Rt(n,"multipleOf",r.value,r.message,t);break}return n}T(og,"parseBigintDef");function sg(e){return R({type:"boolean"},e.coerce?{[wt]:{coerce:e.coerce||void 0}}:{})}T(sg,"parseBooleanDef");function ag(e,t){return Ct(e.type._def,t)}T(ag,"parseBrandedDef");var oT=T((e,t)=>Ct(e.innerType._def,t),"parseCatchDef");function cg(e,t){return t.dateStrategy=="integer"?sT(e,t):R({type:"string",format:"date-time"},e.coerce?{[wt]:{coerce:e.coerce||void 0}}:{})}T(cg,"parseDateDef");var sT=T((e,t)=>{const n=R({type:"integer",format:"unix-time"},e.coerce?{[wt]:{coerce:e.coerce||void 0}}:{});for(const r of e.checks)switch(r.kind){case"min":t.target==="jsonSchema7"&&Rt(n,"minimum",r.value,r.message,t);break;case"max":t.target==="jsonSchema7"&&Rt(n,"maximum",r.value,r.message,t);break}return n},"integerDateParser");function lg(e,t){return Y(R({},Ct(e.innerType._def,t)),{default:e.defaultValue()})}T(lg,"parseDefaultDef");function ug(e,t){return t.effectStrategy==="input"?Ct(e.schema._def,t):{}}T(ug,"parseEffectsDef");function dg(e){return{type:"string",enum:e.values}}T(dg,"parseEnumDef");var aT=T(e=>"type"in e&&e.type==="string"?!1:"allOf"in e,"isJsonSchema7AllOfType");function fg(e,t){const n=[Ct(e.left._def,Y(R({},t),{currentPath:[...t.currentPath,"allOf","0"]})),Ct(e.right._def,Y(R({},t),{currentPath:[...t.currentPath,"allOf","1"]}))].filter(o=>!!o);let r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const i=[];return n.forEach(o=>{if(aT(o))i.push(...o.allOf),o.unevaluatedProperties===void 0&&(r=void 0);else{let s=o;"additionalProperties"in o&&o.additionalProperties===!1?s=uy(o,["additionalProperties"]):r=void 0,i.push(s)}}),i.length?R({allOf:i},r):void 0}T(fg,"parseIntersectionDef");function pg(e,t){const n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}T(pg,"parseLiteralDef");var Ks={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$",ipv6:"^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$"};function uf(e,t){const n=R({type:"string"},e.coerce?{[wt]:{coerce:e.coerce||void 0}}:{});function r(i){return t.patternStrategy==="escape"?cT(i):i}if(T(r,"processPattern"),e.checks)for(const i of e.checks)switch(i.kind){case"min":Rt(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t);break;case"max":Rt(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Yi(n,"email",i.message,t);break;case"format:idn-email":Yi(n,"idn-email",i.message,t);break;case"pattern:zod":Xr(n,Ks.email,i.message,t);break}break;case"url":Yi(n,"uri",i.message,t);break;case"uuid":Yi(n,"uuid",i.message,t);break;case"regex":Xr(n,i.regex.source,i.message,t);break;case"cuid":Xr(n,Ks.cuid,i.message,t);break;case"cuid2":Xr(n,Ks.cuid2,i.message,t);break;case"startsWith":Xr(n,"^"+r(i.value),i.message,t);break;case"endsWith":Xr(n,r(i.value)+"$",i.message,t);break;case"datetime":Yi(n,"date-time",i.message,t);break;case"length":Rt(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t),Rt(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"includes":{Xr(n,r(i.value),i.message,t);break}case"ip":{i.version!=="v6"&&Yi(n,"ipv4",i.message,t),i.version!=="v4"&&Yi(n,"ipv6",i.message,t);break}case"emoji":Xr(n,Ks.emoji,i.message,t);break;case"ulid":{Xr(n,Ks.ulid,i.message,t);break}}return n}T(uf,"parseStringDef");var cT=T(e=>Array.from(e).map(t=>/[a-zA-Z0-9]/.test(t)?t:`\\${t}`).join(""),"escapeNonAlphaNumeric"),Yi=T((e,t,n,r)=>{var i;e.format||(i=e.anyOf)!=null&&i.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push(R({format:e.format},e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}})),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push(R({format:t},n&&r.errorMessages&&{errorMessage:{format:n}}))):Rt(e,"format",t,n,r)},"addFormat"),Xr=T((e,t,n,r)=>{var i;e.pattern||(i=e.allOf)!=null&&i.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push(R({pattern:e.pattern},e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}})),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push(R({pattern:t},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):Rt(e,"pattern",t,n,r)},"addPattern");function df(e,t){var n,r,i,o,s;if(t.target==="openApi3"&&((n=e.keyType)==null?void 0:n._def.typeName)==="ZodEnum")return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((c,l)=>{var u;return Y(R({},c),{[l]:(u=Ct(e.valueType._def,Y(R({},t),{currentPath:[...t.currentPath,"properties",l]})))!=null?u:{}})},{}),additionalProperties:!1};const a={type:"object",additionalProperties:(r=Ct(e.valueType._def,Y(R({},t),{currentPath:[...t.currentPath,"additionalProperties"]})))!=null?r:{}};if(t.target==="openApi3")return a;if(((i=e.keyType)==null?void 0:i._def.typeName)==="ZodString"&&((o=e.keyType._def.checks)!=null&&o.length)){const c=Object.entries(uf(e.keyType._def,t)).reduce((l,[u,d])=>u==="type"?l:Y(R({},l),{[u]:d}),{});return Y(R({},a),{propertyNames:c})}else if(((s=e.keyType)==null?void 0:s._def.typeName)==="ZodEnum")return Y(R({},a),{propertyNames:{enum:e.keyType._def.values}});return a}T(df,"parseRecordDef");function hg(e,t){if(t.mapStrategy==="record")return df(e,t);const n=Ct(e.keyType._def,Y(R({},t),{currentPath:[...t.currentPath,"items","items","0"]}))||{},r=Ct(e.valueType._def,Y(R({},t),{currentPath:[...t.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}T(hg,"parseMapDef");function mg(e){const t=e.values,r=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),i=Array.from(new Set(r.map(o=>typeof o)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r.filter(o=>typeof o=="string"||typeof o=="number")}}T(mg,"parseNativeEnumDef");function yg(){return{not:{}}}T(yg,"parseNeverDef");function gg(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}T(gg,"parseNullDef");var cl={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function vg(e,t){if(t.target==="openApi3")return bg(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in cl&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,o)=>{const s=cl[o._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,o)=>{const s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(o._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((o,s,a)=>a.indexOf(o)===s);return{type:i.length>1?i:i[0],enum:n.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(o=>!r.includes(o))],[])};return bg(e,t)}T(vg,"parseUnionDef");var bg=T((e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,o)=>Ct(i._def,Y(R({},t),{currentPath:[...t.currentPath,t.unionStrategy,`${o}`]}))).filter(i=>!!i&&(!t.strictUnions||typeof i=="object"&&Object.keys(i).length>0)),r=t.discriminator&&e.typeName==="ZodDiscriminatedUnion"&&typeof e.discriminator=="string"?{discriminator:{propertyName:e.discriminator}}:{};if(n.length)return t.unionStrategy==="anyOf"?R({anyOf:n},r):R({oneOf:n},r)},"asUnionOf");function wg(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:cl[e.innerType._def.typeName],nullable:!0}:{type:[cl[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const r=Ct(e.innerType._def,Y(R({},t),{currentPath:[...t.currentPath]}));return r&&Y(R({},r),{nullable:!0})}const n=Ct(e.innerType._def,Y(R({},t),{currentPath:[...t.currentPath,"anyOf","0"]}));return n&&{anyOf:[n,{type:"null"}]}}T(wg,"parseNullableDef");function xg(e,t){const n=R({type:"number"},e.coerce?{[wt]:{coerce:e.coerce||void 0}}:{});if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"int":n.type="integer",lf(n,"type",r.message,t);break;case"min":t.target==="jsonSchema7"?r.inclusive?Rt(n,"minimum",r.value,r.message,t):Rt(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),Rt(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?Rt(n,"maximum",r.value,r.message,t):Rt(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),Rt(n,"maximum",r.value,r.message,t));break;case"multipleOf":Rt(n,"multipleOf",r.value,r.message,t);break}return n}T(xg,"parseNumberDef");function _g(e,t){var n;const r=Y(R({type:"object"},Object.entries(e.shape()).reduce((i,[o,s])=>{if(s===void 0||s._def===void 0)return i;const a=Ct(s._def,Y(R({},t),{currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]}));return a===void 0?i:{properties:Y(R({},i.properties),{[o]:a}),required:s.isOptional()?i.required:[...i.required,o]}},{properties:{},required:[]})),{additionalProperties:e.catchall._def.typeName==="ZodNever"?e.unknownKeys==="passthrough":(n=Ct(e.catchall._def,Y(R({},t),{currentPath:[...t.currentPath,"additionalProperties"]})))!=null?n:!0});return r.required.length||delete r.required,r}T(_g,"parseObjectDef");var lT=T((e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Ct(e.innerType._def,t);const r=Ct(e.innerType._def,Y(R({},t),{currentPath:[...t.currentPath,"anyOf","1"]}));return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),uT=T((e,t)=>{if(t.pipeStrategy==="input")return Ct(e.in._def,t);if(t.pipeStrategy==="output")return Ct(e.out._def,t);const n=Ct(e.in._def,Y(R({},t),{currentPath:[...t.currentPath,"allOf","0"]})),r=Ct(e.out._def,Y(R({},t),{currentPath:[...t.currentPath,"allOf",n?"1":"0"]}));return{allOf:[n,r].filter(i=>i!==void 0)}},"parsePipelineDef");function Sg(e,t){return Ct(e.type._def,t)}T(Sg,"parsePromiseDef");function Eg(e,t){const r={type:"array",uniqueItems:!0,items:Ct(e.valueType._def,Y(R({},t),{currentPath:[...t.currentPath,"items"]}))};return e.minSize&&Rt(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Rt(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}T(Eg,"parseSetDef");function kg(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Ct(n._def,Y(R({},t),{currentPath:[...t.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ct(e.rest._def,Y(R({},t),{currentPath:[...t.currentPath,"additionalItems"]}))}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Ct(n._def,Y(R({},t),{currentPath:[...t.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[])}}T(kg,"parseTupleDef");function Cg(){return{not:{}}}T(Cg,"parseUndefinedDef");function Tg(){return{}}T(Tg,"parseUnknownDef");var dT=T((e,t)=>Ct(e.innerType._def,t),"parseReadonlyDef");function Ag(e){return{$ref:e.uri}}T(Ag,"parseRefDef");function Ct(e,t,n=!1){const r=t.seen.get(e);if(r&&!n){const s=fT(r,t);if(s!==void 0)return s}const i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);const o=hT(e,e.typeName,t);return o&&mT(e,t,o),i.jsonSchema=o,o}T(Ct,"parseDef");var fT=T((e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:pT(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},"get$ref"),pT=T((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("/")},"getRelativePath"),hT=T((e,t,n)=>{switch(t){case"ZodString":return uf(e,n);case"ZodNumber":return xg(e,n);case"ZodObject":return _g(e,n);case"ZodBigInt":return og(e,n);case"ZodBoolean":return sg(e);case"ZodDate":return cg(e,n);case"ZodUndefined":return Cg();case"ZodNull":return gg(n);case"ZodArray":return ig(e,n);case"ZodUnion":case"ZodDiscriminatedUnion":return vg(e,n);case"ZodIntersection":return fg(e,n);case"ZodTuple":return kg(e,n);case"ZodRecord":return df(e,n);case"ZodRef":return Ag(e);case"ZodLiteral":return pg(e,n);case"ZodEnum":return dg(e);case"ZodNativeEnum":return mg(e);case"ZodNullable":return wg(e,n);case"ZodOptional":return lT(e,n);case"ZodMap":return hg(e,n);case"ZodSet":return Eg(e,n);case"ZodLazy":return Ct(e.getter()._def,n);case"ZodPromise":return Sg(e,n);case"ZodNaN":case"ZodNever":return yg();case"ZodEffects":return ug(e,n);case"ZodAny":return rg();case"ZodUnknown":return Tg();case"ZodDefault":return lg(e,n);case"ZodBranded":return ag(e,n);case"ZodReadonly":return dT(e,n);case"ZodCatch":return oT(e,n);case"ZodPipeline":return uT(e,n);case"ZodTemplateLiteral":throw new Error("Template literals are not supported yet");case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})()}},"selectParser"),mT=T((e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),Object.assign(n,{[wt]:R(R({},e[wt]),n[wt])||{}}),n),"addMeta"),Og={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"string",mapStrategy:"entries",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",discriminator:!1,unionStrategy:"anyOf"},yT=T(e=>typeof e=="string"?Y(R({},Og),{name:e}):R(R({},Og),e),"getDefaultOptions"),gT=T(e=>{const t=yT(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return Y(R({},t),{currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))})},"getRefs"),vT=T((e,t)=>{var n;const r=gT(t),i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[l,u])=>{var d;return Y(R({},c),{[l]:(d=Ct(u._def,Y(R({},r),{currentPath:[...r.basePath,r.definitionPath,l]}),!0))!=null?d:{}})},{}):void 0,o=typeof t=="string"?t:t==null?void 0:t.name,s=(n=Ct(e._def,o===void 0?r:Y(R({},r),{currentPath:[...r.basePath,r.definitionPath,o]}),!1))!=null?n:{},a=o===void 0?i?Y(R({},s),{[r.definitionPath]:i}):s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:Y(R({},i),{[o]:s})};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),a},"zodToJsonSchema"),ll=T((e,t={target:"openApi3"})=>{const n=vT(e,t);return t.$schemaUrl===!1?delete n.$schema:typeof t.$schemaUrl=="string"&&(n.$schema=t.$schemaUrl),n},"zuiToJsonSchema"),bT=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"];Jr.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]);var Ig=T(e=>yn.create().displayAs({id:"variable",params:R({type:(e==null?void 0:e.type)||"any"},e==null?void 0:e.params)}),"variable"),Rg=T(e=>yn.create().displayAs({id:"conversation",params:R({},e==null?void 0:e.params)}),"conversation"),Pg=T(e=>yn.create().displayAs({id:"user",params:R({},e==null?void 0:e.params)}),"user"),$g=T(e=>yn.create().displayAs({id:"message",params:R({},e==null?void 0:e.params)}),"message"),Dg=T(e=>yn.create().displayAs({id:"agent",params:R({},e==null?void 0:e.params)}),"agent"),Ng=T(e=>yn.create().displayAs({id:"event",params:R({},e==null?void 0:e.params)}),"event"),jg=T(e=>yn.create().displayAs({id:"table",params:R({},e==null?void 0:e.params)}),"table"),Mg=T(e=>yn.create().displayAs({id:"tablerow",params:R({},e==null?void 0:e.params)}),"tablerow"),qg=T(e=>yn.create().displayAs({id:"intent",params:R({},e==null?void 0:e.params)}),"intent"),Lg=T(()=>Jr.create(bT).displayAs({id:"dropdown",params:{}}),"aimodel"),Fg=T(e=>yn.create().displayAs({id:"datasource",params:R({},e)}),"datasource"),Ug=T(e=>yn.create().displayAs({id:"knowledgebase",params:R({},e)}),"knowledgebase"),Bg={object:Ki.lazycreate},zg=T((e,t={message:`Input not instance of ${e.name}`})=>Yd(n=>n instanceof e,t),"instanceOfType"),ff=yn.create,pf=Bs.create,Zg=tf.create,Vg=Ns.create,hf=js.create,Hg=Ec.create,Wg=af.create,Kg=Hs.create,Jg=Us.create,Yg=Io.create,Gg=$o.create,Xg=yi.create,Qg=cf.create,ev=Ro.create,tv=Ki.create,nv=Ki.strictCreate,rv=Ws.create,iv=Gd.create,ov=Oc.create,sv=Ji.create,av=nf.create,cv=rf.create,lv=ef.create,uv=of.create,dv=Qd.create,fv=Rc.create,pv=Ls.create,hv=Jr.create,mv=Fs.create,yv=zs.create,ul=Gr.create,gv=mr.create,vv=Yr.create,bv=Gr.createWithPreprocess,wv=Uc.create,xv=nl.create,_v=T(()=>ff().optional(),"ostring"),Sv=T(()=>pf().optional(),"onumber"),Ev=T(()=>hf().optional(),"oboolean"),kv=nt.fromJsonSchema,Cv=nt.fromObject,Tv={string:T(e=>yn.create(Y(R({},e),{coerce:!0})),"string"),number:T(e=>Bs.create(Y(R({},e),{coerce:!0})),"number"),boolean:T(e=>js.create(Y(R({},e),{coerce:!0})),"boolean"),bigint:T(e=>Ns.create(Y(R({},e),{coerce:!0})),"bigint"),date:T(e=>Ec.create(Y(R({},e),{coerce:!0})),"date"),templateLiteral:T(e=>nl.create(Y(R({},e),{coerce:!0})),"templateLiteral")},Av=Ve,He=mn,Ov=T((e,t)=>e.anyOf.length?e.anyOf.length===1?ln(e.anyOf[0],Y(R({},t),{path:[...t.path,"anyOf",0]})):`z.union([${e.anyOf.map((n,r)=>ln(n,Y(R({},t),{path:[...t.path,"anyOf",r]}))).join(", ")}])`:"z.any()","parseAnyOf"),wT=T(e=>{var t;return(t=e[wt])!=null&&t.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),xT=T(e=>"z.any()","parseDefault"),_T=T((e,t)=>`z.union([${e.type.map(n=>ln(Y(R({},e),{type:n}),t)).join(", ")}])`,"parseMultipleType"),ST=T((e,t)=>`z.any().refine((value) => !${ln(e.not,Y(R({},t),{path:[...t.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),ET=T(e=>"z.null()","parseNull"),kT=T(e=>[e.slice(0,e.length/2),e.slice(e.length/2)],"half"),CT=T((e,...t)=>Object.keys(e).reduce((n,r)=>(t.includes(r)||(n[r]=e[r]),n),{}),"omit");function Cn(e,t,n){var r;const i=e[t];let o="";if(i!==void 0){const s=n({value:i,json:JSON.stringify(i)});if(s){const a=s[0],c=s.length===3?s[1]:"",l=s.length===3?s[2]:s[1];o+=a,((r=e.errorMessage)==null?void 0:r[t])!==void 0&&(o+=c+JSON.stringify(e.errorMessage[t])),o+=l}}return o}T(Cn,"withMessage");var Js=Symbol("Original index"),TT=T(e=>{let t=[];for(let n=0;n<e.length;n++){const r=e[n];if(typeof r=="boolean")t.push(r?{[Js]:n}:{[Js]:n,not:{}});else{if(Js in r)return e;t.push(Y(R({},r),{[Js]:n}))}}return t},"ensureOriginalIndex");function Ys(e,t){if(e.allOf.length===0)return"z.never()";if(e.allOf.length===1){const n=e.allOf[0];return ln(n,Y(R({},t),{path:[...t.path,"allOf",n[Js]]}))}else{const[n,r]=kT(TT(e.allOf));return`z.intersection(${Ys({allOf:n},t)}, ${Ys({allOf:r},t)})`}}T(Ys,"parseAllOf");var AT=T((e,t)=>{if(Array.isArray(e.items))return`z.tuple([${e.items.map((r,i)=>ln(r,Y(R({},t),{path:[...t.path,"items",i]})))}])`;let n=e.items?`z.array(${ln(e.items,Y(R({},t),{path:[...t.path,"items"]}))})`:"z.array(z.any())";return n+=Cn(e,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=Cn(e,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseArray"),OT=T(e=>`z.literal(${JSON.stringify(e.const)})`,"parseConst"),IT=T(e=>e.enum.length===0?"z.never()":e.enum.length===1?`z.literal(${JSON.stringify(e.enum[0])})`:e.enum.every(t=>typeof t=="string")?`z.enum([${e.enum.map(t=>JSON.stringify(t))}])`:`z.union([${e.enum.map(t=>`z.literal(${JSON.stringify(t)})`).join(", ")}])`,"parseEnum"),RT=T((e,t)=>{const n=ln(e.if,Y(R({},t),{path:[...t.path,"if"]})),r=ln(e.then,Y(R({},t),{path:[...t.path,"then"]})),i=ln(e.else,Y(R({},t),{path:[...t.path,"else"]}));return`z.union([${r}, ${i}]).superRefine((value,ctx) => {
|
|
@@ -66,15 +66,15 @@ ${lc(e.value)}`.trim();case He.ZodFirstPartyTypeKind.ZodEnum:return a.values.map
|
|
|
66
66
|
`,i+=`}
|
|
67
67
|
`,i+=`}
|
|
68
68
|
`),i+=`}
|
|
69
|
-
`,i+="})"}let o=n?i?n+i:r?r==="z.never()"?n+".strict()":n+`.catchall(${r})`:n:i||(r?`z.record(${r})`:"z.record(z.any())");return Gt.an.anyOf(e)&&(o+=`.and(${Ov(Y(R({},e),{anyOf:e.anyOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?Y(R({},s),{type:"object"}):s)}),t)})`),Gt.a.oneOf(e)&&(o+=`.and(${mf(Y(R({},e),{oneOf:e.oneOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?Y(R({},s),{type:"object"}):s)}),t)})`),Gt.an.allOf(e)&&(o+=`.and(${Ys(Y(R({},e),{allOf:e.allOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?Y(R({},s),{type:"object"}):s)}),t)})`),o}T(Iv,"parseObject");var $T=T(e=>{var t;let n="z.string()";if((t=e[wt])!=null&&t.coerce){if(e.format==="date-time")return"z.coerce.date()";n="z.coerce.string()"}return n+=Cn(e,"format",({value:r})=>{switch(r){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime(",")"]}}),n+=Cn(e,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),n+=Cn(e,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),n+=Cn(e,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseString"),DT=T((e,t)=>`${ln(CT(e,"nullable"),t,!0)}.nullable()`,"parseNullable"),NT=T((e,t)=>{var n,r;if(e.oneOf.length<=1||!((n=e.discriminator)!=null&&n.propertyName))return mf(e,t);const i=e.oneOf.map((o,s)=>ln(o,Y(R({},t),{path:[...t.path,"oneOf",s]})));return`z.discriminatedUnion("${(r=e.discriminator)==null?void 0:r.propertyName}", [${i.join(", ")}])`},"parseDiscriminator"),ln=T((e,t={seen:new Map,path:[]},n)=>{if(typeof e!="object")return e?"z.any()":"z.never()";if(t.parserOverride){const o=t.parserOverride(e,t);if(typeof o=="string")return o}let r=t.seen.get(e);if(r){if(r.r!==void 0)return r.r;if(t.depth===void 0||r.n>=t.depth)return"z.any()";r.n+=1}else r={r:void 0,n:0},t.seen.set(e,r);let i=qT(e,t);return n||(i=jT(e,i),t.withoutDefaults||(i=MT(e,i))),r.r=i,i},"parseSchema"),jT=T((e,t)=>(e.description&&(t+=`.describe(${JSON.stringify(e.description)})`),t),"addMeta"),MT=T((e,t)=>(e.default!==void 0&&(t+=`.default(${JSON.stringify(e.default)})`),t),"addDefaults"),qT=T((e,t)=>Gt.a.nullable(e)?DT(e,t):Gt.an.object(e)?Iv(e,t):Gt.an.array(e)?AT(e,t):Gt.an.anyOf(e)?Ov(e,t):Gt.an.allOf(e)?Ys(e,t):Gt.a.discriminator(e)?NT(e,t):Gt.a.oneOf(e)?mf(e,t):Gt.a.not(e)?ST(e,t):Gt.an.enum(e)?IT(e):Gt.a.const(e)?OT(e):Gt.a.multipleType(e)?_T(e,t):Gt.a.primitive(e,"string")?$T(e):Gt.a.primitive(e,"number")||Gt.a.primitive(e,"integer")?PT(e):Gt.a.primitive(e,"boolean")?wT(e):Gt.a.primitive(e,"null")?ET(e):Gt.a.conditional(e)?RT(e,t):xT(e),"selectParser"),Gt={an:{object:T(e=>e.type==="object","object"),array:T(e=>e.type==="array","array"),anyOf:T(e=>e.anyOf!==void 0,"anyOf"),allOf:T(e=>e.allOf!==void 0,"allOf"),enum:T(e=>e.enum!==void 0,"enum")},a:{nullable:T(e=>e.nullable===!0,"nullable"),multipleType:T(e=>Array.isArray(e.type),"multipleType"),not:T(e=>e.not!==void 0,"not"),const:T(e=>e.const!==void 0,"const"),primitive:T((e,t)=>e.type===t,"primitive"),conditional:T(e=>!!("if"in e&&e.if&&"then"in e&&"else"in e&&e.then&&e.else),"conditional"),discriminator:T(e=>{var t;return e.oneOf!==void 0&&((t=e.discriminator)==null?void 0:t.propertyName)!==void 0},"discriminator"),oneOf:T(e=>e.oneOf!==void 0,"oneOf")}},LT=T(e=>ln(e,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),FT=T(e=>{let t=LT(e);return t=t.replaceAll("errors: z.ZodError[]","errors"),new Function("z",`return ${t}`)(mn)},"jsonSchemaToZod"),Gs=T((e,t)=>{var n,r;if(t[wt]&&e._def&&(e._def[wt]=t[wt]),((n=e._def)==null?void 0:n.typeName)==="ZodObject"&&t.type==="object"&&t.properties&&Object.entries(t.properties).forEach(([i,o])=>{const s=typeof e._def.shape=="function"?e._def.shape():e._def.shape;s[i]&&Gs(s[i],o)}),((r=e._def)==null?void 0:r.typeName)==="ZodRecord"&&t.type==="object"&&t.additionalProperties&&Gs(e._def.valueType,t.additionalProperties),t.type==="array"&&t.items){const i=t.items;if(typeof i=="object"&&!Array.isArray(i)){const o=e._def.type;o&&Gs(o,i)}else Array.isArray(i)&&i.forEach((o,s)=>{const a=e._def;a.typeName===mn.ZodFirstPartyTypeKind.ZodTuple&&Gs(a.items[s],o)})}},"applyZuiPropsRecursively"),Xs=T(e=>{const t=FT(e);return Gs(t,e),t},"jsonSchemaToZui"),No=sc(w,1),dl=sc(w,1),Rv=class extends dl.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError&&this.props.fallback?dl.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};T(Rv,"ErrorBoundary");var jo=Rv;function Pv(e,t){return n=>dl.default.createElement(jo,{fallback:t,fieldSchema:n.fieldSchema,path:n.path},dl.default.createElement(e,R({},n)))}T(Pv,"withErrorBoundary");var ar=sc(w,1),fl=T(e=>{var t=e,{components:n,fieldSchema:r,path:i,required:o,fallback:s}=t,a=uy(t,["components","fieldSchema","path","required","fallback"]),c,l;const{formData:u,disabled:d,hidden:h,handlePropertyChange:f,addArrayItem:p,removeArrayItem:m,formErrors:y,formValid:v}=gy(r,i),g=(0,ar.useMemo)(()=>Vi(u,i),[u,i]),b=(0,ar.useMemo)(()=>YC(n,r),[r,n]),{discriminator:S,discriminatedSchema:E,discriminatorValue:_}=WC(r,i);if(!b||h===!0)return null;const{Component:I,type:P}=b,$={type:P,componentID:b.id,scope:i.join("."),context:{path:i,readonly:!1,formData:u,formErrors:y,formValid:v,updateForm:f,updateFormData:T(H=>f([],H),"updateFormData")},onChange:T(H=>f(i,H),"onChange"),disabled:d,errors:(y==null?void 0:y.filter(H=>H.path===i))||[],label:((c=r[wt])==null?void 0:c.title)||Vd(((l=i[i.length-1])==null?void 0:l.toString())||""),params:b.params,schema:r,zuiProps:r[wt]};if(r.type==="array"&&P==="array"){const H=I,B=$.schema,F=Array.isArray(g)||typeof g=="object"?g:[],D=R(Y(R({},$),{type:P,schema:B,data:F,addItem:T(M=>p(i,M),"addItem"),removeItem:T(M=>m(i,M),"removeItem")}),a);return Array.isArray(r.items)?null:ar.default.createElement(H,Y(R({key:$.scope},D),{isArrayChild:D.isArrayChild}),Array.isArray(D.data)?D.data.map((M,Z)=>{const W=[...i,Z.toString()];return ar.default.createElement(jo,{key:W.join("."),fallback:s,fieldSchema:r.items,path:W},ar.default.createElement(fl,{key:W.join("."),components:n,fieldSchema:r.items,path:W,required:o,isArrayChild:!0,index:Z,removeSelf:()=>m(i,Z),fallback:s}))}):[])}if(r.type==="object"&&P==="object"&&r.properties){const H=I,B=R(Y(R({},$),{type:P,schema:$.schema,data:g||{}}),a);return ar.default.createElement(H,Y(R({key:$.scope},B),{isArrayChild:B.isArrayChild}),Object.entries(r.properties).map(([F,D])=>{var M;const Z=[...i,F];return ar.default.createElement(jo,{key:Z.join("."),fallback:s,fieldSchema:D,path:Z},ar.default.createElement(fl,{key:Z.join("."),components:n,fieldSchema:D,path:Z,required:((M=r.required)==null?void 0:M.includes(F))||!1,isArrayChild:!1,fallback:s}))}))}if(P==="discriminatedUnion"){const H=I,B=R(Y(R({},$),{type:P,schema:$.schema,data:g||{},discriminatorKey:(S==null?void 0:S.key)||null,discriminatorLabel:Vd((S==null?void 0:S.key)||"Unknown"),discriminatorOptions:(S==null?void 0:S.values)||null,discriminatorValue:_,setDiscriminator:T(F=>{if(!(S!=null&&S.key)){console.warn("No discriminator key found, cannot set discriminator");return}f(i,{[S.key]:F})},"setDiscriminator")}),a);return ar.default.createElement(H,Y(R({key:$.scope},B),{isArrayChild:B.isArrayChild}),E&&ar.default.createElement(jo,{key:i.join("."),fallback:s,fieldSchema:E,path:i},ar.default.createElement(fl,{components:n,fieldSchema:E,path:i,required:o,isArrayChild:!1,fallback:s})))}const O=I,q=R(Y(R({},$),{type:P,schema:$.schema,config:{},required:o,data:g,description:r.description}),a);return ar.default.createElement(O,R({},q))},"FormElementRenderer"),UT=T(({schema:e,components:t,onChange:n,value:r,disableValidation:i,fallback:o,dataTransform:s,onValidation:a})=>{const[c,l]=(0,No.useState)(r);return(0,No.useEffect)(()=>{n(c)},[c]),(0,No.useEffect)(()=>{const u=To(e);l(d=>cc(u,d))},[JSON.stringify(e),l]),No.default.createElement(HC,{formData:c,setFormData:l,formSchema:e,disableValidation:i||!1,dataTransform:s,onValidation:a},No.default.createElement(jo,{fallback:o,fieldSchema:e,path:[]},No.default.createElement(fl,{components:t,fieldSchema:e,path:[],fallback:o,required:!0,isArrayChild:!1})))},"ZuiForm"),BT={string:{},number:{slider:{id:"slider",params:He.object({})}},boolean:{switch:{id:"switch",params:He.object({})}},array:{},object:{},discriminatedUnion:{}},zT={jsonSchemaToZui:Xs,zuiToJsonSchema:ll,objectToZui:Do,toTypescript:dc};const yf={},gf=zd(Object.freeze(Object.defineProperty({__proto__:null,default:yf},Symbol.toStringTag,{value:"Module"})));function $v(e,t){return function(){return e.apply(t,arguments)}}const{toString:ZT}=Object.prototype,{getPrototypeOf:vf}=Object,pl=(e=>t=>{const n=ZT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),yr=e=>(e=e.toLowerCase(),t=>pl(t)===e),hl=e=>t=>typeof t===e,{isArray:Mo}=Array,Qs=hl("undefined");function VT(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&cr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Dv=yr("ArrayBuffer");function HT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Dv(e.buffer),t}const WT=hl("string"),cr=hl("function"),Nv=hl("number"),ml=e=>e!==null&&typeof e=="object",KT=e=>e===!0||e===!1,yl=e=>{if(pl(e)!=="object")return!1;const t=vf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},JT=yr("Date"),YT=yr("File"),GT=yr("Blob"),XT=yr("FileList"),QT=e=>ml(e)&&cr(e.pipe),eA=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||cr(e.append)&&((t=pl(e))==="formdata"||t==="object"&&cr(e.toString)&&e.toString()==="[object FormData]"))},tA=yr("URLSearchParams"),[nA,rA,iA,oA]=["ReadableStream","Request","Response","Headers"].map(yr),sA=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ea(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Mo(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(r=0;r<s;r++)a=o[r],t.call(null,e[a],a,e)}}function jv(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Mv=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),qv=e=>!Qs(e)&&e!==Mv;function bf(){const{caseless:e}=qv(this)&&this||{},t={},n=(r,i)=>{const o=e&&jv(t,i)||i;yl(t[o])&&yl(r)?t[o]=bf(t[o],r):yl(r)?t[o]=bf({},r):Mo(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ea(arguments[r],n);return t}const aA=(e,t,n,{allOwnKeys:r}={})=>(ea(t,(i,o)=>{n&&cr(i)?e[o]=$v(i,n):e[o]=i},{allOwnKeys:r}),e),cA=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),lA=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},uA=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&vf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},dA=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},fA=e=>{if(!e)return null;if(Mo(e))return e;let t=e.length;if(!Nv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},pA=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&vf(Uint8Array)),hA=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},mA=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},yA=yr("HTMLFormElement"),gA=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Lv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vA=yr("RegExp"),Fv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ea(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},bA=e=>{Fv(e,(t,n)=>{if(cr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(cr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wA=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Mo(e)?r(e):r(String(e).split(t)),n},xA=()=>{},_A=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,wf="abcdefghijklmnopqrstuvwxyz",Uv="0123456789",Bv={DIGIT:Uv,ALPHA:wf,ALPHA_DIGIT:wf+wf.toUpperCase()+Uv},SA=(e=16,t=Bv.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function EA(e){return!!(e&&cr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const kA=e=>{const t=new Array(10),n=(r,i)=>{if(ml(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=Mo(r)?[]:{};return ea(r,(s,a)=>{const c=n(s,i+1);!Qs(c)&&(o[a]=c)}),t[i]=void 0,o}}return r};return n(e,0)},CA=yr("AsyncFunction"),ee={isArray:Mo,isArrayBuffer:Dv,isBuffer:VT,isFormData:eA,isArrayBufferView:HT,isString:WT,isNumber:Nv,isBoolean:KT,isObject:ml,isPlainObject:yl,isReadableStream:nA,isRequest:rA,isResponse:iA,isHeaders:oA,isUndefined:Qs,isDate:JT,isFile:YT,isBlob:GT,isRegExp:vA,isFunction:cr,isStream:QT,isURLSearchParams:tA,isTypedArray:pA,isFileList:XT,forEach:ea,merge:bf,extend:aA,trim:sA,stripBOM:cA,inherits:lA,toFlatObject:uA,kindOf:pl,kindOfTest:yr,endsWith:dA,toArray:fA,forEachEntry:hA,matchAll:mA,isHTMLForm:yA,hasOwnProperty:Lv,hasOwnProp:Lv,reduceDescriptors:Fv,freezeMethods:bA,toObjectSet:wA,toCamelCase:gA,noop:xA,toFiniteNumber:_A,findKey:jv,global:Mv,isContextDefined:qv,ALPHABET:Bv,generateString:SA,isSpecCompliantForm:EA,toJSONObject:kA,isAsyncFn:CA,isThenable:e=>e&&(ml(e)||cr(e))&&cr(e.then)&&cr(e.catch)};function ct(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}ee.inherits(ct,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ee.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const zv=ct.prototype,Zv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Zv[e]={value:e}}),Object.defineProperties(ct,Zv),Object.defineProperty(zv,"isAxiosError",{value:!0}),ct.from=(e,t,n,r,i,o)=>{const s=Object.create(zv);return ee.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ct.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const TA=null;function xf(e){return ee.isPlainObject(e)||ee.isArray(e)}function Vv(e){return ee.endsWith(e,"[]")?e.slice(0,-2):e}function Hv(e,t,n){return e?e.concat(t).map(function(i,o){return i=Vv(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function AA(e){return ee.isArray(e)&&!e.some(xf)}const OA=ee.toFlatObject(ee,{},null,function(t){return/^is[A-Z]/.test(t)});function gl(e,t,n){if(!ee.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ee.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!ee.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&ee.isSpecCompliantForm(t);if(!ee.isFunction(i))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(ee.isDate(p))return p.toISOString();if(!c&&ee.isBlob(p))throw new ct("Blob is not supported. Use a Buffer instead.");return ee.isArrayBuffer(p)||ee.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let v=p;if(p&&!y&&typeof p=="object"){if(ee.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(ee.isArray(p)&&AA(p)||(ee.isFileList(p)||ee.endsWith(m,"[]"))&&(v=ee.toArray(p)))return m=Vv(m),v.forEach(function(b,S){!(ee.isUndefined(b)||b===null)&&t.append(s===!0?Hv([m],S,o):s===null?m:m+"[]",l(b))}),!1}return xf(p)?!0:(t.append(Hv(y,m,o),l(p)),!1)}const d=[],h=Object.assign(OA,{defaultVisitor:u,convertValue:l,isVisitable:xf});function f(p,m){if(!ee.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),ee.forEach(p,function(v,g){(!(ee.isUndefined(v)||v===null)&&i.call(t,v,ee.isString(g)?g.trim():g,m,h))===!0&&f(v,m?m.concat(g):[g])}),d.pop()}}if(!ee.isObject(e))throw new TypeError("data must be an object");return f(e),t}function Wv(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _f(e,t){this._pairs=[],e&&gl(e,this,t)}const Kv=_f.prototype;Kv.append=function(t,n){this._pairs.push([t,n])},Kv.toString=function(t){const n=t?function(r){return t.call(this,r,Wv)}:Wv;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function IA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Jv(e,t,n){if(!t)return e;const r=n&&n.encode||IA,i=n&&n.serialize;let o;if(i?o=i(t,n):o=ee.isURLSearchParams(t)?t.toString():new _f(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}const Yv=class{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ee.forEach(this.handlers,function(r){r!==null&&t(r)})}},Gv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},RA={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:_f,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Sf=typeof window<"u"&&typeof document<"u",PA=(e=>Sf&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),$A=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),DA=Sf&&window.location.href||"http://localhost",gr={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Sf,hasStandardBrowserEnv:PA,hasStandardBrowserWebWorkerEnv:$A,origin:DA},Symbol.toStringTag,{value:"Module"})),...RA};function NA(e,t){return gl(e,new gr.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return gr.isNode&&ee.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function jA(e){return ee.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function MA(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function Xv(e){function t(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=o>=n.length;return s=!s&&ee.isArray(i)?i.length:s,c?(ee.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!ee.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&ee.isArray(i[s])&&(i[s]=MA(i[s])),!a)}if(ee.isFormData(e)&&ee.isFunction(e.entries)){const n={};return ee.forEachEntry(e,(r,i)=>{t(jA(r),i,n,0)}),n}return null}function qA(e,t,n){if(ee.isString(e))try{return(t||JSON.parse)(e),ee.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Ef={transitional:Gv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=ee.isObject(t);if(o&&ee.isHTMLForm(t)&&(t=new FormData(t)),ee.isFormData(t))return i?JSON.stringify(Xv(t)):t;if(ee.isArrayBuffer(t)||ee.isBuffer(t)||ee.isStream(t)||ee.isFile(t)||ee.isBlob(t)||ee.isReadableStream(t))return t;if(ee.isArrayBufferView(t))return t.buffer;if(ee.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return NA(t,this.formSerializer).toString();if((a=ee.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return gl(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),qA(t)):t}],transformResponse:[function(t){const n=this.transitional||Ef.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ee.isResponse(t)||ee.isReadableStream(t))return t;if(t&&ee.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?ct.from(a,ct.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gr.classes.FormData,Blob:gr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ee.forEach(["delete","get","head","post","put","patch"],e=>{Ef.headers[e]={}});const kf=Ef,LA=ee.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),FA=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
69
|
+
`,i+="})"}let o=n?i?n+i:r?r==="z.never()"?n+".strict()":n+`.catchall(${r})`:n:i||(r?`z.record(${r})`:"z.record(z.any())");return Gt.an.anyOf(e)&&(o+=`.and(${Ov(Y(R({},e),{anyOf:e.anyOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?Y(R({},s),{type:"object"}):s)}),t)})`),Gt.a.oneOf(e)&&(o+=`.and(${mf(Y(R({},e),{oneOf:e.oneOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?Y(R({},s),{type:"object"}):s)}),t)})`),Gt.an.allOf(e)&&(o+=`.and(${Ys(Y(R({},e),{allOf:e.allOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?Y(R({},s),{type:"object"}):s)}),t)})`),o}T(Iv,"parseObject");var $T=T(e=>{var t;let n="z.string()";if((t=e[wt])!=null&&t.coerce){if(e.format==="date-time")return"z.coerce.date()";n="z.coerce.string()"}return n+=Cn(e,"format",({value:r})=>{switch(r){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime(",")"]}}),n+=Cn(e,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),n+=Cn(e,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),n+=Cn(e,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseString"),DT=T((e,t)=>`${ln(CT(e,"nullable"),t,!0)}.nullable()`,"parseNullable"),NT=T((e,t)=>{var n,r;if(e.oneOf.length<=1||!((n=e.discriminator)!=null&&n.propertyName))return mf(e,t);const i=e.oneOf.map((o,s)=>ln(o,Y(R({},t),{path:[...t.path,"oneOf",s]})));return`z.discriminatedUnion("${(r=e.discriminator)==null?void 0:r.propertyName}", [${i.join(", ")}])`},"parseDiscriminator"),ln=T((e,t={seen:new Map,path:[]},n)=>{if(typeof e!="object")return e?"z.any()":"z.never()";if(t.parserOverride){const o=t.parserOverride(e,t);if(typeof o=="string")return o}let r=t.seen.get(e);if(r){if(r.r!==void 0)return r.r;if(t.depth===void 0||r.n>=t.depth)return"z.any()";r.n+=1}else r={r:void 0,n:0},t.seen.set(e,r);let i=qT(e,t);return n||(i=jT(e,i),t.withoutDefaults||(i=MT(e,i))),r.r=i,i},"parseSchema"),jT=T((e,t)=>(e.description&&(t+=`.describe(${JSON.stringify(e.description)})`),t),"addMeta"),MT=T((e,t)=>(e.default!==void 0&&(t+=`.default(${JSON.stringify(e.default)})`),t),"addDefaults"),qT=T((e,t)=>Gt.a.nullable(e)?DT(e,t):Gt.an.object(e)?Iv(e,t):Gt.an.array(e)?AT(e,t):Gt.an.anyOf(e)?Ov(e,t):Gt.an.allOf(e)?Ys(e,t):Gt.a.discriminator(e)?NT(e,t):Gt.a.oneOf(e)?mf(e,t):Gt.a.not(e)?ST(e,t):Gt.an.enum(e)?IT(e):Gt.a.const(e)?OT(e):Gt.a.multipleType(e)?_T(e,t):Gt.a.primitive(e,"string")?$T(e):Gt.a.primitive(e,"number")||Gt.a.primitive(e,"integer")?PT(e):Gt.a.primitive(e,"boolean")?wT(e):Gt.a.primitive(e,"null")?ET(e):Gt.a.conditional(e)?RT(e,t):xT(e),"selectParser"),Gt={an:{object:T(e=>e.type==="object","object"),array:T(e=>e.type==="array","array"),anyOf:T(e=>e.anyOf!==void 0,"anyOf"),allOf:T(e=>e.allOf!==void 0,"allOf"),enum:T(e=>e.enum!==void 0,"enum")},a:{nullable:T(e=>e.nullable===!0,"nullable"),multipleType:T(e=>Array.isArray(e.type),"multipleType"),not:T(e=>e.not!==void 0,"not"),const:T(e=>e.const!==void 0,"const"),primitive:T((e,t)=>e.type===t,"primitive"),conditional:T(e=>!!("if"in e&&e.if&&"then"in e&&"else"in e&&e.then&&e.else),"conditional"),discriminator:T(e=>{var t;return e.oneOf!==void 0&&((t=e.discriminator)==null?void 0:t.propertyName)!==void 0},"discriminator"),oneOf:T(e=>e.oneOf!==void 0,"oneOf")}},LT=T(e=>ln(e,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),FT=T(e=>{let t=LT(e);return t=t.replaceAll("errors: z.ZodError[]","errors"),new Function("z",`return ${t}`)(mn)},"jsonSchemaToZod"),Gs=T((e,t)=>{var n,r;if(t[wt]&&e._def&&(e._def[wt]=t[wt]),((n=e._def)==null?void 0:n.typeName)==="ZodObject"&&t.type==="object"&&t.properties&&Object.entries(t.properties).forEach(([i,o])=>{const s=typeof e._def.shape=="function"?e._def.shape():e._def.shape;s[i]&&Gs(s[i],o)}),((r=e._def)==null?void 0:r.typeName)==="ZodRecord"&&t.type==="object"&&t.additionalProperties&&Gs(e._def.valueType,t.additionalProperties),t.type==="array"&&t.items){const i=t.items;if(typeof i=="object"&&!Array.isArray(i)){const o=e._def.type;o&&Gs(o,i)}else Array.isArray(i)&&i.forEach((o,s)=>{const a=e._def;a.typeName===mn.ZodFirstPartyTypeKind.ZodTuple&&Gs(a.items[s],o)})}},"applyZuiPropsRecursively"),Xs=T(e=>{const t=FT(e);return Gs(t,e),t},"jsonSchemaToZui"),No=sc(w,1),dl=sc(w,1),Rv=class extends dl.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError&&this.props.fallback?dl.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};T(Rv,"ErrorBoundary");var jo=Rv;function Pv(e,t){return n=>dl.default.createElement(jo,{fallback:t,fieldSchema:n.fieldSchema,path:n.path},dl.default.createElement(e,R({},n)))}T(Pv,"withErrorBoundary");var ar=sc(w,1),fl=T(e=>{var t=e,{components:n,fieldSchema:r,path:i,required:o,fallback:s}=t,a=uy(t,["components","fieldSchema","path","required","fallback"]),c,l;const{formData:u,disabled:d,hidden:p,handlePropertyChange:f,addArrayItem:h,removeArrayItem:m,formErrors:y,formValid:g}=gy(r,i),v=(0,ar.useMemo)(()=>Vi(u,i),[u,i]),b=(0,ar.useMemo)(()=>YC(n,r),[r,n]),{discriminator:S,discriminatedSchema:E,discriminatorValue:_}=WC(r,i);if(!b||p===!0)return null;const{Component:I,type:P}=b,$={type:P,componentID:b.id,scope:i.join("."),context:{path:i,readonly:!1,formData:u,formErrors:y,formValid:g,updateForm:f,updateFormData:T(H=>f([],H),"updateFormData")},onChange:T(H=>f(i,H),"onChange"),disabled:d,errors:(y==null?void 0:y.filter(H=>H.path===i))||[],label:((c=r[wt])==null?void 0:c.title)||Vd(((l=i[i.length-1])==null?void 0:l.toString())||""),params:b.params,schema:r,zuiProps:r[wt]};if(r.type==="array"&&P==="array"){const H=I,B=$.schema,F=Array.isArray(v)||typeof v=="object"?v:[],D=R(Y(R({},$),{type:P,schema:B,data:F,addItem:T(M=>h(i,M),"addItem"),removeItem:T(M=>m(i,M),"removeItem")}),a);return Array.isArray(r.items)?null:ar.default.createElement(H,Y(R({key:$.scope},D),{isArrayChild:D.isArrayChild}),Array.isArray(D.data)?D.data.map((M,Z)=>{const W=[...i,Z.toString()];return ar.default.createElement(jo,{key:W.join("."),fallback:s,fieldSchema:r.items,path:W},ar.default.createElement(fl,{key:W.join("."),components:n,fieldSchema:r.items,path:W,required:o,isArrayChild:!0,index:Z,removeSelf:()=>m(i,Z),fallback:s}))}):[])}if(r.type==="object"&&P==="object"&&r.properties){const H=I,B=R(Y(R({},$),{type:P,schema:$.schema,data:v||{}}),a);return ar.default.createElement(H,Y(R({key:$.scope},B),{isArrayChild:B.isArrayChild}),Object.entries(r.properties).map(([F,D])=>{var M;const Z=[...i,F];return ar.default.createElement(jo,{key:Z.join("."),fallback:s,fieldSchema:D,path:Z},ar.default.createElement(fl,{key:Z.join("."),components:n,fieldSchema:D,path:Z,required:((M=r.required)==null?void 0:M.includes(F))||!1,isArrayChild:!1,fallback:s}))}))}if(P==="discriminatedUnion"){const H=I,B=R(Y(R({},$),{type:P,schema:$.schema,data:v||{},discriminatorKey:(S==null?void 0:S.key)||null,discriminatorLabel:Vd((S==null?void 0:S.key)||"Unknown"),discriminatorOptions:(S==null?void 0:S.values)||null,discriminatorValue:_,setDiscriminator:T(F=>{if(!(S!=null&&S.key)){console.warn("No discriminator key found, cannot set discriminator");return}f(i,{[S.key]:F})},"setDiscriminator")}),a);return ar.default.createElement(H,Y(R({key:$.scope},B),{isArrayChild:B.isArrayChild}),E&&ar.default.createElement(jo,{key:i.join("."),fallback:s,fieldSchema:E,path:i},ar.default.createElement(fl,{components:n,fieldSchema:E,path:i,required:o,isArrayChild:!1,fallback:s})))}const O=I,q=R(Y(R({},$),{type:P,schema:$.schema,config:{},required:o,data:v,description:r.description}),a);return ar.default.createElement(O,R({},q))},"FormElementRenderer"),UT=T(({schema:e,components:t,onChange:n,value:r,disableValidation:i,fallback:o,dataTransform:s,onValidation:a})=>{const[c,l]=(0,No.useState)(r);return(0,No.useEffect)(()=>{n(c)},[c]),(0,No.useEffect)(()=>{const u=To(e);l(d=>cc(u,d))},[JSON.stringify(e),l]),No.default.createElement(HC,{formData:c,setFormData:l,formSchema:e,disableValidation:i||!1,dataTransform:s,onValidation:a},No.default.createElement(jo,{fallback:o,fieldSchema:e,path:[]},No.default.createElement(fl,{components:t,fieldSchema:e,path:[],fallback:o,required:!0,isArrayChild:!1})))},"ZuiForm"),BT={string:{},number:{slider:{id:"slider",params:He.object({})}},boolean:{switch:{id:"switch",params:He.object({})}},array:{},object:{},discriminatedUnion:{}},zT={jsonSchemaToZui:Xs,zuiToJsonSchema:ll,objectToZui:Do,toTypescript:dc};const yf={},gf=zd(Object.freeze(Object.defineProperty({__proto__:null,default:yf},Symbol.toStringTag,{value:"Module"})));function $v(e,t){return function(){return e.apply(t,arguments)}}const{toString:ZT}=Object.prototype,{getPrototypeOf:vf}=Object,pl=(e=>t=>{const n=ZT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),yr=e=>(e=e.toLowerCase(),t=>pl(t)===e),hl=e=>t=>typeof t===e,{isArray:Mo}=Array,Qs=hl("undefined");function VT(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&cr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Dv=yr("ArrayBuffer");function HT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Dv(e.buffer),t}const WT=hl("string"),cr=hl("function"),Nv=hl("number"),ml=e=>e!==null&&typeof e=="object",KT=e=>e===!0||e===!1,yl=e=>{if(pl(e)!=="object")return!1;const t=vf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},JT=yr("Date"),YT=yr("File"),GT=yr("Blob"),XT=yr("FileList"),QT=e=>ml(e)&&cr(e.pipe),eA=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||cr(e.append)&&((t=pl(e))==="formdata"||t==="object"&&cr(e.toString)&&e.toString()==="[object FormData]"))},tA=yr("URLSearchParams"),[nA,rA,iA,oA]=["ReadableStream","Request","Response","Headers"].map(yr),sA=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ea(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Mo(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(r=0;r<s;r++)a=o[r],t.call(null,e[a],a,e)}}function jv(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Mv=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),qv=e=>!Qs(e)&&e!==Mv;function bf(){const{caseless:e}=qv(this)&&this||{},t={},n=(r,i)=>{const o=e&&jv(t,i)||i;yl(t[o])&&yl(r)?t[o]=bf(t[o],r):yl(r)?t[o]=bf({},r):Mo(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ea(arguments[r],n);return t}const aA=(e,t,n,{allOwnKeys:r}={})=>(ea(t,(i,o)=>{n&&cr(i)?e[o]=$v(i,n):e[o]=i},{allOwnKeys:r}),e),cA=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),lA=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},uA=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&vf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},dA=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},fA=e=>{if(!e)return null;if(Mo(e))return e;let t=e.length;if(!Nv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},pA=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&vf(Uint8Array)),hA=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},mA=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},yA=yr("HTMLFormElement"),gA=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Lv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vA=yr("RegExp"),Fv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ea(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},bA=e=>{Fv(e,(t,n)=>{if(cr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(cr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wA=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Mo(e)?r(e):r(String(e).split(t)),n},xA=()=>{},_A=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,wf="abcdefghijklmnopqrstuvwxyz",Uv="0123456789",Bv={DIGIT:Uv,ALPHA:wf,ALPHA_DIGIT:wf+wf.toUpperCase()+Uv},SA=(e=16,t=Bv.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function EA(e){return!!(e&&cr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const kA=e=>{const t=new Array(10),n=(r,i)=>{if(ml(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=Mo(r)?[]:{};return ea(r,(s,a)=>{const c=n(s,i+1);!Qs(c)&&(o[a]=c)}),t[i]=void 0,o}}return r};return n(e,0)},CA=yr("AsyncFunction"),ee={isArray:Mo,isArrayBuffer:Dv,isBuffer:VT,isFormData:eA,isArrayBufferView:HT,isString:WT,isNumber:Nv,isBoolean:KT,isObject:ml,isPlainObject:yl,isReadableStream:nA,isRequest:rA,isResponse:iA,isHeaders:oA,isUndefined:Qs,isDate:JT,isFile:YT,isBlob:GT,isRegExp:vA,isFunction:cr,isStream:QT,isURLSearchParams:tA,isTypedArray:pA,isFileList:XT,forEach:ea,merge:bf,extend:aA,trim:sA,stripBOM:cA,inherits:lA,toFlatObject:uA,kindOf:pl,kindOfTest:yr,endsWith:dA,toArray:fA,forEachEntry:hA,matchAll:mA,isHTMLForm:yA,hasOwnProperty:Lv,hasOwnProp:Lv,reduceDescriptors:Fv,freezeMethods:bA,toObjectSet:wA,toCamelCase:gA,noop:xA,toFiniteNumber:_A,findKey:jv,global:Mv,isContextDefined:qv,ALPHABET:Bv,generateString:SA,isSpecCompliantForm:EA,toJSONObject:kA,isAsyncFn:CA,isThenable:e=>e&&(ml(e)||cr(e))&&cr(e.then)&&cr(e.catch)};function ct(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}ee.inherits(ct,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ee.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const zv=ct.prototype,Zv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Zv[e]={value:e}}),Object.defineProperties(ct,Zv),Object.defineProperty(zv,"isAxiosError",{value:!0}),ct.from=(e,t,n,r,i,o)=>{const s=Object.create(zv);return ee.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ct.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const TA=null;function xf(e){return ee.isPlainObject(e)||ee.isArray(e)}function Vv(e){return ee.endsWith(e,"[]")?e.slice(0,-2):e}function Hv(e,t,n){return e?e.concat(t).map(function(i,o){return i=Vv(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function AA(e){return ee.isArray(e)&&!e.some(xf)}const OA=ee.toFlatObject(ee,{},null,function(t){return/^is[A-Z]/.test(t)});function gl(e,t,n){if(!ee.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ee.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!ee.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&ee.isSpecCompliantForm(t);if(!ee.isFunction(i))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(ee.isDate(h))return h.toISOString();if(!c&&ee.isBlob(h))throw new ct("Blob is not supported. Use a Buffer instead.");return ee.isArrayBuffer(h)||ee.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,m,y){let g=h;if(h&&!y&&typeof h=="object"){if(ee.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(ee.isArray(h)&&AA(h)||(ee.isFileList(h)||ee.endsWith(m,"[]"))&&(g=ee.toArray(h)))return m=Vv(m),g.forEach(function(b,S){!(ee.isUndefined(b)||b===null)&&t.append(s===!0?Hv([m],S,o):s===null?m:m+"[]",l(b))}),!1}return xf(h)?!0:(t.append(Hv(y,m,o),l(h)),!1)}const d=[],p=Object.assign(OA,{defaultVisitor:u,convertValue:l,isVisitable:xf});function f(h,m){if(!ee.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),ee.forEach(h,function(g,v){(!(ee.isUndefined(g)||g===null)&&i.call(t,g,ee.isString(v)?v.trim():v,m,p))===!0&&f(g,m?m.concat(v):[v])}),d.pop()}}if(!ee.isObject(e))throw new TypeError("data must be an object");return f(e),t}function Wv(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _f(e,t){this._pairs=[],e&&gl(e,this,t)}const Kv=_f.prototype;Kv.append=function(t,n){this._pairs.push([t,n])},Kv.toString=function(t){const n=t?function(r){return t.call(this,r,Wv)}:Wv;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function IA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Jv(e,t,n){if(!t)return e;const r=n&&n.encode||IA,i=n&&n.serialize;let o;if(i?o=i(t,n):o=ee.isURLSearchParams(t)?t.toString():new _f(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}const Yv=class{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ee.forEach(this.handlers,function(r){r!==null&&t(r)})}},Gv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},RA={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:_f,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Sf=typeof window<"u"&&typeof document<"u",PA=(e=>Sf&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),$A=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),DA=Sf&&window.location.href||"http://localhost",gr={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Sf,hasStandardBrowserEnv:PA,hasStandardBrowserWebWorkerEnv:$A,origin:DA},Symbol.toStringTag,{value:"Module"})),...RA};function NA(e,t){return gl(e,new gr.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return gr.isNode&&ee.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function jA(e){return ee.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function MA(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function Xv(e){function t(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=o>=n.length;return s=!s&&ee.isArray(i)?i.length:s,c?(ee.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!ee.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&ee.isArray(i[s])&&(i[s]=MA(i[s])),!a)}if(ee.isFormData(e)&&ee.isFunction(e.entries)){const n={};return ee.forEachEntry(e,(r,i)=>{t(jA(r),i,n,0)}),n}return null}function qA(e,t,n){if(ee.isString(e))try{return(t||JSON.parse)(e),ee.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Ef={transitional:Gv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=ee.isObject(t);if(o&&ee.isHTMLForm(t)&&(t=new FormData(t)),ee.isFormData(t))return i?JSON.stringify(Xv(t)):t;if(ee.isArrayBuffer(t)||ee.isBuffer(t)||ee.isStream(t)||ee.isFile(t)||ee.isBlob(t)||ee.isReadableStream(t))return t;if(ee.isArrayBufferView(t))return t.buffer;if(ee.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return NA(t,this.formSerializer).toString();if((a=ee.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return gl(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),qA(t)):t}],transformResponse:[function(t){const n=this.transitional||Ef.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ee.isResponse(t)||ee.isReadableStream(t))return t;if(t&&ee.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?ct.from(a,ct.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gr.classes.FormData,Blob:gr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ee.forEach(["delete","get","head","post","put","patch"],e=>{Ef.headers[e]={}});const kf=Ef,LA=ee.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),FA=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
70
70
|
`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&LA[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Qv=Symbol("internals");function ta(e){return e&&String(e).trim().toLowerCase()}function vl(e){return e===!1||e==null?e:ee.isArray(e)?e.map(vl):String(e)}function UA(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const BA=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Cf(e,t,n,r,i){if(ee.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!ee.isString(t)){if(ee.isString(r))return t.indexOf(r)!==-1;if(ee.isRegExp(r))return r.test(t)}}function zA(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function ZA(e,t){const n=ee.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}let bl=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,c,l){const u=ta(c);if(!u)throw new Error("header name must be a non-empty string");const d=ee.findKey(i,u);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=vl(a))}const s=(a,c)=>ee.forEach(a,(l,u)=>o(l,u,c));if(ee.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(ee.isString(t)&&(t=t.trim())&&!BA(t))s(FA(t),n);else if(ee.isHeaders(t))for(const[a,c]of t.entries())o(c,a,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=ta(t),t){const r=ee.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return UA(i);if(ee.isFunction(n))return n.call(this,i,r);if(ee.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ta(t),t){const r=ee.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Cf(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=ta(s),s){const a=ee.findKey(r,s);a&&(!n||Cf(r,r[a],a,n))&&(delete r[a],i=!0)}}return ee.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Cf(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return ee.forEach(this,(i,o)=>{const s=ee.findKey(r,o);if(s){n[s]=vl(i),delete n[o];return}const a=t?zA(o):String(o).trim();a!==o&&delete n[o],n[a]=vl(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ee.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&ee.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
71
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Qv]=this[Qv]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=ta(s);r[a]||(ZA(i,s),r[a]=!0)}return ee.isArray(t)?t.forEach(o):o(t),this}};bl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ee.reduceDescriptors(bl.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),ee.freezeMethods(bl);const vr=bl;function Tf(e,t){const n=this||kf,r=t||n,i=vr.from(r.headers);let o=r.data;return ee.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function eb(e){return!!(e&&e.__CANCEL__)}function qo(e,t,n){ct.call(this,e??"canceled",ct.ERR_CANCELED,t,n),this.name="CanceledError"}ee.inherits(qo,ct,{__CANCEL__:!0});function tb(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ct("Request failed with status code "+n.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function VA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function HA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[o];s||(s=l),n[i]=c,r[i]=l;let d=o,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const f=u&&l-u;return f?Math.round(h*1e3/f):void 0}}function WA(e,t){let n=0;const r=1e3/t;let i=null;return function(){const s=this===!0,a=Date.now();if(s||a-n>r)return i&&(clearTimeout(i),i=null),n=a,e.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),e.apply(null,arguments)),r-(a-n)))}}const wl=(e,t,n=3)=>{let r=0;const i=HA(50,250);return WA(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-r,l=i(c),u=s<=a;r=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-s)/l:void 0,event:o,lengthComputable:a!=null};d[t?"download":"upload"]=!0,e(d)},n)},KA=gr.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=ee.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),JA=gr.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];ee.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ee.isString(r)&&s.push("path="+r),ee.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function YA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function GA(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function nb(e,t){return e&&!YA(t)?GA(e,t):t}const rb=e=>e instanceof vr?{...e}:e;function Gi(e,t){t=t||{};const n={};function r(l,u,d){return ee.isPlainObject(l)&&ee.isPlainObject(u)?ee.merge.call({caseless:d},l,u):ee.isPlainObject(u)?ee.merge({},u):ee.isArray(u)?u.slice():u}function i(l,u,d){if(ee.isUndefined(u)){if(!ee.isUndefined(l))return r(void 0,l,d)}else return r(l,u,d)}function o(l,u){if(!ee.isUndefined(u))return r(void 0,u)}function s(l,u){if(ee.isUndefined(u)){if(!ee.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u)=>i(rb(l),rb(u),!0)};return ee.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||i,h=d(e[u],t[u],u);ee.isUndefined(h)&&d!==a||(n[u]=h)}),n}const ib=e=>{const t=Gi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=vr.from(s),t.url=Jv(nb(t.baseURL,t.url),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(ee.isFormData(n)){if(gr.hasStandardBrowserEnv||gr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(gr.hasStandardBrowserEnv&&(r&&ee.isFunction(r)&&(r=r(t)),r||r!==!1&&KA(t.url))){const l=i&&o&&JA.read(o);l&&s.set(i,l)}return t},XA=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=ib(e);let o=i.data;const s=vr.from(i.headers).normalize();let{responseType:a}=i,c;function l(){i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let u=new XMLHttpRequest;u.open(i.method.toUpperCase(),i.url,!0),u.timeout=i.timeout;function d(){if(!u)return;const f=vr.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),m={data:!a||a==="text"||a==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:f,config:e,request:u};tb(function(v){n(v),l()},function(v){r(v),l()},m),u=null}"onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(d)},u.onabort=function(){u&&(r(new ct("Request aborted",ct.ECONNABORTED,i,u)),u=null)},u.onerror=function(){r(new ct("Network Error",ct.ERR_NETWORK,i,u)),u=null},u.ontimeout=function(){let p=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const m=i.transitional||Gv;i.timeoutErrorMessage&&(p=i.timeoutErrorMessage),r(new ct(p,m.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,i,u)),u=null},o===void 0&&s.setContentType(null),"setRequestHeader"in u&&ee.forEach(s.toJSON(),function(p,m){u.setRequestHeader(m,p)}),ee.isUndefined(i.withCredentials)||(u.withCredentials=!!i.withCredentials),a&&a!=="json"&&(u.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&u.addEventListener("progress",wl(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",wl(i.onUploadProgress)),(i.cancelToken||i.signal)&&(c=f=>{u&&(r(!f||f.type?new qo(null,e,u):f),u.abort(),u=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const h=VA(i.url);if(h&&gr.protocols.indexOf(h)===-1){r(new ct("Unsupported protocol "+h+":",ct.ERR_BAD_REQUEST,e));return}u.send(o||null)})},QA=(e,t)=>{let n=new AbortController,r;const i=function(c){if(!r){r=!0,s();const l=c instanceof Error?c:this.reason;n.abort(l instanceof ct?l:new qo(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{i(new ct(`timeout ${t} of ms exceeded`,ct.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",i):c.unsubscribe(i))}),e=null)};e.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",i));const{signal:a}=n;return a.unsubscribe=s,[a,()=>{o&&clearTimeout(o),o=null}]},eO=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},tO=async function*(e,t,n){for await(const r of e)yield*eO(ArrayBuffer.isView(r)?r:await n(String(r)),t)},ob=(e,t,n,r,i)=>{const o=tO(e,t,i);let s=0;return new ReadableStream({type:"bytes",async pull(a){const{done:c,value:l}=await o.next();if(c){a.close(),r();return}let u=l.byteLength;n&&n(s+=u),a.enqueue(new Uint8Array(l))},cancel(a){return r(a),o.return()}},{highWaterMark:2})},sb=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},xl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ab=xl&&typeof ReadableStream=="function",Af=xl&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),nO=ab&&(()=>{let e=!1;const t=new Request(gr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),cb=64*1024,Of=ab&&!!(()=>{try{return ee.isReadableStream(new Response("").body)}catch{}})(),_l={stream:Of&&(e=>e.body)};xl&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_l[t]&&(_l[t]=ee.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ct(`Response type '${t}' is not supported`,ct.ERR_NOT_SUPPORT,r)})})})(new Response);const rO=async e=>{if(e==null)return 0;if(ee.isBlob(e))return e.size;if(ee.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(ee.isArrayBufferView(e))return e.byteLength;if(ee.isURLSearchParams(e)&&(e=e+""),ee.isString(e))return(await Af(e)).byteLength},iO=async(e,t)=>{const n=ee.toFiniteNumber(e.getContentLength());return n??rO(t)},If={http:TA,xhr:XA,fetch:xl&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:h}=ib(e);l=l?(l+"").toLowerCase():"text";let[f,p]=i||o||s?QA([i,o],s):[],m,y;const v=()=>{!m&&setTimeout(()=>{f&&f.unsubscribe()}),m=!0};let g;try{if(c&&nO&&n!=="get"&&n!=="head"&&(g=await iO(u,r))!==0){let _=new Request(t,{method:"POST",body:r,duplex:"half"}),I;ee.isFormData(r)&&(I=_.headers.get("content-type"))&&u.setContentType(I),_.body&&(r=ob(_.body,cb,sb(g,wl(c)),null,Af))}ee.isString(d)||(d=d?"cors":"omit"),y=new Request(t,{...h,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let b=await fetch(y);const S=Of&&(l==="stream"||l==="response");if(Of&&(a||S)){const _={};["status","statusText","headers"].forEach(P=>{_[P]=b[P]});const I=ee.toFiniteNumber(b.headers.get("content-length"));b=new Response(ob(b.body,cb,a&&sb(I,wl(a,!0)),S&&v,Af),_)}l=l||"text";let E=await _l[ee.findKey(_l,l)||"text"](b,e);return!S&&v(),p&&p(),await new Promise((_,I)=>{tb(_,I,{data:E,headers:vr.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:y})})}catch(b){throw v(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new ct("Network Error",ct.ERR_NETWORK,e,y),{cause:b.cause||b}):ct.from(b,b&&b.code,e,y)}})};ee.forEach(If,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const lb=e=>`- ${e}`,oO=e=>ee.isFunction(e)||e===null||e===!1,ub={getAdapter:e=>{e=ee.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){n=e[o];let s;if(r=n,!oO(n)&&(r=If[(s=String(n)).toLowerCase()],r===void 0))throw new ct(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
|
|
71
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Qv]=this[Qv]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=ta(s);r[a]||(ZA(i,s),r[a]=!0)}return ee.isArray(t)?t.forEach(o):o(t),this}};bl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ee.reduceDescriptors(bl.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),ee.freezeMethods(bl);const vr=bl;function Tf(e,t){const n=this||kf,r=t||n,i=vr.from(r.headers);let o=r.data;return ee.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function eb(e){return!!(e&&e.__CANCEL__)}function qo(e,t,n){ct.call(this,e??"canceled",ct.ERR_CANCELED,t,n),this.name="CanceledError"}ee.inherits(qo,ct,{__CANCEL__:!0});function tb(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ct("Request failed with status code "+n.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function VA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function HA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[o];s||(s=l),n[i]=c,r[i]=l;let d=o,p=0;for(;d!==i;)p+=n[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const f=u&&l-u;return f?Math.round(p*1e3/f):void 0}}function WA(e,t){let n=0;const r=1e3/t;let i=null;return function(){const s=this===!0,a=Date.now();if(s||a-n>r)return i&&(clearTimeout(i),i=null),n=a,e.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),e.apply(null,arguments)),r-(a-n)))}}const wl=(e,t,n=3)=>{let r=0;const i=HA(50,250);return WA(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-r,l=i(c),u=s<=a;r=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-s)/l:void 0,event:o,lengthComputable:a!=null};d[t?"download":"upload"]=!0,e(d)},n)},KA=gr.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=ee.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),JA=gr.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];ee.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ee.isString(r)&&s.push("path="+r),ee.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function YA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function GA(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function nb(e,t){return e&&!YA(t)?GA(e,t):t}const rb=e=>e instanceof vr?{...e}:e;function Gi(e,t){t=t||{};const n={};function r(l,u,d){return ee.isPlainObject(l)&&ee.isPlainObject(u)?ee.merge.call({caseless:d},l,u):ee.isPlainObject(u)?ee.merge({},u):ee.isArray(u)?u.slice():u}function i(l,u,d){if(ee.isUndefined(u)){if(!ee.isUndefined(l))return r(void 0,l,d)}else return r(l,u,d)}function o(l,u){if(!ee.isUndefined(u))return r(void 0,u)}function s(l,u){if(ee.isUndefined(u)){if(!ee.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u)=>i(rb(l),rb(u),!0)};return ee.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||i,p=d(e[u],t[u],u);ee.isUndefined(p)&&d!==a||(n[u]=p)}),n}const ib=e=>{const t=Gi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=vr.from(s),t.url=Jv(nb(t.baseURL,t.url),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(ee.isFormData(n)){if(gr.hasStandardBrowserEnv||gr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(gr.hasStandardBrowserEnv&&(r&&ee.isFunction(r)&&(r=r(t)),r||r!==!1&&KA(t.url))){const l=i&&o&&JA.read(o);l&&s.set(i,l)}return t},XA=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=ib(e);let o=i.data;const s=vr.from(i.headers).normalize();let{responseType:a}=i,c;function l(){i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let u=new XMLHttpRequest;u.open(i.method.toUpperCase(),i.url,!0),u.timeout=i.timeout;function d(){if(!u)return;const f=vr.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),m={data:!a||a==="text"||a==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:f,config:e,request:u};tb(function(g){n(g),l()},function(g){r(g),l()},m),u=null}"onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(d)},u.onabort=function(){u&&(r(new ct("Request aborted",ct.ECONNABORTED,i,u)),u=null)},u.onerror=function(){r(new ct("Network Error",ct.ERR_NETWORK,i,u)),u=null},u.ontimeout=function(){let h=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const m=i.transitional||Gv;i.timeoutErrorMessage&&(h=i.timeoutErrorMessage),r(new ct(h,m.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,i,u)),u=null},o===void 0&&s.setContentType(null),"setRequestHeader"in u&&ee.forEach(s.toJSON(),function(h,m){u.setRequestHeader(m,h)}),ee.isUndefined(i.withCredentials)||(u.withCredentials=!!i.withCredentials),a&&a!=="json"&&(u.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&u.addEventListener("progress",wl(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",wl(i.onUploadProgress)),(i.cancelToken||i.signal)&&(c=f=>{u&&(r(!f||f.type?new qo(null,e,u):f),u.abort(),u=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const p=VA(i.url);if(p&&gr.protocols.indexOf(p)===-1){r(new ct("Unsupported protocol "+p+":",ct.ERR_BAD_REQUEST,e));return}u.send(o||null)})},QA=(e,t)=>{let n=new AbortController,r;const i=function(c){if(!r){r=!0,s();const l=c instanceof Error?c:this.reason;n.abort(l instanceof ct?l:new qo(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{i(new ct(`timeout ${t} of ms exceeded`,ct.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",i):c.unsubscribe(i))}),e=null)};e.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",i));const{signal:a}=n;return a.unsubscribe=s,[a,()=>{o&&clearTimeout(o),o=null}]},eO=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},tO=async function*(e,t,n){for await(const r of e)yield*eO(ArrayBuffer.isView(r)?r:await n(String(r)),t)},ob=(e,t,n,r,i)=>{const o=tO(e,t,i);let s=0;return new ReadableStream({type:"bytes",async pull(a){const{done:c,value:l}=await o.next();if(c){a.close(),r();return}let u=l.byteLength;n&&n(s+=u),a.enqueue(new Uint8Array(l))},cancel(a){return r(a),o.return()}},{highWaterMark:2})},sb=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},xl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ab=xl&&typeof ReadableStream=="function",Af=xl&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),nO=ab&&(()=>{let e=!1;const t=new Request(gr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),cb=64*1024,Of=ab&&!!(()=>{try{return ee.isReadableStream(new Response("").body)}catch{}})(),_l={stream:Of&&(e=>e.body)};xl&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_l[t]&&(_l[t]=ee.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ct(`Response type '${t}' is not supported`,ct.ERR_NOT_SUPPORT,r)})})})(new Response);const rO=async e=>{if(e==null)return 0;if(ee.isBlob(e))return e.size;if(ee.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(ee.isArrayBufferView(e))return e.byteLength;if(ee.isURLSearchParams(e)&&(e=e+""),ee.isString(e))return(await Af(e)).byteLength},iO=async(e,t)=>{const n=ee.toFiniteNumber(e.getContentLength());return n??rO(t)},If={http:TA,xhr:XA,fetch:xl&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:p}=ib(e);l=l?(l+"").toLowerCase():"text";let[f,h]=i||o||s?QA([i,o],s):[],m,y;const g=()=>{!m&&setTimeout(()=>{f&&f.unsubscribe()}),m=!0};let v;try{if(c&&nO&&n!=="get"&&n!=="head"&&(v=await iO(u,r))!==0){let _=new Request(t,{method:"POST",body:r,duplex:"half"}),I;ee.isFormData(r)&&(I=_.headers.get("content-type"))&&u.setContentType(I),_.body&&(r=ob(_.body,cb,sb(v,wl(c)),null,Af))}ee.isString(d)||(d=d?"cors":"omit"),y=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let b=await fetch(y);const S=Of&&(l==="stream"||l==="response");if(Of&&(a||S)){const _={};["status","statusText","headers"].forEach(P=>{_[P]=b[P]});const I=ee.toFiniteNumber(b.headers.get("content-length"));b=new Response(ob(b.body,cb,a&&sb(I,wl(a,!0)),S&&g,Af),_)}l=l||"text";let E=await _l[ee.findKey(_l,l)||"text"](b,e);return!S&&g(),h&&h(),await new Promise((_,I)=>{tb(_,I,{data:E,headers:vr.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:y})})}catch(b){throw g(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new ct("Network Error",ct.ERR_NETWORK,e,y),{cause:b.cause||b}):ct.from(b,b&&b.code,e,y)}})};ee.forEach(If,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const lb=e=>`- ${e}`,oO=e=>ee.isFunction(e)||e===null||e===!1,ub={getAdapter:e=>{e=ee.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){n=e[o];let s;if(r=n,!oO(n)&&(r=If[(s=String(n)).toLowerCase()],r===void 0))throw new ct(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
|
|
72
72
|
`+o.map(lb).join(`
|
|
73
73
|
`):" "+lb(o[0]):"as no adapter specified";throw new ct("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:If};function Rf(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new qo(null,e)}function db(e){return Rf(e),e.headers=vr.from(e.headers),e.data=Tf.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ub.getAdapter(e.adapter||kf.adapter)(e).then(function(r){return Rf(e),r.data=Tf.call(e,e.transformResponse,r),r.headers=vr.from(r.headers),r},function(r){return eb(r)||(Rf(e),r&&r.response&&(r.response.data=Tf.call(e,e.transformResponse,r.response),r.response.headers=vr.from(r.response.headers))),Promise.reject(r)})}const fb="1.7.2",Pf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const pb={};Pf.transitional=function(t,n,r){function i(o,s){return"[Axios v"+fb+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new ct(i(s," has been removed"+(n?" in "+n:"")),ct.ERR_DEPRECATED);return n&&!pb[s]&&(pb[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};function sO(e,t,n){if(typeof e!="object")throw new ct("options must be an object",ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new ct("option "+o+" must be "+c,ct.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ct("Unknown option "+o,ct.ERR_BAD_OPTION)}}const $f={assertOptions:sO,validators:Pf},vi=$f.validators;let Sl=class{constructor(t){this.defaults=t,this.interceptors={request:new Yv,response:new Yv}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
74
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Gi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&$f.assertOptions(r,{silentJSONParsing:vi.transitional(vi.boolean),forcedJSONParsing:vi.transitional(vi.boolean),clarifyTimeoutError:vi.transitional(vi.boolean)},!1),i!=null&&(ee.isFunction(i)?n.paramsSerializer={serialize:i}:$f.assertOptions(i,{encode:vi.function,serialize:vi.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&ee.merge(o.common,o[n.method]);o&&ee.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=vr.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!c){const p=[db.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(y){m.call(this,y);break}}try{u=db.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Gi(this.defaults,t);const n=nb(t.baseURL,t.url);return Jv(n,t.params,t.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(t){Sl.prototype[t]=function(n,r){return this.request(Gi(r||{},{method:t,url:n,data:(r||{}).data}))}}),ee.forEach(["post","put","patch"],function(t){function n(r){return function(o,s,a){return this.request(Gi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Sl.prototype[t]=n(),Sl.prototype[t+"Form"]=n(!0)});const El=Sl,aO=class MC{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new qo(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new MC(function(i){t=i}),cancel:t}}};function cO(e){return function(n){return e.apply(null,n)}}function lO(e){return ee.isObject(e)&&e.isAxiosError===!0}const Df={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Df).forEach(([e,t])=>{Df[t]=e});const uO=Df;function hb(e){const t=new El(e),n=$v(El.prototype.request,t);return ee.extend(n,El.prototype,t,{allOwnKeys:!0}),ee.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return hb(Gi(e,i))},n}const Xt=hb(kf);Xt.Axios=El,Xt.CanceledError=qo,Xt.CancelToken=aO,Xt.isCancel=eb,Xt.VERSION=fb,Xt.toFormData=gl,Xt.AxiosError=ct,Xt.Cancel=Xt.CanceledError,Xt.all=function(t){return Promise.all(t)},Xt.spread=cO,Xt.isAxiosError=lO,Xt.mergeConfig=Gi,Xt.AxiosHeaders=vr,Xt.formToJSON=e=>Xv(ee.isHTMLForm(e)?new FormData(e):e),Xt.getAdapter=ub.getAdapter,Xt.HttpStatusCode=uO,Xt.default=Xt;const Lo=Xt,{Axios:dO,AxiosError:fO,CanceledError:pO,isCancel:hO,CancelToken:mO,VERSION:yO,all:gO,Cancel:vO,isAxiosError:bO,spread:wO,toFormData:xO,AxiosHeaders:_O,HttpStatusCode:SO,formToJSON:EO,getAdapter:kO,mergeConfig:CO}=Lo,TO=Object.freeze(Object.defineProperty({__proto__:null,Axios:dO,AxiosError:fO,AxiosHeaders:_O,Cancel:vO,CancelToken:mO,CanceledError:pO,HttpStatusCode:SO,VERSION:yO,all:gO,default:Lo,formToJSON:EO,getAdapter:kO,isAxiosError:bO,isCancel:hO,mergeConfig:CO,spread:wO,toFormData:xO},Symbol.toStringTag,{value:"Module"}));var Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});var AO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OO=typeof window<"u"&&typeof window.document<"u",IO=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,RO=(typeof self>"u"?"undefined":AO(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",PO=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),$O=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",mb=Fo.isBrowser=OO;Fo.isWebWorker=RO;var Nf=Fo.isNode=IO;Fo.isJsDom=PO,Fo.isDeno=$O;var DO=Object.create,jf=Object.defineProperty,NO=Object.getOwnPropertyDescriptor,jO=Object.getOwnPropertyNames,MO=Object.getPrototypeOf,qO=Object.prototype.hasOwnProperty,Qt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),LO=(e,t)=>{for(var n in t)jf(e,n,{get:t[n],enumerable:!0})},FO=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jO(t))!qO.call(e,i)&&i!==n&&jf(e,i,{get:()=>t[i],enumerable:!(r=NO(t,i))||r.enumerable});return e},kl=(e,t,n)=>(n=e!=null?DO(MO(e)):{},FO(t||!e||!e.__esModule?jf(n,"default",{value:e,enumerable:!0}):n,e)),UO=Qt((e,t)=>{var n=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);t.exports=r=>!n.has(r&&r.code)}),BO=Qt(()=>{}),zO=Qt(()=>{}),ZO=Qt((e,t)=>{t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[r]=o;for(r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var s=Object.getOwnPropertySymbols(n);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(n,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(n,r);if(a.value!==o||a.enumerable!==!0)return!1}return!0}}),VO=Qt((e,t)=>{var n=typeof Symbol<"u"&&Symbol,r=ZO();t.exports=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r()}}),HO=Qt((e,t)=>{var n={foo:{}},r=Object;t.exports=function(){return{__proto__:n}.foo===n.foo&&!({__proto__:null}instanceof r)}}),WO=Qt((e,t)=>{var n="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,i=Object.prototype.toString,o="[object Function]";t.exports=function(s){var a=this;if(typeof a!="function"||i.call(a)!==o)throw new TypeError(n+a);for(var c=r.call(arguments,1),l,u=function(){if(this instanceof l){var m=a.apply(this,c.concat(r.call(arguments)));return Object(m)===m?m:this}else return a.apply(s,c.concat(r.call(arguments)))},d=Math.max(0,a.length-c.length),h=[],f=0;f<d;f++)h.push("$"+f);if(l=Function("binder","return function ("+h.join(",")+"){ return binder.apply(this,arguments); }")(u),a.prototype){var p=function(){};p.prototype=a.prototype,l.prototype=new p,p.prototype=null}return l}}),Mf=Qt((e,t)=>{var n=WO();t.exports=Function.prototype.bind||n}),KO=Qt((e,t)=>{var n=Mf();t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)}),qf=Qt((e,t)=>{var n,r=SyntaxError,i=Function,o=TypeError,s=function(F){try{return i('"use strict"; return ('+F+").constructor;")()}catch{}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var c=function(){throw new o},l=a?function(){try{return arguments.callee,c}catch{try{return a(arguments,"callee").get}catch{return c}}}():c,u=VO()(),d=HO()(),h=Object.getPrototypeOf||(d?function(F){return F.__proto__}:null),f={},p=typeof Uint8Array>"u"||!h?n:h(Uint8Array),m={"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":u&&h?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u&&h?h(h([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!u||!h?n:h(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!u||!h?n:h(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u&&h?h(""[Symbol.iterator]()):n,"%Symbol%":u?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet};if(h)try{null.error}catch(F){y=h(h(F)),m["%Error.prototype%"]=y}var y,v=function F(D){var M;if(D==="%AsyncFunction%")M=s("async function () {}");else if(D==="%GeneratorFunction%")M=s("function* () {}");else if(D==="%AsyncGeneratorFunction%")M=s("async function* () {}");else if(D==="%AsyncGenerator%"){var Z=F("%AsyncGeneratorFunction%");Z&&(M=Z.prototype)}else if(D==="%AsyncIteratorPrototype%"){var W=F("%AsyncGenerator%");W&&h&&(M=h(W.prototype))}return m[D]=M,M},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=Mf(),S=KO(),E=b.call(Function.call,Array.prototype.concat),_=b.call(Function.apply,Array.prototype.splice),I=b.call(Function.call,String.prototype.replace),P=b.call(Function.call,String.prototype.slice),$=b.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,H=function(F){var D=P(F,0,1),M=P(F,-1);if(D==="%"&&M!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&D!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var Z=[];return I(F,O,function(W,Q,C,te){Z[Z.length]=C?I(te,q,"$1"):Q||W}),Z},B=function(F,D){var M=F,Z;if(S(g,M)&&(Z=g[M],M="%"+Z[0]+"%"),S(m,M)){var W=m[M];if(W===f&&(W=v(M)),typeof W>"u"&&!D)throw new o("intrinsic "+F+" exists, but is not available. Please file an issue!");return{alias:Z,name:M,value:W}}throw new r("intrinsic "+F+" does not exist!")};t.exports=function(F,D){if(typeof F!="string"||F.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof D!="boolean")throw new o('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,F)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=H(F),Z=M.length>0?M[0]:"",W=B("%"+Z+"%",D),Q=W.name,C=W.value,te=!1,fe=W.alias;fe&&(Z=fe[0],_(M,E([0,1],fe)));for(var A=1,we=!0;A<M.length;A+=1){var Te=M[A],Ee=P(Te,0,1),Pe=P(Te,-1);if((Ee==='"'||Ee==="'"||Ee==="`"||Pe==='"'||Pe==="'"||Pe==="`")&&Ee!==Pe)throw new r("property names with quotes must have matching quotes");if((Te==="constructor"||!we)&&(te=!0),Z+="."+Te,Q="%"+Z+"%",S(m,Q))C=m[Q];else if(C!=null){if(!(Te in C)){if(!D)throw new o("base intrinsic for "+F+" exists, but the property is not available.");return}if(a&&A+1>=M.length){var Fe=a(C,Te);we=!!Fe,we&&"get"in Fe&&!("originalValue"in Fe.get)?C=Fe.get:C=C[Te]}else we=S(C,Te),C=C[Te];we&&!te&&(m[Q]=C)}}return C}}),JO=Qt((e,t)=>{var n=Mf(),r=qf(),i=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||n.call(o,i),a=r("%Object.getOwnPropertyDescriptor%",!0),c=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch{c=null}t.exports=function(d){var h=s(n,o,arguments);if(a&&c){var f=a(h,"length");f.configurable&&c(h,"length",{value:1+l(0,d.length-(arguments.length-1))})}return h};var u=function(){return s(n,i,arguments)};c?c(t.exports,"apply",{value:u}):t.exports.apply=u}),YO=Qt((e,t)=>{var n=qf(),r=JO(),i=r(n("String.prototype.indexOf"));t.exports=function(o,s){var a=n(o,!!s);return typeof a=="function"&&i(o,".prototype.")>-1?r(a):a}}),GO=Qt(()=>{}),XO=Qt((e,t)=>{var n=typeof Map=="function"&&Map.prototype,r=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&r&&typeof r.get=="function"?r.get:null,o=n&&Map.prototype.forEach,s=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&a&&typeof a.get=="function"?a.get:null,l=s&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,d=u?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,f=h?WeakSet.prototype.has:null,p=typeof WeakRef=="function"&&WeakRef.prototype,m=p?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,v=Object.prototype.toString,g=Function.prototype.toString,b=String.prototype.match,S=String.prototype.slice,E=String.prototype.replace,_=String.prototype.toUpperCase,I=String.prototype.toLowerCase,P=RegExp.prototype.test,$=Array.prototype.concat,O=Array.prototype.join,q=Array.prototype.slice,H=Math.floor,B=typeof BigInt=="function"?BigInt.prototype.valueOf:null,F=Object.getOwnPropertySymbols,D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,M=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Z=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===M||"symbol")?Symbol.toStringTag:null,W=Object.prototype.propertyIsEnumerable,Q=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(z){return z.__proto__}:null);function C(z,J){if(z===1/0||z===-1/0||z!==z||z&&z>-1e3&&z<1e3||P.call(/e/,J))return J;var Xe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof z=="number"){var rt=z<0?-H(-z):H(z);if(rt!==z){var At=String(rt),Ye=S.call(J,At.length+1);return E.call(At,Xe,"$&_")+"."+E.call(E.call(Ye,/([0-9]{3})/g,"$&_"),/_$/,"")}}return E.call(J,Xe,"$&_")}var te=GO(),fe=te.custom,A=pe(fe)?fe:null;t.exports=function z(J,Xe,rt,At){var Ye=Xe||{};if(L(Ye,"quoteStyle")&&Ye.quoteStyle!=="single"&&Ye.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(L(Ye,"maxStringLength")&&(typeof Ye.maxStringLength=="number"?Ye.maxStringLength<0&&Ye.maxStringLength!==1/0:Ye.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var cn=L(Ye,"customInspect")?Ye.customInspect:!0;if(typeof cn!="boolean"&&cn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(L(Ye,"indent")&&Ye.indent!==null&&Ye.indent!==" "&&!(parseInt(Ye.indent,10)===Ye.indent&&Ye.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(L(Ye,"numericSeparator")&&typeof Ye.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Un=Ye.numericSeparator;if(typeof J>"u")return"undefined";if(J===null)return"null";if(typeof J=="boolean")return J?"true":"false";if(typeof J=="string")return ie(J,Ye);if(typeof J=="number"){if(J===0)return 1/0/J>0?"0":"-0";var Vt=String(J);return Un?C(J,Vt):Vt}if(typeof J=="bigint"){var _n=String(J)+"n";return Un?C(J,_n):_n}var ir=typeof Ye.depth>"u"?5:Ye.depth;if(typeof rt>"u"&&(rt=0),rt>=ir&&ir>0&&typeof J=="object")return Ee(J)?"[Array]":"[Object]";var It=Et(Ye,rt);if(typeof At>"u")At=[];else if(ue(At,J)>=0)return"[Circular]";function xt(ot,Kt,Lt){if(Kt&&(At=q.call(At),At.push(Kt)),Lt){var Ft={depth:Ye.depth};return L(Ye,"quoteStyle")&&(Ft.quoteStyle=Ye.quoteStyle),z(ot,Ft,rt+1,At)}return z(ot,Ye,rt+1,At)}if(typeof J=="function"&&!Fe(J)){var Ht=ce(J),zt=Yt(J,xt);return"[Function"+(Ht?": "+Ht:" (anonymous)")+"]"+(zt.length>0?" { "+O.call(zt,", ")+" }":"")}if(pe(J)){var Wt=M?E.call(String(J),/^(Symbol\(.*\))_[^)]*$/,"$1"):D.call(J);return typeof J=="object"&&!M?Ae(Wt):Wt}if(K(J)){for(var Pt="<"+I.call(String(J.nodeName)),fn=J.attributes||[],pn=0;pn<fn.length;pn++)Pt+=" "+fn[pn].name+"="+we(Te(fn[pn].value),"double",Ye);return Pt+=">",J.childNodes&&J.childNodes.length&&(Pt+="..."),Pt+="</"+I.call(String(J.nodeName))+">",Pt}if(Ee(J)){if(J.length===0)return"[]";var Nn=Yt(J,xt);return It&&!Ot(Nn)?"["+Nt(Nn,It)+"]":"[ "+O.call(Nn,", ")+" ]"}if(Re(J)){var So=Yt(J,xt);return!("cause"in Error.prototype)&&"cause"in J&&!W.call(J,"cause")?"{ ["+String(J)+"] "+O.call($.call("[cause]: "+xt(J.cause),So),", ")+" }":So.length===0?"["+String(J)+"]":"{ ["+String(J)+"] "+O.call(So,", ")+" }"}if(typeof J=="object"&&cn){if(A&&typeof J[A]=="function"&&te)return te(J,{depth:ir-rt});if(cn!=="symbol"&&typeof J.inspect=="function")return J.inspect()}if(Ne(J)){var Eo=[];return o&&o.call(J,function(ot,Kt){Eo.push(xt(Kt,J,!0)+" => "+xt(ot,J))}),Mt("Map",i.call(J),Eo,It)}if(pt(J)){var j=[];return l&&l.call(J,function(ot){j.push(xt(ot,J))}),Mt("Set",c.call(J),j,It)}if(Se(J))return Je("WeakMap");if(Ge(J))return Je("WeakSet");if(Be(J))return Je("WeakRef");if(de(J))return Ae(xt(Number(J)));if(De(J))return Ae(xt(B.call(J)));if(_e(J))return Ae(y.call(J));if(he(J))return Ae(xt(String(J)));if(!Pe(J)&&!Fe(J)){var le=Yt(J,xt),ve=Q?Q(J)===Object.prototype:J instanceof Object||J.constructor===Object,Ue=J instanceof Object?"":"null prototype",bt=!ve&&Z&&Object(J)===J&&Z in J?S.call(oe(J),8,-1):Ue?"Object":"",_t=ve||typeof J.constructor!="function"?"":J.constructor.name?J.constructor.name+" ":"",ut=_t+(bt||Ue?"["+O.call($.call([],bt||[],Ue||[]),": ")+"] ":"");return le.length===0?ut+"{}":It?ut+"{"+Nt(le,It)+"}":ut+"{ "+O.call(le,", ")+" }"}return String(J)};function we(z,J,Xe){var rt=(Xe.quoteStyle||J)==="double"?'"':"'";return rt+z+rt}function Te(z){return E.call(String(z),/"/g,""")}function Ee(z){return oe(z)==="[object Array]"&&(!Z||!(typeof z=="object"&&Z in z))}function Pe(z){return oe(z)==="[object Date]"&&(!Z||!(typeof z=="object"&&Z in z))}function Fe(z){return oe(z)==="[object RegExp]"&&(!Z||!(typeof z=="object"&&Z in z))}function Re(z){return oe(z)==="[object Error]"&&(!Z||!(typeof z=="object"&&Z in z))}function he(z){return oe(z)==="[object String]"&&(!Z||!(typeof z=="object"&&Z in z))}function de(z){return oe(z)==="[object Number]"&&(!Z||!(typeof z=="object"&&Z in z))}function _e(z){return oe(z)==="[object Boolean]"&&(!Z||!(typeof z=="object"&&Z in z))}function pe(z){if(M)return z&&typeof z=="object"&&z instanceof Symbol;if(typeof z=="symbol")return!0;if(!z||typeof z!="object"||!D)return!1;try{return D.call(z),!0}catch{}return!1}function De(z){if(!z||typeof z!="object"||!B)return!1;try{return B.call(z),!0}catch{}return!1}var et=Object.prototype.hasOwnProperty||function(z){return z in this};function L(z,J){return et.call(z,J)}function oe(z){return v.call(z)}function ce(z){if(z.name)return z.name;var J=b.call(g.call(z),/^function\s*([\w$]+)/);return J?J[1]:null}function ue(z,J){if(z.indexOf)return z.indexOf(J);for(var Xe=0,rt=z.length;Xe<rt;Xe++)if(z[Xe]===J)return Xe;return-1}function Ne(z){if(!i||!z||typeof z!="object")return!1;try{i.call(z);try{c.call(z)}catch{return!0}return z instanceof Map}catch{}return!1}function Se(z){if(!d||!z||typeof z!="object")return!1;try{d.call(z,d);try{f.call(z,f)}catch{return!0}return z instanceof WeakMap}catch{}return!1}function Be(z){if(!m||!z||typeof z!="object")return!1;try{return m.call(z),!0}catch{}return!1}function pt(z){if(!c||!z||typeof z!="object")return!1;try{c.call(z);try{i.call(z)}catch{return!0}return z instanceof Set}catch{}return!1}function Ge(z){if(!f||!z||typeof z!="object")return!1;try{f.call(z,f);try{d.call(z,d)}catch{return!0}return z instanceof WeakSet}catch{}return!1}function K(z){return!z||typeof z!="object"?!1:typeof HTMLElement<"u"&&z instanceof HTMLElement?!0:typeof z.nodeName=="string"&&typeof z.getAttribute=="function"}function ie(z,J){if(z.length>J.maxStringLength){var Xe=z.length-J.maxStringLength,rt="... "+Xe+" more character"+(Xe>1?"s":"");return ie(S.call(z,0,J.maxStringLength),J)+rt}var At=E.call(E.call(z,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ae);return we(At,"single",J)}function ae(z){var J=z.charCodeAt(0),Xe={8:"b",9:"t",10:"n",12:"f",13:"r"}[J];return Xe?"\\"+Xe:"\\x"+(J<16?"0":"")+_.call(J.toString(16))}function Ae(z){return"Object("+z+")"}function Je(z){return z+" { ? }"}function Mt(z,J,Xe,rt){var At=rt?Nt(Xe,rt):O.call(Xe,", ");return z+" ("+J+") {"+At+"}"}function Ot(z){for(var J=0;J<z.length;J++)if(ue(z[J],`
|
|
74
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Gi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&$f.assertOptions(r,{silentJSONParsing:vi.transitional(vi.boolean),forcedJSONParsing:vi.transitional(vi.boolean),clarifyTimeoutError:vi.transitional(vi.boolean)},!1),i!=null&&(ee.isFunction(i)?n.paramsSerializer={serialize:i}:$f.assertOptions(i,{encode:vi.function,serialize:vi.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&ee.merge(o.common,o[n.method]);o&&ee.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=vr.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,p;if(!c){const h=[db.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,l),p=h.length,u=Promise.resolve(n);d<p;)u=u.then(h[d++],h[d++]);return u}p=a.length;let f=n;for(d=0;d<p;){const h=a[d++],m=a[d++];try{f=h(f)}catch(y){m.call(this,y);break}}try{u=db.call(this,f)}catch(h){return Promise.reject(h)}for(d=0,p=l.length;d<p;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Gi(this.defaults,t);const n=nb(t.baseURL,t.url);return Jv(n,t.params,t.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(t){Sl.prototype[t]=function(n,r){return this.request(Gi(r||{},{method:t,url:n,data:(r||{}).data}))}}),ee.forEach(["post","put","patch"],function(t){function n(r){return function(o,s,a){return this.request(Gi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Sl.prototype[t]=n(),Sl.prototype[t+"Form"]=n(!0)});const El=Sl,aO=class MC{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new qo(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new MC(function(i){t=i}),cancel:t}}};function cO(e){return function(n){return e.apply(null,n)}}function lO(e){return ee.isObject(e)&&e.isAxiosError===!0}const Df={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Df).forEach(([e,t])=>{Df[t]=e});const uO=Df;function hb(e){const t=new El(e),n=$v(El.prototype.request,t);return ee.extend(n,El.prototype,t,{allOwnKeys:!0}),ee.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return hb(Gi(e,i))},n}const Xt=hb(kf);Xt.Axios=El,Xt.CanceledError=qo,Xt.CancelToken=aO,Xt.isCancel=eb,Xt.VERSION=fb,Xt.toFormData=gl,Xt.AxiosError=ct,Xt.Cancel=Xt.CanceledError,Xt.all=function(t){return Promise.all(t)},Xt.spread=cO,Xt.isAxiosError=lO,Xt.mergeConfig=Gi,Xt.AxiosHeaders=vr,Xt.formToJSON=e=>Xv(ee.isHTMLForm(e)?new FormData(e):e),Xt.getAdapter=ub.getAdapter,Xt.HttpStatusCode=uO,Xt.default=Xt;const Lo=Xt,{Axios:dO,AxiosError:fO,CanceledError:pO,isCancel:hO,CancelToken:mO,VERSION:yO,all:gO,Cancel:vO,isAxiosError:bO,spread:wO,toFormData:xO,AxiosHeaders:_O,HttpStatusCode:SO,formToJSON:EO,getAdapter:kO,mergeConfig:CO}=Lo,TO=Object.freeze(Object.defineProperty({__proto__:null,Axios:dO,AxiosError:fO,AxiosHeaders:_O,Cancel:vO,CancelToken:mO,CanceledError:pO,HttpStatusCode:SO,VERSION:yO,all:gO,default:Lo,formToJSON:EO,getAdapter:kO,isAxiosError:bO,isCancel:hO,mergeConfig:CO,spread:wO,toFormData:xO},Symbol.toStringTag,{value:"Module"}));var Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});var AO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OO=typeof window<"u"&&typeof window.document<"u",IO=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,RO=(typeof self>"u"?"undefined":AO(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",PO=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),$O=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",mb=Fo.isBrowser=OO;Fo.isWebWorker=RO;var Nf=Fo.isNode=IO;Fo.isJsDom=PO,Fo.isDeno=$O;var DO=Object.create,jf=Object.defineProperty,NO=Object.getOwnPropertyDescriptor,jO=Object.getOwnPropertyNames,MO=Object.getPrototypeOf,qO=Object.prototype.hasOwnProperty,Qt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),LO=(e,t)=>{for(var n in t)jf(e,n,{get:t[n],enumerable:!0})},FO=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jO(t))!qO.call(e,i)&&i!==n&&jf(e,i,{get:()=>t[i],enumerable:!(r=NO(t,i))||r.enumerable});return e},kl=(e,t,n)=>(n=e!=null?DO(MO(e)):{},FO(t||!e||!e.__esModule?jf(n,"default",{value:e,enumerable:!0}):n,e)),UO=Qt((e,t)=>{var n=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);t.exports=r=>!n.has(r&&r.code)}),BO=Qt(()=>{}),zO=Qt(()=>{}),ZO=Qt((e,t)=>{t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[r]=o;for(r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var s=Object.getOwnPropertySymbols(n);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(n,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(n,r);if(a.value!==o||a.enumerable!==!0)return!1}return!0}}),VO=Qt((e,t)=>{var n=typeof Symbol<"u"&&Symbol,r=ZO();t.exports=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r()}}),HO=Qt((e,t)=>{var n={foo:{}},r=Object;t.exports=function(){return{__proto__:n}.foo===n.foo&&!({__proto__:null}instanceof r)}}),WO=Qt((e,t)=>{var n="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,i=Object.prototype.toString,o="[object Function]";t.exports=function(s){var a=this;if(typeof a!="function"||i.call(a)!==o)throw new TypeError(n+a);for(var c=r.call(arguments,1),l,u=function(){if(this instanceof l){var m=a.apply(this,c.concat(r.call(arguments)));return Object(m)===m?m:this}else return a.apply(s,c.concat(r.call(arguments)))},d=Math.max(0,a.length-c.length),p=[],f=0;f<d;f++)p.push("$"+f);if(l=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(u),a.prototype){var h=function(){};h.prototype=a.prototype,l.prototype=new h,h.prototype=null}return l}}),Mf=Qt((e,t)=>{var n=WO();t.exports=Function.prototype.bind||n}),KO=Qt((e,t)=>{var n=Mf();t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)}),qf=Qt((e,t)=>{var n,r=SyntaxError,i=Function,o=TypeError,s=function(F){try{return i('"use strict"; return ('+F+").constructor;")()}catch{}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var c=function(){throw new o},l=a?function(){try{return arguments.callee,c}catch{try{return a(arguments,"callee").get}catch{return c}}}():c,u=VO()(),d=HO()(),p=Object.getPrototypeOf||(d?function(F){return F.__proto__}:null),f={},h=typeof Uint8Array>"u"||!p?n:p(Uint8Array),m={"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":u&&p?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u&&p?p(p([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!u||!p?n:p(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!u||!p?n:p(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u&&p?p(""[Symbol.iterator]()):n,"%Symbol%":u?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":l,"%TypedArray%":h,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet};if(p)try{null.error}catch(F){y=p(p(F)),m["%Error.prototype%"]=y}var y,g=function F(D){var M;if(D==="%AsyncFunction%")M=s("async function () {}");else if(D==="%GeneratorFunction%")M=s("function* () {}");else if(D==="%AsyncGeneratorFunction%")M=s("async function* () {}");else if(D==="%AsyncGenerator%"){var Z=F("%AsyncGeneratorFunction%");Z&&(M=Z.prototype)}else if(D==="%AsyncIteratorPrototype%"){var W=F("%AsyncGenerator%");W&&p&&(M=p(W.prototype))}return m[D]=M,M},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=Mf(),S=KO(),E=b.call(Function.call,Array.prototype.concat),_=b.call(Function.apply,Array.prototype.splice),I=b.call(Function.call,String.prototype.replace),P=b.call(Function.call,String.prototype.slice),$=b.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,H=function(F){var D=P(F,0,1),M=P(F,-1);if(D==="%"&&M!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&D!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var Z=[];return I(F,O,function(W,Q,C,te){Z[Z.length]=C?I(te,q,"$1"):Q||W}),Z},B=function(F,D){var M=F,Z;if(S(v,M)&&(Z=v[M],M="%"+Z[0]+"%"),S(m,M)){var W=m[M];if(W===f&&(W=g(M)),typeof W>"u"&&!D)throw new o("intrinsic "+F+" exists, but is not available. Please file an issue!");return{alias:Z,name:M,value:W}}throw new r("intrinsic "+F+" does not exist!")};t.exports=function(F,D){if(typeof F!="string"||F.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof D!="boolean")throw new o('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,F)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=H(F),Z=M.length>0?M[0]:"",W=B("%"+Z+"%",D),Q=W.name,C=W.value,te=!1,fe=W.alias;fe&&(Z=fe[0],_(M,E([0,1],fe)));for(var A=1,we=!0;A<M.length;A+=1){var Te=M[A],Ee=P(Te,0,1),$e=P(Te,-1);if((Ee==='"'||Ee==="'"||Ee==="`"||$e==='"'||$e==="'"||$e==="`")&&Ee!==$e)throw new r("property names with quotes must have matching quotes");if((Te==="constructor"||!we)&&(te=!0),Z+="."+Te,Q="%"+Z+"%",S(m,Q))C=m[Q];else if(C!=null){if(!(Te in C)){if(!D)throw new o("base intrinsic for "+F+" exists, but the property is not available.");return}if(a&&A+1>=M.length){var Fe=a(C,Te);we=!!Fe,we&&"get"in Fe&&!("originalValue"in Fe.get)?C=Fe.get:C=C[Te]}else we=S(C,Te),C=C[Te];we&&!te&&(m[Q]=C)}}return C}}),JO=Qt((e,t)=>{var n=Mf(),r=qf(),i=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||n.call(o,i),a=r("%Object.getOwnPropertyDescriptor%",!0),c=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch{c=null}t.exports=function(d){var p=s(n,o,arguments);if(a&&c){var f=a(p,"length");f.configurable&&c(p,"length",{value:1+l(0,d.length-(arguments.length-1))})}return p};var u=function(){return s(n,i,arguments)};c?c(t.exports,"apply",{value:u}):t.exports.apply=u}),YO=Qt((e,t)=>{var n=qf(),r=JO(),i=r(n("String.prototype.indexOf"));t.exports=function(o,s){var a=n(o,!!s);return typeof a=="function"&&i(o,".prototype.")>-1?r(a):a}}),GO=Qt(()=>{}),XO=Qt((e,t)=>{var n=typeof Map=="function"&&Map.prototype,r=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&r&&typeof r.get=="function"?r.get:null,o=n&&Map.prototype.forEach,s=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&a&&typeof a.get=="function"?a.get:null,l=s&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,d=u?WeakMap.prototype.has:null,p=typeof WeakSet=="function"&&WeakSet.prototype,f=p?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,m=h?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,g=Object.prototype.toString,v=Function.prototype.toString,b=String.prototype.match,S=String.prototype.slice,E=String.prototype.replace,_=String.prototype.toUpperCase,I=String.prototype.toLowerCase,P=RegExp.prototype.test,$=Array.prototype.concat,O=Array.prototype.join,q=Array.prototype.slice,H=Math.floor,B=typeof BigInt=="function"?BigInt.prototype.valueOf:null,F=Object.getOwnPropertySymbols,D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,M=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Z=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===M||"symbol")?Symbol.toStringTag:null,W=Object.prototype.propertyIsEnumerable,Q=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(z){return z.__proto__}:null);function C(z,J){if(z===1/0||z===-1/0||z!==z||z&&z>-1e3&&z<1e3||P.call(/e/,J))return J;var Xe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof z=="number"){var rt=z<0?-H(-z):H(z);if(rt!==z){var At=String(rt),Ye=S.call(J,At.length+1);return E.call(At,Xe,"$&_")+"."+E.call(E.call(Ye,/([0-9]{3})/g,"$&_"),/_$/,"")}}return E.call(J,Xe,"$&_")}var te=GO(),fe=te.custom,A=pe(fe)?fe:null;t.exports=function z(J,Xe,rt,At){var Ye=Xe||{};if(L(Ye,"quoteStyle")&&Ye.quoteStyle!=="single"&&Ye.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(L(Ye,"maxStringLength")&&(typeof Ye.maxStringLength=="number"?Ye.maxStringLength<0&&Ye.maxStringLength!==1/0:Ye.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var cn=L(Ye,"customInspect")?Ye.customInspect:!0;if(typeof cn!="boolean"&&cn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(L(Ye,"indent")&&Ye.indent!==null&&Ye.indent!==" "&&!(parseInt(Ye.indent,10)===Ye.indent&&Ye.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(L(Ye,"numericSeparator")&&typeof Ye.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Un=Ye.numericSeparator;if(typeof J>"u")return"undefined";if(J===null)return"null";if(typeof J=="boolean")return J?"true":"false";if(typeof J=="string")return ie(J,Ye);if(typeof J=="number"){if(J===0)return 1/0/J>0?"0":"-0";var Vt=String(J);return Un?C(J,Vt):Vt}if(typeof J=="bigint"){var _n=String(J)+"n";return Un?C(J,_n):_n}var ir=typeof Ye.depth>"u"?5:Ye.depth;if(typeof rt>"u"&&(rt=0),rt>=ir&&ir>0&&typeof J=="object")return Ee(J)?"[Array]":"[Object]";var It=Et(Ye,rt);if(typeof At>"u")At=[];else if(ue(At,J)>=0)return"[Circular]";function xt(ot,Kt,Lt){if(Kt&&(At=q.call(At),At.push(Kt)),Lt){var Ft={depth:Ye.depth};return L(Ye,"quoteStyle")&&(Ft.quoteStyle=Ye.quoteStyle),z(ot,Ft,rt+1,At)}return z(ot,Ye,rt+1,At)}if(typeof J=="function"&&!Fe(J)){var Ht=ce(J),zt=Yt(J,xt);return"[Function"+(Ht?": "+Ht:" (anonymous)")+"]"+(zt.length>0?" { "+O.call(zt,", ")+" }":"")}if(pe(J)){var Wt=M?E.call(String(J),/^(Symbol\(.*\))_[^)]*$/,"$1"):D.call(J);return typeof J=="object"&&!M?Ae(Wt):Wt}if(K(J)){for(var Pt="<"+I.call(String(J.nodeName)),fn=J.attributes||[],pn=0;pn<fn.length;pn++)Pt+=" "+fn[pn].name+"="+we(Te(fn[pn].value),"double",Ye);return Pt+=">",J.childNodes&&J.childNodes.length&&(Pt+="..."),Pt+="</"+I.call(String(J.nodeName))+">",Pt}if(Ee(J)){if(J.length===0)return"[]";var Nn=Yt(J,xt);return It&&!Ot(Nn)?"["+Nt(Nn,It)+"]":"[ "+O.call(Nn,", ")+" ]"}if(Pe(J)){var So=Yt(J,xt);return!("cause"in Error.prototype)&&"cause"in J&&!W.call(J,"cause")?"{ ["+String(J)+"] "+O.call($.call("[cause]: "+xt(J.cause),So),", ")+" }":So.length===0?"["+String(J)+"]":"{ ["+String(J)+"] "+O.call(So,", ")+" }"}if(typeof J=="object"&&cn){if(A&&typeof J[A]=="function"&&te)return te(J,{depth:ir-rt});if(cn!=="symbol"&&typeof J.inspect=="function")return J.inspect()}if(Ne(J)){var Eo=[];return o&&o.call(J,function(ot,Kt){Eo.push(xt(Kt,J,!0)+" => "+xt(ot,J))}),Mt("Map",i.call(J),Eo,It)}if(pt(J)){var j=[];return l&&l.call(J,function(ot){j.push(xt(ot,J))}),Mt("Set",c.call(J),j,It)}if(Se(J))return Je("WeakMap");if(Ge(J))return Je("WeakSet");if(Be(J))return Je("WeakRef");if(de(J))return Ae(xt(Number(J)));if(De(J))return Ae(xt(B.call(J)));if(_e(J))return Ae(y.call(J));if(he(J))return Ae(xt(String(J)));if(!$e(J)&&!Fe(J)){var le=Yt(J,xt),ve=Q?Q(J)===Object.prototype:J instanceof Object||J.constructor===Object,Ue=J instanceof Object?"":"null prototype",bt=!ve&&Z&&Object(J)===J&&Z in J?S.call(oe(J),8,-1):Ue?"Object":"",_t=ve||typeof J.constructor!="function"?"":J.constructor.name?J.constructor.name+" ":"",ut=_t+(bt||Ue?"["+O.call($.call([],bt||[],Ue||[]),": ")+"] ":"");return le.length===0?ut+"{}":It?ut+"{"+Nt(le,It)+"}":ut+"{ "+O.call(le,", ")+" }"}return String(J)};function we(z,J,Xe){var rt=(Xe.quoteStyle||J)==="double"?'"':"'";return rt+z+rt}function Te(z){return E.call(String(z),/"/g,""")}function Ee(z){return oe(z)==="[object Array]"&&(!Z||!(typeof z=="object"&&Z in z))}function $e(z){return oe(z)==="[object Date]"&&(!Z||!(typeof z=="object"&&Z in z))}function Fe(z){return oe(z)==="[object RegExp]"&&(!Z||!(typeof z=="object"&&Z in z))}function Pe(z){return oe(z)==="[object Error]"&&(!Z||!(typeof z=="object"&&Z in z))}function he(z){return oe(z)==="[object String]"&&(!Z||!(typeof z=="object"&&Z in z))}function de(z){return oe(z)==="[object Number]"&&(!Z||!(typeof z=="object"&&Z in z))}function _e(z){return oe(z)==="[object Boolean]"&&(!Z||!(typeof z=="object"&&Z in z))}function pe(z){if(M)return z&&typeof z=="object"&&z instanceof Symbol;if(typeof z=="symbol")return!0;if(!z||typeof z!="object"||!D)return!1;try{return D.call(z),!0}catch{}return!1}function De(z){if(!z||typeof z!="object"||!B)return!1;try{return B.call(z),!0}catch{}return!1}var et=Object.prototype.hasOwnProperty||function(z){return z in this};function L(z,J){return et.call(z,J)}function oe(z){return g.call(z)}function ce(z){if(z.name)return z.name;var J=b.call(v.call(z),/^function\s*([\w$]+)/);return J?J[1]:null}function ue(z,J){if(z.indexOf)return z.indexOf(J);for(var Xe=0,rt=z.length;Xe<rt;Xe++)if(z[Xe]===J)return Xe;return-1}function Ne(z){if(!i||!z||typeof z!="object")return!1;try{i.call(z);try{c.call(z)}catch{return!0}return z instanceof Map}catch{}return!1}function Se(z){if(!d||!z||typeof z!="object")return!1;try{d.call(z,d);try{f.call(z,f)}catch{return!0}return z instanceof WeakMap}catch{}return!1}function Be(z){if(!m||!z||typeof z!="object")return!1;try{return m.call(z),!0}catch{}return!1}function pt(z){if(!c||!z||typeof z!="object")return!1;try{c.call(z);try{i.call(z)}catch{return!0}return z instanceof Set}catch{}return!1}function Ge(z){if(!f||!z||typeof z!="object")return!1;try{f.call(z,f);try{d.call(z,d)}catch{return!0}return z instanceof WeakSet}catch{}return!1}function K(z){return!z||typeof z!="object"?!1:typeof HTMLElement<"u"&&z instanceof HTMLElement?!0:typeof z.nodeName=="string"&&typeof z.getAttribute=="function"}function ie(z,J){if(z.length>J.maxStringLength){var Xe=z.length-J.maxStringLength,rt="... "+Xe+" more character"+(Xe>1?"s":"");return ie(S.call(z,0,J.maxStringLength),J)+rt}var At=E.call(E.call(z,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ae);return we(At,"single",J)}function ae(z){var J=z.charCodeAt(0),Xe={8:"b",9:"t",10:"n",12:"f",13:"r"}[J];return Xe?"\\"+Xe:"\\x"+(J<16?"0":"")+_.call(J.toString(16))}function Ae(z){return"Object("+z+")"}function Je(z){return z+" { ? }"}function Mt(z,J,Xe,rt){var At=rt?Nt(Xe,rt):O.call(Xe,", ");return z+" ("+J+") {"+At+"}"}function Ot(z){for(var J=0;J<z.length;J++)if(ue(z[J],`
|
|
75
75
|
`)>=0)return!1;return!0}function Et(z,J){var Xe;if(z.indent===" ")Xe=" ";else if(typeof z.indent=="number"&&z.indent>0)Xe=O.call(Array(z.indent+1)," ");else return null;return{base:Xe,prev:O.call(Array(J+1),Xe)}}function Nt(z,J){if(z.length===0)return"";var Xe=`
|
|
76
76
|
`+J.prev+J.base;return Xe+O.call(z,","+Xe)+`
|
|
77
|
-
`+J.prev}function Yt(z,J){var Xe=Ee(z),rt=[];if(Xe){rt.length=z.length;for(var At=0;At<z.length;At++)rt[At]=L(z,At)?J(z[At],z):""}var Ye=typeof F=="function"?F(z):[],cn;if(M){cn={};for(var Un=0;Un<Ye.length;Un++)cn["$"+Ye[Un]]=Ye[Un]}for(var Vt in z)L(z,Vt)&&(Xe&&String(Number(Vt))===Vt&&Vt<z.length||M&&cn["$"+Vt]instanceof Symbol||(P.call(/[^\w$]/,Vt)?rt.push(J(Vt,z)+": "+J(z[Vt],z)):rt.push(Vt+": "+J(z[Vt],z))));if(typeof F=="function")for(var _n=0;_n<Ye.length;_n++)W.call(z,Ye[_n])&&rt.push("["+J(Ye[_n])+"]: "+J(z[Ye[_n]],z));return rt}}),QO=Qt((e,t)=>{var n=qf(),r=YO(),i=XO(),o=n("%TypeError%"),s=n("%WeakMap%",!0),a=n("%Map%",!0),c=r("WeakMap.prototype.get",!0),l=r("WeakMap.prototype.set",!0),u=r("WeakMap.prototype.has",!0),d=r("Map.prototype.get",!0),h=r("Map.prototype.set",!0),f=r("Map.prototype.has",!0),p=function(g,b){for(var S=g,E;(E=S.next)!==null;S=E)if(E.key===b)return S.next=E.next,E.next=g.next,g.next=E,E},m=function(g,b){var S=p(g,b);return S&&S.value},y=function(g,b,S){var E=p(g,b);E?E.value=S:g.next={key:b,next:g.next,value:S}},v=function(g,b){return!!p(g,b)};t.exports=function(){var g,b,S,E={assert:function(_){if(!E.has(_))throw new o("Side channel does not contain "+i(_))},get:function(_){if(s&&_&&(typeof _=="object"||typeof _=="function")){if(g)return c(g,_)}else if(a){if(b)return d(b,_)}else if(S)return m(S,_)},has:function(_){if(s&&_&&(typeof _=="object"||typeof _=="function")){if(g)return u(g,_)}else if(a){if(b)return f(b,_)}else if(S)return v(S,_);return!1},set:function(_,I){s&&_&&(typeof _=="object"||typeof _=="function")?(g||(g=new s),l(g,_,I)):a?(b||(b=new a),h(b,_,I)):(S||(S={key:{},next:null}),y(S,_,I))}};return E}}),Lf=Qt((e,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:"RFC1738",RFC3986:"RFC3986"};t.exports={default:i.RFC3986,formatters:{RFC1738:function(o){return n.call(o,r,"+")},RFC3986:function(o){return String(o)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}}),yb=Qt((e,t)=>{var n=Lf(),r=Object.prototype.hasOwnProperty,i=Array.isArray,o=function(){for(var v=[],g=0;g<256;++g)v.push("%"+((g<16?"0":"")+g.toString(16)).toUpperCase());return v}(),s=function(v){for(;v.length>1;){var g=v.pop(),b=g.obj[g.prop];if(i(b)){for(var S=[],E=0;E<b.length;++E)typeof b[E]<"u"&&S.push(b[E]);g.obj[g.prop]=S}}},a=function(v,g){for(var b=g&&g.plainObjects?Object.create(null):{},S=0;S<v.length;++S)typeof v[S]<"u"&&(b[S]=v[S]);return b},c=function v(g,b,S){if(!b)return g;if(typeof b!="object"){if(i(g))g.push(b);else if(g&&typeof g=="object")(S&&(S.plainObjects||S.allowPrototypes)||!r.call(Object.prototype,b))&&(g[b]=!0);else return[g,b];return g}if(!g||typeof g!="object")return[g].concat(b);var E=g;return i(g)&&!i(b)&&(E=a(g,S)),i(g)&&i(b)?(b.forEach(function(_,I){if(r.call(g,I)){var P=g[I];P&&typeof P=="object"&&_&&typeof _=="object"?g[I]=v(P,_,S):g.push(_)}else g[I]=_}),g):Object.keys(b).reduce(function(_,I){var P=b[I];return r.call(_,I)?_[I]=v(_[I],P,S):_[I]=P,_},E)},l=function(v,g){return Object.keys(g).reduce(function(b,S){return b[S]=g[S],b},v)},u=function(v,g,b){var S=v.replace(/\+/g," ");if(b==="iso-8859-1")return S.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(S)}catch{return S}},d=function(v,g,b,S,E){if(v.length===0)return v;var _=v;if(typeof v=="symbol"?_=Symbol.prototype.toString.call(v):typeof v!="string"&&(_=String(v)),b==="iso-8859-1")return escape(_).replace(/%u[0-9a-f]{4}/gi,function(O){return"%26%23"+parseInt(O.slice(2),16)+"%3B"});for(var I="",P=0;P<_.length;++P){var $=_.charCodeAt(P);if($===45||$===46||$===95||$===126||$>=48&&$<=57||$>=65&&$<=90||$>=97&&$<=122||E===n.RFC1738&&($===40||$===41)){I+=_.charAt(P);continue}if($<128){I=I+o[$];continue}if($<2048){I=I+(o[192|$>>6]+o[128|$&63]);continue}if($<55296||$>=57344){I=I+(o[224|$>>12]+o[128|$>>6&63]+o[128|$&63]);continue}P+=1,$=65536+(($&1023)<<10|_.charCodeAt(P)&1023),I+=o[240|$>>18]+o[128|$>>12&63]+o[128|$>>6&63]+o[128|$&63]}return I},h=function(v){for(var g=[{obj:{o:v},prop:"o"}],b=[],S=0;S<g.length;++S)for(var E=g[S],_=E.obj[E.prop],I=Object.keys(_),P=0;P<I.length;++P){var $=I[P],O=_[$];typeof O=="object"&&O!==null&&b.indexOf(O)===-1&&(g.push({obj:_,prop:$}),b.push(O))}return s(g),v},f=function(v){return Object.prototype.toString.call(v)==="[object RegExp]"},p=function(v){return!v||typeof v!="object"?!1:!!(v.constructor&&v.constructor.isBuffer&&v.constructor.isBuffer(v))},m=function(v,g){return[].concat(v,g)},y=function(v,g){if(i(v)){for(var b=[],S=0;S<v.length;S+=1)b.push(g(v[S]));return b}return g(v)};t.exports={arrayToObject:a,assign:l,combine:m,compact:h,decode:u,encode:d,isBuffer:p,isRegExp:f,maybeMap:y,merge:c}}),eI=Qt((e,t)=>{var n=QO(),r=yb(),i=Lf(),o=Object.prototype.hasOwnProperty,s={brackets:function(g){return g+"[]"},comma:"comma",indices:function(g,b){return g+"["+b+"]"},repeat:function(g){return g}},a=Array.isArray,c=String.prototype.split,l=Array.prototype.push,u=function(g,b){l.apply(g,a(b)?b:[b])},d=Date.prototype.toISOString,h=i.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(g){return d.call(g)},skipNulls:!1,strictNullHandling:!1},p=function(g){return typeof g=="string"||typeof g=="number"||typeof g=="boolean"||typeof g=="symbol"||typeof g=="bigint"},m={},y=function g(b,S,E,_,I,P,$,O,q,H,B,F,D,M,Z,W){for(var Q=b,C=W,te=0,fe=!1;(C=C.get(m))!==void 0&&!fe;){var A=C.get(b);if(te+=1,typeof A<"u"){if(A===te)throw new RangeError("Cyclic object value");fe=!0}typeof C.get(m)>"u"&&(te=0)}if(typeof O=="function"?Q=O(S,Q):Q instanceof Date?Q=B(Q):E==="comma"&&a(Q)&&(Q=r.maybeMap(Q,function(oe){return oe instanceof Date?B(oe):oe})),Q===null){if(I)return $&&!M?$(S,f.encoder,Z,"key",F):S;Q=""}if(p(Q)||r.isBuffer(Q)){if($){var we=M?S:$(S,f.encoder,Z,"key",F);if(E==="comma"&&M){for(var Te=c.call(String(Q),","),Ee="",Pe=0;Pe<Te.length;++Pe)Ee+=(Pe===0?"":",")+D($(Te[Pe],f.encoder,Z,"value",F));return[D(we)+(_&&a(Q)&&Te.length===1?"[]":"")+"="+Ee]}return[D(we)+"="+D($(Q,f.encoder,Z,"value",F))]}return[D(S)+"="+D(String(Q))]}var Fe=[];if(typeof Q>"u")return Fe;var Re;if(E==="comma"&&a(Q))Re=[{value:Q.length>0?Q.join(",")||null:void 0}];else if(a(O))Re=O;else{var he=Object.keys(Q);Re=q?he.sort(q):he}for(var de=_&&a(Q)&&Q.length===1?S+"[]":S,_e=0;_e<Re.length;++_e){var pe=Re[_e],De=typeof pe=="object"&&typeof pe.value<"u"?pe.value:Q[pe];if(!(P&&De===null)){var et=a(Q)?typeof E=="function"?E(de,pe):de:de+(H?"."+pe:"["+pe+"]");W.set(b,te);var L=n();L.set(m,W),u(Fe,g(De,et,E,_,I,P,$,O,q,H,B,F,D,M,Z,L))}}return Fe},v=function(g){if(!g)return f;if(g.encoder!==null&&typeof g.encoder<"u"&&typeof g.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=g.charset||f.charset;if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=i.default;if(typeof g.format<"u"){if(!o.call(i.formatters,g.format))throw new TypeError("Unknown format option provided.");S=g.format}var E=i.formatters[S],_=f.filter;return(typeof g.filter=="function"||a(g.filter))&&(_=g.filter),{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:f.addQueryPrefix,allowDots:typeof g.allowDots>"u"?f.allowDots:!!g.allowDots,charset:b,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:f.charsetSentinel,delimiter:typeof g.delimiter>"u"?f.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:f.encode,encoder:typeof g.encoder=="function"?g.encoder:f.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:f.encodeValuesOnly,filter:_,format:S,formatter:E,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:f.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:f.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:f.strictNullHandling}};t.exports=function(g,b){var S=g,E=v(b),_,I;typeof E.filter=="function"?(I=E.filter,S=I("",S)):a(E.filter)&&(I=E.filter,_=I);var P=[];if(typeof S!="object"||S===null)return"";var $;b&&b.arrayFormat in s?$=b.arrayFormat:b&&"indices"in b?$=b.indices?"indices":"repeat":$="indices";var O=s[$];if(b&&"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var q=O==="comma"&&b&&b.commaRoundTrip;_||(_=Object.keys(S)),E.sort&&_.sort(E.sort);for(var H=n(),B=0;B<_.length;++B){var F=_[B];E.skipNulls&&S[F]===null||u(P,y(S[F],F,O,q,E.strictNullHandling,E.skipNulls,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,H))}var D=P.join(E.delimiter),M=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?M+="utf8=%26%2310003%3B&":M+="utf8=%E2%9C%93&"),D.length>0?M+D:""}}),tI=Qt((e,t)=>{var n=yb(),r=Object.prototype.hasOwnProperty,i=Array.isArray,o={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(p){return p.replace(/&#(\d+);/g,function(m,y){return String.fromCharCode(parseInt(y,10))})},a=function(p,m){return p&&typeof p=="string"&&m.comma&&p.indexOf(",")>-1?p.split(","):p},c="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(p,m){var y={},v=m.ignoreQueryPrefix?p.replace(/^\?/,""):p,g=m.parameterLimit===1/0?void 0:m.parameterLimit,b=v.split(m.delimiter,g),S=-1,E,_=m.charset;if(m.charsetSentinel)for(E=0;E<b.length;++E)b[E].indexOf("utf8=")===0&&(b[E]===l?_="utf-8":b[E]===c&&(_="iso-8859-1"),S=E,E=b.length);for(E=0;E<b.length;++E)if(E!==S){var I=b[E],P=I.indexOf("]="),$=P===-1?I.indexOf("="):P+1,O,q;$===-1?(O=m.decoder(I,o.decoder,_,"key"),q=m.strictNullHandling?null:""):(O=m.decoder(I.slice(0,$),o.decoder,_,"key"),q=n.maybeMap(a(I.slice($+1),m),function(H){return m.decoder(H,o.decoder,_,"value")})),q&&m.interpretNumericEntities&&_==="iso-8859-1"&&(q=s(q)),I.indexOf("[]=")>-1&&(q=i(q)?[q]:q),r.call(y,O)?y[O]=n.combine(y[O],q):y[O]=q}return y},d=function(p,m,y,v){for(var g=v?m:a(m,y),b=p.length-1;b>=0;--b){var S,E=p[b];if(E==="[]"&&y.parseArrays)S=[].concat(g);else{S=y.plainObjects?Object.create(null):{};var _=E.charAt(0)==="["&&E.charAt(E.length-1)==="]"?E.slice(1,-1):E,I=parseInt(_,10);!y.parseArrays&&_===""?S={0:g}:!isNaN(I)&&E!==_&&String(I)===_&&I>=0&&y.parseArrays&&I<=y.arrayLimit?(S=[],S[I]=g):_!=="__proto__"&&(S[_]=g)}g=S}return g},h=function(p,m,y,v){if(p){var g=y.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,b=/(\[[^[\]]*])/,S=/(\[[^[\]]*])/g,E=y.depth>0&&b.exec(g),_=E?g.slice(0,E.index):g,I=[];if(_){if(!y.plainObjects&&r.call(Object.prototype,_)&&!y.allowPrototypes)return;I.push(_)}for(var P=0;y.depth>0&&(E=S.exec(g))!==null&&P<y.depth;){if(P+=1,!y.plainObjects&&r.call(Object.prototype,E[1].slice(1,-1))&&!y.allowPrototypes)return;I.push(E[1])}return E&&I.push("["+g.slice(E.index)+"]"),d(I,m,y,v)}},f=function(p){if(!p)return o;if(p.decoder!==null&&p.decoder!==void 0&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var m=typeof p.charset>"u"?o.charset:p.charset;return{allowDots:typeof p.allowDots>"u"?o.allowDots:!!p.allowDots,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:o.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:o.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:o.arrayLimit,charset:m,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:o.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:o.comma,decoder:typeof p.decoder=="function"?p.decoder:o.decoder,delimiter:typeof p.delimiter=="string"||n.isRegExp(p.delimiter)?p.delimiter:o.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:o.depth,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:o.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:o.plainObjects,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:o.strictNullHandling}};t.exports=function(p,m){var y=f(m);if(p===""||p===null||typeof p>"u")return y.plainObjects?Object.create(null):{};for(var v=typeof p=="string"?u(p,y):p,g=y.plainObjects?Object.create(null):{},b=Object.keys(v),S=0;S<b.length;++S){var E=b[S],_=h(E,v[E],y,typeof p=="string");g=n.merge(g,_,y)}return y.allowSparse===!0?g:n.compact(g)}}),nI=Qt((e,t)=>{var n=eI(),r=tI(),i=Lf();t.exports={formats:i,parse:r,stringify:n}}),gb={};LO(gb,{DEFAULT_OPTIONS:()=>_b,default:()=>Eb,exponentialDelay:()=>wb,isIdempotentRequestError:()=>Uf,isNetworkError:()=>Ff,isNetworkOrIdempotentRequestError:()=>Bf,isRetryableError:()=>Tl,isSafeRequestError:()=>bb,linearDelay:()=>xb,namespace:()=>Cl,retryAfter:()=>Al});var rI=kl(UO(),1),Cl="axios-retry";function Ff(e){let t=["ERR_CANCELED","ECONNABORTED"];return e.response||!e.code||t.includes(e.code)?!1:(0,rI.default)(e)}var vb=["get","head","options"],iI=vb.concat(["put","delete"]);function Tl(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status===429||e.response.status>=500&&e.response.status<=599)}function bb(e){var t;return(t=e.config)!=null&&t.method?Tl(e)&&vb.indexOf(e.config.method)!==-1:!1}function Uf(e){var t;return(t=e.config)!=null&&t.method?Tl(e)&&iI.indexOf(e.config.method)!==-1:!1}function Bf(e){return Ff(e)||Uf(e)}function Al(e=void 0){var r;let t=(r=e==null?void 0:e.response)==null?void 0:r.headers["retry-after"];if(!t)return 0;let n=(Number(t)||0)*1e3;return n===0&&(n=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,n)}function oI(e=0,t=void 0){return Math.max(0,Al(t))}function wb(e=0,t=void 0,n=100){let r=2**e*n,i=Math.max(r,Al(t)),o=i*.2*Math.random();return i+o}function xb(e=100){return(t=0,n=void 0)=>{let r=t*e;return Math.max(r,Al(n))}}var _b={retries:3,retryCondition:Bf,retryDelay:oI,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function sI(e,t){return{..._b,...t,...e[Cl]}}function Sb(e,t,n=!1){let r=sI(e,t||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),e[Cl]=r,r}function aI(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function cI(e,t){let{retries:n,retryCondition:r}=e,i=(e.retryCount||0)<n&&r(t);if(typeof i=="object")try{return await i!==!1}catch{return!1}return i}async function lI(e,t,n,r){var c;t.retryCount+=1;let{retryDelay:i,shouldResetTimeout:o,onRetry:s}=t,a=i(t.retryCount,n);if(aI(e,r),!o&&r.timeout&&t.lastRequestTime){let l=Date.now()-t.lastRequestTime,u=r.timeout-l-a;if(u<=0)return Promise.reject(n);r.timeout=u}return r.transformRequest=[l=>l],await s(t.retryCount,n,r),(c=r.signal)!=null&&c.aborted?Promise.resolve(e(r)):new Promise(l=>{var h;let u=()=>{clearTimeout(d),l(e(r))},d=setTimeout(()=>{var f;l(e(r)),(f=r.signal)!=null&&f.removeEventListener&&r.signal.removeEventListener("abort",u)},a);(h=r.signal)!=null&&h.addEventListener&&r.signal.addEventListener("abort",u,{once:!0})})}async function uI(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}var bi=(e,t)=>{let n=e.interceptors.request.use(i=>{var o;return Sb(i,t,!0),(o=i[Cl])!=null&&o.validateResponse&&(i.validateStatus=()=>!1),i}),r=e.interceptors.response.use(null,async i=>{var a;let{config:o}=i;if(!o)return Promise.reject(i);let s=Sb(o,t);return i.response&&((a=s.validateResponse)!=null&&a.call(s,i.response))?i.response:await cI(s,i)?lI(e,s,i,o):(await uI(s,i),Promise.reject(i))});return{requestInterceptorId:n,responseInterceptorId:r}};bi.isNetworkError=Ff,bi.isSafeRequestError=bb,bi.isIdempotentRequestError=Uf,bi.isNetworkOrIdempotentRequestError=Bf,bi.exponentialDelay=wb,bi.linearDelay=xb,bi.isRetryableError=Tl;var Eb=bi,dI={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))},zf=typeof window<"u"&&typeof window.document<"u"?window.crypto:yf;zf.getRandomValues||(zf=dI);var jt=class extends Error{constructor(t,n,r,i,o,s){super(i);k(this,"isApiError",!0);this.code=t,this.description=n,this.type=r,this.message=i,this.error=o,this.id=s,this.id||(this.id=jt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let t=this.getPrefix(),n=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],r=4,i=Array.from(zf.getRandomValues(new Uint8Array(r))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${t}_${n}x${i}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},fI=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,kb=e=>e instanceof jt||fI(e)&&e.isApiError===!0,Uo=class extends jt{constructor(e,t,n){super(500,"An unknown error occurred","Unknown",e,t,n)}},Cb=class extends jt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}},Tb=class extends jt{constructor(e,t,n){super(401,"The request requires to be authenticated.","Unauthorized",e,t,n)}},Ab=class extends jt{constructor(e,t,n){super(403,"The requested action can't be peform by this resource.","Forbidden",e,t,n)}},Ob=class extends jt{constructor(e,t,n){super(413,"The request payload is too large.","PayloadTooLarge",e,t,n)}},Ib=class extends jt{constructor(e,t,n){super(400,"The request payload is invalid.","InvalidPayload",e,t,n)}},Rb=class extends jt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}},Pb=class extends jt{constructor(e,t,n){super(405,"The requested method does not exist.","MethodNotFound",e,t,n)}},$b=class extends jt{constructor(e,t,n){super(404,"The requested resource does not exist.","ResourceNotFound",e,t,n)}},Db=class extends jt{constructor(e,t,n){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",e,t,n)}},Nb=class extends jt{constructor(e,t,n){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",e,t,n)}},jb=class extends jt{constructor(e,t,n){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",e,t,n)}},Mb=class extends jt{constructor(e,t,n){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",e,t,n)}},qb=class extends jt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}},Lb=class extends jt{constructor(e,t,n){super(409,"The resource is current locked and cannot be operated on until the lock is released.","ResourceLockedConflict",e,t,n)}},Fb=class extends jt{constructor(e,t,n){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",e,t,n)}},Ub=class extends jt{constructor(e,t,n){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",e,t,n)}},Bb=class extends jt{constructor(e,t,n){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",e,t,n)}},zb=class extends jt{constructor(e,t,n){super(409,"The record attempted to be created already exists.","AlreadyExists",e,t,n)}},Zb=class extends jt{constructor(e,t,n){super(429,"The request has been rate limited.","RateLimited",e,t,n)}},Vb=class extends jt{constructor(e,t,n){super(402,"A payment is required to perform this request.","PaymentRequired",e,t,n)}},Hb=class extends jt{constructor(e,t,n){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",e,t,n)}},Wb=class extends jt{constructor(e,t,n){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",e,t,n)}},Kb=class extends jt{constructor(e,t,n){super(400,"Request payload contains breaking changes which is not allowed for this resource without a version increment.","BreakingChanges",e,t,n)}},pI={Unknown:Uo,Internal:Cb,Unauthorized:Tb,Forbidden:Ab,PayloadTooLarge:Ob,InvalidPayload:Ib,UnsupportedMediaType:Rb,MethodNotFound:Pb,ResourceNotFound:$b,InvalidJsonSchema:Db,InvalidDataFormat:Nb,InvalidIdentifier:jb,RelationConflict:Mb,ReferenceConstraint:qb,ResourceLockedConflict:Lb,ReferenceNotFound:Fb,InvalidQuery:Ub,Runtime:Bb,AlreadyExists:zb,RateLimited:Zb,PaymentRequired:Vb,QuotaExceeded:Hb,LimitExceeded:Wb,BreakingChanges:Kb},Zf=e=>kb(e)?e:e instanceof Error?new Uo(e.message,e):typeof e=="string"?new Uo(e):hI(e);function hI(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){let t=pI[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new Uo(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new Uo("An invalid error occurred: "+JSON.stringify(e))}var Bo=class extends Error{constructor(t,n,r){super(t),this.innerError=n,this.file=r,this.name="FileUploadError"}},mI=kl(BO()),yI=kl(zO()),gI="https://api.botpress.cloud",vI=6e4,bI="BP_API_URL",wI="BP_BOT_ID",xI="BP_INTEGRATION_ID",_I="BP_WORKSPACE_ID",SI="BP_TOKEN";function EI(e){let t=kI(e),n={};t.workspaceId&&(n["x-workspace-id"]=t.workspaceId),t.botId&&(n["x-bot-id"]=t.botId),t.integrationId&&(n["x-integration-id"]=t.integrationId),t.token&&(n.Authorization=`Bearer ${t.token}`),n={...n,...t.headers};let r=t.apiUrl??gI,i=t.timeout??vI;return{apiUrl:r,timeout:i,withCredentials:mb,headers:n}}function kI(e){return mb?e:Nf?CI(e):e}function CI(e){let t={...e,apiUrl:e.apiUrl??process.env[bI],botId:e.botId??process.env[wI],integrationId:e.integrationId??process.env[xI],workspaceId:e.workspaceId??process.env[_I]},n=t.token??process.env[SI];return n&&(t.token=n),t}var TI=kl(nI()),AI=e=>e[1]!==void 0,G=e=>{let{method:t,path:n,query:r,headers:i,body:o}=e,s=Object.entries(i).filter(AI),a=Object.fromEntries(s),c=TI.default.stringify(r,{encode:!0,arrayFormat:"repeat",allowDots:!0}),l=c?[n,c].join("?"):n;return{method:t,url:l,headers:a,data:o}},OI=e=>({path:"/v1/chat/conversations",headers:{},query:{},params:{},body:{channel:e.channel,tags:e.tags,integrationName:e.integrationName}}),II=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),RI=e=>({path:"/v1/chat/conversations",headers:{},query:{nextToken:e.nextToken,sortField:e.sortField,sortDirection:e.sortDirection,tags:e.tags,participantIds:e.participantIds,integrationName:e.integrationName},params:{},body:{}}),PI=e=>({path:"/v1/chat/conversations/get-or-create",headers:{},query:{},params:{},body:{channel:e.channel,tags:e.tags,integrationName:e.integrationName}}),$I=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{currentTaskId:e.currentTaskId,tags:e.tags}}),DI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),NI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}/participants`,headers:{},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),jI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}/participants`,headers:{},query:{},params:{id:e.id},body:{userId:e.userId}}),MI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}/participants/${encodeURIComponent(e.userId)}`,headers:{},query:{},params:{id:e.id,userId:e.userId},body:{}}),qI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}/participants/${encodeURIComponent(e.userId)}`,headers:{},query:{},params:{id:e.id,userId:e.userId},body:{}}),LI=e=>({path:"/v1/chat/events",headers:{},query:{},params:{},body:{type:e.type,payload:e.payload,schedule:e.schedule,conversationId:e.conversationId,userId:e.userId,messageId:e.messageId}}),FI=e=>({path:`/v1/chat/events/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),UI=e=>({path:"/v1/chat/events",headers:{},query:{nextToken:e.nextToken,type:e.type,conversationId:e.conversationId,userId:e.userId,messageId:e.messageId,status:e.status},params:{},body:{}}),BI=e=>({path:"/v1/chat/messages",headers:{},query:{},params:{},body:{payload:e.payload,userId:e.userId,conversationId:e.conversationId,type:e.type,tags:e.tags,schedule:e.schedule}}),zI=e=>({path:"/v1/chat/messages/get-or-create",headers:{},query:{},params:{},body:{payload:e.payload,userId:e.userId,conversationId:e.conversationId,type:e.type,tags:e.tags,schedule:e.schedule}}),ZI=e=>({path:`/v1/chat/messages/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),VI=e=>({path:`/v1/chat/messages/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{tags:e.tags}}),HI=e=>({path:"/v1/chat/messages",headers:{},query:{nextToken:e.nextToken,conversationId:e.conversationId,tags:e.tags},params:{},body:{}}),WI=e=>({path:`/v1/chat/messages/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),KI=e=>({path:"/v1/chat/users",headers:{},query:{},params:{},body:{tags:e.tags,integrationName:e.integrationName,name:e.name,pictureUrl:e.pictureUrl}}),JI=e=>({path:`/v1/chat/users/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),YI=e=>({path:"/v1/chat/users",headers:{},query:{nextToken:e.nextToken,conversationId:e.conversationId,tags:e.tags},params:{},body:{}}),GI=e=>({path:"/v1/chat/users/get-or-create",headers:{},query:{},params:{},body:{tags:e.tags,integrationName:e.integrationName,name:e.name,pictureUrl:e.pictureUrl}}),XI=e=>({path:`/v1/chat/users/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{tags:e.tags,name:e.name,pictureUrl:e.pictureUrl}}),QI=e=>({path:`/v1/chat/users/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),eR=e=>({path:`/v1/chat/states/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}/${encodeURIComponent(e.name)}`,headers:{},query:{},params:{type:e.type,id:e.id,name:e.name},body:{}}),tR=e=>({path:`/v1/chat/states/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}/${encodeURIComponent(e.name)}`,headers:{},query:{},params:{type:e.type,id:e.id,name:e.name},body:{payload:e.payload,expiry:e.expiry}}),nR=e=>({path:`/v1/chat/states/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}/${encodeURIComponent(e.name)}/get-or-set`,headers:{},query:{},params:{type:e.type,id:e.id,name:e.name},body:{payload:e.payload,expiry:e.expiry}}),rR=e=>({path:`/v1/chat/states/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}/${encodeURIComponent(e.name)}`,headers:{},query:{},params:{type:e.type,id:e.id,name:e.name},body:{payload:e.payload}}),iR=e=>({path:"/v1/chat/actions",headers:{},query:{},params:{},body:{type:e.type,input:e.input}}),oR=e=>({path:"/v1/chat/integrations/configure",headers:{},query:{},params:{},body:{identifier:e.identifier}}),sR=e=>({path:`/v1/chat/tasks/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),aR=e=>({path:"/v1/chat/tasks",headers:{},query:{},params:{},body:{title:e.title,description:e.description,type:e.type,data:e.data,parentTaskId:e.parentTaskId,conversationId:e.conversationId,userId:e.userId,timeoutAt:e.timeoutAt,tags:e.tags}}),cR=e=>({path:`/v1/chat/tasks/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{title:e.title,description:e.description,data:e.data,timeoutAt:e.timeoutAt,status:e.status,tags:e.tags}}),lR=e=>({path:`/v1/chat/tasks/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),uR=e=>({path:"/v1/chat/tasks",headers:{},query:{nextToken:e.nextToken,tags:e.tags,conversationId:e.conversationId,userId:e.userId,parentTaskId:e.parentTaskId,status:e.status,type:e.type},params:{},body:{}}),dR=e=>({path:"/v1/chat/analytics",headers:{},query:{},params:{},body:{name:e.name,count:e.count}}),fR=e=>({path:"/v1/admin/helper/vrl",headers:{},query:{},params:{},body:{data:e.data,script:e.script}}),pR=e=>({path:"/v1/admin/account/me",headers:{},query:{},params:{},body:{}}),hR=e=>({path:"/v1/admin/account/me",headers:{},query:{},params:{},body:{displayName:e.displayName,profilePicture:e.profilePicture,refresh:e.refresh}}),mR=e=>({path:"/v1/admin/account/pats",headers:{},query:{},params:{},body:{}}),yR=e=>({path:"/v1/admin/account/pats",headers:{},query:{},params:{},body:{note:e.note}}),gR=e=>({path:`/v1/admin/account/pats/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),vR=e=>({path:`/v1/admin/account/preferences/${encodeURIComponent(e.key)}`,headers:{},query:{},params:{key:e.key},body:{value:e.value}}),bR=e=>({path:`/v1/admin/account/preferences/${encodeURIComponent(e.key)}`,headers:{},query:{},params:{key:e.key},body:{}}),wR=e=>({path:"/v1/admin/hub/integrations",headers:{},query:{nextToken:e.nextToken,name:e.name,version:e.version},params:{},body:{}}),xR=e=>({path:`/v1/admin/hub/integrations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),_R=e=>({path:`/v1/admin/hub/integrations/${encodeURIComponent(e.name)}/${encodeURIComponent(e.version)}`,headers:{},query:{},params:{name:e.name,version:e.version},body:{}}),SR=e=>({path:"/v1/admin/bots",headers:{},query:{},params:{},body:{states:e.states,events:e.events,recurringEvents:e.recurringEvents,subscriptions:e.subscriptions,actions:e.actions,configuration:e.configuration,user:e.user,conversation:e.conversation,message:e.message,code:e.code,name:e.name,medias:e.medias,url:e.url,dev:e.dev}}),ER=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{url:e.url,authentication:e.authentication,configuration:e.configuration,blocked:e.blocked,alwaysAlive:e.alwaysAlive,user:e.user,message:e.message,conversation:e.conversation,events:e.events,actions:e.actions,states:e.states,recurringEvents:e.recurringEvents,integrations:e.integrations,subscriptions:e.subscriptions,code:e.code,name:e.name,medias:e.medias}}),kR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/transfer`,headers:{},query:{},params:{id:e.id},body:{targetWorkspaceId:e.targetWorkspaceId}}),CR=e=>({path:"/v1/admin/bots",headers:{},query:{dev:e.dev,nextToken:e.nextToken,sortField:e.sortField,sortDirection:e.sortDirection},params:{},body:{}}),TR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),AR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),OR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/logs`,headers:{},query:{timeStart:e.timeStart,timeEnd:e.timeEnd,nextToken:e.nextToken},params:{id:e.id},body:{}}),IR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/webchat`,headers:{},query:{type:e.type},params:{id:e.id},body:{}}),RR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/analytics`,headers:{},query:{startDate:e.startDate,endDate:e.endDate},params:{id:e.id},body:{}}),PR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/issues/${encodeURIComponent(e.issueId)}`,headers:{},query:{},params:{id:e.id,issueId:e.issueId},body:{}}),$R=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/issues`,headers:{},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),DR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/issues/${encodeURIComponent(e.issueId)}`,headers:{},query:{},params:{id:e.id,issueId:e.issueId},body:{}}),NR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/issues/${encodeURIComponent(e.issueId)}/events`,headers:{},query:{},params:{id:e.id,issueId:e.issueId},body:{}}),jR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/versions`,headers:{},query:{},params:{id:e.id},body:{}}),MR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/versions/${encodeURIComponent(e.versionId)}`,headers:{},query:{},params:{id:e.id,versionId:e.versionId},body:{}}),qR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/versions`,headers:{},query:{},params:{id:e.id},body:{name:e.name,description:e.description}}),LR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/versions/deploy`,headers:{},query:{},params:{id:e.id},body:{versionId:e.versionId}}),FR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/billing/payment-method`,headers:{},query:{},params:{id:e.id},body:{stripePaymentMethodId:e.stripePaymentMethodId}}),UR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/billing/invoices`,headers:{},query:{},params:{id:e.id},body:{}}),BR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/billing/upcoming-invoice`,headers:{},query:{},params:{id:e.id},body:{}}),zR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/billing/invoices/charge-unpaid`,headers:{},query:{},params:{id:e.id},body:{invoiceIds:e.invoiceIds}}),ZR=e=>({path:"/v1/admin/workspaces",headers:{},query:{},params:{},body:{name:e.name}}),VR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/public`,headers:{},query:{},params:{id:e.id},body:{}}),HR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),WR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/usages`,headers:{},query:{type:e.type,period:e.period},params:{id:e.id},body:{}}),KR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/usages/by-bot`,headers:{},query:{type:e.type,period:e.period},params:{id:e.id},body:{}}),JR=e=>({path:"/v1/admin/workspaces/usages/quota-completion",headers:{},query:{},params:{},body:{}}),YR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/quota`,headers:{},query:{type:e.type,period:e.period},params:{id:e.id},body:{}}),GR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/quotas`,headers:{},query:{period:e.period},params:{id:e.id},body:{}}),XR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{name:e.name,spendingLimit:e.spendingLimit,about:e.about,profilePicture:e.profilePicture,contactEmail:e.contactEmail,website:e.website,socialAccounts:e.socialAccounts,isPublic:e.isPublic,handle:e.handle}}),QR=e=>({path:"/v1/admin/workspaces/handle-availability",headers:{},query:{},params:{},body:{handle:e.handle}}),eP=e=>({path:"/v1/admin/workspaces",headers:{},query:{nextToken:e.nextToken},params:{},body:{}}),tP=e=>({path:"/v1/admin/workspaces/public",headers:{},query:{nextToken:e.nextToken,workspaceIds:e.workspaceIds,search:e.search},params:{},body:{}}),nP=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),rP=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/audit-records`,headers:{},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),iP=e=>({path:"/v1/admin/workspace-members",headers:{},query:{nextToken:e.nextToken},params:{},body:{}}),oP=e=>({path:"/v1/admin/workspace-members/me",headers:{},query:{},params:{},body:{}}),sP=e=>({path:`/v1/admin/workspace-members/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),aP=e=>({path:"/v1/admin/workspace-members",headers:{},query:{},params:{},body:{email:e.email,role:e.role}}),cP=e=>({path:`/v1/admin/workspace-members/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{role:e.role}}),lP=e=>({path:"/v1/admin/integrations/iaks",headers:{},query:{integrationId:e.integrationId},params:{},body:{}}),uP=e=>({path:"/v1/admin/integrations/iaks",headers:{},query:{},params:{},body:{integrationId:e.integrationId,note:e.note}}),dP=e=>({path:`/v1/admin/integrations/iaks/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),fP=e=>({path:"/v1/admin/integrations",headers:{},query:{},params:{},body:{name:e.name,version:e.version,interfaces:e.interfaces,configuration:e.configuration,states:e.states,events:e.events,actions:e.actions,entities:e.entities,identifier:e.identifier,channels:e.channels,user:e.user,secrets:e.secrets,code:e.code,url:e.url,dev:e.dev,icon:e.icon,readme:e.readme,title:e.title,description:e.description,public:e.public}}),pP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{configuration:e.configuration,channels:e.channels,identifier:e.identifier,actions:e.actions,events:e.events,states:e.states,user:e.user,entities:e.entities,interfaces:e.interfaces,secrets:e.secrets,code:e.code,icon:e.icon,readme:e.readme,title:e.title,description:e.description,url:e.url,public:e.public}}),hP=e=>({path:"/v1/admin/integrations",headers:{},query:{nextToken:e.nextToken,name:e.name,version:e.version,dev:e.dev},params:{},body:{}}),mP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),yP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.id)}/logs`,headers:{},query:{timeStart:e.timeStart,timeEnd:e.timeEnd,nextToken:e.nextToken},params:{id:e.id},body:{}}),gP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.name)}/${encodeURIComponent(e.version)}`,headers:{},query:{},params:{name:e.name,version:e.version},body:{}}),vP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),bP=e=>({path:"/v1/admin/integrations/request-verification",headers:{},query:{},params:{},body:{integrationId:e.integrationId}}),wP=e=>({path:"/v1/admin/interfaces",headers:{},query:{},params:{},body:{name:e.name,version:e.version,events:e.events,actions:e.actions,entities:e.entities}}),xP=e=>({path:`/v1/admin/interfaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),_P=e=>({path:`/v1/admin/interfaces/${encodeURIComponent(e.name)}/${encodeURIComponent(e.version)}`,headers:{},query:{},params:{name:e.name,version:e.version},body:{}}),SP=e=>({path:`/v1/admin/interfaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{events:e.events,actions:e.actions,entities:e.entities}}),EP=e=>({path:`/v1/admin/interfaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),kP=e=>({path:"/v1/admin/interfaces",headers:{},query:{nextToken:e.nextToken},params:{},body:{}}),CP=e=>({path:`/v1/admin/usages/${encodeURIComponent(e.id)}`,headers:{},query:{type:e.type,period:e.period},params:{id:e.id},body:{}}),TP=e=>({path:"/v1/admin/usages/multiple",headers:{},query:{types:e.types,ids:e.ids,period:e.period},params:{},body:{}}),AP=e=>({path:`/v1/admin/usages/${encodeURIComponent(e.id)}/history`,headers:{},query:{type:e.type},params:{id:e.id},body:{}}),OP=e=>({path:"/v1/admin/quotas/ai-spend",headers:{},query:{},params:{},body:{monthlySpendingLimit:e.monthlySpendingLimit}}),IP=e=>({path:"/v1/admin/activities",headers:{},query:{nextToken:e.nextToken,taskId:e.taskId,botId:e.botId},params:{},body:{}}),RP=e=>({path:"/v1/admin/introspect",headers:{},query:{},params:{},body:{botId:e.botId}}),PP=e=>({path:"/v1/files",headers:{},query:{},params:{},body:{key:e.key,tags:e.tags,size:e.size,index:e.index,accessPolicies:e.accessPolicies,contentType:e.contentType,expiresAt:e.expiresAt}}),$P=e=>({path:`/v1/files/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),DP=e=>({path:"/v1/files",headers:{},query:{nextToken:e.nextToken,tags:e.tags},params:{},body:{}}),NP=e=>({path:`/v1/files/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),jP=e=>({path:`/v1/files/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{tags:e.tags,accessPolicies:e.accessPolicies,expiresAt:e.expiresAt}}),MP=e=>({path:"/v1/files/search",headers:{},query:{tags:e.tags,query:e.query,contextDepth:e.contextDepth,limit:e.limit,includeBreadcrumb:e.includeBreadcrumb},params:{},body:{}}),qP=e=>({path:`/v1/files/${encodeURIComponent(e.fileId)}/passages`,headers:{},query:{nextToken:e.nextToken,limit:e.limit},params:{fileId:e.fileId},body:{}}),LP=e=>({path:"/v1/tables",headers:{},query:{tags:e.tags},params:{},body:{}}),FP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}`,headers:{},query:{},params:{table:e.table},body:{}}),UP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}`,headers:{},query:{},params:{table:e.table},body:{factor:e.factor,frozen:e.frozen,schema:e.schema,tags:e.tags,isComputeEnabled:e.isComputeEnabled}}),BP=e=>({path:"/v1/tables",headers:{},query:{},params:{},body:{name:e.name,factor:e.factor,frozen:e.frozen,schema:e.schema,tags:e.tags,isComputeEnabled:e.isComputeEnabled}}),zP=e=>({path:`/v1/tables/${encodeURIComponent(e.sourceTableId)}/duplicate`,headers:{},query:{},params:{sourceTableId:e.sourceTableId},body:{tableName:e.tableName,schemaOnly:e.schemaOnly,factor:e.factor}}),ZP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}`,headers:{},query:{},params:{table:e.table},body:{name:e.name,frozen:e.frozen,schema:e.schema,tags:e.tags,isComputeEnabled:e.isComputeEnabled}}),VP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/column`,headers:{},query:{},params:{table:e.table},body:{name:e.name,newName:e.newName}}),HP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}`,headers:{},query:{},params:{table:e.table},body:{}}),WP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/row`,headers:{},query:{id:e.id},params:{table:e.table},body:{}}),KP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows/find`,headers:{},query:{},params:{table:e.table},body:{limit:e.limit,offset:e.offset,filter:e.filter,group:e.group,search:e.search,orderBy:e.orderBy,orderDirection:e.orderDirection}}),JP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows`,headers:{},query:{},params:{table:e.table},body:{rows:e.rows,waitComputed:e.waitComputed}}),YP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows/delete`,headers:{},query:{},params:{table:e.table},body:{ids:e.ids,filter:e.filter,deleteAllRows:e.deleteAllRows}}),GP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows`,headers:{},query:{},params:{table:e.table},body:{rows:e.rows,waitComputed:e.waitComputed}}),XP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows/upsert`,headers:{},query:{},params:{table:e.table},body:{rows:e.rows,keyColumn:e.keyColumn,waitComputed:e.waitComputed}}),QP=class{constructor(e,t={}){k(this,"createConversation",async e=>{let{path:t,headers:n,query:r,body:i}=OI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getConversation",async e=>{let{path:t,headers:n,query:r,body:i}=II(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listConversations",async e=>{let{path:t,headers:n,query:r,body:i}=RI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrCreateConversation",async e=>{let{path:t,headers:n,query:r,body:i}=PI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateConversation",async e=>{let{path:t,headers:n,query:r,body:i}=$I(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteConversation",async e=>{let{path:t,headers:n,query:r,body:i}=DI(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listParticipants",async e=>{let{path:t,headers:n,query:r,body:i}=NI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"addParticipant",async e=>{let{path:t,headers:n,query:r,body:i}=jI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getParticipant",async e=>{let{path:t,headers:n,query:r,body:i}=MI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"removeParticipant",async e=>{let{path:t,headers:n,query:r,body:i}=qI(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createEvent",async e=>{let{path:t,headers:n,query:r,body:i}=LI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getEvent",async e=>{let{path:t,headers:n,query:r,body:i}=FI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listEvents",async e=>{let{path:t,headers:n,query:r,body:i}=UI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createMessage",async e=>{let{path:t,headers:n,query:r,body:i}=BI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrCreateMessage",async e=>{let{path:t,headers:n,query:r,body:i}=zI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getMessage",async e=>{let{path:t,headers:n,query:r,body:i}=ZI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateMessage",async e=>{let{path:t,headers:n,query:r,body:i}=VI(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listMessages",async e=>{let{path:t,headers:n,query:r,body:i}=HI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteMessage",async e=>{let{path:t,headers:n,query:r,body:i}=WI(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createUser",async e=>{let{path:t,headers:n,query:r,body:i}=KI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getUser",async e=>{let{path:t,headers:n,query:r,body:i}=JI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listUsers",async e=>{let{path:t,headers:n,query:r,body:i}=YI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrCreateUser",async e=>{let{path:t,headers:n,query:r,body:i}=GI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateUser",async e=>{let{path:t,headers:n,query:r,body:i}=XI(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteUser",async e=>{let{path:t,headers:n,query:r,body:i}=QI(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getState",async e=>{let{path:t,headers:n,query:r,body:i}=eR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"setState",async e=>{let{path:t,headers:n,query:r,body:i}=tR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrSetState",async e=>{let{path:t,headers:n,query:r,body:i}=nR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"patchState",async e=>{let{path:t,headers:n,query:r,body:i}=rR(e),o=(this.props.toAxiosRequest??G)({method:"patch",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"callAction",async e=>{let{path:t,headers:n,query:r,body:i}=iR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"configureIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=oR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getTask",async e=>{let{path:t,headers:n,query:r,body:i}=sR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createTask",async e=>{let{path:t,headers:n,query:r,body:i}=aR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateTask",async e=>{let{path:t,headers:n,query:r,body:i}=cR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteTask",async e=>{let{path:t,headers:n,query:r,body:i}=lR(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listTasks",async e=>{let{path:t,headers:n,query:r,body:i}=uR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"trackAnalytics",async e=>{let{path:t,headers:n,query:r,body:i}=dR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"runVrl",async e=>{let{path:t,headers:n,query:r,body:i}=fR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getAccount",async e=>{let{path:t,headers:n,query:r,body:i}=pR(),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateAccount",async e=>{let{path:t,headers:n,query:r,body:i}=hR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listPersonalAccessTokens",async e=>{let{path:t,headers:n,query:r,body:i}=mR(),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createPersonalAccessToken",async e=>{let{path:t,headers:n,query:r,body:i}=yR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deletePersonalAccessToken",async e=>{let{path:t,headers:n,query:r,body:i}=gR(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"setAccountPreference",async e=>{let{path:t,headers:n,query:r,body:i}=vR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getAccountPreference",async e=>{let{path:t,headers:n,query:r,body:i}=bR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listPublicIntegrations",async e=>{let{path:t,headers:n,query:r,body:i}=wR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getPublicIntegrationById",async e=>{let{path:t,headers:n,query:r,body:i}=xR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getPublicIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=_R(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createBot",async e=>{let{path:t,headers:n,query:r,body:i}=SR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateBot",async e=>{let{path:t,headers:n,query:r,body:i}=ER(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"transferBot",async e=>{let{path:t,headers:n,query:r,body:i}=kR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listBots",async e=>{let{path:t,headers:n,query:r,body:i}=CR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBot",async e=>{let{path:t,headers:n,query:r,body:i}=TR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteBot",async e=>{let{path:t,headers:n,query:r,body:i}=AR(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotLogs",async e=>{let{path:t,headers:n,query:r,body:i}=OR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotWebchat",async e=>{let{path:t,headers:n,query:r,body:i}=IR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotAnalytics",async e=>{let{path:t,headers:n,query:r,body:i}=RR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotIssue",async e=>{let{path:t,headers:n,query:r,body:i}=PR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listBotIssues",async e=>{let{path:t,headers:n,query:r,body:i}=$R(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteBotIssue",async e=>{let{path:t,headers:n,query:r,body:i}=DR(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listBotIssueEvents",async e=>{let{path:t,headers:n,query:r,body:i}=NR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listBotVersions",async e=>{let{path:t,headers:n,query:r,body:i}=jR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotVersion",async e=>{let{path:t,headers:n,query:r,body:i}=MR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createBotVersion",async e=>{let{path:t,headers:n,query:r,body:i}=qR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deployBotVersion",async e=>{let{path:t,headers:n,query:r,body:i}=LR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"setWorkspacePaymentMethod",async e=>{let{path:t,headers:n,query:r,body:i}=FR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaceInvoices",async e=>{let{path:t,headers:n,query:r,body:i}=UR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getUpcomingInvoice",async e=>{let{path:t,headers:n,query:r,body:i}=BR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"chargeWorkspaceUnpaidInvoices",async e=>{let{path:t,headers:n,query:r,body:i}=zR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=ZR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getPublicWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=VR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=HR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaceUsages",async e=>{let{path:t,headers:n,query:r,body:i}=WR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"breakDownWorkspaceUsageByBot",async e=>{let{path:t,headers:n,query:r,body:i}=KR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getAllWorkspaceQuotaCompletion",async e=>{let{path:t,headers:n,query:r,body:i}=JR(),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getWorkspaceQuota",async e=>{let{path:t,headers:n,query:r,body:i}=YR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaceQuotas",async e=>{let{path:t,headers:n,query:r,body:i}=GR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=XR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"checkHandleAvailability",async e=>{let{path:t,headers:n,query:r,body:i}=QR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaces",async e=>{let{path:t,headers:n,query:r,body:i}=eP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listPublicWorkspaces",async e=>{let{path:t,headers:n,query:r,body:i}=tP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=nP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getAuditRecords",async e=>{let{path:t,headers:n,query:r,body:i}=rP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaceMembers",async e=>{let{path:t,headers:n,query:r,body:i}=iP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getWorkspaceMember",async e=>{let{path:t,headers:n,query:r,body:i}=oP(),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteWorkspaceMember",async e=>{let{path:t,headers:n,query:r,body:i}=sP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createWorkspaceMember",async e=>{let{path:t,headers:n,query:r,body:i}=aP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateWorkspaceMember",async e=>{let{path:t,headers:n,query:r,body:i}=cP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listIntegrationApiKeys",async e=>{let{path:t,headers:n,query:r,body:i}=lP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createIntegrationApiKey",async e=>{let{path:t,headers:n,query:r,body:i}=uP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteIntegrationApiKey",async e=>{let{path:t,headers:n,query:r,body:i}=dP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=fP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=pP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listIntegrations",async e=>{let{path:t,headers:n,query:r,body:i}=hP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=mP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getIntegrationLogs",async e=>{let{path:t,headers:n,query:r,body:i}=yP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getIntegrationByName",async e=>{let{path:t,headers:n,query:r,body:i}=gP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=vP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"requestIntegrationVerification",async e=>{let{path:t,headers:n,query:r,body:i}=bP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createInterface",async e=>{let{path:t,headers:n,query:r,body:i}=wP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getInterface",async e=>{let{path:t,headers:n,query:r,body:i}=xP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getInterfaceByName",async e=>{let{path:t,headers:n,query:r,body:i}=_P(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateInterface",async e=>{let{path:t,headers:n,query:r,body:i}=SP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteInterface",async e=>{let{path:t,headers:n,query:r,body:i}=EP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listInterfaces",async e=>{let{path:t,headers:n,query:r,body:i}=kP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getUsage",async e=>{let{path:t,headers:n,query:r,body:i}=CP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getMultipleUsages",async e=>{let{path:t,headers:n,query:r,body:i}=TP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listUsageHistory",async e=>{let{path:t,headers:n,query:r,body:i}=AP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"changeAISpendQuota",async e=>{let{path:t,headers:n,query:r,body:i}=OP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listActivities",async e=>{let{path:t,headers:n,query:r,body:i}=IP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"introspect",async e=>{let{path:t,headers:n,query:r,body:i}=RP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"upsertFile",async e=>{let{path:t,headers:n,query:r,body:i}=PP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteFile",async e=>{let{path:t,headers:n,query:r,body:i}=$P(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listFiles",async e=>{let{path:t,headers:n,query:r,body:i}=DP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getFile",async e=>{let{path:t,headers:n,query:r,body:i}=NP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateFileMetadata",async e=>{let{path:t,headers:n,query:r,body:i}=jP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"searchFiles",async e=>{let{path:t,headers:n,query:r,body:i}=MP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listFilePassages",async e=>{let{path:t,headers:n,query:r,body:i}=qP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listTables",async e=>{let{path:t,headers:n,query:r,body:i}=LP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getTable",async e=>{let{path:t,headers:n,query:r,body:i}=FP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrCreateTable",async e=>{let{path:t,headers:n,query:r,body:i}=UP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createTable",async e=>{let{path:t,headers:n,query:r,body:i}=BP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"duplicateTable",async e=>{let{path:t,headers:n,query:r,body:i}=zP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateTable",async e=>{let{path:t,headers:n,query:r,body:i}=ZP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"renameTableColumn",async e=>{let{path:t,headers:n,query:r,body:i}=VP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteTable",async e=>{let{path:t,headers:n,query:r,body:i}=HP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getTableRow",async e=>{let{path:t,headers:n,query:r,body:i}=WP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"findTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=KP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=JP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=YP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=GP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"upsertTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=XP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});this.axiosInstance=e,this.props=t}};function X(e){var t;return Lo.isAxiosError(e)&&((t=e.response)!=null&&t.data)?Zf(e.response.data):Zf(e)}var gn=class{constructor(e){this._list=e}async*[Symbol.asyncIterator](){let e;do{let{items:t,meta:n}=await this._list({nextToken:e});e=n.nextToken;for(let r of t)yield r}while(e)}async collect(e={}){let t=e.limit??Number.POSITIVE_INFINITY,n=[],r=0;for await(let i of this)if(n.push(i),r++,r>=t)break;return n}},e$=class{constructor(e){k(this,"conversations",e=>new gn(({nextToken:t})=>this.client.listConversations({nextToken:t,...e}).then(n=>({...n,items:n.conversations}))));k(this,"participants",e=>new gn(({nextToken:t})=>this.client.listParticipants({nextToken:t,...e}).then(n=>({...n,items:n.participants}))));k(this,"events",e=>new gn(({nextToken:t})=>this.client.listEvents({nextToken:t,...e}).then(n=>({...n,items:n.events}))));k(this,"messages",e=>new gn(({nextToken:t})=>this.client.listMessages({nextToken:t,...e}).then(n=>({...n,items:n.messages}))));k(this,"users",e=>new gn(({nextToken:t})=>this.client.listUsers({nextToken:t,...e}).then(n=>({...n,items:n.users}))));k(this,"tasks",e=>new gn(({nextToken:t})=>this.client.listTasks({nextToken:t,...e}).then(n=>({...n,items:n.tasks}))));k(this,"publicIntegrations",e=>new gn(({nextToken:t})=>this.client.listPublicIntegrations({nextToken:t,...e}).then(n=>({...n,items:n.integrations}))));k(this,"bots",e=>new gn(({nextToken:t})=>this.client.listBots({nextToken:t,...e}).then(n=>({...n,items:n.bots}))));k(this,"botIssues",e=>new gn(({nextToken:t})=>this.client.listBotIssues({nextToken:t,...e}).then(n=>({...n,items:n.issues}))));k(this,"workspaces",e=>new gn(({nextToken:t})=>this.client.listWorkspaces({nextToken:t,...e}).then(n=>({...n,items:n.workspaces}))));k(this,"publicWorkspaces",e=>new gn(({nextToken:t})=>this.client.listPublicWorkspaces({nextToken:t,...e}).then(n=>({...n,items:n.workspaces}))));k(this,"workspaceMembers",e=>new gn(({nextToken:t})=>this.client.listWorkspaceMembers({nextToken:t,...e}).then(n=>({...n,items:n.members}))));k(this,"integrations",e=>new gn(({nextToken:t})=>this.client.listIntegrations({nextToken:t,...e}).then(n=>({...n,items:n.integrations}))));k(this,"interfaces",e=>new gn(({nextToken:t})=>this.client.listInterfaces({nextToken:t,...e}).then(n=>({...n,items:n.interfaces}))));k(this,"activities",e=>new gn(({nextToken:t})=>this.client.listActivities({nextToken:t,...e}).then(n=>({...n,items:n.activities}))));k(this,"files",e=>new gn(({nextToken:t})=>this.client.listFiles({nextToken:t,...e}).then(n=>({...n,items:n.files}))));k(this,"filePassages",e=>new gn(({nextToken:t})=>this.client.listFilePassages({nextToken:t,...e}).then(n=>({...n,items:n.passages}))));this.client=e}},Jb=100*1024*1024,t$=Jb,n$=Jb,r$=class extends QP{constructor(t={}){let n=EI(t),{apiUrl:r,headers:i,withCredentials:o,timeout:s}=n,a=Lo.create({baseURL:r,headers:i,withCredentials:o,timeout:s,maxBodyLength:t$,maxContentLength:n$,httpAgent:Nf?new mI.default.Agent({keepAlive:!0}):void 0,httpsAgent:Nf?new yI.default.Agent({keepAlive:!0}):void 0});super(a);k(this,"config");k(this,"uploadFile",async({key:t,index:n,tags:r,contentType:i,accessPolicies:o,content:s,url:a,expiresAt:c})=>{if(a&&s)throw new Bo("Cannot provide both content and URL, please provide only one of them");if(a&&(s=await Lo.get(a,{responseType:"arraybuffer"}).then(h=>h.data).catch(h=>{throw new Bo(`Failed to download file from provided URL: ${h.message}`,h)})),!s)throw new Bo("No content was provided for the file");let l,u;if(typeof s=="string"){let h=new TextEncoder().encode(s);l=h,u=h.byteLength}else if(s instanceof Uint8Array)l=s,u=l.byteLength;else if(s instanceof ArrayBuffer)l=s,u=l.byteLength;else if(s instanceof Blob)l=s,u=s.size;else throw new Bo("The provided content is not supported");let{file:d}=await this.upsertFile({key:t,tags:r,index:n,accessPolicies:o,contentType:i,size:u,expiresAt:c});try{await Lo.put(d.uploadUrl,l,{maxBodyLength:1/0,headers:{"Content-Type":d.contentType}})}catch(h){throw new Bo(`Failed to upload file: ${h.message}`,h,d)}return{file:d}});t.retry&&Eb(a,t.retry),this.config=n}get list(){return new e$(this)}};const Ol=zd(Object.freeze(Object.defineProperty({__proto__:null,AlreadyExistsError:zb,BreakingChangesError:Kb,Client:r$,ForbiddenError:Ab,InternalError:Cb,InvalidDataFormatError:Nb,InvalidIdentifierError:jb,InvalidJsonSchemaError:Db,InvalidPayloadError:Ib,InvalidQueryError:Ub,LimitExceededError:Wb,MethodNotFoundError:Pb,PayloadTooLargeError:Ob,PaymentRequiredError:Vb,QuotaExceededError:Hb,RateLimitedError:Zb,ReferenceConstraintError:qb,ReferenceNotFoundError:Fb,RelationConflictError:Mb,ResourceLockedConflictError:Lb,ResourceNotFoundError:$b,RuntimeError:Bb,UnauthorizedError:Tb,UnknownError:Uo,UnsupportedMediaTypeError:Rb,UploadFileError:Bo,axios:TO,axiosRetry:gb,errorFrom:Zf,isApiError:kb},Symbol.toStringTag,{value:"Module"})));(function(e){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,a=(x,ne)=>{for(var be in ne)n(x,be,{get:ne[be],enumerable:!0})},c=(x,ne,be,Me)=>{if(ne&&typeof ne=="object"||typeof ne=="function")for(let qe of i(ne))!s.call(x,qe)&&qe!==be&&n(x,qe,{get:()=>ne[qe],enumerable:!(Me=r(ne,qe))||Me.enumerable});return x},l=(x,ne,be)=>(c(x,ne,"default"),be&&c(be,ne,"default")),u=(x,ne,be)=>(be=x!=null?t(o(x)):{},c(ne||!x||!x.__esModule?n(be,"default",{value:x,enumerable:!0}):be,x)),d=x=>c(n({},"__esModule",{value:!0}),x),h={};a(h,{Bot:()=>GH,BotSpecificClient:()=>kC,Integration:()=>Vt,IntegrationDefinition:()=>oe,IntegrationSpecificClient:()=>Mt,InterfaceDeclaration:()=>ce,RuntimeError:()=>EC.RuntimeError,botIdHeader:()=>C,botUserIdHeader:()=>te,configurationHeader:()=>we,integrationIdHeader:()=>fe,interfaces:()=>D,isApiError:()=>EC.isApiError,messages:()=>f,operationHeader:()=>Te,parseBody:()=>Se,serve:()=>Be,typeHeader:()=>Ee,webhookIdHeader:()=>A}),e.exports=d(h);var f={};a(f,{defaults:()=>F});var p={};a(p,{default:()=>y});var m=ac;l(p,ac);var y=m.z,v=p.z.string().min(1),g=p.z.object({text:v}),b=p.z.object({markdown:v}),S=p.z.object({imageUrl:v}),E=p.z.object({audioUrl:v}),_=p.z.object({videoUrl:v}),I=p.z.object({fileUrl:v,title:v.optional()}),P=p.z.object({latitude:p.z.number(),longitude:p.z.number(),address:p.z.string().optional(),title:p.z.string().optional()}),$=p.z.object({title:v,subtitle:v.optional(),imageUrl:v.optional(),actions:p.z.array(p.z.object({action:p.z.enum(["postback","url","say"]),label:v,value:v}))}),O=p.z.object({text:v,options:p.z.array(p.z.object({label:v,value:v}))}),q=p.z.object({items:p.z.array($)}),H=p.z.discriminatedUnion("type",[p.z.object({type:p.z.literal("text"),payload:g}),p.z.object({type:p.z.literal("markdown"),payload:b}),p.z.object({type:p.z.literal("image"),payload:S}),p.z.object({type:p.z.literal("audio"),payload:E}),p.z.object({type:p.z.literal("video"),payload:_}),p.z.object({type:p.z.literal("file"),payload:I}),p.z.object({type:p.z.literal("location"),payload:P})]),B=p.z.object({items:p.z.array(H)}),F={text:{schema:g},markdown:{schema:b},image:{schema:S},audio:{schema:E},video:{schema:_},file:{schema:I},location:{schema:P},carousel:{schema:q},card:{schema:$},dropdown:{schema:O},choice:{schema:O},bloc:{schema:B}},D={};a(D,{creatable:()=>Kt,deletable:()=>Kn,hitl:()=>ir,listable:()=>ot,llm:()=>pn,readable:()=>Lt,schemas:()=>M,speechToText:()=>le,textToImage:()=>FH,typingIndicator:()=>UH,updatable:()=>Ft});var M={};a(M,{speechToText:()=>Z});var Z={};a(Z,{OpenAITranscribeAudioOutputSchema:()=>W});var W=y.object({language:y.string().describe("Detected language of the audio"),duration:y.number().describe("Duration of the audio file, in seconds"),segments:y.array(y.object({text:y.string().describe("Text content of the segment."),id:y.number().describe("Unique identifier of the segment"),seek:y.number().describe("Seek offset of the segment"),start:y.number().describe("Start time of the segment in seconds."),end:y.number().describe("End time of the segment in seconds."),tokens:y.array(y.number()).describe("Array of token IDs for the text content."),temperature:y.number().describe("Temperature parameter used for generating the segment."),avg_logprob:y.number().describe("Average logprob of the segment. If the value is lower than -1, consider the logprobs failed."),compression_ratio:y.number().describe("Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed."),no_speech_prob:y.number().describe("Probability of no speech in the segment. If the value is higher than 1.0 and the avg_logprob is below -1, consider this segment silent.")}))}),Q=ac,C="x-bot-id",te="x-bot-user-id",fe="x-integration-id",A="x-webhook-id",we="x-bp-configuration",Te="x-bp-operation",Ee="x-bp-type",Pe=Q.z.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Fe=x=>{let ne=x[C],be=x[te],Me=x[fe],qe=x[A],je=x[we],Le=Pe.parse(x[Te]);if(!ne)throw new Error("Missing bot headers");if(!be)throw new Error("Missing bot user headers");if(!Me)throw new Error("Missing integration headers");if(!qe)throw new Error("Missing webhook headers");if(!je)throw new Error("Missing configuration headers");if(!Le)throw new Error("Missing operation headers");return{botId:ne,botUserId:be,integrationId:Me,webhookId:qe,operation:Le,configuration:je?JSON.parse(Buffer.from(je,"base64").toString("utf-8")):{}}},Re=x=>Array.from(new Set(x)),he=x=>Object.entries(x),de=(x,ne)=>Object.fromEntries(he(x).map(([be,Me])=>[be,ne(Me,be)])),_e=(x,ne,be)=>{let Me=Re([...Object.keys(x),...Object.keys(ne)]),qe={};for(let je of Me){let Le=x[je],at=ne[je];Le&&at?qe[je]=be(Le,at):Le?qe[je]=Le:at&&(qe[je]=at)}return qe},pe=Symbol("schemaName"),De=x=>x?de(x,(ne,be)=>({...ne,[pe]:be})):{},et=x=>x[pe]!==void 0,L=x=>x[pe],oe=class{constructor(x){k(this,"name");k(this,"version");k(this,"title");k(this,"description");k(this,"icon");k(this,"readme");k(this,"configuration");k(this,"events");k(this,"actions");k(this,"channels");k(this,"states");k(this,"user");k(this,"secrets");k(this,"identifier");k(this,"entities");k(this,"interfaces",{});k(this,"_mergeActions",(x,ne)=>({title:ne.title??x.title,description:ne.description??x.description,input:{schema:x.input.schema.merge(ne.input.schema)},output:{schema:x.output.schema.merge(ne.output.schema)}}));k(this,"_mergeEvents",(x,ne)=>({title:ne.title??x.title,description:ne.description??x.description,schema:x.schema.merge(ne.schema)}));k(this,"_mergeChannels",(x,ne)=>{let be=_e(x.messages,ne.messages,this._mergeMessage);return{title:ne.title??x.title,description:ne.description??x.description,conversation:ne.conversation??x.conversation,message:ne.message??x.message,messages:be}});k(this,"_mergeMessage",(x,ne)=>({schema:x.schema.merge(ne.schema)}));this.props=x,this.name=x.name,this.version=x.version,this.icon=x.icon,this.readme=x.readme,this.title=x.title,this.identifier=x.identifier,this.description=x.description,this.configuration=x.configuration,this.events=x.events,this.actions=x.actions,this.channels=x.channels,this.states=x.states,this.user=x.user,this.secrets=x.secrets,this.entities=x.entities}clone(x){let ne=new oe({...this,...x});for(let[be,Me]of Object.entries(this.interfaces))ne.interfaces[be]=Me;return ne}extend(x,ne){let be=ne(De(this.entities)),Me=he(be).find(([or,Rs])=>!et(Rs));if(Me)throw new Error(`Cannot extend interface "${x.name}" with entity "${Me[0]}"; the provided schema is not part of the integration's entities.`);let qe=de(be,or=>({name:L(or),schema:or.schema})),{resolved:je,implementStatement:Le}=x.resolve({entities:qe}),at=this;at.actions=_e(at.actions??{},je.actions,this._mergeActions),at.channels=_e(at.channels??{},je.channels,this._mergeChannels),at.events=_e(at.events??{},je.events,this._mergeEvents);let hn=Object.values(qe).map(or=>or.name),Sn=`${x.name}<${hn.join(",")}>`;return this.interfaces[Sn]=Le,this}},ce=class{constructor(x){k(this,"name");k(this,"version");k(this,"entities");k(this,"events");k(this,"actions");k(this,"channels");k(this,"templateName");this.props=x,this.name=x.name,this.version=x.version,this.entities=x.entities??{},this.events=x.events??{},this.actions=x.actions??{},this.channels=x.channels??{},this.templateName=x.templateName}resolve(x){let{entities:ne}=x,be={name:this.name,version:this.version,entities:de(ne,Le=>({name:Le.name})),actions:{},events:{}},Me={},qe={},je={};for(let[Le,at]of he(this.actions)){let hn=this._dereference(at.input.schema,ne),Sn=this._dereference(at.output.schema,ne),or=this._rename(ne,Le);Me[or]={input:{schema:hn},output:{schema:Sn}},be.actions[Le]={name:or}}for(let[Le,at]of he(this.events)){let hn=this._dereference(at.schema,ne),Sn=this._rename(ne,Le);qe[Sn]={schema:hn},be.events[Le]={name:Sn}}for(let[Le,at]of he(this.channels)){let hn={};for(let[Sn,or]of he(at.messages)){let Rs=this._dereference(or.schema,ne);hn[Sn]={schema:Rs}}je[Le]={messages:hn}}return{resolved:{actions:Me,events:qe,channels:je},implementStatement:be}}_dereference(x,ne){let be={},Me={};for(let[qe,je]of he(ne))be[qe]=je.schema,Me[qe]=y.ref(qe);return x(Me).dereference(be)}_rename(x,ne){if(!this.templateName)return ne;let be=de(x,Me=>Me.name);return this.templateName(ne,be)}},ue=gf,Ne=console;function Se(x){if(!x.body)throw new Error("Missing body");return JSON.parse(x.body)}async function Be(x,ne=8072,be=ie){let Me=(0,ue.createServer)(async(qe,je)=>{try{let Le=await pt(qe);if(Le.path==="/health"){je.writeHead(200).end("ok");return}let at=await x(Le);je.writeHead((at==null?void 0:at.status)??200,(at==null?void 0:at.headers)??{}).end((at==null?void 0:at.body)??"{}")}catch(Le){Ne.error("Error while handling request",{error:(Le==null?void 0:Le.message)??"Internal error occured"}),je.writeHead(500).end(JSON.stringify({error:(Le==null?void 0:Le.message)??"Internal error occured"}))}});return Me.listen(ne,()=>be(ne)),Me}async function pt(x){var qe;let ne=await K(x),be={};for(let je=0;je<x.rawHeaders.length;je+=2){let Le=x.rawHeaders[je].toLowerCase(),at=x.rawHeaders[je+1];be[Le]=at}let Me=new URL(x.url??"",x.headers.host?`http://${x.headers.host}`:"http://botpress.cloud");return{body:ne,path:Me.pathname,query:Ge(Me.search,"?"),headers:be,method:((qe=x.method)==null?void 0:qe.toUpperCase())??"GET"}}function Ge(x,ne){return x.indexOf(ne)===0?x.slice(ne.length):x}async function K(x){return new Promise((ne,be)=>{if(x.method!=="POST"&&x.method!=="PUT"&&x.method!=="PATCH")return ne(void 0);let Me="";x.on("data",qe=>Me+=qe.toString()),x.on("error",qe=>be(qe)),x.on("end",()=>ne(Me))})}function ie(x){Ne.info(`Listening on port ${x}`)}var ae=Ol,Ae=Ol,Je={retries:3,retryCondition:x=>{var ne;return Ae.axiosRetry.isNetworkOrIdempotentRequestError(x)||[429,502].includes(((ne=x.response)==null?void 0:ne.status)??0)},retryDelay:x=>x*1e3},Mt=class{constructor(x){k(this,"createConversation",x=>this.client.createConversation(x));k(this,"getConversation",x=>this.client.getConversation(x));k(this,"listConversations",x=>this.client.listConversations(x));k(this,"getOrCreateConversation",x=>this.client.getOrCreateConversation(x));k(this,"updateConversation",x=>this.client.updateConversation(x));k(this,"deleteConversation",x=>this.client.deleteConversation(x));k(this,"listParticipants",x=>this.client.listParticipants(x));k(this,"addParticipant",x=>this.client.addParticipant(x));k(this,"getParticipant",x=>this.client.getParticipant(x));k(this,"removeParticipant",x=>this.client.removeParticipant(x));k(this,"createEvent",x=>this.client.createEvent(x));k(this,"getEvent",x=>this.client.getEvent(x));k(this,"listEvents",x=>this.client.listEvents(x));k(this,"createMessage",x=>this.client.createMessage(x));k(this,"getOrCreateMessage",x=>this.client.getOrCreateMessage(x));k(this,"getMessage",x=>this.client.getMessage(x));k(this,"updateMessage",x=>this.client.updateMessage(x));k(this,"listMessages",x=>this.client.listMessages(x));k(this,"deleteMessage",x=>this.client.deleteMessage(x));k(this,"createUser",x=>this.client.createUser(x));k(this,"getUser",x=>this.client.getUser(x));k(this,"listUsers",x=>this.client.listUsers(x));k(this,"getOrCreateUser",x=>this.client.getOrCreateUser(x));k(this,"updateUser",x=>this.client.updateUser(x));k(this,"deleteUser",x=>this.client.deleteUser(x));k(this,"getState",x=>this.client.getState(x));k(this,"setState",x=>this.client.setState(x));k(this,"getOrSetState",x=>this.client.getOrSetState(x));k(this,"patchState",x=>this.client.patchState(x));k(this,"configureIntegration",x=>this.client.configureIntegration(x));k(this,"uploadFile",x=>this.client.uploadFile(x));k(this,"upsertFile",x=>this.client.upsertFile(x));k(this,"deleteFile",x=>this.client.deleteFile(x));k(this,"listFiles",x=>this.client.listFiles(x));k(this,"getFile",x=>this.client.getFile(x));k(this,"updateFileMetadata",x=>this.client.updateFileMetadata(x));this.client=x}},Ot=u(gf),Et=x=>{if(process.env.BP_LOG_FORMAT==="json")return JSON.stringify({msg:Ot.default.format(...x),visible_to_bot_owner:!0});{let[ne,...be]=x;return Ot.default.format(`[For Bot Owner] ${ne}`,...be)}},Nt={forBot:()=>({info:(...x)=>{console.info(Et(x))},warn:(...x)=>{console.warn(Et(x))},error:(...x)=>{console.error(Et(x))},debug:(...x)=>{console.debug(Et(x))}})},Yt=x=>async ne=>{let be=Fe(ne.headers),Me=new ae.Client({botId:be.botId,integrationId:be.integrationId,retry:Je}),qe=new Mt(Me),je={ctx:be,req:ne,client:qe,logger:Nt,instance:x};try{let Le;switch(be.operation){case"webhook_received":Le=await J(je);break;case"register":Le=await Xe(je);break;case"unregister":Le=await rt(je);break;case"message_created":Le=await cn(je);break;case"action_triggered":Le=await Un(je);break;case"ping":Le=await z(je);break;case"create_user":Le=await At(je);break;case"create_conversation":Le=await Ye(je);break;default:throw new Error(`Unknown operation ${be.operation}`)}return Le?{...Le,status:Le.status??200}:{status:200}}catch(Le){if((0,ae.isApiError)(Le)){let hn=new ae.RuntimeError(Le.message,Le);return Nt.forBot().error(hn.message),{status:hn.code,body:JSON.stringify(hn.toJSON())}}console.error(Le);let at=new ae.RuntimeError("An unexpected error occurred in the integration. Bot owners: Check logs for more informations. Integration owners: throw a RuntimeError to return a custom error message instead.");return Nt.forBot().error(at.message),{status:at.code,body:JSON.stringify(at.toJSON())}}},z=async x=>{},J=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{let{req:je}=Se(be);return qe.webhook({client:x,ctx:ne,req:je,logger:Me})},Xe=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{if(!qe.register)return;let{webhookUrl:je}=Se(be);await qe.register({client:x,ctx:ne,webhookUrl:je,logger:Me})},rt=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{if(!qe.unregister)return;let{webhookUrl:je}=Se(be);await qe.unregister({ctx:ne,webhookUrl:je,client:x,logger:Me})},At=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{if(!qe.createUser)return;let{tags:je}=Se(be);return await qe.createUser({ctx:ne,client:x,tags:je,logger:Me})},Ye=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{if(!qe.createConversation)return;let{channel:je,tags:Le}=Se(be);return await qe.createConversation({ctx:ne,client:x,channel:je,tags:Le,logger:Me})},cn=async({ctx:x,req:ne,client:be,logger:Me,instance:qe})=>{let{conversation:je,user:Le,type:at,payload:hn,message:Sn}=Se(ne),or=qe.channels[je.channel];if(!or)throw new Error(`Channel ${je.channel} not found`);let Rs=or.messages[at];if(!Rs)throw new Error(`Message of type ${at} not found in channel ${je.channel}`);await Rs({ctx:x,conversation:je,message:Sn,user:Le,type:at,client:be,payload:hn,ack:async({tags:XH})=>{await be.updateMessage({id:Sn.id,tags:XH})},logger:Me})},Un=async({req:x,ctx:ne,client:be,logger:Me,instance:qe})=>{let{input:je,type:Le}=Se(x);if(!Le)throw new Error("Missing action type");let at=qe.actions[Le];if(!at)throw new Error(`Action ${Le} not found`);let hn=await at({ctx:ne,input:je,client:be,type:Le,logger:Me});return{body:JSON.stringify({output:hn})}},Vt=class{constructor(x){k(this,"props");k(this,"actions");k(this,"channels");k(this,"register");k(this,"unregister");k(this,"createUser");k(this,"createConversation");k(this,"webhook");k(this,"handler",Yt(this));k(this,"start",x=>Be(this.handler,x));this.props=x,this.actions=x.actions,this.channels=x.channels,this.register=x.register,this.unregister=x.unregister,this.createUser=x.createUser,this.createConversation=x.createConversation,this.webhook=x.handler}},_n=x=>({...x,schema:()=>x.schema.extend({userId:y.string().optional().describe("Allows sending a message pretending to be a certain user")})}),ir=new ce({name:"hitl",version:"0.2.0",entities:{},events:{hitlAssigned:{schema:()=>y.object({conversationId:y.string(),userId:y.string()})},hitlStopped:{schema:()=>y.object({conversationId:y.string()})}},actions:{createUser:{input:{schema:()=>y.object({name:y.string().optional(),pictureUrl:y.string().optional(),email:y.string().optional()})},output:{schema:()=>y.object({userId:y.string()})}},startHitl:{input:{schema:()=>y.object({userId:y.string(),title:y.string(),description:y.string().optional()})},output:{schema:()=>y.object({conversationId:y.string()})}},stopHitl:{input:{schema:()=>y.object({conversationId:y.string(),reason:y.enum(["timeout","cancel"]).optional()})},output:{schema:()=>y.object({})}}},channels:{hitl:{messages:{text:_n(F.text)}}}}),It=y.object({id:y.string(),type:y.enum(["function"]),function:y.object({name:y.string(),arguments:y.record(y.any()).nullable().describe("Some LLMs may generate invalid JSON for a tool call, so this will be `null` when it happens.")})}),xt=y.object({type:y.enum(["auto","specific","any","none",""]).optional(),functionName:y.string().optional().describe('Required if `type` is "specific"')}),Ht=y.object({role:y.enum(["user","assistant"]),type:y.enum(["text","tool_calls","tool_result","multipart"]).default("text"),toolCalls:y.array(It).optional().describe('Required if `type` is "tool_calls"'),toolResultCallId:y.string().optional().describe('Required if `type` is "tool_result"'),content:y.string().or(y.array(y.object({type:y.enum(["text","image"]),mimeType:y.string().optional().describe("Indicates the MIME type of the content. If not provided it will be detected from the content-type header of the provided URL."),text:y.string().optional().describe('Required if part type is "text" '),url:y.string().optional().describe('Required if part type is "image"')}))).optional().nullable().describe('Required unless `type` is "tool_call". If `type` is "multipart", this field must be an array of content objects. If `type` is "tool_result" then this field should be the result of the tool call (a plain string or a JSON-encoded array or object). If `type` is "tool_call" then the `toolCalls` field should be used instead.')}),zt=y.object({id:y.string()}),Wt=zt.extend({name:y.string(),description:y.string(),tags:y.array(y.enum(["recommended","deprecated","general-purpose","low-cost","vision","coding","agents","function-calling","roleplay","storytelling"])),input:y.object({maxTokens:y.number().int(),costPer1MTokens:y.number().describe("Cost per 1 million tokens, in U.S. dollars")}),output:y.object({maxTokens:y.number().int(),costPer1MTokens:y.number().describe("Cost per 1 million tokens, in U.S. dollars")})}),Pt=x=>y.object({model:x.describe("Model to use for content generation").optional(),systemPrompt:y.string().optional().describe("Optional system prompt to guide the model"),messages:y.array(Ht).describe("Array of messages for the model to process"),responseFormat:y.enum(["text","json_object"]).optional().describe('Response format expected from the model. If "json_object" is chosen, you must instruct the model to generate JSON either via the system prompt or a user message.'),maxTokens:y.number().optional().describe("Maximum number of tokens allowed in the generated response"),temperature:y.number().min(0).max(2).displayAs({id:"slider",params:{stepSize:.01,horizontal:!0}}).default(1).describe("Sampling temperature for the model. Higher values result in more random outputs."),topP:y.number().min(0).max(1).default(1).displayAs({id:"slider",params:{stepSize:.01,horizontal:!0}}).describe("Top-p sampling parameter. Limits sampling to the smallest set of tokens with a cumulative probability above the threshold."),stopSequences:y.array(y.string()).max(4).optional().describe("Sequences where the model should stop generating further tokens."),tools:y.array(y.object({type:y.literal("function"),function:y.object({name:y.string().describe("Function name"),description:y.string().optional(),argumentsSchema:y.object({}).passthrough().optional().describe("JSON schema of the function arguments")})})).optional(),toolChoice:xt.optional(),userId:y.string().optional(),debug:y.boolean().optional().describe("Set to `true` to output debug information to the bot logs")});Pt(zt);var fn=y.object({id:y.string().describe("Response ID from LLM provider"),provider:y.string().describe("LLM provider name"),model:y.string().describe("Model name"),choices:y.array(Ht.omit({role:!0}).extend({role:y.literal("assistant"),index:y.number().int(),stopReason:y.enum(["stop","max_tokens","tool_calls","content_filter","other"])})),usage:y.object({inputTokens:y.number().int().describe("Number of input tokens used by the model"),inputCost:y.number().describe("Cost of the input tokens received by the model, in U.S. dollars"),outputTokens:y.number().int().describe("Number of output tokens used by the model"),outputCost:y.number().describe("Cost of the output tokens generated by the model, in U.S. dollars")})}),pn=new ce({name:"llm",version:"4.0.0",entities:{modelRef:{schema:zt}},events:{},actions:{generateContent:{input:{schema:({modelRef:x})=>Pt(x)},output:{schema:()=>fn}},listLanguageModels:{input:{schema:()=>y.object({})},output:{schema:({modelRef:x})=>y.object({models:y.array(y.intersection(Wt,x))})}}}}),Nn=y.object({id:y.string()}),So=Nn.extend({name:y.string(),costPerMinute:y.number().describe("Cost per minute of speech transcription, in U.S. dollars")}),Eo=x=>y.object({model:x.optional().describe("Model to use for speech-to-text transcription (optional)"),fileUrl:y.string().url().describe("URL of the audio file to transcribe. The URL should return a content-type header in order to detect the audio format. Supported audio formats supported are: mp3, mp4, mpeg, mpga, m4a, wav, webm"),language:y.string().optional().describe("The language of the input audio (optional). Supplying the input language in ISO-639-1 format will improve accuracy and latency."),prompt:y.string().optional().describe("An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language."),temperature:y.number().default(0).optional().describe("The sampling temperature (optional), between 0 and 1. Defaults to 0 (automatic). Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.")});Eo(Nn);var j=W.extend({model:y.string().describe("Model name used"),cost:y.number().describe("Total cost of this transcription, in U.S. dollars")}),le=new ce({name:"speechToText",version:"1.0.0",entities:{speechToTextModelRef:{schema:Nn}},actions:{transcribeAudio:{input:{schema:({speechToTextModelRef:x})=>Eo(x)},output:{schema:()=>j}},listSpeechToTextModels:{input:{schema:()=>y.object({})},output:{schema:({speechToTextModelRef:x})=>y.object({models:y.array(y.intersection(So,x))})}}}}),ve=y.object({id:y.string()}),Ue=x=>y.intersection(x,ve),bt=x=>x[0].toUpperCase()+x.slice(1),_t=(...x)=>{let[ne,...be]=x.filter(Me=>Me.length>0).map(Me=>Me.toLowerCase());return ne?[ne,...be.map(bt)].join(""):""},ut=y.string().optional(),ot=new ce({name:"listable",version:"0.0.1",entities:{item:{schema:ve}},events:{},actions:{list:{input:{schema:()=>y.object({nextToken:ut})},output:{schema:x=>y.object({items:y.array(Ue(x.item)),meta:y.object({nextToken:ut})})}}},templateName:(x,ne)=>_t(ne.item,x)}),Kt=new ce({name:"creatable",version:"0.0.1",entities:{item:{schema:ve}},events:{created:{schema:x=>y.object({item:Ue(x.item)})}},actions:{create:{input:{schema:x=>y.object({item:x.item})},output:{schema:x=>y.object({item:Ue(x.item)})}}},templateName:(x,ne)=>_t(ne.item,x)}),Lt=new ce({name:"readable",version:"0.0.1",entities:{item:{schema:ve}},events:{},actions:{read:{input:{schema:()=>ve},output:{schema:x=>y.object({item:Ue(x.item)})}}},templateName:(x,ne)=>_t(ne.item,x)}),Ft=new ce({name:"updatable",version:"0.0.1",entities:{item:{schema:ve}},events:{updated:{schema:x=>y.object({item:Ue(x.item)})}},actions:{update:{input:{schema:x=>ve.extend({item:x.item})},output:{schema:x=>y.object({item:Ue(x.item)})}}},templateName:(x,ne)=>_t(ne.item,x)}),Kn=new ce({name:"deletable",version:"0.0.1",entities:{item:{schema:ve}},events:{deleted:{schema:()=>ve}},actions:{delete:{input:{schema:()=>ve},output:{schema:()=>y.object({})}}},templateName:(x,ne)=>_t(ne.item,x)}),Hr=y.object({id:y.string()}),Ld=Hr.extend({name:y.string(),costPerImage:y.number().describe("Cost per image generation, in U.S. dollars"),sizes:y.array(y.string()).describe("Available image sizes"),defaultSize:y.string().describe("Default image size generated by model")}),pr=y.object({}).describe("Model-specific parameters for image generation"),SC=(x,ne)=>y.object({model:x.optional().describe("Model to use for image generation"),prompt:y.string(),size:y.string().optional(),expiration:y.number().int().min(30).max(90).optional().describe("Expiration of the generated image in days, after which the image will be automatically deleted to free up storage space in your account. The default is to keep the image indefinitely (no expiration). The minimum is 30 days and the maximum is 90 days."),params:ne.optional()});SC(Hr,pr);var LH=y.object({model:y.string().describe("Model name used"),imageUrl:y.string().describe("Temporary URL of generated image"),cost:y.number().describe("Cost of the image generation, in U.S. dollars")}),FH=new ce({name:"textToImage",version:"1.1.0",entities:{imageModelRef:{schema:Hr},imageGenerationParams:{schema:pr}},actions:{generateImage:{input:{schema:({imageModelRef:x,imageGenerationParams:ne})=>SC(x,ne)},output:{schema:()=>LH}},listImageModels:{input:{schema:()=>y.object({})},output:{schema:({imageModelRef:x})=>y.object({models:y.array(y.intersection(Ld,x))})}}}}),UH=new ce({name:"typingIndicator",version:"0.0.1",entities:{},events:{},actions:{startTypingIndicator:{input:{schema:()=>y.object({conversationId:y.string(),messageId:y.string().describe("The message ID to which the typing indicator should be attached"),timeout:y.number().optional().describe("The timeout in milliseconds after which the typing indicator should stop")})},output:{schema:()=>y.object({})}},stopTypingIndicator:{input:{schema:()=>y.object({conversationId:y.string(),messageId:y.string().describe("The message ID from which the typing indicator should be removed")})},output:{schema:()=>y.object({})}}}});l(h,p,e.exports);var EC=Ol,BH=u(Ol),kC=class{constructor(x){k(this,"getConversation",x=>this.client.getConversation(x));k(this,"listConversations",x=>this.client.listConversations(x));k(this,"updateConversation",x=>this.client.updateConversation(x));k(this,"deleteConversation",x=>this.client.deleteConversation(x));k(this,"listParticipants",x=>this.client.listParticipants(x));k(this,"addParticipant",x=>this.client.addParticipant(x));k(this,"getParticipant",x=>this.client.getParticipant(x));k(this,"removeParticipant",x=>this.client.removeParticipant(x));k(this,"getEvent",x=>this.client.getEvent(x));k(this,"listEvents",x=>this.client.listEvents(x));k(this,"createMessage",x=>this.client.createMessage(x));k(this,"getOrCreateMessage",x=>this.client.getOrCreateMessage(x));k(this,"getMessage",x=>this.client.getMessage(x));k(this,"updateMessage",x=>this.client.updateMessage(x));k(this,"listMessages",x=>this.client.listMessages(x));k(this,"deleteMessage",x=>this.client.deleteMessage(x));k(this,"getUser",x=>this.client.getUser(x));k(this,"listUsers",x=>this.client.listUsers(x));k(this,"updateUser",x=>this.client.updateUser(x));k(this,"deleteUser",x=>this.client.deleteUser(x));k(this,"getState",x=>this.client.getState(x).then(ne=>({state:{...ne.state,payload:ne.state.payload}})));k(this,"setState",x=>this.client.setState(x).then(ne=>({state:{...ne.state,payload:ne.state.payload}})));k(this,"getOrSetState",x=>this.client.getOrSetState(x).then(ne=>({state:{...ne.state,payload:ne.state.payload}})));k(this,"patchState",x=>this.client.patchState(x).then(ne=>({state:{...ne.state,payload:ne.state.payload}})));k(this,"callAction",x=>this.client.callAction(x));k(this,"uploadFile",x=>this.client.uploadFile(x));k(this,"upsertFile",x=>this.client.upsertFile(x));k(this,"deleteFile",x=>this.client.deleteFile(x));k(this,"listFiles",x=>this.client.listFiles(x));k(this,"getFile",x=>this.client.getFile(x));k(this,"updateFileMetadata",x=>this.client.updateFileMetadata(x));k(this,"searchFiles",x=>this.client.searchFiles(x));k(this,"createConversation",x=>this.client.createConversation(x));k(this,"getOrCreateConversation",x=>this.client.getOrCreateConversation(x));k(this,"createUser",x=>this.client.createUser(x));k(this,"getOrCreateUser",x=>this.client.getOrCreateUser(x));this.client=x}},zH=ac,ZH=zH.z.enum(["event_received","register","unregister","ping","action_triggered"]),VH=x=>{let ne=x[C],be=x[we],Me=x[Ee],qe=ZH.parse(x[Te]);if(!ne)throw new Error("Missing bot headers");if(!Me)throw new Error("Missing type headers");if(!be)throw new Error("Missing configuration headers");if(!qe)throw new Error("Missing operation headers");return{botId:ne,operation:qe,type:Me,configuration:be?JSON.parse(Buffer.from(be,"base64").toString("utf-8")):{}}},HH=x=>async ne=>{let be=VH(ne.headers);be.operation!=="ping"&&Ne.info(`Received ${be.operation} operation for bot ${be.botId} of type ${be.type}`);let Me=new BH.Client({botId:be.botId,retry:Je}),qe=new kC(Me),je={req:ne,ctx:be,client:qe,instance:x};switch(be.operation){case"action_triggered":throw new Error(`Operation ${be.operation} not supported yet`);case"event_received":await YH(je);break;case"register":await KH();break;case"unregister":await JH();break;case"ping":await WH();break;default:throw new Error(`Unknown operation ${be.operation}`)}return{status:200}},WH=async x=>{},KH=async x=>{},JH=async x=>{},YH=async({ctx:x,req:ne,client:be,instance:Me})=>{Ne.debug(`Received event ${x.type}`);let qe=Se(ne),je=qe.event;switch(x.type){case"message_created":let Le={user:je.payload.user,conversation:je.payload.conversation,message:je.payload.message,states:je.payload.states,event:je};await Promise.all(Me.messageHandlers.map(Sn=>Sn({client:be,ctx:x,...Le})));break;case"state_expired":let at={state:je.payload.state};await Promise.all(Me.stateExpiredHandlers.map(Sn=>Sn({client:be,ctx:x,...at})));break;default:let hn={event:qe.event};await Promise.all(Me.eventHandlers.map(Sn=>Sn({client:be,ctx:x,...hn})))}},GH=class{constructor(x){k(this,"_state",{messageHandlers:[],eventHandlers:[],stateExpiredHandlers:[]});k(this,"props");k(this,"message",x=>{this._state.messageHandlers.push(x)});k(this,"event",x=>{this._state.eventHandlers.push(x)});k(this,"stateExpired",x=>{this._state.stateExpiredHandlers.push(x)});k(this,"handler",HH(this._state));k(this,"start",x=>Be(this.handler,x));this.props=x}}})(ay);var re=ay.exports;const{defaults:Ir}=re.messages,br={className:re.z.string().describe("CSS className to apply to the message").optional()},Yb=Ir.audio.schema.extend({...br,type:re.z.literal("audio")}),Vf=Ir.card.schema.extend({type:re.z.literal("card"),subtitle:re.z.string().optional(),imageUrl:re.z.string().optional(),...br}),i$=Vf.omit({type:!0}),Gb=re.z.object({items:re.z.array(i$),...br,type:re.z.literal("carousel")}),Xb=Ir.choice.schema.extend({text:re.z.string(),...br,type:re.z.literal("choice"),disableFreeText:re.z.boolean().optional()}),Qb=Ir.dropdown.schema.extend({text:re.z.string(),...br,type:re.z.literal("dropdown")}),ew=Ir.file.schema.extend({...br,type:re.z.literal("file")}),tw=Ir.image.schema.extend({...br,type:re.z.literal("image")}),nw=Ir.location.schema.extend({...br,type:re.z.literal("location")}),rw=Ir.markdown.schema.extend({...br,type:re.z.literal("markdown")}),iw=Ir.text.schema.extend({...br,type:re.z.literal("text")}),ow=Ir.video.schema.extend({...br,type:re.z.literal("video")}),sw=re.z.union([Yb,Vf,Gb,Xb,Qb,ew,tw,nw,rw,iw,ow]),aw=re.z.object({type:re.z.literal("webchat_visibility"),data:re.z.object({visibility:re.z.union([re.z.literal("show"),re.z.literal("hide"),re.z.literal("toggle")])})}),cw=re.z.object({type:re.z.literal("webchat_config"),data:re.z.object({config:re.z.record(re.z.any())})}),lw=re.z.object({type:re.z.literal("custom"),data:re.z.object({event:re.z.record(re.z.any())})}),uw=re.z.union([aw,cw,lw]),o$=uw,s$=re.z.object({type:re.z.literal("message_created"),data:sw}),dw=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:Yb,cardSchema:Vf,carouselSchema:Gb,choiceSchema:Xb,customSchema:lw,dropdownSchema:Qb,fileSchema:ew,imageSchema:tw,locationSchema:nw,markdownSchema:rw,messageCreatedSchema:s$,messageSchema:sw,textSchema:iw,triggerSchema:uw,triggerSignalSchema:o$,videoSchema:ow,webchatConfigSchema:cw,webchatVisibilitySchema:aw},Symbol.toStringTag,{value:"Module"})),Rr=re.z.object({className:re.z.string().optional(),avatarUrl:re.z.string().url().optional()}),fw=Rr.extend({type:re.z.literal("audio"),audio:re.z.string(),title:re.z.string().optional()}),a$=re.z.union([re.z.object({title:re.z.string(),action:re.z.literal("Say something"),text:re.z.string()}),re.z.object({title:re.z.string(),action:re.z.literal("Open URL"),url:re.z.string()}),re.z.object({title:re.z.string(),action:re.z.literal("Postback"),payload:re.z.string()})]),Hf=Rr.extend({type:re.z.literal("card"),title:re.z.string(),subtitle:re.z.string().optional(),image:re.z.string().optional(),actions:re.z.array(a$)}),pw=Rr.extend({type:re.z.literal("carousel"),items:re.z.array(Hf)}),hw=Rr.extend({type:re.z.literal("dropdown"),message:re.z.string().optional(),options:re.z.array(re.z.object({label:re.z.string(),value:re.z.string()})),allowCreation:re.z.boolean().optional(),placeholderText:re.z.string().optional(),allowMultiple:re.z.boolean().optional(),buttonText:re.z.string().optional(),width:re.z.number().optional(),displayInKeyboard:re.z.boolean().optional(),markdown:re.z.boolean().optional(),text:re.z.string().optional()}),mw=Rr.extend({type:re.z.literal("file"),file:re.z.string(),title:re.z.string().optional()}),yw=Rr.extend({type:re.z.literal("image"),image:re.z.string()}),gw=Rr.extend({type:re.z.literal("location"),latitude:re.z.number(),longitude:re.z.number(),address:re.z.string().optional(),title:re.z.string().optional()}),vw=Rr.extend({type:re.z.literal("single-choice"),text:re.z.string(),disableFreeText:re.z.boolean().optional(),choices:re.z.array(re.z.object({title:re.z.string(),value:re.z.string()}))}),bw=Rr.extend({type:re.z.literal("text"),text:re.z.string(),markdown:re.z.boolean().optional()}),ww=Rr.extend({type:re.z.literal("video"),video:re.z.string(),title:re.z.string().optional()}),xw=re.z.object({type:re.z.literal("quick_reply"),text:re.z.string(),payload:re.z.string().optional()}),Il=re.z.union([fw,Hf,pw,hw,mw,yw,gw,vw,bw,ww,xw]),_w=re.z.object({type:re.z.literal("webchat-visibility"),visibility:re.z.union([re.z.literal("show"),re.z.literal("hide"),re.z.literal("toggle")])}),Sw=re.z.object({type:re.z.literal("webchat-config"),config:re.z.record(re.z.any())}),Ew=re.z.object({type:re.z.literal("custom-event"),event:re.z.record(re.z.any())}),kw=re.z.union([_w,Sw,Ew]),c$=re.z.object({type:re.z.literal("trigger"),trigger:kw}),Cw=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:fw,cardSchema:Hf,carouselSchame:pw,customEventSchema:Ew,dropdownSchema:hw,fileSchema:mw,imageSchema:yw,locationSchema:gw,messageSchema:Il,messageSignalSchema:Il,quickReplySchema:xw,singleChoiceSchema:vw,textSchema:bw,triggerSchema:kw,triggerSignalSchema:c$,videoSchema:ww,webchatConfigSchema:Sw,webchatVisibilitySchema:_w},Symbol.toStringTag,{value:"Module"})),Tw=e=>({type:"card",title:e.title,subtitle:e.subtitle,image:e.imageUrl,actions:e.actions.map(l$)}),l$=e=>{switch(e.action){case"postback":return{title:e.label,action:"Postback",payload:e.value};case"url":return{title:e.label,action:"Open URL",url:e.value};case"say":return{title:e.label,action:"Say something",text:e.value};default:throw new Error(`Unknown action type ${e.action}`)}},Aw=e=>({...e,type:"audio",audio:e.audioUrl}),Ow=e=>Tw(e),Iw=e=>({...e,type:"carousel",items:e.items.map(Tw)}),Rw=e=>({...e,type:"single-choice",text:e.text,choices:e.options.map(t=>({title:t.label,value:t.value})),disableFreeText:e.disableFreeText}),Pw=e=>({...e,type:"dropdown",message:e.text,options:e.options.map(t=>({label:t.label,value:t.value}))}),$w=e=>({...e,type:"file",file:e.fileUrl,title:e.title}),Dw=e=>({...e,type:"image",image:e.imageUrl}),Nw=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),jw=e=>({...e,type:"text",text:e.markdown,markdown:!0}),Mw=e=>({...e,type:"text",text:e.text,markdown:!0}),qw=e=>({...e,type:"video",video:e.videoUrl}),u$=e=>{switch(e.type){case"audio":return Aw(e);case"card":return Ow(e);case"carousel":return Iw(e);case"choice":return Rw(e);case"dropdown":return Pw(e);case"file":return $w(e);case"image":return Dw(e);case"location":return Nw(e);case"markdown":return jw(e);case"text":return Mw(e);case"video":return qw(e);default:throw new Error("Unsuported message type")}},Lw=e=>({type:"webchat-visibility",visibility:e.data.visibility}),Fw=e=>({type:"webchat-config",config:e.data.config}),Uw=e=>({type:"custom-event",event:e.data.event}),Bw=Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Aw,cardAdapter:Ow,carouselAdapter:Iw,choiceAdapter:Rw,customAdapter:Uw,dropdownAdapter:Pw,fileAdapter:$w,imageAdapter:Dw,locationAdapter:Nw,markdownAdapter:jw,messageAdapter:u$,textAdapter:Mw,triggerAdapter:e=>{switch(e.type){case"webchat_visibility":return Lw(e);case"webchat_config":return Fw(e);case"custom":return Uw(e);default:throw new Error("unknown trigger type")}},videoAdapter:qw,webchatConfigAdapter:Fw,webchatVisibilityAdapter:Lw},Symbol.toStringTag,{value:"Module"})),zw=e=>({type:"card",title:e.title,subtitle:e.subtitle,imageUrl:e.image,actions:e.actions.map(d$)}),d$=e=>{switch(e.action){case"Postback":return{label:e.title,action:"postback",value:e.payload};case"Open URL":return{label:e.title,action:"url",value:e.url};case"Say something":return{label:e.title,action:"say",value:e.text};default:throw new Error("Unknown action type")}},f$=e=>({...e,type:"audio",audioUrl:e.audio}),p$=e=>zw(e),h$=e=>({...e,type:"carousel",items:e.items.map(zw)}),m$=e=>({...e,type:"dropdown",text:e.message??"",options:e.options.map(t=>({label:t.label,value:t.value}))}),y$=e=>({...e,type:"file",fileUrl:e.file,title:e.title}),g$=e=>({...e,type:"image",imageUrl:e.image}),v$=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),b$=e=>({...e,type:"choice",text:e.text,options:e.choices.map(t=>({label:t.title,value:t.value})),disableFreeText:e.disableFreeText}),w$=e=>({...e,type:"text",text:e.text}),x$=e=>({...e,type:"video",videoUrl:e.video}),_$=e=>({...e,type:"text",text:e.text??e.payload}),Zw=Object.freeze(Object.defineProperty({__proto__:null,messageAdapter:e=>{switch(e.type){case"audio":return f$(e);case"card":return p$(e);case"carousel":return h$(e);case"dropdown":return m$(e);case"file":return y$(e);case"image":return g$(e);case"location":return v$(e);case"single-choice":return b$(e);case"text":return w$(e);case"video":return x$(e);case"quick_reply":return _$(e);default:throw new Error("Unsuported message type")}}},Symbol.toStringTag,{value:"Module"})),S$=Object.freeze(Object.defineProperty({__proto__:null,messaging:Cw,messagingToWebChat:Zw,webchat:dw,webchatToMessaging:Bw},Symbol.toStringTag,{value:"Module"})),E$=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));let Rl;const k$=new Uint8Array(16);function C$(){if(!Rl&&(Rl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Rl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Rl(k$)}const vn=[];for(let e=0;e<256;++e)vn.push((e+256).toString(16).slice(1));function T$(e,t=0){return vn[e[t+0]]+vn[e[t+1]]+vn[e[t+2]]+vn[e[t+3]]+"-"+vn[e[t+4]]+vn[e[t+5]]+"-"+vn[e[t+6]]+vn[e[t+7]]+"-"+vn[e[t+8]]+vn[e[t+9]]+"-"+vn[e[t+10]]+vn[e[t+11]]+vn[e[t+12]]+vn[e[t+13]]+vn[e[t+14]]+vn[e[t+15]]}const Vw={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pl(e,t,n){if(Vw.randomUUID&&!t&&!e)return Vw.randomUUID();e=e||{};const r=e.random||(e.rng||C$)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return T$(r)}const $l=e=>({block:e,type:"bubble"}),A$=e=>e.action==="Say something"?{type:"button",variant:"action",text:e.title,buttonValue:e.text,reusable:!0}:e.action==="Open URL"?{type:"button",variant:"link",text:e.title,buttonValue:e.url,reusable:!0}:{type:"button",variant:"action",text:e.title,buttonValue:e.payload,reusable:!0},Hw=({title:e,image:t,actions:n,subtitle:r})=>{const i=[];return t&&i.push({type:"image",url:t}),e&&i.push({type:"text",text:`## ${e}`}),r&&i.push({type:"text",text:r}),n.length>0&&i.push({type:"row",blocks:n.map(A$)}),{type:"column",horizontalAlignment:"center",blocks:[...i]}},O$=({choices:e,text:t})=>{const n=Pl(),r=$l({type:"text",text:t});return e.length===0?r:{type:"column",horizontalAlignment:"left",blocks:[r,{type:"row",blocks:e.map(({title:i,value:o})=>({type:"button",variant:"action",text:i,buttonValue:o,groupId:n}))}]}},I$=({options:e,text:t})=>{const n=[{type:"dropdown",label:t??"Select an option",options:e}];return t&&n.unshift({type:"text",text:t}),{type:"column",blocks:n}},Wf=({type:e,audio:t})=>({payload:{type:e,url:t}}),Kf=e=>({payload:$l(Hw(e))}),Jf=({items:e})=>({payload:{type:"carousel",blocks:e.map(Hw)}}),Yf=e=>({disableInput:e.disableFreeText,payload:O$(e)}),Gf=e=>({disableInput:!0,payload:$l(I$(e))}),Xf=({file:e,...t})=>({payload:{url:e,...t}}),Qf=({type:e,image:t})=>({payload:{type:e,url:t}}),ep=({type:e,latitude:t,longitude:n,title:r,address:i})=>({payload:{type:e,latitude:t,longitude:n,title:r??i??"View on map"}}),Ww=({text:e,payload:t})=>({payload:{type:"text",text:e??t}}),Dl=({type:e,text:t})=>({payload:$l({type:e,text:t})}),tp=({type:e,video:t})=>({payload:{type:e,url:t}}),np=e=>{switch(e.type){case"audio":return Wf(e);case"card":return Kf(e);case"carousel":return Jf(e);case"single-choice":return Yf(e);case"dropdown":return Gf(e);case"file":return Xf(e);case"image":return Qf(e);case"location":return ep(e);case"quick_reply":return Ww(e);case"text":return Dl(e);case"video":return tp(e);default:throw new Error("Unsuported message type")}},R$=Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Wf,cardAdapter:Kf,carouselAdapter:Jf,choiceAdapter:Yf,dropdownAdapter:Gf,fileAdapter:Xf,imageAdapter:Qf,locationAdapter:ep,messageAdapter:np,quickReplyAdapter:Ww,textAdapter:Dl,videoAdapter:tp},Symbol.toStringTag,{value:"Module"})),{webchatToMessaging:wr}=S$,Kw=e=>{const t=wr.audioAdapter(e);return Wf(t)},Jw=e=>{const t=wr.cardAdapter(e);return Kf(t)},Yw=e=>{const t=wr.carouselAdapter(e);return Jf(t)},Gw=e=>{const t=wr.choiceAdapter(e);return Yf(t)},Xw=e=>{const t=wr.dropdownAdapter(e);return Gf(t)},Qw=e=>{const t=wr.fileAdapter(e);return Xf(t)},ex=e=>{const t=wr.imageAdapter(e);return Qf(t)},tx=e=>{const t=wr.locationAdapter(e);return ep(t)},nx=e=>{const t=wr.markdownAdapter(e);return Dl(t)},rx=e=>{const t=wr.textAdapter(e);return Dl(t)},ix=e=>{const t=wr.videoAdapter(e);return tp(t)},ox=e=>{switch(e.type){case"audio":return Kw(e);case"card":return Jw(e);case"carousel":return Yw(e);case"choice":return Gw(e);case"dropdown":return Xw(e);case"file":return Qw(e);case"image":return ex(e);case"location":return tx(e);case"markdown":return nx(e);case"text":return rx(e);case"video":return ix(e);default:throw new Error("Unsuported message type")}},P$=Object.freeze(Object.defineProperty({__proto__:null,messaging:Cw,messagingToTarget:R$,messagingToWebChat:Zw,target:E$,webchat:dw,webchatToMessaging:Bw,webchatToTarget:Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Kw,cardAdapter:Jw,carouselAdapter:Yw,choiceAdapter:Gw,dropdownAdapter:Xw,fileAdapter:Qw,imageAdapter:ex,locationAdapter:tx,markdownAdapter:nx,messageAdapter:ox,textAdapter:rx,videoAdapter:ix},Symbol.toStringTag,{value:"Module"}))},Symbol.toStringTag,{value:"Module"}));var rp={exports:{}},na={};/**
|
|
77
|
+
`+J.prev}function Yt(z,J){var Xe=Ee(z),rt=[];if(Xe){rt.length=z.length;for(var At=0;At<z.length;At++)rt[At]=L(z,At)?J(z[At],z):""}var Ye=typeof F=="function"?F(z):[],cn;if(M){cn={};for(var Un=0;Un<Ye.length;Un++)cn["$"+Ye[Un]]=Ye[Un]}for(var Vt in z)L(z,Vt)&&(Xe&&String(Number(Vt))===Vt&&Vt<z.length||M&&cn["$"+Vt]instanceof Symbol||(P.call(/[^\w$]/,Vt)?rt.push(J(Vt,z)+": "+J(z[Vt],z)):rt.push(Vt+": "+J(z[Vt],z))));if(typeof F=="function")for(var _n=0;_n<Ye.length;_n++)W.call(z,Ye[_n])&&rt.push("["+J(Ye[_n])+"]: "+J(z[Ye[_n]],z));return rt}}),QO=Qt((e,t)=>{var n=qf(),r=YO(),i=XO(),o=n("%TypeError%"),s=n("%WeakMap%",!0),a=n("%Map%",!0),c=r("WeakMap.prototype.get",!0),l=r("WeakMap.prototype.set",!0),u=r("WeakMap.prototype.has",!0),d=r("Map.prototype.get",!0),p=r("Map.prototype.set",!0),f=r("Map.prototype.has",!0),h=function(v,b){for(var S=v,E;(E=S.next)!==null;S=E)if(E.key===b)return S.next=E.next,E.next=v.next,v.next=E,E},m=function(v,b){var S=h(v,b);return S&&S.value},y=function(v,b,S){var E=h(v,b);E?E.value=S:v.next={key:b,next:v.next,value:S}},g=function(v,b){return!!h(v,b)};t.exports=function(){var v,b,S,E={assert:function(_){if(!E.has(_))throw new o("Side channel does not contain "+i(_))},get:function(_){if(s&&_&&(typeof _=="object"||typeof _=="function")){if(v)return c(v,_)}else if(a){if(b)return d(b,_)}else if(S)return m(S,_)},has:function(_){if(s&&_&&(typeof _=="object"||typeof _=="function")){if(v)return u(v,_)}else if(a){if(b)return f(b,_)}else if(S)return g(S,_);return!1},set:function(_,I){s&&_&&(typeof _=="object"||typeof _=="function")?(v||(v=new s),l(v,_,I)):a?(b||(b=new a),p(b,_,I)):(S||(S={key:{},next:null}),y(S,_,I))}};return E}}),Lf=Qt((e,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:"RFC1738",RFC3986:"RFC3986"};t.exports={default:i.RFC3986,formatters:{RFC1738:function(o){return n.call(o,r,"+")},RFC3986:function(o){return String(o)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}}),yb=Qt((e,t)=>{var n=Lf(),r=Object.prototype.hasOwnProperty,i=Array.isArray,o=function(){for(var g=[],v=0;v<256;++v)g.push("%"+((v<16?"0":"")+v.toString(16)).toUpperCase());return g}(),s=function(g){for(;g.length>1;){var v=g.pop(),b=v.obj[v.prop];if(i(b)){for(var S=[],E=0;E<b.length;++E)typeof b[E]<"u"&&S.push(b[E]);v.obj[v.prop]=S}}},a=function(g,v){for(var b=v&&v.plainObjects?Object.create(null):{},S=0;S<g.length;++S)typeof g[S]<"u"&&(b[S]=g[S]);return b},c=function g(v,b,S){if(!b)return v;if(typeof b!="object"){if(i(v))v.push(b);else if(v&&typeof v=="object")(S&&(S.plainObjects||S.allowPrototypes)||!r.call(Object.prototype,b))&&(v[b]=!0);else return[v,b];return v}if(!v||typeof v!="object")return[v].concat(b);var E=v;return i(v)&&!i(b)&&(E=a(v,S)),i(v)&&i(b)?(b.forEach(function(_,I){if(r.call(v,I)){var P=v[I];P&&typeof P=="object"&&_&&typeof _=="object"?v[I]=g(P,_,S):v.push(_)}else v[I]=_}),v):Object.keys(b).reduce(function(_,I){var P=b[I];return r.call(_,I)?_[I]=g(_[I],P,S):_[I]=P,_},E)},l=function(g,v){return Object.keys(v).reduce(function(b,S){return b[S]=v[S],b},g)},u=function(g,v,b){var S=g.replace(/\+/g," ");if(b==="iso-8859-1")return S.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(S)}catch{return S}},d=function(g,v,b,S,E){if(g.length===0)return g;var _=g;if(typeof g=="symbol"?_=Symbol.prototype.toString.call(g):typeof g!="string"&&(_=String(g)),b==="iso-8859-1")return escape(_).replace(/%u[0-9a-f]{4}/gi,function(O){return"%26%23"+parseInt(O.slice(2),16)+"%3B"});for(var I="",P=0;P<_.length;++P){var $=_.charCodeAt(P);if($===45||$===46||$===95||$===126||$>=48&&$<=57||$>=65&&$<=90||$>=97&&$<=122||E===n.RFC1738&&($===40||$===41)){I+=_.charAt(P);continue}if($<128){I=I+o[$];continue}if($<2048){I=I+(o[192|$>>6]+o[128|$&63]);continue}if($<55296||$>=57344){I=I+(o[224|$>>12]+o[128|$>>6&63]+o[128|$&63]);continue}P+=1,$=65536+(($&1023)<<10|_.charCodeAt(P)&1023),I+=o[240|$>>18]+o[128|$>>12&63]+o[128|$>>6&63]+o[128|$&63]}return I},p=function(g){for(var v=[{obj:{o:g},prop:"o"}],b=[],S=0;S<v.length;++S)for(var E=v[S],_=E.obj[E.prop],I=Object.keys(_),P=0;P<I.length;++P){var $=I[P],O=_[$];typeof O=="object"&&O!==null&&b.indexOf(O)===-1&&(v.push({obj:_,prop:$}),b.push(O))}return s(v),g},f=function(g){return Object.prototype.toString.call(g)==="[object RegExp]"},h=function(g){return!g||typeof g!="object"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))},m=function(g,v){return[].concat(g,v)},y=function(g,v){if(i(g)){for(var b=[],S=0;S<g.length;S+=1)b.push(v(g[S]));return b}return v(g)};t.exports={arrayToObject:a,assign:l,combine:m,compact:p,decode:u,encode:d,isBuffer:h,isRegExp:f,maybeMap:y,merge:c}}),eI=Qt((e,t)=>{var n=QO(),r=yb(),i=Lf(),o=Object.prototype.hasOwnProperty,s={brackets:function(v){return v+"[]"},comma:"comma",indices:function(v,b){return v+"["+b+"]"},repeat:function(v){return v}},a=Array.isArray,c=String.prototype.split,l=Array.prototype.push,u=function(v,b){l.apply(v,a(b)?b:[b])},d=Date.prototype.toISOString,p=i.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function(v){return d.call(v)},skipNulls:!1,strictNullHandling:!1},h=function(v){return typeof v=="string"||typeof v=="number"||typeof v=="boolean"||typeof v=="symbol"||typeof v=="bigint"},m={},y=function v(b,S,E,_,I,P,$,O,q,H,B,F,D,M,Z,W){for(var Q=b,C=W,te=0,fe=!1;(C=C.get(m))!==void 0&&!fe;){var A=C.get(b);if(te+=1,typeof A<"u"){if(A===te)throw new RangeError("Cyclic object value");fe=!0}typeof C.get(m)>"u"&&(te=0)}if(typeof O=="function"?Q=O(S,Q):Q instanceof Date?Q=B(Q):E==="comma"&&a(Q)&&(Q=r.maybeMap(Q,function(oe){return oe instanceof Date?B(oe):oe})),Q===null){if(I)return $&&!M?$(S,f.encoder,Z,"key",F):S;Q=""}if(h(Q)||r.isBuffer(Q)){if($){var we=M?S:$(S,f.encoder,Z,"key",F);if(E==="comma"&&M){for(var Te=c.call(String(Q),","),Ee="",$e=0;$e<Te.length;++$e)Ee+=($e===0?"":",")+D($(Te[$e],f.encoder,Z,"value",F));return[D(we)+(_&&a(Q)&&Te.length===1?"[]":"")+"="+Ee]}return[D(we)+"="+D($(Q,f.encoder,Z,"value",F))]}return[D(S)+"="+D(String(Q))]}var Fe=[];if(typeof Q>"u")return Fe;var Pe;if(E==="comma"&&a(Q))Pe=[{value:Q.length>0?Q.join(",")||null:void 0}];else if(a(O))Pe=O;else{var he=Object.keys(Q);Pe=q?he.sort(q):he}for(var de=_&&a(Q)&&Q.length===1?S+"[]":S,_e=0;_e<Pe.length;++_e){var pe=Pe[_e],De=typeof pe=="object"&&typeof pe.value<"u"?pe.value:Q[pe];if(!(P&&De===null)){var et=a(Q)?typeof E=="function"?E(de,pe):de:de+(H?"."+pe:"["+pe+"]");W.set(b,te);var L=n();L.set(m,W),u(Fe,v(De,et,E,_,I,P,$,O,q,H,B,F,D,M,Z,L))}}return Fe},g=function(v){if(!v)return f;if(v.encoder!==null&&typeof v.encoder<"u"&&typeof v.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=v.charset||f.charset;if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=i.default;if(typeof v.format<"u"){if(!o.call(i.formatters,v.format))throw new TypeError("Unknown format option provided.");S=v.format}var E=i.formatters[S],_=f.filter;return(typeof v.filter=="function"||a(v.filter))&&(_=v.filter),{addQueryPrefix:typeof v.addQueryPrefix=="boolean"?v.addQueryPrefix:f.addQueryPrefix,allowDots:typeof v.allowDots>"u"?f.allowDots:!!v.allowDots,charset:b,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:f.charsetSentinel,delimiter:typeof v.delimiter>"u"?f.delimiter:v.delimiter,encode:typeof v.encode=="boolean"?v.encode:f.encode,encoder:typeof v.encoder=="function"?v.encoder:f.encoder,encodeValuesOnly:typeof v.encodeValuesOnly=="boolean"?v.encodeValuesOnly:f.encodeValuesOnly,filter:_,format:S,formatter:E,serializeDate:typeof v.serializeDate=="function"?v.serializeDate:f.serializeDate,skipNulls:typeof v.skipNulls=="boolean"?v.skipNulls:f.skipNulls,sort:typeof v.sort=="function"?v.sort:null,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:f.strictNullHandling}};t.exports=function(v,b){var S=v,E=g(b),_,I;typeof E.filter=="function"?(I=E.filter,S=I("",S)):a(E.filter)&&(I=E.filter,_=I);var P=[];if(typeof S!="object"||S===null)return"";var $;b&&b.arrayFormat in s?$=b.arrayFormat:b&&"indices"in b?$=b.indices?"indices":"repeat":$="indices";var O=s[$];if(b&&"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var q=O==="comma"&&b&&b.commaRoundTrip;_||(_=Object.keys(S)),E.sort&&_.sort(E.sort);for(var H=n(),B=0;B<_.length;++B){var F=_[B];E.skipNulls&&S[F]===null||u(P,y(S[F],F,O,q,E.strictNullHandling,E.skipNulls,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,H))}var D=P.join(E.delimiter),M=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?M+="utf8=%26%2310003%3B&":M+="utf8=%E2%9C%93&"),D.length>0?M+D:""}}),tI=Qt((e,t)=>{var n=yb(),r=Object.prototype.hasOwnProperty,i=Array.isArray,o={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(h){return h.replace(/&#(\d+);/g,function(m,y){return String.fromCharCode(parseInt(y,10))})},a=function(h,m){return h&&typeof h=="string"&&m.comma&&h.indexOf(",")>-1?h.split(","):h},c="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(h,m){var y={},g=m.ignoreQueryPrefix?h.replace(/^\?/,""):h,v=m.parameterLimit===1/0?void 0:m.parameterLimit,b=g.split(m.delimiter,v),S=-1,E,_=m.charset;if(m.charsetSentinel)for(E=0;E<b.length;++E)b[E].indexOf("utf8=")===0&&(b[E]===l?_="utf-8":b[E]===c&&(_="iso-8859-1"),S=E,E=b.length);for(E=0;E<b.length;++E)if(E!==S){var I=b[E],P=I.indexOf("]="),$=P===-1?I.indexOf("="):P+1,O,q;$===-1?(O=m.decoder(I,o.decoder,_,"key"),q=m.strictNullHandling?null:""):(O=m.decoder(I.slice(0,$),o.decoder,_,"key"),q=n.maybeMap(a(I.slice($+1),m),function(H){return m.decoder(H,o.decoder,_,"value")})),q&&m.interpretNumericEntities&&_==="iso-8859-1"&&(q=s(q)),I.indexOf("[]=")>-1&&(q=i(q)?[q]:q),r.call(y,O)?y[O]=n.combine(y[O],q):y[O]=q}return y},d=function(h,m,y,g){for(var v=g?m:a(m,y),b=h.length-1;b>=0;--b){var S,E=h[b];if(E==="[]"&&y.parseArrays)S=[].concat(v);else{S=y.plainObjects?Object.create(null):{};var _=E.charAt(0)==="["&&E.charAt(E.length-1)==="]"?E.slice(1,-1):E,I=parseInt(_,10);!y.parseArrays&&_===""?S={0:v}:!isNaN(I)&&E!==_&&String(I)===_&&I>=0&&y.parseArrays&&I<=y.arrayLimit?(S=[],S[I]=v):_!=="__proto__"&&(S[_]=v)}v=S}return v},p=function(h,m,y,g){if(h){var v=y.allowDots?h.replace(/\.([^.[]+)/g,"[$1]"):h,b=/(\[[^[\]]*])/,S=/(\[[^[\]]*])/g,E=y.depth>0&&b.exec(v),_=E?v.slice(0,E.index):v,I=[];if(_){if(!y.plainObjects&&r.call(Object.prototype,_)&&!y.allowPrototypes)return;I.push(_)}for(var P=0;y.depth>0&&(E=S.exec(v))!==null&&P<y.depth;){if(P+=1,!y.plainObjects&&r.call(Object.prototype,E[1].slice(1,-1))&&!y.allowPrototypes)return;I.push(E[1])}return E&&I.push("["+v.slice(E.index)+"]"),d(I,m,y,g)}},f=function(h){if(!h)return o;if(h.decoder!==null&&h.decoder!==void 0&&typeof h.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof h.charset<"u"&&h.charset!=="utf-8"&&h.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var m=typeof h.charset>"u"?o.charset:h.charset;return{allowDots:typeof h.allowDots>"u"?o.allowDots:!!h.allowDots,allowPrototypes:typeof h.allowPrototypes=="boolean"?h.allowPrototypes:o.allowPrototypes,allowSparse:typeof h.allowSparse=="boolean"?h.allowSparse:o.allowSparse,arrayLimit:typeof h.arrayLimit=="number"?h.arrayLimit:o.arrayLimit,charset:m,charsetSentinel:typeof h.charsetSentinel=="boolean"?h.charsetSentinel:o.charsetSentinel,comma:typeof h.comma=="boolean"?h.comma:o.comma,decoder:typeof h.decoder=="function"?h.decoder:o.decoder,delimiter:typeof h.delimiter=="string"||n.isRegExp(h.delimiter)?h.delimiter:o.delimiter,depth:typeof h.depth=="number"||h.depth===!1?+h.depth:o.depth,ignoreQueryPrefix:h.ignoreQueryPrefix===!0,interpretNumericEntities:typeof h.interpretNumericEntities=="boolean"?h.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:typeof h.parameterLimit=="number"?h.parameterLimit:o.parameterLimit,parseArrays:h.parseArrays!==!1,plainObjects:typeof h.plainObjects=="boolean"?h.plainObjects:o.plainObjects,strictNullHandling:typeof h.strictNullHandling=="boolean"?h.strictNullHandling:o.strictNullHandling}};t.exports=function(h,m){var y=f(m);if(h===""||h===null||typeof h>"u")return y.plainObjects?Object.create(null):{};for(var g=typeof h=="string"?u(h,y):h,v=y.plainObjects?Object.create(null):{},b=Object.keys(g),S=0;S<b.length;++S){var E=b[S],_=p(E,g[E],y,typeof h=="string");v=n.merge(v,_,y)}return y.allowSparse===!0?v:n.compact(v)}}),nI=Qt((e,t)=>{var n=eI(),r=tI(),i=Lf();t.exports={formats:i,parse:r,stringify:n}}),gb={};LO(gb,{DEFAULT_OPTIONS:()=>_b,default:()=>Eb,exponentialDelay:()=>wb,isIdempotentRequestError:()=>Uf,isNetworkError:()=>Ff,isNetworkOrIdempotentRequestError:()=>Bf,isRetryableError:()=>Tl,isSafeRequestError:()=>bb,linearDelay:()=>xb,namespace:()=>Cl,retryAfter:()=>Al});var rI=kl(UO(),1),Cl="axios-retry";function Ff(e){let t=["ERR_CANCELED","ECONNABORTED"];return e.response||!e.code||t.includes(e.code)?!1:(0,rI.default)(e)}var vb=["get","head","options"],iI=vb.concat(["put","delete"]);function Tl(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status===429||e.response.status>=500&&e.response.status<=599)}function bb(e){var t;return(t=e.config)!=null&&t.method?Tl(e)&&vb.indexOf(e.config.method)!==-1:!1}function Uf(e){var t;return(t=e.config)!=null&&t.method?Tl(e)&&iI.indexOf(e.config.method)!==-1:!1}function Bf(e){return Ff(e)||Uf(e)}function Al(e=void 0){var r;let t=(r=e==null?void 0:e.response)==null?void 0:r.headers["retry-after"];if(!t)return 0;let n=(Number(t)||0)*1e3;return n===0&&(n=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,n)}function oI(e=0,t=void 0){return Math.max(0,Al(t))}function wb(e=0,t=void 0,n=100){let r=2**e*n,i=Math.max(r,Al(t)),o=i*.2*Math.random();return i+o}function xb(e=100){return(t=0,n=void 0)=>{let r=t*e;return Math.max(r,Al(n))}}var _b={retries:3,retryCondition:Bf,retryDelay:oI,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function sI(e,t){return{..._b,...t,...e[Cl]}}function Sb(e,t,n=!1){let r=sI(e,t||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),e[Cl]=r,r}function aI(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function cI(e,t){let{retries:n,retryCondition:r}=e,i=(e.retryCount||0)<n&&r(t);if(typeof i=="object")try{return await i!==!1}catch{return!1}return i}async function lI(e,t,n,r){var c;t.retryCount+=1;let{retryDelay:i,shouldResetTimeout:o,onRetry:s}=t,a=i(t.retryCount,n);if(aI(e,r),!o&&r.timeout&&t.lastRequestTime){let l=Date.now()-t.lastRequestTime,u=r.timeout-l-a;if(u<=0)return Promise.reject(n);r.timeout=u}return r.transformRequest=[l=>l],await s(t.retryCount,n,r),(c=r.signal)!=null&&c.aborted?Promise.resolve(e(r)):new Promise(l=>{var p;let u=()=>{clearTimeout(d),l(e(r))},d=setTimeout(()=>{var f;l(e(r)),(f=r.signal)!=null&&f.removeEventListener&&r.signal.removeEventListener("abort",u)},a);(p=r.signal)!=null&&p.addEventListener&&r.signal.addEventListener("abort",u,{once:!0})})}async function uI(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}var bi=(e,t)=>{let n=e.interceptors.request.use(i=>{var o;return Sb(i,t,!0),(o=i[Cl])!=null&&o.validateResponse&&(i.validateStatus=()=>!1),i}),r=e.interceptors.response.use(null,async i=>{var a;let{config:o}=i;if(!o)return Promise.reject(i);let s=Sb(o,t);return i.response&&((a=s.validateResponse)!=null&&a.call(s,i.response))?i.response:await cI(s,i)?lI(e,s,i,o):(await uI(s,i),Promise.reject(i))});return{requestInterceptorId:n,responseInterceptorId:r}};bi.isNetworkError=Ff,bi.isSafeRequestError=bb,bi.isIdempotentRequestError=Uf,bi.isNetworkOrIdempotentRequestError=Bf,bi.exponentialDelay=wb,bi.linearDelay=xb,bi.isRetryableError=Tl;var Eb=bi,dI={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))},zf=typeof window<"u"&&typeof window.document<"u"?window.crypto:yf;zf.getRandomValues||(zf=dI);var jt=class extends Error{constructor(t,n,r,i,o,s){super(i);k(this,"isApiError",!0);this.code=t,this.description=n,this.type=r,this.message=i,this.error=o,this.id=s,this.id||(this.id=jt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let t=this.getPrefix(),n=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],r=4,i=Array.from(zf.getRandomValues(new Uint8Array(r))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${t}_${n}x${i}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},fI=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,kb=e=>e instanceof jt||fI(e)&&e.isApiError===!0,Uo=class extends jt{constructor(e,t,n){super(500,"An unknown error occurred","Unknown",e,t,n)}},Cb=class extends jt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}},Tb=class extends jt{constructor(e,t,n){super(401,"The request requires to be authenticated.","Unauthorized",e,t,n)}},Ab=class extends jt{constructor(e,t,n){super(403,"The requested action can't be peform by this resource.","Forbidden",e,t,n)}},Ob=class extends jt{constructor(e,t,n){super(413,"The request payload is too large.","PayloadTooLarge",e,t,n)}},Ib=class extends jt{constructor(e,t,n){super(400,"The request payload is invalid.","InvalidPayload",e,t,n)}},Rb=class extends jt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}},Pb=class extends jt{constructor(e,t,n){super(405,"The requested method does not exist.","MethodNotFound",e,t,n)}},$b=class extends jt{constructor(e,t,n){super(404,"The requested resource does not exist.","ResourceNotFound",e,t,n)}},Db=class extends jt{constructor(e,t,n){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",e,t,n)}},Nb=class extends jt{constructor(e,t,n){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",e,t,n)}},jb=class extends jt{constructor(e,t,n){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",e,t,n)}},Mb=class extends jt{constructor(e,t,n){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",e,t,n)}},qb=class extends jt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}},Lb=class extends jt{constructor(e,t,n){super(409,"The resource is current locked and cannot be operated on until the lock is released.","ResourceLockedConflict",e,t,n)}},Fb=class extends jt{constructor(e,t,n){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",e,t,n)}},Ub=class extends jt{constructor(e,t,n){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",e,t,n)}},Bb=class extends jt{constructor(e,t,n){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",e,t,n)}},zb=class extends jt{constructor(e,t,n){super(409,"The record attempted to be created already exists.","AlreadyExists",e,t,n)}},Zb=class extends jt{constructor(e,t,n){super(429,"The request has been rate limited.","RateLimited",e,t,n)}},Vb=class extends jt{constructor(e,t,n){super(402,"A payment is required to perform this request.","PaymentRequired",e,t,n)}},Hb=class extends jt{constructor(e,t,n){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",e,t,n)}},Wb=class extends jt{constructor(e,t,n){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",e,t,n)}},Kb=class extends jt{constructor(e,t,n){super(400,"Request payload contains breaking changes which is not allowed for this resource without a version increment.","BreakingChanges",e,t,n)}},pI={Unknown:Uo,Internal:Cb,Unauthorized:Tb,Forbidden:Ab,PayloadTooLarge:Ob,InvalidPayload:Ib,UnsupportedMediaType:Rb,MethodNotFound:Pb,ResourceNotFound:$b,InvalidJsonSchema:Db,InvalidDataFormat:Nb,InvalidIdentifier:jb,RelationConflict:Mb,ReferenceConstraint:qb,ResourceLockedConflict:Lb,ReferenceNotFound:Fb,InvalidQuery:Ub,Runtime:Bb,AlreadyExists:zb,RateLimited:Zb,PaymentRequired:Vb,QuotaExceeded:Hb,LimitExceeded:Wb,BreakingChanges:Kb},Zf=e=>kb(e)?e:e instanceof Error?new Uo(e.message,e):typeof e=="string"?new Uo(e):hI(e);function hI(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){let t=pI[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new Uo(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new Uo("An invalid error occurred: "+JSON.stringify(e))}var Bo=class extends Error{constructor(t,n,r){super(t),this.innerError=n,this.file=r,this.name="FileUploadError"}},mI=kl(BO()),yI=kl(zO()),gI="https://api.botpress.cloud",vI=6e4,bI="BP_API_URL",wI="BP_BOT_ID",xI="BP_INTEGRATION_ID",_I="BP_WORKSPACE_ID",SI="BP_TOKEN";function EI(e){let t=kI(e),n={};t.workspaceId&&(n["x-workspace-id"]=t.workspaceId),t.botId&&(n["x-bot-id"]=t.botId),t.integrationId&&(n["x-integration-id"]=t.integrationId),t.token&&(n.Authorization=`Bearer ${t.token}`),n={...n,...t.headers};let r=t.apiUrl??gI,i=t.timeout??vI;return{apiUrl:r,timeout:i,withCredentials:mb,headers:n}}function kI(e){return mb?e:Nf?CI(e):e}function CI(e){let t={...e,apiUrl:e.apiUrl??process.env[bI],botId:e.botId??process.env[wI],integrationId:e.integrationId??process.env[xI],workspaceId:e.workspaceId??process.env[_I]},n=t.token??process.env[SI];return n&&(t.token=n),t}var TI=kl(nI()),AI=e=>e[1]!==void 0,G=e=>{let{method:t,path:n,query:r,headers:i,body:o}=e,s=Object.entries(i).filter(AI),a=Object.fromEntries(s),c=TI.default.stringify(r,{encode:!0,arrayFormat:"repeat",allowDots:!0}),l=c?[n,c].join("?"):n;return{method:t,url:l,headers:a,data:o}},OI=e=>({path:"/v1/chat/conversations",headers:{},query:{},params:{},body:{channel:e.channel,tags:e.tags,integrationName:e.integrationName}}),II=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),RI=e=>({path:"/v1/chat/conversations",headers:{},query:{nextToken:e.nextToken,sortField:e.sortField,sortDirection:e.sortDirection,tags:e.tags,participantIds:e.participantIds,integrationName:e.integrationName},params:{},body:{}}),PI=e=>({path:"/v1/chat/conversations/get-or-create",headers:{},query:{},params:{},body:{channel:e.channel,tags:e.tags,integrationName:e.integrationName}}),$I=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{currentTaskId:e.currentTaskId,tags:e.tags}}),DI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),NI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}/participants`,headers:{},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),jI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}/participants`,headers:{},query:{},params:{id:e.id},body:{userId:e.userId}}),MI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}/participants/${encodeURIComponent(e.userId)}`,headers:{},query:{},params:{id:e.id,userId:e.userId},body:{}}),qI=e=>({path:`/v1/chat/conversations/${encodeURIComponent(e.id)}/participants/${encodeURIComponent(e.userId)}`,headers:{},query:{},params:{id:e.id,userId:e.userId},body:{}}),LI=e=>({path:"/v1/chat/events",headers:{},query:{},params:{},body:{type:e.type,payload:e.payload,schedule:e.schedule,conversationId:e.conversationId,userId:e.userId,messageId:e.messageId}}),FI=e=>({path:`/v1/chat/events/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),UI=e=>({path:"/v1/chat/events",headers:{},query:{nextToken:e.nextToken,type:e.type,conversationId:e.conversationId,userId:e.userId,messageId:e.messageId,status:e.status},params:{},body:{}}),BI=e=>({path:"/v1/chat/messages",headers:{},query:{},params:{},body:{payload:e.payload,userId:e.userId,conversationId:e.conversationId,type:e.type,tags:e.tags,schedule:e.schedule}}),zI=e=>({path:"/v1/chat/messages/get-or-create",headers:{},query:{},params:{},body:{payload:e.payload,userId:e.userId,conversationId:e.conversationId,type:e.type,tags:e.tags,schedule:e.schedule}}),ZI=e=>({path:`/v1/chat/messages/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),VI=e=>({path:`/v1/chat/messages/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{tags:e.tags}}),HI=e=>({path:"/v1/chat/messages",headers:{},query:{nextToken:e.nextToken,conversationId:e.conversationId,tags:e.tags},params:{},body:{}}),WI=e=>({path:`/v1/chat/messages/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),KI=e=>({path:"/v1/chat/users",headers:{},query:{},params:{},body:{tags:e.tags,integrationName:e.integrationName,name:e.name,pictureUrl:e.pictureUrl}}),JI=e=>({path:`/v1/chat/users/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),YI=e=>({path:"/v1/chat/users",headers:{},query:{nextToken:e.nextToken,conversationId:e.conversationId,tags:e.tags},params:{},body:{}}),GI=e=>({path:"/v1/chat/users/get-or-create",headers:{},query:{},params:{},body:{tags:e.tags,integrationName:e.integrationName,name:e.name,pictureUrl:e.pictureUrl}}),XI=e=>({path:`/v1/chat/users/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{tags:e.tags,name:e.name,pictureUrl:e.pictureUrl}}),QI=e=>({path:`/v1/chat/users/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),eR=e=>({path:`/v1/chat/states/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}/${encodeURIComponent(e.name)}`,headers:{},query:{},params:{type:e.type,id:e.id,name:e.name},body:{}}),tR=e=>({path:`/v1/chat/states/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}/${encodeURIComponent(e.name)}`,headers:{},query:{},params:{type:e.type,id:e.id,name:e.name},body:{payload:e.payload,expiry:e.expiry}}),nR=e=>({path:`/v1/chat/states/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}/${encodeURIComponent(e.name)}/get-or-set`,headers:{},query:{},params:{type:e.type,id:e.id,name:e.name},body:{payload:e.payload,expiry:e.expiry}}),rR=e=>({path:`/v1/chat/states/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}/${encodeURIComponent(e.name)}`,headers:{},query:{},params:{type:e.type,id:e.id,name:e.name},body:{payload:e.payload}}),iR=e=>({path:"/v1/chat/actions",headers:{},query:{},params:{},body:{type:e.type,input:e.input}}),oR=e=>({path:"/v1/chat/integrations/configure",headers:{},query:{},params:{},body:{identifier:e.identifier}}),sR=e=>({path:`/v1/chat/tasks/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),aR=e=>({path:"/v1/chat/tasks",headers:{},query:{},params:{},body:{title:e.title,description:e.description,type:e.type,data:e.data,parentTaskId:e.parentTaskId,conversationId:e.conversationId,userId:e.userId,timeoutAt:e.timeoutAt,tags:e.tags}}),cR=e=>({path:`/v1/chat/tasks/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{title:e.title,description:e.description,data:e.data,timeoutAt:e.timeoutAt,status:e.status,tags:e.tags}}),lR=e=>({path:`/v1/chat/tasks/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),uR=e=>({path:"/v1/chat/tasks",headers:{},query:{nextToken:e.nextToken,tags:e.tags,conversationId:e.conversationId,userId:e.userId,parentTaskId:e.parentTaskId,status:e.status,type:e.type},params:{},body:{}}),dR=e=>({path:"/v1/chat/analytics",headers:{},query:{},params:{},body:{name:e.name,count:e.count}}),fR=e=>({path:"/v1/admin/helper/vrl",headers:{},query:{},params:{},body:{data:e.data,script:e.script}}),pR=e=>({path:"/v1/admin/account/me",headers:{},query:{},params:{},body:{}}),hR=e=>({path:"/v1/admin/account/me",headers:{},query:{},params:{},body:{displayName:e.displayName,profilePicture:e.profilePicture,refresh:e.refresh}}),mR=e=>({path:"/v1/admin/account/pats",headers:{},query:{},params:{},body:{}}),yR=e=>({path:"/v1/admin/account/pats",headers:{},query:{},params:{},body:{note:e.note}}),gR=e=>({path:`/v1/admin/account/pats/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),vR=e=>({path:`/v1/admin/account/preferences/${encodeURIComponent(e.key)}`,headers:{},query:{},params:{key:e.key},body:{value:e.value}}),bR=e=>({path:`/v1/admin/account/preferences/${encodeURIComponent(e.key)}`,headers:{},query:{},params:{key:e.key},body:{}}),wR=e=>({path:"/v1/admin/hub/integrations",headers:{},query:{nextToken:e.nextToken,name:e.name,version:e.version},params:{},body:{}}),xR=e=>({path:`/v1/admin/hub/integrations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),_R=e=>({path:`/v1/admin/hub/integrations/${encodeURIComponent(e.name)}/${encodeURIComponent(e.version)}`,headers:{},query:{},params:{name:e.name,version:e.version},body:{}}),SR=e=>({path:"/v1/admin/bots",headers:{},query:{},params:{},body:{states:e.states,events:e.events,recurringEvents:e.recurringEvents,subscriptions:e.subscriptions,actions:e.actions,configuration:e.configuration,user:e.user,conversation:e.conversation,message:e.message,code:e.code,name:e.name,medias:e.medias,url:e.url,dev:e.dev}}),ER=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{url:e.url,authentication:e.authentication,configuration:e.configuration,blocked:e.blocked,alwaysAlive:e.alwaysAlive,user:e.user,message:e.message,conversation:e.conversation,events:e.events,actions:e.actions,states:e.states,recurringEvents:e.recurringEvents,integrations:e.integrations,subscriptions:e.subscriptions,code:e.code,name:e.name,medias:e.medias}}),kR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/transfer`,headers:{},query:{},params:{id:e.id},body:{targetWorkspaceId:e.targetWorkspaceId}}),CR=e=>({path:"/v1/admin/bots",headers:{},query:{dev:e.dev,nextToken:e.nextToken,sortField:e.sortField,sortDirection:e.sortDirection},params:{},body:{}}),TR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),AR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),OR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/logs`,headers:{},query:{timeStart:e.timeStart,timeEnd:e.timeEnd,nextToken:e.nextToken},params:{id:e.id},body:{}}),IR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/webchat`,headers:{},query:{type:e.type},params:{id:e.id},body:{}}),RR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/analytics`,headers:{},query:{startDate:e.startDate,endDate:e.endDate},params:{id:e.id},body:{}}),PR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/issues/${encodeURIComponent(e.issueId)}`,headers:{},query:{},params:{id:e.id,issueId:e.issueId},body:{}}),$R=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/issues`,headers:{},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),DR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/issues/${encodeURIComponent(e.issueId)}`,headers:{},query:{},params:{id:e.id,issueId:e.issueId},body:{}}),NR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/issues/${encodeURIComponent(e.issueId)}/events`,headers:{},query:{},params:{id:e.id,issueId:e.issueId},body:{}}),jR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/versions`,headers:{},query:{},params:{id:e.id},body:{}}),MR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/versions/${encodeURIComponent(e.versionId)}`,headers:{},query:{},params:{id:e.id,versionId:e.versionId},body:{}}),qR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/versions`,headers:{},query:{},params:{id:e.id},body:{name:e.name,description:e.description}}),LR=e=>({path:`/v1/admin/bots/${encodeURIComponent(e.id)}/versions/deploy`,headers:{},query:{},params:{id:e.id},body:{versionId:e.versionId}}),FR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/billing/payment-method`,headers:{},query:{},params:{id:e.id},body:{stripePaymentMethodId:e.stripePaymentMethodId}}),UR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/billing/invoices`,headers:{},query:{},params:{id:e.id},body:{}}),BR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/billing/upcoming-invoice`,headers:{},query:{},params:{id:e.id},body:{}}),zR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/billing/invoices/charge-unpaid`,headers:{},query:{},params:{id:e.id},body:{invoiceIds:e.invoiceIds}}),ZR=e=>({path:"/v1/admin/workspaces",headers:{},query:{},params:{},body:{name:e.name}}),VR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/public`,headers:{},query:{},params:{id:e.id},body:{}}),HR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),WR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/usages`,headers:{},query:{type:e.type,period:e.period},params:{id:e.id},body:{}}),KR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/usages/by-bot`,headers:{},query:{type:e.type,period:e.period},params:{id:e.id},body:{}}),JR=e=>({path:"/v1/admin/workspaces/usages/quota-completion",headers:{},query:{},params:{},body:{}}),YR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/quota`,headers:{},query:{type:e.type,period:e.period},params:{id:e.id},body:{}}),GR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/quotas`,headers:{},query:{period:e.period},params:{id:e.id},body:{}}),XR=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{name:e.name,spendingLimit:e.spendingLimit,about:e.about,profilePicture:e.profilePicture,contactEmail:e.contactEmail,website:e.website,socialAccounts:e.socialAccounts,isPublic:e.isPublic,handle:e.handle}}),QR=e=>({path:"/v1/admin/workspaces/handle-availability",headers:{},query:{},params:{},body:{handle:e.handle}}),eP=e=>({path:"/v1/admin/workspaces",headers:{},query:{nextToken:e.nextToken},params:{},body:{}}),tP=e=>({path:"/v1/admin/workspaces/public",headers:{},query:{nextToken:e.nextToken,workspaceIds:e.workspaceIds,search:e.search},params:{},body:{}}),nP=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),rP=e=>({path:`/v1/admin/workspaces/${encodeURIComponent(e.id)}/audit-records`,headers:{},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),iP=e=>({path:"/v1/admin/workspace-members",headers:{},query:{nextToken:e.nextToken},params:{},body:{}}),oP=e=>({path:"/v1/admin/workspace-members/me",headers:{},query:{},params:{},body:{}}),sP=e=>({path:`/v1/admin/workspace-members/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),aP=e=>({path:"/v1/admin/workspace-members",headers:{},query:{},params:{},body:{email:e.email,role:e.role}}),cP=e=>({path:`/v1/admin/workspace-members/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{role:e.role}}),lP=e=>({path:"/v1/admin/integrations/iaks",headers:{},query:{integrationId:e.integrationId},params:{},body:{}}),uP=e=>({path:"/v1/admin/integrations/iaks",headers:{},query:{},params:{},body:{integrationId:e.integrationId,note:e.note}}),dP=e=>({path:`/v1/admin/integrations/iaks/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),fP=e=>({path:"/v1/admin/integrations",headers:{},query:{},params:{},body:{name:e.name,version:e.version,interfaces:e.interfaces,configuration:e.configuration,states:e.states,events:e.events,actions:e.actions,entities:e.entities,identifier:e.identifier,channels:e.channels,user:e.user,secrets:e.secrets,code:e.code,url:e.url,dev:e.dev,icon:e.icon,readme:e.readme,title:e.title,description:e.description,public:e.public}}),pP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{configuration:e.configuration,channels:e.channels,identifier:e.identifier,actions:e.actions,events:e.events,states:e.states,user:e.user,entities:e.entities,interfaces:e.interfaces,secrets:e.secrets,code:e.code,icon:e.icon,readme:e.readme,title:e.title,description:e.description,url:e.url,public:e.public}}),hP=e=>({path:"/v1/admin/integrations",headers:{},query:{nextToken:e.nextToken,name:e.name,version:e.version,dev:e.dev},params:{},body:{}}),mP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),yP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.id)}/logs`,headers:{},query:{timeStart:e.timeStart,timeEnd:e.timeEnd,nextToken:e.nextToken},params:{id:e.id},body:{}}),gP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.name)}/${encodeURIComponent(e.version)}`,headers:{},query:{},params:{name:e.name,version:e.version},body:{}}),vP=e=>({path:`/v1/admin/integrations/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),bP=e=>({path:"/v1/admin/integrations/request-verification",headers:{},query:{},params:{},body:{integrationId:e.integrationId}}),wP=e=>({path:"/v1/admin/interfaces",headers:{},query:{},params:{},body:{name:e.name,version:e.version,events:e.events,actions:e.actions,entities:e.entities}}),xP=e=>({path:`/v1/admin/interfaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),_P=e=>({path:`/v1/admin/interfaces/${encodeURIComponent(e.name)}/${encodeURIComponent(e.version)}`,headers:{},query:{},params:{name:e.name,version:e.version},body:{}}),SP=e=>({path:`/v1/admin/interfaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{events:e.events,actions:e.actions,entities:e.entities}}),EP=e=>({path:`/v1/admin/interfaces/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),kP=e=>({path:"/v1/admin/interfaces",headers:{},query:{nextToken:e.nextToken},params:{},body:{}}),CP=e=>({path:`/v1/admin/usages/${encodeURIComponent(e.id)}`,headers:{},query:{type:e.type,period:e.period},params:{id:e.id},body:{}}),TP=e=>({path:"/v1/admin/usages/multiple",headers:{},query:{types:e.types,ids:e.ids,period:e.period},params:{},body:{}}),AP=e=>({path:`/v1/admin/usages/${encodeURIComponent(e.id)}/history`,headers:{},query:{type:e.type},params:{id:e.id},body:{}}),OP=e=>({path:"/v1/admin/quotas/ai-spend",headers:{},query:{},params:{},body:{monthlySpendingLimit:e.monthlySpendingLimit}}),IP=e=>({path:"/v1/admin/activities",headers:{},query:{nextToken:e.nextToken,taskId:e.taskId,botId:e.botId},params:{},body:{}}),RP=e=>({path:"/v1/admin/introspect",headers:{},query:{},params:{},body:{botId:e.botId}}),PP=e=>({path:"/v1/files",headers:{},query:{},params:{},body:{key:e.key,tags:e.tags,size:e.size,index:e.index,accessPolicies:e.accessPolicies,contentType:e.contentType,expiresAt:e.expiresAt}}),$P=e=>({path:`/v1/files/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),DP=e=>({path:"/v1/files",headers:{},query:{nextToken:e.nextToken,tags:e.tags},params:{},body:{}}),NP=e=>({path:`/v1/files/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{}}),jP=e=>({path:`/v1/files/${encodeURIComponent(e.id)}`,headers:{},query:{},params:{id:e.id},body:{tags:e.tags,accessPolicies:e.accessPolicies,expiresAt:e.expiresAt}}),MP=e=>({path:"/v1/files/search",headers:{},query:{tags:e.tags,query:e.query,contextDepth:e.contextDepth,limit:e.limit,includeBreadcrumb:e.includeBreadcrumb},params:{},body:{}}),qP=e=>({path:`/v1/files/${encodeURIComponent(e.fileId)}/passages`,headers:{},query:{nextToken:e.nextToken,limit:e.limit},params:{fileId:e.fileId},body:{}}),LP=e=>({path:"/v1/tables",headers:{},query:{tags:e.tags},params:{},body:{}}),FP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}`,headers:{},query:{},params:{table:e.table},body:{}}),UP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}`,headers:{},query:{},params:{table:e.table},body:{factor:e.factor,frozen:e.frozen,schema:e.schema,tags:e.tags,isComputeEnabled:e.isComputeEnabled}}),BP=e=>({path:"/v1/tables",headers:{},query:{},params:{},body:{name:e.name,factor:e.factor,frozen:e.frozen,schema:e.schema,tags:e.tags,isComputeEnabled:e.isComputeEnabled}}),zP=e=>({path:`/v1/tables/${encodeURIComponent(e.sourceTableId)}/duplicate`,headers:{},query:{},params:{sourceTableId:e.sourceTableId},body:{tableName:e.tableName,schemaOnly:e.schemaOnly,factor:e.factor}}),ZP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}`,headers:{},query:{},params:{table:e.table},body:{name:e.name,frozen:e.frozen,schema:e.schema,tags:e.tags,isComputeEnabled:e.isComputeEnabled}}),VP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/column`,headers:{},query:{},params:{table:e.table},body:{name:e.name,newName:e.newName}}),HP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}`,headers:{},query:{},params:{table:e.table},body:{}}),WP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/row`,headers:{},query:{id:e.id},params:{table:e.table},body:{}}),KP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows/find`,headers:{},query:{},params:{table:e.table},body:{limit:e.limit,offset:e.offset,filter:e.filter,group:e.group,search:e.search,orderBy:e.orderBy,orderDirection:e.orderDirection}}),JP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows`,headers:{},query:{},params:{table:e.table},body:{rows:e.rows,waitComputed:e.waitComputed}}),YP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows/delete`,headers:{},query:{},params:{table:e.table},body:{ids:e.ids,filter:e.filter,deleteAllRows:e.deleteAllRows}}),GP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows`,headers:{},query:{},params:{table:e.table},body:{rows:e.rows,waitComputed:e.waitComputed}}),XP=e=>({path:`/v1/tables/${encodeURIComponent(e.table)}/rows/upsert`,headers:{},query:{},params:{table:e.table},body:{rows:e.rows,keyColumn:e.keyColumn,waitComputed:e.waitComputed}}),QP=class{constructor(e,t={}){k(this,"createConversation",async e=>{let{path:t,headers:n,query:r,body:i}=OI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getConversation",async e=>{let{path:t,headers:n,query:r,body:i}=II(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listConversations",async e=>{let{path:t,headers:n,query:r,body:i}=RI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrCreateConversation",async e=>{let{path:t,headers:n,query:r,body:i}=PI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateConversation",async e=>{let{path:t,headers:n,query:r,body:i}=$I(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteConversation",async e=>{let{path:t,headers:n,query:r,body:i}=DI(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listParticipants",async e=>{let{path:t,headers:n,query:r,body:i}=NI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"addParticipant",async e=>{let{path:t,headers:n,query:r,body:i}=jI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getParticipant",async e=>{let{path:t,headers:n,query:r,body:i}=MI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"removeParticipant",async e=>{let{path:t,headers:n,query:r,body:i}=qI(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createEvent",async e=>{let{path:t,headers:n,query:r,body:i}=LI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getEvent",async e=>{let{path:t,headers:n,query:r,body:i}=FI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listEvents",async e=>{let{path:t,headers:n,query:r,body:i}=UI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createMessage",async e=>{let{path:t,headers:n,query:r,body:i}=BI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrCreateMessage",async e=>{let{path:t,headers:n,query:r,body:i}=zI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getMessage",async e=>{let{path:t,headers:n,query:r,body:i}=ZI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateMessage",async e=>{let{path:t,headers:n,query:r,body:i}=VI(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listMessages",async e=>{let{path:t,headers:n,query:r,body:i}=HI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteMessage",async e=>{let{path:t,headers:n,query:r,body:i}=WI(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createUser",async e=>{let{path:t,headers:n,query:r,body:i}=KI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getUser",async e=>{let{path:t,headers:n,query:r,body:i}=JI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listUsers",async e=>{let{path:t,headers:n,query:r,body:i}=YI(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrCreateUser",async e=>{let{path:t,headers:n,query:r,body:i}=GI(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateUser",async e=>{let{path:t,headers:n,query:r,body:i}=XI(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteUser",async e=>{let{path:t,headers:n,query:r,body:i}=QI(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getState",async e=>{let{path:t,headers:n,query:r,body:i}=eR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"setState",async e=>{let{path:t,headers:n,query:r,body:i}=tR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrSetState",async e=>{let{path:t,headers:n,query:r,body:i}=nR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"patchState",async e=>{let{path:t,headers:n,query:r,body:i}=rR(e),o=(this.props.toAxiosRequest??G)({method:"patch",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"callAction",async e=>{let{path:t,headers:n,query:r,body:i}=iR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"configureIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=oR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getTask",async e=>{let{path:t,headers:n,query:r,body:i}=sR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createTask",async e=>{let{path:t,headers:n,query:r,body:i}=aR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateTask",async e=>{let{path:t,headers:n,query:r,body:i}=cR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteTask",async e=>{let{path:t,headers:n,query:r,body:i}=lR(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listTasks",async e=>{let{path:t,headers:n,query:r,body:i}=uR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"trackAnalytics",async e=>{let{path:t,headers:n,query:r,body:i}=dR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"runVrl",async e=>{let{path:t,headers:n,query:r,body:i}=fR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getAccount",async e=>{let{path:t,headers:n,query:r,body:i}=pR(),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateAccount",async e=>{let{path:t,headers:n,query:r,body:i}=hR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listPersonalAccessTokens",async e=>{let{path:t,headers:n,query:r,body:i}=mR(),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createPersonalAccessToken",async e=>{let{path:t,headers:n,query:r,body:i}=yR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deletePersonalAccessToken",async e=>{let{path:t,headers:n,query:r,body:i}=gR(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"setAccountPreference",async e=>{let{path:t,headers:n,query:r,body:i}=vR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getAccountPreference",async e=>{let{path:t,headers:n,query:r,body:i}=bR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listPublicIntegrations",async e=>{let{path:t,headers:n,query:r,body:i}=wR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getPublicIntegrationById",async e=>{let{path:t,headers:n,query:r,body:i}=xR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getPublicIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=_R(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createBot",async e=>{let{path:t,headers:n,query:r,body:i}=SR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateBot",async e=>{let{path:t,headers:n,query:r,body:i}=ER(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"transferBot",async e=>{let{path:t,headers:n,query:r,body:i}=kR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listBots",async e=>{let{path:t,headers:n,query:r,body:i}=CR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBot",async e=>{let{path:t,headers:n,query:r,body:i}=TR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteBot",async e=>{let{path:t,headers:n,query:r,body:i}=AR(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotLogs",async e=>{let{path:t,headers:n,query:r,body:i}=OR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotWebchat",async e=>{let{path:t,headers:n,query:r,body:i}=IR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotAnalytics",async e=>{let{path:t,headers:n,query:r,body:i}=RR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotIssue",async e=>{let{path:t,headers:n,query:r,body:i}=PR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listBotIssues",async e=>{let{path:t,headers:n,query:r,body:i}=$R(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteBotIssue",async e=>{let{path:t,headers:n,query:r,body:i}=DR(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listBotIssueEvents",async e=>{let{path:t,headers:n,query:r,body:i}=NR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listBotVersions",async e=>{let{path:t,headers:n,query:r,body:i}=jR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getBotVersion",async e=>{let{path:t,headers:n,query:r,body:i}=MR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createBotVersion",async e=>{let{path:t,headers:n,query:r,body:i}=qR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deployBotVersion",async e=>{let{path:t,headers:n,query:r,body:i}=LR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"setWorkspacePaymentMethod",async e=>{let{path:t,headers:n,query:r,body:i}=FR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaceInvoices",async e=>{let{path:t,headers:n,query:r,body:i}=UR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getUpcomingInvoice",async e=>{let{path:t,headers:n,query:r,body:i}=BR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"chargeWorkspaceUnpaidInvoices",async e=>{let{path:t,headers:n,query:r,body:i}=zR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=ZR(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getPublicWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=VR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=HR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaceUsages",async e=>{let{path:t,headers:n,query:r,body:i}=WR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"breakDownWorkspaceUsageByBot",async e=>{let{path:t,headers:n,query:r,body:i}=KR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getAllWorkspaceQuotaCompletion",async e=>{let{path:t,headers:n,query:r,body:i}=JR(),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getWorkspaceQuota",async e=>{let{path:t,headers:n,query:r,body:i}=YR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaceQuotas",async e=>{let{path:t,headers:n,query:r,body:i}=GR(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=XR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"checkHandleAvailability",async e=>{let{path:t,headers:n,query:r,body:i}=QR(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaces",async e=>{let{path:t,headers:n,query:r,body:i}=eP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listPublicWorkspaces",async e=>{let{path:t,headers:n,query:r,body:i}=tP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteWorkspace",async e=>{let{path:t,headers:n,query:r,body:i}=nP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getAuditRecords",async e=>{let{path:t,headers:n,query:r,body:i}=rP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listWorkspaceMembers",async e=>{let{path:t,headers:n,query:r,body:i}=iP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getWorkspaceMember",async e=>{let{path:t,headers:n,query:r,body:i}=oP(),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteWorkspaceMember",async e=>{let{path:t,headers:n,query:r,body:i}=sP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createWorkspaceMember",async e=>{let{path:t,headers:n,query:r,body:i}=aP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateWorkspaceMember",async e=>{let{path:t,headers:n,query:r,body:i}=cP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listIntegrationApiKeys",async e=>{let{path:t,headers:n,query:r,body:i}=lP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createIntegrationApiKey",async e=>{let{path:t,headers:n,query:r,body:i}=uP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteIntegrationApiKey",async e=>{let{path:t,headers:n,query:r,body:i}=dP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=fP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=pP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listIntegrations",async e=>{let{path:t,headers:n,query:r,body:i}=hP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=mP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getIntegrationLogs",async e=>{let{path:t,headers:n,query:r,body:i}=yP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getIntegrationByName",async e=>{let{path:t,headers:n,query:r,body:i}=gP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteIntegration",async e=>{let{path:t,headers:n,query:r,body:i}=vP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"requestIntegrationVerification",async e=>{let{path:t,headers:n,query:r,body:i}=bP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createInterface",async e=>{let{path:t,headers:n,query:r,body:i}=wP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getInterface",async e=>{let{path:t,headers:n,query:r,body:i}=xP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getInterfaceByName",async e=>{let{path:t,headers:n,query:r,body:i}=_P(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateInterface",async e=>{let{path:t,headers:n,query:r,body:i}=SP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteInterface",async e=>{let{path:t,headers:n,query:r,body:i}=EP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listInterfaces",async e=>{let{path:t,headers:n,query:r,body:i}=kP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getUsage",async e=>{let{path:t,headers:n,query:r,body:i}=CP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getMultipleUsages",async e=>{let{path:t,headers:n,query:r,body:i}=TP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listUsageHistory",async e=>{let{path:t,headers:n,query:r,body:i}=AP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"changeAISpendQuota",async e=>{let{path:t,headers:n,query:r,body:i}=OP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listActivities",async e=>{let{path:t,headers:n,query:r,body:i}=IP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"introspect",async e=>{let{path:t,headers:n,query:r,body:i}=RP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"upsertFile",async e=>{let{path:t,headers:n,query:r,body:i}=PP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteFile",async e=>{let{path:t,headers:n,query:r,body:i}=$P(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listFiles",async e=>{let{path:t,headers:n,query:r,body:i}=DP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getFile",async e=>{let{path:t,headers:n,query:r,body:i}=NP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateFileMetadata",async e=>{let{path:t,headers:n,query:r,body:i}=jP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"searchFiles",async e=>{let{path:t,headers:n,query:r,body:i}=MP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listFilePassages",async e=>{let{path:t,headers:n,query:r,body:i}=qP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"listTables",async e=>{let{path:t,headers:n,query:r,body:i}=LP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getTable",async e=>{let{path:t,headers:n,query:r,body:i}=FP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getOrCreateTable",async e=>{let{path:t,headers:n,query:r,body:i}=UP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createTable",async e=>{let{path:t,headers:n,query:r,body:i}=BP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"duplicateTable",async e=>{let{path:t,headers:n,query:r,body:i}=zP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateTable",async e=>{let{path:t,headers:n,query:r,body:i}=ZP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"renameTableColumn",async e=>{let{path:t,headers:n,query:r,body:i}=VP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteTable",async e=>{let{path:t,headers:n,query:r,body:i}=HP(e),o=(this.props.toAxiosRequest??G)({method:"delete",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"getTableRow",async e=>{let{path:t,headers:n,query:r,body:i}=WP(e),o=(this.props.toAxiosRequest??G)({method:"get",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"findTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=KP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"createTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=JP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"deleteTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=YP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"updateTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=GP(e),o=(this.props.toAxiosRequest??G)({method:"put",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});k(this,"upsertTableRows",async e=>{let{path:t,headers:n,query:r,body:i}=XP(e),o=(this.props.toAxiosRequest??G)({method:"post",path:t,headers:{...n},query:{...r},body:i});return this.axiosInstance.request(o).then(s=>s.data).catch(s=>{throw X(s)})});this.axiosInstance=e,this.props=t}};function X(e){var t;return Lo.isAxiosError(e)&&((t=e.response)!=null&&t.data)?Zf(e.response.data):Zf(e)}var gn=class{constructor(e){this._list=e}async*[Symbol.asyncIterator](){let e;do{let{items:t,meta:n}=await this._list({nextToken:e});e=n.nextToken;for(let r of t)yield r}while(e)}async collect(e={}){let t=e.limit??Number.POSITIVE_INFINITY,n=[],r=0;for await(let i of this)if(n.push(i),r++,r>=t)break;return n}},e$=class{constructor(e){k(this,"conversations",e=>new gn(({nextToken:t})=>this.client.listConversations({nextToken:t,...e}).then(n=>({...n,items:n.conversations}))));k(this,"participants",e=>new gn(({nextToken:t})=>this.client.listParticipants({nextToken:t,...e}).then(n=>({...n,items:n.participants}))));k(this,"events",e=>new gn(({nextToken:t})=>this.client.listEvents({nextToken:t,...e}).then(n=>({...n,items:n.events}))));k(this,"messages",e=>new gn(({nextToken:t})=>this.client.listMessages({nextToken:t,...e}).then(n=>({...n,items:n.messages}))));k(this,"users",e=>new gn(({nextToken:t})=>this.client.listUsers({nextToken:t,...e}).then(n=>({...n,items:n.users}))));k(this,"tasks",e=>new gn(({nextToken:t})=>this.client.listTasks({nextToken:t,...e}).then(n=>({...n,items:n.tasks}))));k(this,"publicIntegrations",e=>new gn(({nextToken:t})=>this.client.listPublicIntegrations({nextToken:t,...e}).then(n=>({...n,items:n.integrations}))));k(this,"bots",e=>new gn(({nextToken:t})=>this.client.listBots({nextToken:t,...e}).then(n=>({...n,items:n.bots}))));k(this,"botIssues",e=>new gn(({nextToken:t})=>this.client.listBotIssues({nextToken:t,...e}).then(n=>({...n,items:n.issues}))));k(this,"workspaces",e=>new gn(({nextToken:t})=>this.client.listWorkspaces({nextToken:t,...e}).then(n=>({...n,items:n.workspaces}))));k(this,"publicWorkspaces",e=>new gn(({nextToken:t})=>this.client.listPublicWorkspaces({nextToken:t,...e}).then(n=>({...n,items:n.workspaces}))));k(this,"workspaceMembers",e=>new gn(({nextToken:t})=>this.client.listWorkspaceMembers({nextToken:t,...e}).then(n=>({...n,items:n.members}))));k(this,"integrations",e=>new gn(({nextToken:t})=>this.client.listIntegrations({nextToken:t,...e}).then(n=>({...n,items:n.integrations}))));k(this,"interfaces",e=>new gn(({nextToken:t})=>this.client.listInterfaces({nextToken:t,...e}).then(n=>({...n,items:n.interfaces}))));k(this,"activities",e=>new gn(({nextToken:t})=>this.client.listActivities({nextToken:t,...e}).then(n=>({...n,items:n.activities}))));k(this,"files",e=>new gn(({nextToken:t})=>this.client.listFiles({nextToken:t,...e}).then(n=>({...n,items:n.files}))));k(this,"filePassages",e=>new gn(({nextToken:t})=>this.client.listFilePassages({nextToken:t,...e}).then(n=>({...n,items:n.passages}))));this.client=e}},Jb=100*1024*1024,t$=Jb,n$=Jb,r$=class extends QP{constructor(t={}){let n=EI(t),{apiUrl:r,headers:i,withCredentials:o,timeout:s}=n,a=Lo.create({baseURL:r,headers:i,withCredentials:o,timeout:s,maxBodyLength:t$,maxContentLength:n$,httpAgent:Nf?new mI.default.Agent({keepAlive:!0}):void 0,httpsAgent:Nf?new yI.default.Agent({keepAlive:!0}):void 0});super(a);k(this,"config");k(this,"uploadFile",async({key:t,index:n,tags:r,contentType:i,accessPolicies:o,content:s,url:a,expiresAt:c})=>{if(a&&s)throw new Bo("Cannot provide both content and URL, please provide only one of them");if(a&&(s=await Lo.get(a,{responseType:"arraybuffer"}).then(p=>p.data).catch(p=>{throw new Bo(`Failed to download file from provided URL: ${p.message}`,p)})),!s)throw new Bo("No content was provided for the file");let l,u;if(typeof s=="string"){let p=new TextEncoder().encode(s);l=p,u=p.byteLength}else if(s instanceof Uint8Array)l=s,u=l.byteLength;else if(s instanceof ArrayBuffer)l=s,u=l.byteLength;else if(s instanceof Blob)l=s,u=s.size;else throw new Bo("The provided content is not supported");let{file:d}=await this.upsertFile({key:t,tags:r,index:n,accessPolicies:o,contentType:i,size:u,expiresAt:c});try{await Lo.put(d.uploadUrl,l,{maxBodyLength:1/0,headers:{"Content-Type":d.contentType}})}catch(p){throw new Bo(`Failed to upload file: ${p.message}`,p,d)}return{file:d}});t.retry&&Eb(a,t.retry),this.config=n}get list(){return new e$(this)}};const Ol=zd(Object.freeze(Object.defineProperty({__proto__:null,AlreadyExistsError:zb,BreakingChangesError:Kb,Client:r$,ForbiddenError:Ab,InternalError:Cb,InvalidDataFormatError:Nb,InvalidIdentifierError:jb,InvalidJsonSchemaError:Db,InvalidPayloadError:Ib,InvalidQueryError:Ub,LimitExceededError:Wb,MethodNotFoundError:Pb,PayloadTooLargeError:Ob,PaymentRequiredError:Vb,QuotaExceededError:Hb,RateLimitedError:Zb,ReferenceConstraintError:qb,ReferenceNotFoundError:Fb,RelationConflictError:Mb,ResourceLockedConflictError:Lb,ResourceNotFoundError:$b,RuntimeError:Bb,UnauthorizedError:Tb,UnknownError:Uo,UnsupportedMediaTypeError:Rb,UploadFileError:Bo,axios:TO,axiosRetry:gb,errorFrom:Zf,isApiError:kb},Symbol.toStringTag,{value:"Module"})));(function(e){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,a=(x,ne)=>{for(var be in ne)n(x,be,{get:ne[be],enumerable:!0})},c=(x,ne,be,Me)=>{if(ne&&typeof ne=="object"||typeof ne=="function")for(let qe of i(ne))!s.call(x,qe)&&qe!==be&&n(x,qe,{get:()=>ne[qe],enumerable:!(Me=r(ne,qe))||Me.enumerable});return x},l=(x,ne,be)=>(c(x,ne,"default"),be&&c(be,ne,"default")),u=(x,ne,be)=>(be=x!=null?t(o(x)):{},c(ne||!x||!x.__esModule?n(be,"default",{value:x,enumerable:!0}):be,x)),d=x=>c(n({},"__esModule",{value:!0}),x),p={};a(p,{Bot:()=>GH,BotSpecificClient:()=>kC,Integration:()=>Vt,IntegrationDefinition:()=>oe,IntegrationSpecificClient:()=>Mt,InterfaceDeclaration:()=>ce,RuntimeError:()=>EC.RuntimeError,botIdHeader:()=>C,botUserIdHeader:()=>te,configurationHeader:()=>we,integrationIdHeader:()=>fe,interfaces:()=>D,isApiError:()=>EC.isApiError,messages:()=>f,operationHeader:()=>Te,parseBody:()=>Se,serve:()=>Be,typeHeader:()=>Ee,webhookIdHeader:()=>A}),e.exports=d(p);var f={};a(f,{defaults:()=>F});var h={};a(h,{default:()=>y});var m=ac;l(h,ac);var y=m.z,g=h.z.string().min(1),v=h.z.object({text:g}),b=h.z.object({markdown:g}),S=h.z.object({imageUrl:g}),E=h.z.object({audioUrl:g}),_=h.z.object({videoUrl:g}),I=h.z.object({fileUrl:g,title:g.optional()}),P=h.z.object({latitude:h.z.number(),longitude:h.z.number(),address:h.z.string().optional(),title:h.z.string().optional()}),$=h.z.object({title:g,subtitle:g.optional(),imageUrl:g.optional(),actions:h.z.array(h.z.object({action:h.z.enum(["postback","url","say"]),label:g,value:g}))}),O=h.z.object({text:g,options:h.z.array(h.z.object({label:g,value:g}))}),q=h.z.object({items:h.z.array($)}),H=h.z.discriminatedUnion("type",[h.z.object({type:h.z.literal("text"),payload:v}),h.z.object({type:h.z.literal("markdown"),payload:b}),h.z.object({type:h.z.literal("image"),payload:S}),h.z.object({type:h.z.literal("audio"),payload:E}),h.z.object({type:h.z.literal("video"),payload:_}),h.z.object({type:h.z.literal("file"),payload:I}),h.z.object({type:h.z.literal("location"),payload:P})]),B=h.z.object({items:h.z.array(H)}),F={text:{schema:v},markdown:{schema:b},image:{schema:S},audio:{schema:E},video:{schema:_},file:{schema:I},location:{schema:P},carousel:{schema:q},card:{schema:$},dropdown:{schema:O},choice:{schema:O},bloc:{schema:B}},D={};a(D,{creatable:()=>Kt,deletable:()=>Kn,hitl:()=>ir,listable:()=>ot,llm:()=>pn,readable:()=>Lt,schemas:()=>M,speechToText:()=>le,textToImage:()=>FH,typingIndicator:()=>UH,updatable:()=>Ft});var M={};a(M,{speechToText:()=>Z});var Z={};a(Z,{OpenAITranscribeAudioOutputSchema:()=>W});var W=y.object({language:y.string().describe("Detected language of the audio"),duration:y.number().describe("Duration of the audio file, in seconds"),segments:y.array(y.object({text:y.string().describe("Text content of the segment."),id:y.number().describe("Unique identifier of the segment"),seek:y.number().describe("Seek offset of the segment"),start:y.number().describe("Start time of the segment in seconds."),end:y.number().describe("End time of the segment in seconds."),tokens:y.array(y.number()).describe("Array of token IDs for the text content."),temperature:y.number().describe("Temperature parameter used for generating the segment."),avg_logprob:y.number().describe("Average logprob of the segment. If the value is lower than -1, consider the logprobs failed."),compression_ratio:y.number().describe("Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed."),no_speech_prob:y.number().describe("Probability of no speech in the segment. If the value is higher than 1.0 and the avg_logprob is below -1, consider this segment silent.")}))}),Q=ac,C="x-bot-id",te="x-bot-user-id",fe="x-integration-id",A="x-webhook-id",we="x-bp-configuration",Te="x-bp-operation",Ee="x-bp-type",$e=Q.z.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Fe=x=>{let ne=x[C],be=x[te],Me=x[fe],qe=x[A],je=x[we],Le=$e.parse(x[Te]);if(!ne)throw new Error("Missing bot headers");if(!be)throw new Error("Missing bot user headers");if(!Me)throw new Error("Missing integration headers");if(!qe)throw new Error("Missing webhook headers");if(!je)throw new Error("Missing configuration headers");if(!Le)throw new Error("Missing operation headers");return{botId:ne,botUserId:be,integrationId:Me,webhookId:qe,operation:Le,configuration:je?JSON.parse(Buffer.from(je,"base64").toString("utf-8")):{}}},Pe=x=>Array.from(new Set(x)),he=x=>Object.entries(x),de=(x,ne)=>Object.fromEntries(he(x).map(([be,Me])=>[be,ne(Me,be)])),_e=(x,ne,be)=>{let Me=Pe([...Object.keys(x),...Object.keys(ne)]),qe={};for(let je of Me){let Le=x[je],at=ne[je];Le&&at?qe[je]=be(Le,at):Le?qe[je]=Le:at&&(qe[je]=at)}return qe},pe=Symbol("schemaName"),De=x=>x?de(x,(ne,be)=>({...ne,[pe]:be})):{},et=x=>x[pe]!==void 0,L=x=>x[pe],oe=class{constructor(x){k(this,"name");k(this,"version");k(this,"title");k(this,"description");k(this,"icon");k(this,"readme");k(this,"configuration");k(this,"events");k(this,"actions");k(this,"channels");k(this,"states");k(this,"user");k(this,"secrets");k(this,"identifier");k(this,"entities");k(this,"interfaces",{});k(this,"_mergeActions",(x,ne)=>({title:ne.title??x.title,description:ne.description??x.description,input:{schema:x.input.schema.merge(ne.input.schema)},output:{schema:x.output.schema.merge(ne.output.schema)}}));k(this,"_mergeEvents",(x,ne)=>({title:ne.title??x.title,description:ne.description??x.description,schema:x.schema.merge(ne.schema)}));k(this,"_mergeChannels",(x,ne)=>{let be=_e(x.messages,ne.messages,this._mergeMessage);return{title:ne.title??x.title,description:ne.description??x.description,conversation:ne.conversation??x.conversation,message:ne.message??x.message,messages:be}});k(this,"_mergeMessage",(x,ne)=>({schema:x.schema.merge(ne.schema)}));this.props=x,this.name=x.name,this.version=x.version,this.icon=x.icon,this.readme=x.readme,this.title=x.title,this.identifier=x.identifier,this.description=x.description,this.configuration=x.configuration,this.events=x.events,this.actions=x.actions,this.channels=x.channels,this.states=x.states,this.user=x.user,this.secrets=x.secrets,this.entities=x.entities}clone(x){let ne=new oe({...this,...x});for(let[be,Me]of Object.entries(this.interfaces))ne.interfaces[be]=Me;return ne}extend(x,ne){let be=ne(De(this.entities)),Me=he(be).find(([or,Rs])=>!et(Rs));if(Me)throw new Error(`Cannot extend interface "${x.name}" with entity "${Me[0]}"; the provided schema is not part of the integration's entities.`);let qe=de(be,or=>({name:L(or),schema:or.schema})),{resolved:je,implementStatement:Le}=x.resolve({entities:qe}),at=this;at.actions=_e(at.actions??{},je.actions,this._mergeActions),at.channels=_e(at.channels??{},je.channels,this._mergeChannels),at.events=_e(at.events??{},je.events,this._mergeEvents);let hn=Object.values(qe).map(or=>or.name),Sn=`${x.name}<${hn.join(",")}>`;return this.interfaces[Sn]=Le,this}},ce=class{constructor(x){k(this,"name");k(this,"version");k(this,"entities");k(this,"events");k(this,"actions");k(this,"channels");k(this,"templateName");this.props=x,this.name=x.name,this.version=x.version,this.entities=x.entities??{},this.events=x.events??{},this.actions=x.actions??{},this.channels=x.channels??{},this.templateName=x.templateName}resolve(x){let{entities:ne}=x,be={name:this.name,version:this.version,entities:de(ne,Le=>({name:Le.name})),actions:{},events:{}},Me={},qe={},je={};for(let[Le,at]of he(this.actions)){let hn=this._dereference(at.input.schema,ne),Sn=this._dereference(at.output.schema,ne),or=this._rename(ne,Le);Me[or]={input:{schema:hn},output:{schema:Sn}},be.actions[Le]={name:or}}for(let[Le,at]of he(this.events)){let hn=this._dereference(at.schema,ne),Sn=this._rename(ne,Le);qe[Sn]={schema:hn},be.events[Le]={name:Sn}}for(let[Le,at]of he(this.channels)){let hn={};for(let[Sn,or]of he(at.messages)){let Rs=this._dereference(or.schema,ne);hn[Sn]={schema:Rs}}je[Le]={messages:hn}}return{resolved:{actions:Me,events:qe,channels:je},implementStatement:be}}_dereference(x,ne){let be={},Me={};for(let[qe,je]of he(ne))be[qe]=je.schema,Me[qe]=y.ref(qe);return x(Me).dereference(be)}_rename(x,ne){if(!this.templateName)return ne;let be=de(x,Me=>Me.name);return this.templateName(ne,be)}},ue=gf,Ne=console;function Se(x){if(!x.body)throw new Error("Missing body");return JSON.parse(x.body)}async function Be(x,ne=8072,be=ie){let Me=(0,ue.createServer)(async(qe,je)=>{try{let Le=await pt(qe);if(Le.path==="/health"){je.writeHead(200).end("ok");return}let at=await x(Le);je.writeHead((at==null?void 0:at.status)??200,(at==null?void 0:at.headers)??{}).end((at==null?void 0:at.body)??"{}")}catch(Le){Ne.error("Error while handling request",{error:(Le==null?void 0:Le.message)??"Internal error occured"}),je.writeHead(500).end(JSON.stringify({error:(Le==null?void 0:Le.message)??"Internal error occured"}))}});return Me.listen(ne,()=>be(ne)),Me}async function pt(x){var qe;let ne=await K(x),be={};for(let je=0;je<x.rawHeaders.length;je+=2){let Le=x.rawHeaders[je].toLowerCase(),at=x.rawHeaders[je+1];be[Le]=at}let Me=new URL(x.url??"",x.headers.host?`http://${x.headers.host}`:"http://botpress.cloud");return{body:ne,path:Me.pathname,query:Ge(Me.search,"?"),headers:be,method:((qe=x.method)==null?void 0:qe.toUpperCase())??"GET"}}function Ge(x,ne){return x.indexOf(ne)===0?x.slice(ne.length):x}async function K(x){return new Promise((ne,be)=>{if(x.method!=="POST"&&x.method!=="PUT"&&x.method!=="PATCH")return ne(void 0);let Me="";x.on("data",qe=>Me+=qe.toString()),x.on("error",qe=>be(qe)),x.on("end",()=>ne(Me))})}function ie(x){Ne.info(`Listening on port ${x}`)}var ae=Ol,Ae=Ol,Je={retries:3,retryCondition:x=>{var ne;return Ae.axiosRetry.isNetworkOrIdempotentRequestError(x)||[429,502].includes(((ne=x.response)==null?void 0:ne.status)??0)},retryDelay:x=>x*1e3},Mt=class{constructor(x){k(this,"createConversation",x=>this.client.createConversation(x));k(this,"getConversation",x=>this.client.getConversation(x));k(this,"listConversations",x=>this.client.listConversations(x));k(this,"getOrCreateConversation",x=>this.client.getOrCreateConversation(x));k(this,"updateConversation",x=>this.client.updateConversation(x));k(this,"deleteConversation",x=>this.client.deleteConversation(x));k(this,"listParticipants",x=>this.client.listParticipants(x));k(this,"addParticipant",x=>this.client.addParticipant(x));k(this,"getParticipant",x=>this.client.getParticipant(x));k(this,"removeParticipant",x=>this.client.removeParticipant(x));k(this,"createEvent",x=>this.client.createEvent(x));k(this,"getEvent",x=>this.client.getEvent(x));k(this,"listEvents",x=>this.client.listEvents(x));k(this,"createMessage",x=>this.client.createMessage(x));k(this,"getOrCreateMessage",x=>this.client.getOrCreateMessage(x));k(this,"getMessage",x=>this.client.getMessage(x));k(this,"updateMessage",x=>this.client.updateMessage(x));k(this,"listMessages",x=>this.client.listMessages(x));k(this,"deleteMessage",x=>this.client.deleteMessage(x));k(this,"createUser",x=>this.client.createUser(x));k(this,"getUser",x=>this.client.getUser(x));k(this,"listUsers",x=>this.client.listUsers(x));k(this,"getOrCreateUser",x=>this.client.getOrCreateUser(x));k(this,"updateUser",x=>this.client.updateUser(x));k(this,"deleteUser",x=>this.client.deleteUser(x));k(this,"getState",x=>this.client.getState(x));k(this,"setState",x=>this.client.setState(x));k(this,"getOrSetState",x=>this.client.getOrSetState(x));k(this,"patchState",x=>this.client.patchState(x));k(this,"configureIntegration",x=>this.client.configureIntegration(x));k(this,"uploadFile",x=>this.client.uploadFile(x));k(this,"upsertFile",x=>this.client.upsertFile(x));k(this,"deleteFile",x=>this.client.deleteFile(x));k(this,"listFiles",x=>this.client.listFiles(x));k(this,"getFile",x=>this.client.getFile(x));k(this,"updateFileMetadata",x=>this.client.updateFileMetadata(x));this.client=x}},Ot=u(gf),Et=x=>{if(process.env.BP_LOG_FORMAT==="json")return JSON.stringify({msg:Ot.default.format(...x),visible_to_bot_owner:!0});{let[ne,...be]=x;return Ot.default.format(`[For Bot Owner] ${ne}`,...be)}},Nt={forBot:()=>({info:(...x)=>{console.info(Et(x))},warn:(...x)=>{console.warn(Et(x))},error:(...x)=>{console.error(Et(x))},debug:(...x)=>{console.debug(Et(x))}})},Yt=x=>async ne=>{let be=Fe(ne.headers),Me=new ae.Client({botId:be.botId,integrationId:be.integrationId,retry:Je}),qe=new Mt(Me),je={ctx:be,req:ne,client:qe,logger:Nt,instance:x};try{let Le;switch(be.operation){case"webhook_received":Le=await J(je);break;case"register":Le=await Xe(je);break;case"unregister":Le=await rt(je);break;case"message_created":Le=await cn(je);break;case"action_triggered":Le=await Un(je);break;case"ping":Le=await z(je);break;case"create_user":Le=await At(je);break;case"create_conversation":Le=await Ye(je);break;default:throw new Error(`Unknown operation ${be.operation}`)}return Le?{...Le,status:Le.status??200}:{status:200}}catch(Le){if((0,ae.isApiError)(Le)){let hn=new ae.RuntimeError(Le.message,Le);return Nt.forBot().error(hn.message),{status:hn.code,body:JSON.stringify(hn.toJSON())}}console.error(Le);let at=new ae.RuntimeError("An unexpected error occurred in the integration. Bot owners: Check logs for more informations. Integration owners: throw a RuntimeError to return a custom error message instead.");return Nt.forBot().error(at.message),{status:at.code,body:JSON.stringify(at.toJSON())}}},z=async x=>{},J=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{let{req:je}=Se(be);return qe.webhook({client:x,ctx:ne,req:je,logger:Me})},Xe=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{if(!qe.register)return;let{webhookUrl:je}=Se(be);await qe.register({client:x,ctx:ne,webhookUrl:je,logger:Me})},rt=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{if(!qe.unregister)return;let{webhookUrl:je}=Se(be);await qe.unregister({ctx:ne,webhookUrl:je,client:x,logger:Me})},At=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{if(!qe.createUser)return;let{tags:je}=Se(be);return await qe.createUser({ctx:ne,client:x,tags:je,logger:Me})},Ye=async({client:x,ctx:ne,req:be,logger:Me,instance:qe})=>{if(!qe.createConversation)return;let{channel:je,tags:Le}=Se(be);return await qe.createConversation({ctx:ne,client:x,channel:je,tags:Le,logger:Me})},cn=async({ctx:x,req:ne,client:be,logger:Me,instance:qe})=>{let{conversation:je,user:Le,type:at,payload:hn,message:Sn}=Se(ne),or=qe.channels[je.channel];if(!or)throw new Error(`Channel ${je.channel} not found`);let Rs=or.messages[at];if(!Rs)throw new Error(`Message of type ${at} not found in channel ${je.channel}`);await Rs({ctx:x,conversation:je,message:Sn,user:Le,type:at,client:be,payload:hn,ack:async({tags:XH})=>{await be.updateMessage({id:Sn.id,tags:XH})},logger:Me})},Un=async({req:x,ctx:ne,client:be,logger:Me,instance:qe})=>{let{input:je,type:Le}=Se(x);if(!Le)throw new Error("Missing action type");let at=qe.actions[Le];if(!at)throw new Error(`Action ${Le} not found`);let hn=await at({ctx:ne,input:je,client:be,type:Le,logger:Me});return{body:JSON.stringify({output:hn})}},Vt=class{constructor(x){k(this,"props");k(this,"actions");k(this,"channels");k(this,"register");k(this,"unregister");k(this,"createUser");k(this,"createConversation");k(this,"webhook");k(this,"handler",Yt(this));k(this,"start",x=>Be(this.handler,x));this.props=x,this.actions=x.actions,this.channels=x.channels,this.register=x.register,this.unregister=x.unregister,this.createUser=x.createUser,this.createConversation=x.createConversation,this.webhook=x.handler}},_n=x=>({...x,schema:()=>x.schema.extend({userId:y.string().optional().describe("Allows sending a message pretending to be a certain user")})}),ir=new ce({name:"hitl",version:"0.2.0",entities:{},events:{hitlAssigned:{schema:()=>y.object({conversationId:y.string(),userId:y.string()})},hitlStopped:{schema:()=>y.object({conversationId:y.string()})}},actions:{createUser:{input:{schema:()=>y.object({name:y.string().optional(),pictureUrl:y.string().optional(),email:y.string().optional()})},output:{schema:()=>y.object({userId:y.string()})}},startHitl:{input:{schema:()=>y.object({userId:y.string(),title:y.string(),description:y.string().optional()})},output:{schema:()=>y.object({conversationId:y.string()})}},stopHitl:{input:{schema:()=>y.object({conversationId:y.string(),reason:y.enum(["timeout","cancel"]).optional()})},output:{schema:()=>y.object({})}}},channels:{hitl:{messages:{text:_n(F.text)}}}}),It=y.object({id:y.string(),type:y.enum(["function"]),function:y.object({name:y.string(),arguments:y.record(y.any()).nullable().describe("Some LLMs may generate invalid JSON for a tool call, so this will be `null` when it happens.")})}),xt=y.object({type:y.enum(["auto","specific","any","none",""]).optional(),functionName:y.string().optional().describe('Required if `type` is "specific"')}),Ht=y.object({role:y.enum(["user","assistant"]),type:y.enum(["text","tool_calls","tool_result","multipart"]).default("text"),toolCalls:y.array(It).optional().describe('Required if `type` is "tool_calls"'),toolResultCallId:y.string().optional().describe('Required if `type` is "tool_result"'),content:y.string().or(y.array(y.object({type:y.enum(["text","image"]),mimeType:y.string().optional().describe("Indicates the MIME type of the content. If not provided it will be detected from the content-type header of the provided URL."),text:y.string().optional().describe('Required if part type is "text" '),url:y.string().optional().describe('Required if part type is "image"')}))).optional().nullable().describe('Required unless `type` is "tool_call". If `type` is "multipart", this field must be an array of content objects. If `type` is "tool_result" then this field should be the result of the tool call (a plain string or a JSON-encoded array or object). If `type` is "tool_call" then the `toolCalls` field should be used instead.')}),zt=y.object({id:y.string()}),Wt=zt.extend({name:y.string(),description:y.string(),tags:y.array(y.enum(["recommended","deprecated","general-purpose","low-cost","vision","coding","agents","function-calling","roleplay","storytelling"])),input:y.object({maxTokens:y.number().int(),costPer1MTokens:y.number().describe("Cost per 1 million tokens, in U.S. dollars")}),output:y.object({maxTokens:y.number().int(),costPer1MTokens:y.number().describe("Cost per 1 million tokens, in U.S. dollars")})}),Pt=x=>y.object({model:x.describe("Model to use for content generation").optional(),systemPrompt:y.string().optional().describe("Optional system prompt to guide the model"),messages:y.array(Ht).describe("Array of messages for the model to process"),responseFormat:y.enum(["text","json_object"]).optional().describe('Response format expected from the model. If "json_object" is chosen, you must instruct the model to generate JSON either via the system prompt or a user message.'),maxTokens:y.number().optional().describe("Maximum number of tokens allowed in the generated response"),temperature:y.number().min(0).max(2).displayAs({id:"slider",params:{stepSize:.01,horizontal:!0}}).default(1).describe("Sampling temperature for the model. Higher values result in more random outputs."),topP:y.number().min(0).max(1).default(1).displayAs({id:"slider",params:{stepSize:.01,horizontal:!0}}).describe("Top-p sampling parameter. Limits sampling to the smallest set of tokens with a cumulative probability above the threshold."),stopSequences:y.array(y.string()).max(4).optional().describe("Sequences where the model should stop generating further tokens."),tools:y.array(y.object({type:y.literal("function"),function:y.object({name:y.string().describe("Function name"),description:y.string().optional(),argumentsSchema:y.object({}).passthrough().optional().describe("JSON schema of the function arguments")})})).optional(),toolChoice:xt.optional(),userId:y.string().optional(),debug:y.boolean().optional().describe("Set to `true` to output debug information to the bot logs")});Pt(zt);var fn=y.object({id:y.string().describe("Response ID from LLM provider"),provider:y.string().describe("LLM provider name"),model:y.string().describe("Model name"),choices:y.array(Ht.omit({role:!0}).extend({role:y.literal("assistant"),index:y.number().int(),stopReason:y.enum(["stop","max_tokens","tool_calls","content_filter","other"])})),usage:y.object({inputTokens:y.number().int().describe("Number of input tokens used by the model"),inputCost:y.number().describe("Cost of the input tokens received by the model, in U.S. dollars"),outputTokens:y.number().int().describe("Number of output tokens used by the model"),outputCost:y.number().describe("Cost of the output tokens generated by the model, in U.S. dollars")})}),pn=new ce({name:"llm",version:"4.0.0",entities:{modelRef:{schema:zt}},events:{},actions:{generateContent:{input:{schema:({modelRef:x})=>Pt(x)},output:{schema:()=>fn}},listLanguageModels:{input:{schema:()=>y.object({})},output:{schema:({modelRef:x})=>y.object({models:y.array(y.intersection(Wt,x))})}}}}),Nn=y.object({id:y.string()}),So=Nn.extend({name:y.string(),costPerMinute:y.number().describe("Cost per minute of speech transcription, in U.S. dollars")}),Eo=x=>y.object({model:x.optional().describe("Model to use for speech-to-text transcription (optional)"),fileUrl:y.string().url().describe("URL of the audio file to transcribe. The URL should return a content-type header in order to detect the audio format. Supported audio formats supported are: mp3, mp4, mpeg, mpga, m4a, wav, webm"),language:y.string().optional().describe("The language of the input audio (optional). Supplying the input language in ISO-639-1 format will improve accuracy and latency."),prompt:y.string().optional().describe("An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language."),temperature:y.number().default(0).optional().describe("The sampling temperature (optional), between 0 and 1. Defaults to 0 (automatic). Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.")});Eo(Nn);var j=W.extend({model:y.string().describe("Model name used"),cost:y.number().describe("Total cost of this transcription, in U.S. dollars")}),le=new ce({name:"speechToText",version:"1.0.0",entities:{speechToTextModelRef:{schema:Nn}},actions:{transcribeAudio:{input:{schema:({speechToTextModelRef:x})=>Eo(x)},output:{schema:()=>j}},listSpeechToTextModels:{input:{schema:()=>y.object({})},output:{schema:({speechToTextModelRef:x})=>y.object({models:y.array(y.intersection(So,x))})}}}}),ve=y.object({id:y.string()}),Ue=x=>y.intersection(x,ve),bt=x=>x[0].toUpperCase()+x.slice(1),_t=(...x)=>{let[ne,...be]=x.filter(Me=>Me.length>0).map(Me=>Me.toLowerCase());return ne?[ne,...be.map(bt)].join(""):""},ut=y.string().optional(),ot=new ce({name:"listable",version:"0.0.1",entities:{item:{schema:ve}},events:{},actions:{list:{input:{schema:()=>y.object({nextToken:ut})},output:{schema:x=>y.object({items:y.array(Ue(x.item)),meta:y.object({nextToken:ut})})}}},templateName:(x,ne)=>_t(ne.item,x)}),Kt=new ce({name:"creatable",version:"0.0.1",entities:{item:{schema:ve}},events:{created:{schema:x=>y.object({item:Ue(x.item)})}},actions:{create:{input:{schema:x=>y.object({item:x.item})},output:{schema:x=>y.object({item:Ue(x.item)})}}},templateName:(x,ne)=>_t(ne.item,x)}),Lt=new ce({name:"readable",version:"0.0.1",entities:{item:{schema:ve}},events:{},actions:{read:{input:{schema:()=>ve},output:{schema:x=>y.object({item:Ue(x.item)})}}},templateName:(x,ne)=>_t(ne.item,x)}),Ft=new ce({name:"updatable",version:"0.0.1",entities:{item:{schema:ve}},events:{updated:{schema:x=>y.object({item:Ue(x.item)})}},actions:{update:{input:{schema:x=>ve.extend({item:x.item})},output:{schema:x=>y.object({item:Ue(x.item)})}}},templateName:(x,ne)=>_t(ne.item,x)}),Kn=new ce({name:"deletable",version:"0.0.1",entities:{item:{schema:ve}},events:{deleted:{schema:()=>ve}},actions:{delete:{input:{schema:()=>ve},output:{schema:()=>y.object({})}}},templateName:(x,ne)=>_t(ne.item,x)}),Hr=y.object({id:y.string()}),Ld=Hr.extend({name:y.string(),costPerImage:y.number().describe("Cost per image generation, in U.S. dollars"),sizes:y.array(y.string()).describe("Available image sizes"),defaultSize:y.string().describe("Default image size generated by model")}),pr=y.object({}).describe("Model-specific parameters for image generation"),SC=(x,ne)=>y.object({model:x.optional().describe("Model to use for image generation"),prompt:y.string(),size:y.string().optional(),expiration:y.number().int().min(30).max(90).optional().describe("Expiration of the generated image in days, after which the image will be automatically deleted to free up storage space in your account. The default is to keep the image indefinitely (no expiration). The minimum is 30 days and the maximum is 90 days."),params:ne.optional()});SC(Hr,pr);var LH=y.object({model:y.string().describe("Model name used"),imageUrl:y.string().describe("Temporary URL of generated image"),cost:y.number().describe("Cost of the image generation, in U.S. dollars")}),FH=new ce({name:"textToImage",version:"1.1.0",entities:{imageModelRef:{schema:Hr},imageGenerationParams:{schema:pr}},actions:{generateImage:{input:{schema:({imageModelRef:x,imageGenerationParams:ne})=>SC(x,ne)},output:{schema:()=>LH}},listImageModels:{input:{schema:()=>y.object({})},output:{schema:({imageModelRef:x})=>y.object({models:y.array(y.intersection(Ld,x))})}}}}),UH=new ce({name:"typingIndicator",version:"0.0.1",entities:{},events:{},actions:{startTypingIndicator:{input:{schema:()=>y.object({conversationId:y.string(),messageId:y.string().describe("The message ID to which the typing indicator should be attached"),timeout:y.number().optional().describe("The timeout in milliseconds after which the typing indicator should stop")})},output:{schema:()=>y.object({})}},stopTypingIndicator:{input:{schema:()=>y.object({conversationId:y.string(),messageId:y.string().describe("The message ID from which the typing indicator should be removed")})},output:{schema:()=>y.object({})}}}});l(p,h,e.exports);var EC=Ol,BH=u(Ol),kC=class{constructor(x){k(this,"getConversation",x=>this.client.getConversation(x));k(this,"listConversations",x=>this.client.listConversations(x));k(this,"updateConversation",x=>this.client.updateConversation(x));k(this,"deleteConversation",x=>this.client.deleteConversation(x));k(this,"listParticipants",x=>this.client.listParticipants(x));k(this,"addParticipant",x=>this.client.addParticipant(x));k(this,"getParticipant",x=>this.client.getParticipant(x));k(this,"removeParticipant",x=>this.client.removeParticipant(x));k(this,"getEvent",x=>this.client.getEvent(x));k(this,"listEvents",x=>this.client.listEvents(x));k(this,"createMessage",x=>this.client.createMessage(x));k(this,"getOrCreateMessage",x=>this.client.getOrCreateMessage(x));k(this,"getMessage",x=>this.client.getMessage(x));k(this,"updateMessage",x=>this.client.updateMessage(x));k(this,"listMessages",x=>this.client.listMessages(x));k(this,"deleteMessage",x=>this.client.deleteMessage(x));k(this,"getUser",x=>this.client.getUser(x));k(this,"listUsers",x=>this.client.listUsers(x));k(this,"updateUser",x=>this.client.updateUser(x));k(this,"deleteUser",x=>this.client.deleteUser(x));k(this,"getState",x=>this.client.getState(x).then(ne=>({state:{...ne.state,payload:ne.state.payload}})));k(this,"setState",x=>this.client.setState(x).then(ne=>({state:{...ne.state,payload:ne.state.payload}})));k(this,"getOrSetState",x=>this.client.getOrSetState(x).then(ne=>({state:{...ne.state,payload:ne.state.payload}})));k(this,"patchState",x=>this.client.patchState(x).then(ne=>({state:{...ne.state,payload:ne.state.payload}})));k(this,"callAction",x=>this.client.callAction(x));k(this,"uploadFile",x=>this.client.uploadFile(x));k(this,"upsertFile",x=>this.client.upsertFile(x));k(this,"deleteFile",x=>this.client.deleteFile(x));k(this,"listFiles",x=>this.client.listFiles(x));k(this,"getFile",x=>this.client.getFile(x));k(this,"updateFileMetadata",x=>this.client.updateFileMetadata(x));k(this,"searchFiles",x=>this.client.searchFiles(x));k(this,"createConversation",x=>this.client.createConversation(x));k(this,"getOrCreateConversation",x=>this.client.getOrCreateConversation(x));k(this,"createUser",x=>this.client.createUser(x));k(this,"getOrCreateUser",x=>this.client.getOrCreateUser(x));this.client=x}},zH=ac,ZH=zH.z.enum(["event_received","register","unregister","ping","action_triggered"]),VH=x=>{let ne=x[C],be=x[we],Me=x[Ee],qe=ZH.parse(x[Te]);if(!ne)throw new Error("Missing bot headers");if(!Me)throw new Error("Missing type headers");if(!be)throw new Error("Missing configuration headers");if(!qe)throw new Error("Missing operation headers");return{botId:ne,operation:qe,type:Me,configuration:be?JSON.parse(Buffer.from(be,"base64").toString("utf-8")):{}}},HH=x=>async ne=>{let be=VH(ne.headers);be.operation!=="ping"&&Ne.info(`Received ${be.operation} operation for bot ${be.botId} of type ${be.type}`);let Me=new BH.Client({botId:be.botId,retry:Je}),qe=new kC(Me),je={req:ne,ctx:be,client:qe,instance:x};switch(be.operation){case"action_triggered":throw new Error(`Operation ${be.operation} not supported yet`);case"event_received":await YH(je);break;case"register":await KH();break;case"unregister":await JH();break;case"ping":await WH();break;default:throw new Error(`Unknown operation ${be.operation}`)}return{status:200}},WH=async x=>{},KH=async x=>{},JH=async x=>{},YH=async({ctx:x,req:ne,client:be,instance:Me})=>{Ne.debug(`Received event ${x.type}`);let qe=Se(ne),je=qe.event;switch(x.type){case"message_created":let Le={user:je.payload.user,conversation:je.payload.conversation,message:je.payload.message,states:je.payload.states,event:je};await Promise.all(Me.messageHandlers.map(Sn=>Sn({client:be,ctx:x,...Le})));break;case"state_expired":let at={state:je.payload.state};await Promise.all(Me.stateExpiredHandlers.map(Sn=>Sn({client:be,ctx:x,...at})));break;default:let hn={event:qe.event};await Promise.all(Me.eventHandlers.map(Sn=>Sn({client:be,ctx:x,...hn})))}},GH=class{constructor(x){k(this,"_state",{messageHandlers:[],eventHandlers:[],stateExpiredHandlers:[]});k(this,"props");k(this,"message",x=>{this._state.messageHandlers.push(x)});k(this,"event",x=>{this._state.eventHandlers.push(x)});k(this,"stateExpired",x=>{this._state.stateExpiredHandlers.push(x)});k(this,"handler",HH(this._state));k(this,"start",x=>Be(this.handler,x));this.props=x}}})(ay);var re=ay.exports;const{defaults:Ir}=re.messages,br={className:re.z.string().describe("CSS className to apply to the message").optional()},Yb=Ir.audio.schema.extend({...br,type:re.z.literal("audio")}),Vf=Ir.card.schema.extend({type:re.z.literal("card"),subtitle:re.z.string().optional(),imageUrl:re.z.string().optional(),...br}),i$=Vf.omit({type:!0}),Gb=re.z.object({items:re.z.array(i$),...br,type:re.z.literal("carousel")}),Xb=Ir.choice.schema.extend({text:re.z.string(),...br,type:re.z.literal("choice"),disableFreeText:re.z.boolean().optional()}),Qb=Ir.dropdown.schema.extend({text:re.z.string(),...br,type:re.z.literal("dropdown")}),ew=Ir.file.schema.extend({...br,type:re.z.literal("file")}),tw=Ir.image.schema.extend({...br,type:re.z.literal("image")}),nw=Ir.location.schema.extend({...br,type:re.z.literal("location")}),rw=Ir.markdown.schema.extend({...br,type:re.z.literal("markdown")}),iw=Ir.text.schema.extend({...br,type:re.z.literal("text")}),ow=Ir.video.schema.extend({...br,type:re.z.literal("video")}),sw=re.z.union([Yb,Vf,Gb,Xb,Qb,ew,tw,nw,rw,iw,ow]),aw=re.z.object({type:re.z.literal("webchat_visibility"),data:re.z.object({visibility:re.z.union([re.z.literal("show"),re.z.literal("hide"),re.z.literal("toggle")])})}),cw=re.z.object({type:re.z.literal("webchat_config"),data:re.z.object({config:re.z.record(re.z.any())})}),lw=re.z.object({type:re.z.literal("custom"),data:re.z.object({event:re.z.record(re.z.any())})}),uw=re.z.union([aw,cw,lw]),o$=uw,s$=re.z.object({type:re.z.literal("message_created"),data:sw}),dw=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:Yb,cardSchema:Vf,carouselSchema:Gb,choiceSchema:Xb,customSchema:lw,dropdownSchema:Qb,fileSchema:ew,imageSchema:tw,locationSchema:nw,markdownSchema:rw,messageCreatedSchema:s$,messageSchema:sw,textSchema:iw,triggerSchema:uw,triggerSignalSchema:o$,videoSchema:ow,webchatConfigSchema:cw,webchatVisibilitySchema:aw},Symbol.toStringTag,{value:"Module"})),Rr=re.z.object({className:re.z.string().optional(),avatarUrl:re.z.string().url().optional()}),fw=Rr.extend({type:re.z.literal("audio"),audio:re.z.string(),title:re.z.string().optional()}),a$=re.z.union([re.z.object({title:re.z.string(),action:re.z.literal("Say something"),text:re.z.string()}),re.z.object({title:re.z.string(),action:re.z.literal("Open URL"),url:re.z.string()}),re.z.object({title:re.z.string(),action:re.z.literal("Postback"),payload:re.z.string()})]),Hf=Rr.extend({type:re.z.literal("card"),title:re.z.string(),subtitle:re.z.string().optional(),image:re.z.string().optional(),actions:re.z.array(a$)}),pw=Rr.extend({type:re.z.literal("carousel"),items:re.z.array(Hf)}),hw=Rr.extend({type:re.z.literal("dropdown"),message:re.z.string().optional(),options:re.z.array(re.z.object({label:re.z.string(),value:re.z.string()})),allowCreation:re.z.boolean().optional(),placeholderText:re.z.string().optional(),allowMultiple:re.z.boolean().optional(),buttonText:re.z.string().optional(),width:re.z.number().optional(),displayInKeyboard:re.z.boolean().optional(),markdown:re.z.boolean().optional(),text:re.z.string().optional()}),mw=Rr.extend({type:re.z.literal("file"),file:re.z.string(),title:re.z.string().optional()}),yw=Rr.extend({type:re.z.literal("image"),image:re.z.string()}),gw=Rr.extend({type:re.z.literal("location"),latitude:re.z.number(),longitude:re.z.number(),address:re.z.string().optional(),title:re.z.string().optional()}),vw=Rr.extend({type:re.z.literal("single-choice"),text:re.z.string(),disableFreeText:re.z.boolean().optional(),choices:re.z.array(re.z.object({title:re.z.string(),value:re.z.string()}))}),bw=Rr.extend({type:re.z.literal("text"),text:re.z.string(),markdown:re.z.boolean().optional()}),ww=Rr.extend({type:re.z.literal("video"),video:re.z.string(),title:re.z.string().optional()}),xw=re.z.object({type:re.z.literal("quick_reply"),text:re.z.string(),payload:re.z.string().optional()}),Il=re.z.union([fw,Hf,pw,hw,mw,yw,gw,vw,bw,ww,xw]),_w=re.z.object({type:re.z.literal("webchat-visibility"),visibility:re.z.union([re.z.literal("show"),re.z.literal("hide"),re.z.literal("toggle")])}),Sw=re.z.object({type:re.z.literal("webchat-config"),config:re.z.record(re.z.any())}),Ew=re.z.object({type:re.z.literal("custom-event"),event:re.z.record(re.z.any())}),kw=re.z.union([_w,Sw,Ew]),c$=re.z.object({type:re.z.literal("trigger"),trigger:kw}),Cw=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:fw,cardSchema:Hf,carouselSchame:pw,customEventSchema:Ew,dropdownSchema:hw,fileSchema:mw,imageSchema:yw,locationSchema:gw,messageSchema:Il,messageSignalSchema:Il,quickReplySchema:xw,singleChoiceSchema:vw,textSchema:bw,triggerSchema:kw,triggerSignalSchema:c$,videoSchema:ww,webchatConfigSchema:Sw,webchatVisibilitySchema:_w},Symbol.toStringTag,{value:"Module"})),Tw=e=>({type:"card",title:e.title,subtitle:e.subtitle,image:e.imageUrl,actions:e.actions.map(l$)}),l$=e=>{switch(e.action){case"postback":return{title:e.label,action:"Postback",payload:e.value};case"url":return{title:e.label,action:"Open URL",url:e.value};case"say":return{title:e.label,action:"Say something",text:e.value};default:throw new Error(`Unknown action type ${e.action}`)}},Aw=e=>({...e,type:"audio",audio:e.audioUrl}),Ow=e=>Tw(e),Iw=e=>({...e,type:"carousel",items:e.items.map(Tw)}),Rw=e=>({...e,type:"single-choice",text:e.text,choices:e.options.map(t=>({title:t.label,value:t.value})),disableFreeText:e.disableFreeText}),Pw=e=>({...e,type:"dropdown",message:e.text,options:e.options.map(t=>({label:t.label,value:t.value}))}),$w=e=>({...e,type:"file",file:e.fileUrl,title:e.title}),Dw=e=>({...e,type:"image",image:e.imageUrl}),Nw=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),jw=e=>({...e,type:"text",text:e.markdown,markdown:!0}),Mw=e=>({...e,type:"text",text:e.text,markdown:!0}),qw=e=>({...e,type:"video",video:e.videoUrl}),u$=e=>{switch(e.type){case"audio":return Aw(e);case"card":return Ow(e);case"carousel":return Iw(e);case"choice":return Rw(e);case"dropdown":return Pw(e);case"file":return $w(e);case"image":return Dw(e);case"location":return Nw(e);case"markdown":return jw(e);case"text":return Mw(e);case"video":return qw(e);default:throw new Error("Unsuported message type")}},Lw=e=>({type:"webchat-visibility",visibility:e.data.visibility}),Fw=e=>({type:"webchat-config",config:e.data.config}),Uw=e=>({type:"custom-event",event:e.data.event}),Bw=Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Aw,cardAdapter:Ow,carouselAdapter:Iw,choiceAdapter:Rw,customAdapter:Uw,dropdownAdapter:Pw,fileAdapter:$w,imageAdapter:Dw,locationAdapter:Nw,markdownAdapter:jw,messageAdapter:u$,textAdapter:Mw,triggerAdapter:e=>{switch(e.type){case"webchat_visibility":return Lw(e);case"webchat_config":return Fw(e);case"custom":return Uw(e);default:throw new Error("unknown trigger type")}},videoAdapter:qw,webchatConfigAdapter:Fw,webchatVisibilityAdapter:Lw},Symbol.toStringTag,{value:"Module"})),zw=e=>({type:"card",title:e.title,subtitle:e.subtitle,imageUrl:e.image,actions:e.actions.map(d$)}),d$=e=>{switch(e.action){case"Postback":return{label:e.title,action:"postback",value:e.payload};case"Open URL":return{label:e.title,action:"url",value:e.url};case"Say something":return{label:e.title,action:"say",value:e.text};default:throw new Error("Unknown action type")}},f$=e=>({...e,type:"audio",audioUrl:e.audio}),p$=e=>zw(e),h$=e=>({...e,type:"carousel",items:e.items.map(zw)}),m$=e=>({...e,type:"dropdown",text:e.message??"",options:e.options.map(t=>({label:t.label,value:t.value}))}),y$=e=>({...e,type:"file",fileUrl:e.file,title:e.title}),g$=e=>({...e,type:"image",imageUrl:e.image}),v$=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),b$=e=>({...e,type:"choice",text:e.text,options:e.choices.map(t=>({label:t.title,value:t.value})),disableFreeText:e.disableFreeText}),w$=e=>({...e,type:"text",text:e.text}),x$=e=>({...e,type:"video",videoUrl:e.video}),_$=e=>({...e,type:"text",text:e.text??e.payload}),Zw=Object.freeze(Object.defineProperty({__proto__:null,messageAdapter:e=>{switch(e.type){case"audio":return f$(e);case"card":return p$(e);case"carousel":return h$(e);case"dropdown":return m$(e);case"file":return y$(e);case"image":return g$(e);case"location":return v$(e);case"single-choice":return b$(e);case"text":return w$(e);case"video":return x$(e);case"quick_reply":return _$(e);default:throw new Error("Unsuported message type")}}},Symbol.toStringTag,{value:"Module"})),S$=Object.freeze(Object.defineProperty({__proto__:null,messaging:Cw,messagingToWebChat:Zw,webchat:dw,webchatToMessaging:Bw},Symbol.toStringTag,{value:"Module"})),E$=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));let Rl;const k$=new Uint8Array(16);function C$(){if(!Rl&&(Rl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Rl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Rl(k$)}const vn=[];for(let e=0;e<256;++e)vn.push((e+256).toString(16).slice(1));function T$(e,t=0){return vn[e[t+0]]+vn[e[t+1]]+vn[e[t+2]]+vn[e[t+3]]+"-"+vn[e[t+4]]+vn[e[t+5]]+"-"+vn[e[t+6]]+vn[e[t+7]]+"-"+vn[e[t+8]]+vn[e[t+9]]+"-"+vn[e[t+10]]+vn[e[t+11]]+vn[e[t+12]]+vn[e[t+13]]+vn[e[t+14]]+vn[e[t+15]]}const Vw={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pl(e,t,n){if(Vw.randomUUID&&!t&&!e)return Vw.randomUUID();e=e||{};const r=e.random||(e.rng||C$)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return T$(r)}const $l=e=>({block:e,type:"bubble"}),A$=e=>e.action==="Say something"?{type:"button",variant:"action",text:e.title,buttonValue:e.text,reusable:!0}:e.action==="Open URL"?{type:"button",variant:"link",text:e.title,buttonValue:e.url,reusable:!0}:{type:"button",variant:"action",text:e.title,buttonValue:e.payload,reusable:!0},Hw=({title:e,image:t,actions:n,subtitle:r})=>{const i=[];return t&&i.push({type:"image",url:t}),e&&i.push({type:"text",text:`## ${e}`}),r&&i.push({type:"text",text:r}),n.length>0&&i.push({type:"row",blocks:n.map(A$)}),{type:"column",horizontalAlignment:"center",blocks:[...i]}},O$=({choices:e,text:t})=>{const n=Pl(),r=$l({type:"text",text:t});return e.length===0?r:{type:"column",horizontalAlignment:"left",blocks:[r,{type:"row",blocks:e.map(({title:i,value:o})=>({type:"button",variant:"action",text:i,buttonValue:o,groupId:n}))}]}},I$=({options:e,text:t})=>{const n=[{type:"dropdown",label:t??"Select an option",options:e}];return t&&n.unshift({type:"text",text:t}),{type:"column",blocks:n}},Wf=({type:e,audio:t})=>({payload:{type:e,url:t}}),Kf=e=>({payload:$l(Hw(e))}),Jf=({items:e})=>({payload:{type:"carousel",blocks:e.map(Hw)}}),Yf=e=>({disableInput:e.disableFreeText,payload:O$(e)}),Gf=e=>({disableInput:!0,payload:$l(I$(e))}),Xf=({file:e,...t})=>({payload:{url:e,...t}}),Qf=({type:e,image:t})=>({payload:{type:e,url:t}}),ep=({type:e,latitude:t,longitude:n,title:r,address:i})=>({payload:{type:e,latitude:t,longitude:n,title:r??i??"View on map"}}),Ww=({text:e,payload:t})=>({payload:{type:"text",text:e??t}}),Dl=({type:e,text:t})=>({payload:$l({type:e,text:t})}),tp=({type:e,video:t})=>({payload:{type:e,url:t}}),np=e=>{switch(e.type){case"audio":return Wf(e);case"card":return Kf(e);case"carousel":return Jf(e);case"single-choice":return Yf(e);case"dropdown":return Gf(e);case"file":return Xf(e);case"image":return Qf(e);case"location":return ep(e);case"quick_reply":return Ww(e);case"text":return Dl(e);case"video":return tp(e);default:throw new Error("Unsuported message type")}},R$=Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Wf,cardAdapter:Kf,carouselAdapter:Jf,choiceAdapter:Yf,dropdownAdapter:Gf,fileAdapter:Xf,imageAdapter:Qf,locationAdapter:ep,messageAdapter:np,quickReplyAdapter:Ww,textAdapter:Dl,videoAdapter:tp},Symbol.toStringTag,{value:"Module"})),{webchatToMessaging:wr}=S$,Kw=e=>{const t=wr.audioAdapter(e);return Wf(t)},Jw=e=>{const t=wr.cardAdapter(e);return Kf(t)},Yw=e=>{const t=wr.carouselAdapter(e);return Jf(t)},Gw=e=>{const t=wr.choiceAdapter(e);return Yf(t)},Xw=e=>{const t=wr.dropdownAdapter(e);return Gf(t)},Qw=e=>{const t=wr.fileAdapter(e);return Xf(t)},ex=e=>{const t=wr.imageAdapter(e);return Qf(t)},tx=e=>{const t=wr.locationAdapter(e);return ep(t)},nx=e=>{const t=wr.markdownAdapter(e);return Dl(t)},rx=e=>{const t=wr.textAdapter(e);return Dl(t)},ix=e=>{const t=wr.videoAdapter(e);return tp(t)},ox=e=>{switch(e.type){case"audio":return Kw(e);case"card":return Jw(e);case"carousel":return Yw(e);case"choice":return Gw(e);case"dropdown":return Xw(e);case"file":return Qw(e);case"image":return ex(e);case"location":return tx(e);case"markdown":return nx(e);case"text":return rx(e);case"video":return ix(e);default:throw new Error("Unsuported message type")}},P$=Object.freeze(Object.defineProperty({__proto__:null,messaging:Cw,messagingToTarget:R$,messagingToWebChat:Zw,target:E$,webchat:dw,webchatToMessaging:Bw,webchatToTarget:Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Kw,cardAdapter:Jw,carouselAdapter:Yw,choiceAdapter:Gw,dropdownAdapter:Xw,fileAdapter:Qw,imageAdapter:ex,locationAdapter:tx,markdownAdapter:nx,messageAdapter:ox,textAdapter:rx,videoAdapter:ix},Symbol.toStringTag,{value:"Module"}))},Symbol.toStringTag,{value:"Module"}));var rp={exports:{}},na={};/**
|
|
78
78
|
* @license React
|
|
79
79
|
* react-jsx-runtime.production.min.js
|
|
80
80
|
*
|
|
@@ -82,7 +82,7 @@ ${lc(e.value)}`.trim();case He.ZodFirstPartyTypeKind.ZodEnum:return a.values.map
|
|
|
82
82
|
*
|
|
83
83
|
* This source code is licensed under the MIT license found in the
|
|
84
84
|
* LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var sx;function $$(){if(sx)return na;sx=1;var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,c,l){var u,d={},
|
|
85
|
+
*/var sx;function $$(){if(sx)return na;sx=1;var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,c,l){var u,d={},p=null,f=null;l!==void 0&&(p=""+l),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(f=c.ref);for(u in c)r.call(c,u)&&!o.hasOwnProperty(u)&&(d[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)d[u]===void 0&&(d[u]=c[u]);return{$$typeof:t,type:a,key:p,ref:f,props:d,_owner:i.current}}return na.Fragment=n,na.jsx=s,na.jsxs=s,na}var ra={};/**
|
|
86
86
|
* @license React
|
|
87
87
|
* react-jsx-runtime.development.js
|
|
88
88
|
*
|
|
@@ -90,58 +90,58 @@ ${lc(e.value)}`.trim();case He.ZodFirstPartyTypeKind.ZodEnum:return a.values.map
|
|
|
90
90
|
*
|
|
91
91
|
* This source code is licensed under the MIT license found in the
|
|
92
92
|
* LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/var ax;function D$(){return ax||(ax=1,process.env.NODE_ENV!=="production"&&function(){var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),
|
|
94
|
-
|
|
93
|
+
*/var ax;function D$(){return ax||(ax=1,process.env.NODE_ENV!=="production"&&function(){var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),h=Symbol.iterator,m="@@iterator";function y(j){if(j===null||typeof j!="object")return null;var le=h&&j[h]||j[m];return typeof le=="function"?le:null}var g=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(j){{for(var le=arguments.length,ve=new Array(le>1?le-1:0),Ue=1;Ue<le;Ue++)ve[Ue-1]=arguments[Ue];b("error",j,ve)}}function b(j,le,ve){{var Ue=g.ReactDebugCurrentFrame,bt=Ue.getStackAddendum();bt!==""&&(le+="%s",ve=ve.concat([bt]));var _t=ve.map(function(ut){return String(ut)});_t.unshift("Warning: "+le),Function.prototype.apply.call(console[j],console,_t)}}var S=!1,E=!1,_=!1,I=!1,P=!1,$;$=Symbol.for("react.module.reference");function O(j){return!!(typeof j=="string"||typeof j=="function"||j===r||j===o||P||j===i||j===l||j===u||I||j===f||S||E||_||typeof j=="object"&&j!==null&&(j.$$typeof===p||j.$$typeof===d||j.$$typeof===s||j.$$typeof===a||j.$$typeof===c||j.$$typeof===$||j.getModuleId!==void 0))}function q(j,le,ve){var Ue=j.displayName;if(Ue)return Ue;var bt=le.displayName||le.name||"";return bt!==""?ve+"("+bt+")":ve}function H(j){return j.displayName||"Context"}function B(j){if(j==null)return null;if(typeof j.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof j=="function")return j.displayName||j.name||null;if(typeof j=="string")return j;switch(j){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof j=="object")switch(j.$$typeof){case a:var le=j;return H(le)+".Consumer";case s:var ve=j;return H(ve._context)+".Provider";case c:return q(j,j.render,"ForwardRef");case d:var Ue=j.displayName||null;return Ue!==null?Ue:B(j.type)||"Memo";case p:{var bt=j,_t=bt._payload,ut=bt._init;try{return B(ut(_t))}catch{return null}}}return null}var F=Object.assign,D=0,M,Z,W,Q,C,te,fe;function A(){}A.__reactDisabledLog=!0;function we(){{if(D===0){M=console.log,Z=console.info,W=console.warn,Q=console.error,C=console.group,te=console.groupCollapsed,fe=console.groupEnd;var j={configurable:!0,enumerable:!0,value:A,writable:!0};Object.defineProperties(console,{info:j,log:j,warn:j,error:j,group:j,groupCollapsed:j,groupEnd:j})}D++}}function Te(){{if(D--,D===0){var j={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},j,{value:M}),info:F({},j,{value:Z}),warn:F({},j,{value:W}),error:F({},j,{value:Q}),group:F({},j,{value:C}),groupCollapsed:F({},j,{value:te}),groupEnd:F({},j,{value:fe})})}D<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ee=g.ReactCurrentDispatcher,$e;function Fe(j,le,ve){{if($e===void 0)try{throw Error()}catch(bt){var Ue=bt.stack.trim().match(/\n( *(at )?)/);$e=Ue&&Ue[1]||""}return`
|
|
94
|
+
`+$e+j}}var Pe=!1,he;{var de=typeof WeakMap=="function"?WeakMap:Map;he=new de}function _e(j,le){if(!j||Pe)return"";{var ve=he.get(j);if(ve!==void 0)return ve}var Ue;Pe=!0;var bt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var _t;_t=Ee.current,Ee.current=null,we();try{if(le){var ut=function(){throw Error()};if(Object.defineProperty(ut.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ut,[])}catch(pr){Ue=pr}Reflect.construct(j,[],ut)}else{try{ut.call()}catch(pr){Ue=pr}j.call(ut.prototype)}}else{try{throw Error()}catch(pr){Ue=pr}j()}}catch(pr){if(pr&&Ue&&typeof pr.stack=="string"){for(var ot=pr.stack.split(`
|
|
95
95
|
`),Kt=Ue.stack.split(`
|
|
96
96
|
`),Lt=ot.length-1,Ft=Kt.length-1;Lt>=1&&Ft>=0&&ot[Lt]!==Kt[Ft];)Ft--;for(;Lt>=1&&Ft>=0;Lt--,Ft--)if(ot[Lt]!==Kt[Ft]){if(Lt!==1||Ft!==1)do if(Lt--,Ft--,Ft<0||ot[Lt]!==Kt[Ft]){var Kn=`
|
|
97
|
-
`+ot[Lt].replace(" at new "," at ");return j.displayName&&Kn.includes("<anonymous>")&&(Kn=Kn.replace("<anonymous>",j.displayName)),typeof j=="function"&&he.set(j,Kn),Kn}while(Lt>=1&&Ft>=0);break}}}finally{
|
|
97
|
+
`+ot[Lt].replace(" at new "," at ");return j.displayName&&Kn.includes("<anonymous>")&&(Kn=Kn.replace("<anonymous>",j.displayName)),typeof j=="function"&&he.set(j,Kn),Kn}while(Lt>=1&&Ft>=0);break}}}finally{Pe=!1,Ee.current=_t,Te(),Error.prepareStackTrace=bt}var Hr=j?j.displayName||j.name:"",Ld=Hr?Fe(Hr):"";return typeof j=="function"&&he.set(j,Ld),Ld}function pe(j,le,ve){return _e(j,!1)}function De(j){var le=j.prototype;return!!(le&&le.isReactComponent)}function et(j,le,ve){if(j==null)return"";if(typeof j=="function")return _e(j,De(j));if(typeof j=="string")return Fe(j);switch(j){case l:return Fe("Suspense");case u:return Fe("SuspenseList")}if(typeof j=="object")switch(j.$$typeof){case c:return pe(j.render);case d:return et(j.type,le,ve);case p:{var Ue=j,bt=Ue._payload,_t=Ue._init;try{return et(_t(bt),le,ve)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,oe={},ce=g.ReactDebugCurrentFrame;function ue(j){if(j){var le=j._owner,ve=et(j.type,j._source,le?le.type:null);ce.setExtraStackFrame(ve)}else ce.setExtraStackFrame(null)}function Ne(j,le,ve,Ue,bt){{var _t=Function.call.bind(L);for(var ut in j)if(_t(j,ut)){var ot=void 0;try{if(typeof j[ut]!="function"){var Kt=Error((Ue||"React class")+": "+ve+" type `"+ut+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof j[ut]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Kt.name="Invariant Violation",Kt}ot=j[ut](le,ut,Ue,ve,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Lt){ot=Lt}ot&&!(ot instanceof Error)&&(ue(bt),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ue||"React class",ve,ut,typeof ot),ue(null)),ot instanceof Error&&!(ot.message in oe)&&(oe[ot.message]=!0,ue(bt),v("Failed %s type: %s",ve,ot.message),ue(null))}}}var Se=Array.isArray;function Be(j){return Se(j)}function pt(j){{var le=typeof Symbol=="function"&&Symbol.toStringTag,ve=le&&j[Symbol.toStringTag]||j.constructor.name||"Object";return ve}}function Ge(j){try{return K(j),!1}catch{return!0}}function K(j){return""+j}function ie(j){if(Ge(j))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",pt(j)),K(j)}var ae=g.ReactCurrentOwner,Ae={key:!0,ref:!0,__self:!0,__source:!0},Je,Mt,Ot;Ot={};function Et(j){if(L.call(j,"ref")){var le=Object.getOwnPropertyDescriptor(j,"ref").get;if(le&&le.isReactWarning)return!1}return j.ref!==void 0}function Nt(j){if(L.call(j,"key")){var le=Object.getOwnPropertyDescriptor(j,"key").get;if(le&&le.isReactWarning)return!1}return j.key!==void 0}function Yt(j,le){if(typeof j.ref=="string"&&ae.current&&le&&ae.current.stateNode!==le){var ve=B(ae.current.type);Ot[ve]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',B(ae.current.type),j.ref),Ot[ve]=!0)}}function z(j,le){{var ve=function(){Je||(Je=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",le))};ve.isReactWarning=!0,Object.defineProperty(j,"key",{get:ve,configurable:!0})}}function J(j,le){{var ve=function(){Mt||(Mt=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",le))};ve.isReactWarning=!0,Object.defineProperty(j,"ref",{get:ve,configurable:!0})}}var Xe=function(j,le,ve,Ue,bt,_t,ut){var ot={$$typeof:t,type:j,key:le,ref:ve,props:ut,_owner:_t};return ot._store={},Object.defineProperty(ot._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ot,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ue}),Object.defineProperty(ot,"_source",{configurable:!1,enumerable:!1,writable:!1,value:bt}),Object.freeze&&(Object.freeze(ot.props),Object.freeze(ot)),ot};function rt(j,le,ve,Ue,bt){{var _t,ut={},ot=null,Kt=null;ve!==void 0&&(ie(ve),ot=""+ve),Nt(le)&&(ie(le.key),ot=""+le.key),Et(le)&&(Kt=le.ref,Yt(le,bt));for(_t in le)L.call(le,_t)&&!Ae.hasOwnProperty(_t)&&(ut[_t]=le[_t]);if(j&&j.defaultProps){var Lt=j.defaultProps;for(_t in Lt)ut[_t]===void 0&&(ut[_t]=Lt[_t])}if(ot||Kt){var Ft=typeof j=="function"?j.displayName||j.name||"Unknown":j;ot&&z(ut,Ft),Kt&&J(ut,Ft)}return Xe(j,ot,Kt,bt,Ue,ae.current,ut)}}var At=g.ReactCurrentOwner,Ye=g.ReactDebugCurrentFrame;function cn(j){if(j){var le=j._owner,ve=et(j.type,j._source,le?le.type:null);Ye.setExtraStackFrame(ve)}else Ye.setExtraStackFrame(null)}var Un;Un=!1;function Vt(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function _n(){{if(At.current){var j=B(At.current.type);if(j)return`
|
|
98
98
|
|
|
99
99
|
Check the render method of \``+j+"`."}return""}}function ir(j){{if(j!==void 0){var le=j.fileName.replace(/^.*[\\\/]/,""),ve=j.lineNumber;return`
|
|
100
100
|
|
|
101
101
|
Check your code at `+le+":"+ve+"."}return""}}var It={};function xt(j){{var le=_n();if(!le){var ve=typeof j=="string"?j:j.displayName||j.name;ve&&(le=`
|
|
102
102
|
|
|
103
|
-
Check the top-level render call using <`+ve+">.")}return le}}function Ht(j,le){{if(!j._store||j._store.validated||j.key!=null)return;j._store.validated=!0;var ve=xt(le);if(It[ve])return;It[ve]=!0;var Ue="";j&&j._owner&&j._owner!==At.current&&(Ue=" It was passed a child from "+B(j._owner.type)+"."),cn(j),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ve,Ue),cn(null)}}function zt(j,le){{if(typeof j!="object")return;if(Be(j))for(var ve=0;ve<j.length;ve++){var Ue=j[ve];Vt(Ue)&&Ht(Ue,le)}else if(Vt(j))j._store&&(j._store.validated=!0);else if(j){var bt=y(j);if(typeof bt=="function"&&bt!==j.entries)for(var _t=bt.call(j),ut;!(ut=_t.next()).done;)Vt(ut.value)&&Ht(ut.value,le)}}}function Wt(j){{var le=j.type;if(le==null||typeof le=="string")return;var ve;if(typeof le=="function")ve=le.propTypes;else if(typeof le=="object"&&(le.$$typeof===c||le.$$typeof===d))ve=le.propTypes;else return;if(ve){var Ue=B(le);Ne(ve,j.props,"prop",Ue,j)}else if(le.PropTypes!==void 0&&!Un){Un=!0;var bt=B(le);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",bt||"Unknown")}typeof le.getDefaultProps=="function"&&!le.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pt(j){{for(var le=Object.keys(j.props),ve=0;ve<le.length;ve++){var Ue=le[ve];if(Ue!=="children"&&Ue!=="key"){cn(j),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ue),cn(null);break}}j.ref!==null&&(cn(j),g("Invalid attribute `ref` supplied to `React.Fragment`."),cn(null))}}function fn(j,le,ve,Ue,bt,_t){{var ut=O(j);if(!ut){var ot="";(j===void 0||typeof j=="object"&&j!==null&&Object.keys(j).length===0)&&(ot+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Kt=ir(bt);Kt?ot+=Kt:ot+=_n();var Lt;j===null?Lt="null":Be(j)?Lt="array":j!==void 0&&j.$$typeof===t?(Lt="<"+(B(j.type)||"Unknown")+" />",ot=" Did you accidentally export a JSX literal instead of a component?"):Lt=typeof j,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Lt,ot)}var Ft=rt(j,le,ve,bt,_t);if(Ft==null)return Ft;if(ut){var Kn=le.children;if(Kn!==void 0)if(Ue)if(Be(Kn)){for(var Hr=0;Hr<Kn.length;Hr++)zt(Kn[Hr],j);Object.freeze&&Object.freeze(Kn)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zt(Kn,j)}return j===r?Pt(Ft):Wt(Ft),Ft}}function pn(j,le,ve){return fn(j,le,ve,!0)}function Nn(j,le,ve){return fn(j,le,ve,!1)}var So=Nn,Eo=pn;ra.Fragment=r,ra.jsx=So,ra.jsxs=Eo}()),ra}process.env.NODE_ENV==="production"?rp.exports=$$():rp.exports=D$();var U=rp.exports;function mt(){return mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mt.apply(this,arguments)}function Nl(e,t=[]){let n=[];function r(o,s){const a=w.createContext(s),c=n.length;n=[...n,s];function l(d){const{scope:h,children:f,...p}=d,m=(h==null?void 0:h[e][c])||a,y=w.useMemo(()=>p,Object.values(p));return w.createElement(m.Provider,{value:y},f)}function u(d,h){const f=(h==null?void 0:h[e][c])||a,p=w.useContext(f);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return l.displayName=o+"Provider",[l,u]}const i=()=>{const o=n.map(s=>w.createContext(s));return function(a){const c=(a==null?void 0:a[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return i.scopeName=e,[r,N$(i,...t)]}function N$(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(o)[`__scope${l}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Mn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const zo=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function Xi(){return Xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xi.apply(null,arguments)}function j$(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cx(...e){return t=>e.forEach(n=>j$(n,t))}function Jn(...e){return w.useCallback(cx(...e),e)}const ip=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(q$);if(o){const s=o.props.children,a=i.map(c=>c===o?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:c);return w.createElement(op,Xi({},r,{ref:t}),w.isValidElement(s)?w.cloneElement(s,void 0,a):null)}return w.createElement(op,Xi({},r,{ref:t}),n)});ip.displayName="Slot";const op=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...L$(r,n.props),ref:t?cx(t,n.ref):n.ref}):w.Children.count(n)>1?w.Children.only(null):null});op.displayName="SlotClone";const M$=({children:e})=>w.createElement(w.Fragment,null,e);function q$(e){return w.isValidElement(e)&&e.type===M$}function L$(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const bn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?ip:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(a,Xi({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function F$(e,t){e&&Ar.flushSync(()=>e.dispatchEvent(t))}const lx="Avatar",[U$,bW]=Nl(lx),[B$,ux]=U$(lx),dx=w.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=w.useState("idle");return w.createElement(B$,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o},w.createElement(bn.span,mt({},r,{ref:t})))}),z$="AvatarImage",fx=w.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=ux(z$,n),a=V$(r),c=Mn(l=>{i(l),s.onImageLoadingStatusChange(l)});return zo(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?w.createElement(bn.img,mt({},o,{ref:t,src:r})):null}),Z$="AvatarFallback",px=w.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=ux(Z$,n),[s,a]=w.useState(r===void 0);return w.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),s&&o.imageLoadingStatus!=="loaded"?w.createElement(bn.span,mt({},i,{ref:t})):null});function V$(e){const[t,n]=w.useState("idle");return w.useEffect(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,o=s=>()=>{r&&n(s)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,()=>{r=!1}},[e]),t}let sp=class{constructor(){k(this,"eventMap");this.eventMap={}}on(t,n){var r;return this.eventMap[t]||(this.eventMap[t]=new Set),(r=this.eventMap[t])==null||r.add(n),()=>{var i;(i=this.eventMap[t])==null||i.delete(n)}}emit(t,n){var r,i;(r=this.eventMap[t])==null||r.forEach(o=>{o(n)}),(i=this.eventMap["*"])==null||i.forEach(o=>{o({type:t,payload:n})})}};const H$=new sp;function hx(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const ap=w.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=hx(e??"",15);return U.jsxs(dx,{ref:s,"data-color":a,...n,...o,children:[U.jsx(fx,{src:t,...r}),U.jsx(px,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});function wW(){}function xW(){}function W$(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const K$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Y$={};function mx(e,t){return((t||Y$).jsx?J$:K$).test(e)}const G$=/[ \t\n\f\r]/g;function X$(e){return typeof e=="object"?e.type==="text"?yx(e.value):!1:yx(e)}function yx(e){return e.replace(G$,"")===""}class ia{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}ia.prototype.property={},ia.prototype.normal={},ia.prototype.space=null;function gx(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new ia(n,r,t)}function cp(e){return e.toLowerCase()}class lr{constructor(t,n){this.property=t,this.attribute=n}}lr.prototype.space=null,lr.prototype.boolean=!1,lr.prototype.booleanish=!1,lr.prototype.overloadedBoolean=!1,lr.prototype.number=!1,lr.prototype.commaSeparated=!1,lr.prototype.spaceSeparated=!1,lr.prototype.commaOrSpaceSeparated=!1,lr.prototype.mustUseProperty=!1,lr.prototype.defined=!1;let Q$=0;const dt=Qi(),en=Qi(),vx=Qi(),ye=Qi(),qt=Qi(),Zo=Qi(),Yn=Qi();function Qi(){return 2**++Q$}const lp=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:en,commaOrSpaceSeparated:Yn,commaSeparated:Zo,number:ye,overloadedBoolean:vx,spaceSeparated:qt},Symbol.toStringTag,{value:"Module"})),up=Object.keys(lp);class dp extends lr{constructor(t,n,r,i){let o=-1;if(super(t,n),bx(this,"space",i),typeof r=="number")for(;++o<up.length;){const s=up[o];bx(this,up[o],(r&lp[s])===lp[s])}}}dp.prototype.defined=!0;function bx(e,t,n){n&&(e[t]=n)}const eD={}.hasOwnProperty;function Vo(e){const t={},n={};let r;for(r in e.properties)if(eD.call(e.properties,r)){const i=e.properties[r],o=new dp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[cp(r)]=r,n[cp(o.attribute)]=r}return new ia(t,n,e.space)}const wx=Vo({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),xx=Vo({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function _x(e,t){return t in e?e[t]:t}function Sx(e,t){return _x(e,t.toLowerCase())}const Ex=Vo({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Sx,properties:{xmlns:null,xmlnsXLink:null}}),kx=Vo({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:en,ariaAutoComplete:null,ariaBusy:en,ariaChecked:en,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:qt,ariaCurrent:null,ariaDescribedBy:qt,ariaDetails:null,ariaDisabled:en,ariaDropEffect:qt,ariaErrorMessage:null,ariaExpanded:en,ariaFlowTo:qt,ariaGrabbed:en,ariaHasPopup:null,ariaHidden:en,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qt,ariaLevel:ye,ariaLive:null,ariaModal:en,ariaMultiLine:en,ariaMultiSelectable:en,ariaOrientation:null,ariaOwns:qt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:en,ariaReadOnly:en,ariaRelevant:null,ariaRequired:en,ariaRoleDescription:qt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:en,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null}}),tD=Vo({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Sx,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zo,acceptCharset:qt,accessKey:qt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:qt,autoFocus:dt,autoPlay:dt,capture:dt,charSet:null,checked:dt,cite:null,className:qt,cols:ye,colSpan:null,content:null,contentEditable:en,controls:dt,controlsList:qt,coords:ye|Zo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:vx,draggable:en,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:qt,height:ye,hidden:dt,high:ye,href:null,hrefLang:null,htmlFor:qt,httpEquiv:qt,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:qt,itemRef:qt,itemScope:dt,itemType:qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint: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:dt,optimum:ye,pattern:null,ping:qt,placeholder:null,playsInline:dt,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:qt,required:dt,reversed:dt,rows:ye,rowSpan:ye,sandbox:qt,scope:null,scoped:dt,seamless:dt,selected:dt,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:en,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:en,width:ye,wrap:null,align:null,aLink:null,archive:qt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:en,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:ye,security:null,unselectable:null}}),nD=Vo({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:_x,properties:{about:Yn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:qt,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:Zo,g2:Zo,glyphName:Zo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yn,rev:Yn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yn,requiredFeatures:Yn,requiredFonts:Yn,requiredFormats:Yn,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),rD=/^data[-\w.:]+$/i,Cx=/-[a-z]/g,iD=/[A-Z]/g;function oD(e,t){const n=cp(t);let r=t,i=lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rD.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Cx,aD);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Cx.test(o)){let s=o.replace(iD,sD);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=dp}return new i(r,t)}function sD(e){return"-"+e.toLowerCase()}function aD(e){return e.charAt(1).toUpperCase()}const cD={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"},lD=gx([xx,wx,Ex,kx,tD],"html"),fp=gx([xx,wx,Ex,kx,nD],"svg");function uD(e){return e.join(" ").trim()}var Tx={},Ax=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dD=/\n/g,fD=/^\s*/,pD=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,hD=/^:\s*/,mD=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,yD=/^[;\s]*/,gD=/^\s+|\s+$/g,vD=`
|
|
104
|
-
`,Ox="/",Ix="*",eo="",bD="comment",wD="declaration",xD=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(dD);m&&(n+=m.length);var y=p.lastIndexOf(vD);r=~y?p.length-y:r+p.length}function o(){var p={line:n,column:r};return function(m){return m.position=new s(p),l(),m}}function s(p){this.start=p,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function c(p){var m=p.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function l(){c(fD)}function u(p){var m;for(p=p||[];m=d();)m!==!1&&p.push(m);return p}function d(){var p=o();if(!(Ox!=e.charAt(0)||Ix!=e.charAt(1))){for(var m=2;eo!=e.charAt(m)&&(Ix!=e.charAt(m)||Ox!=e.charAt(m+1));)++m;if(m+=2,eo===e.charAt(m-1))return a("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,p({type:bD,comment:y})}}function h(){var p=o(),m=c(pD);if(m){if(d(),!c(hD))return a("property missing ':'");var y=c(mD),v=p({type:wD,property:Rx(m[0].replace(Ax,eo)),value:y?Rx(y[0].replace(Ax,eo)):eo});return c(yD),v}}function f(){var p=[];u(p);for(var m;m=h();)m!==!1&&(p.push(m),u(p));return p}return l(),f()};function Rx(e){return e?e.replace(gD,eo):eo}var _D=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tx,"__esModule",{value:!0});var SD=_D(xD);function ED(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,SD.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var Px=Tx.default=ED;const kD=Px.default||Px,$x=Dx("end"),pp=Dx("start");function Dx(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function CD(e){const t=pp(e),n=$x(e);if(t&&n)return{start:t,end:n}}function oa(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nx(e.position):"start"in e||"end"in e?Nx(e):"line"in e||"column"in e?hp(e):""}function hp(e){return jx(e&&e.line)+":"+jx(e&&e.column)}function Nx(e){return hp(e&&e.start)+"-"+hp(e&&e.end)}function jx(e){return e&&typeof e=="number"?e:1}class Tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=oa(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Tn.prototype.file="",Tn.prototype.name="",Tn.prototype.reason="",Tn.prototype.message="",Tn.prototype.stack="",Tn.prototype.column=void 0,Tn.prototype.line=void 0,Tn.prototype.ancestors=void 0,Tn.prototype.cause=void 0,Tn.prototype.fatal=void 0,Tn.prototype.place=void 0,Tn.prototype.ruleId=void 0,Tn.prototype.source=void 0;const mp={}.hasOwnProperty,TD=new Map,AD=/[A-Z]/g,OD=/-([a-z])/g,ID=new Set(["table","tbody","thead","tfoot","tr"]),RD=new Set(["td","th"]),Mx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=FD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=LD(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fp:lD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=qx(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function qx(e,t,n){if(t.type==="element")return $D(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return DD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return jD(e,t,n);if(t.type==="mdxjsEsm")return ND(e,t);if(t.type==="root")return MD(e,t,n);if(t.type==="text")return qD(e,t)}function $D(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=fp,e.schema=i),e.ancestors.push(t);const o=Fx(e,t.tagName,!1),s=UD(e,t);let a=gp(e,t);return ID.has(t.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!X$(c):!0})),Lx(e,s,o,t),yp(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function DD(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}sa(e,t.position)}function ND(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sa(e,t.position)}function jD(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=fp,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Fx(e,t.name,!0),s=BD(e,t),a=gp(e,t);return Lx(e,s,o,t),yp(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function MD(e,t,n){const r={};return yp(r,gp(e,t)),e.create(t,e.Fragment,r,n)}function qD(e,t){return t.value}function Lx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function yp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function LD(e,t,n){return r;function r(i,o,s,a){const l=Array.isArray(s.children)?n:t;return a?l(o,s,a):l(o,s)}}function FD(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),c=pp(r);return t(i,o,s,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function UD(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&mp.call(t.properties,i)){const o=zD(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&RD.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function BD(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else sa(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else sa(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function gp(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:TD;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const c=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(c){const l=i.get(c)||0;s=c+"-"+l,i.set(c,l+1)}}const a=qx(e,o,s);a!==void 0&&n.push(a)}return n}function zD(e,t,n){const r=oD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?W$(n):uD(n)),r.property==="style"){let i=typeof n=="object"?n:ZD(e,String(n));return e.stylePropertyNameCase==="css"&&(i=VD(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?cD[r.property]||r.property:r.attribute,n]}}function ZD(e,t){const n={};try{kD(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Mx+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(OD,WD)),n[s]=o}}function Fx(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=mx(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=mx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return mp.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);sa(e)}function sa(e,t){const n=new Tn("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=Mx+"#cannot-handle-mdx-estrees-without-createevaluater",n}function VD(e){const t={};let n;for(n in e)mp.call(e,n)&&(t[HD(n)]=e[n]);return t}function HD(e){let t=e.replace(AD,KD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function WD(e,t){return t.toUpperCase()}function KD(e){return"-"+e.toLowerCase()}const vp={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"]},JD={};function bp(e,t){const n=t||JD,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ux(e,r,i)}function Ux(e,t,n){if(YD(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Bx(e.children,t,n)}return Array.isArray(e)?Bx(e,t,n):""}function Bx(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ux(e[i],t,n);return r.join("")}function YD(e){return!!(e&&typeof e=="object")}const zx=document.createElement("i");function wp(e){const t="&"+e+";";zx.innerHTML=t;const n=zx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gn(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function ur(e,t){return e.length>0?(Gn(e,e.length,0,t),e):t}const Zx={}.hasOwnProperty;function Vx(e){const t={};let n=-1;for(;++n<e.length;)GD(t,e[n]);return t}function GD(e,t){let n;for(n in t){const i=(Zx.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Zx.call(i,s)||(i[s]=[]);const a=o[s];XD(i[s],Array.isArray(a)?a:a?[a]:[])}}}function XD(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Gn(e,0,0,r)}function Hx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function xr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qn=wi(/[A-Za-z]/),An=wi(/[\dA-Za-z]/),QD=wi(/[#-'*+\--9=?A-Z^-~]/);function jl(e){return e!==null&&(e<32||e===127)}const xp=wi(/\d/),eN=wi(/[\dA-Fa-f]/),tN=wi(/[!-/:-@[-`{-~]/);function We(e){return e!==null&&e<-2}function $t(e){return e!==null&&(e<0||e===32)}function yt(e){return e===-2||e===-1||e===32}const Ml=wi(/\p{P}|\p{S}/u),to=wi(/\s/);function wi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ho(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&An(e.charCodeAt(n+1))&&An(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function St(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(c){return yt(c)?(e.enter(n),a(c)):t(c)}function a(c){return yt(c)&&o++<i?(e.consume(c),a):(e.exit(n),t(c))}}const nN={tokenize:rN};function rN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),St(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return We(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const iN={tokenize:oN},Wx={tokenize:sN};function oN(e){const t=this,n=[];let r=0,i,o,s;return a;function a(b){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,l)(b)}return l(b)}function c(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&g();const S=t.events.length;let E=S,_;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){_=t.events[E][1].end;break}v(r);let I=S;for(;I<t.events.length;)t.events[I][1].end=Object.assign({},_),I++;return Gn(t.events,E+1,0,t.events.slice(S)),t.events.length=I,l(b)}return a(b)}function l(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return p(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Wx,u,d)(b)}function u(b){return i&&g(),v(r),h(b)}function d(b){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(b)}function h(b){return t.containerState={},e.attempt(Wx,f,p)(b)}function f(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function p(b){if(b===null){i&&g(),v(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),m(b)}function m(b){if(b===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(b);return}return We(b)?(e.consume(b),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),m)}function y(b,S){const E=t.sliceStream(b);if(S&&E.push(null),b.previous=o,o&&(o.next=b),o=b,i.defineSkip(b.start),i.write(E),t.parser.lazy[b.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<s&&(!i.events[_][1].end||i.events[_][1].end.offset>s))return;const I=t.events.length;let P=I,$,O;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if($){O=t.events[P][1].end;break}$=!0}for(v(r),_=I;_<t.events.length;)t.events[_][1].end=Object.assign({},O),_++;Gn(t.events,P+1,0,t.events.slice(I)),t.events.length=_}}function v(b){let S=n.length;for(;S-- >b;){const E=n[S];t.containerState=E[1],E[0].exit.call(t,e)}n.length=b}function g(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function sN(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ql(e){if(e===null||$t(e)||to(e))return 1;if(Ml(e))return 2}function Ll(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _p={name:"attention",tokenize:cN,resolveAll:aN};function aN(e,t){let n=-1,r,i,o,s,a,c,l,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);Kx(d,-c),Kx(h,c),s={type:c>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},a={type:c>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},o={type:c>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:c>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ur(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=ur(l,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),l=ur(l,Ll(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ur(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ur(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Gn(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function cN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ql(r);let o;return s;function s(c){return o=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===o)return e.consume(c),a;const l=e.exit("attentionSequence"),u=ql(c),d=!u||u===2&&i||n.includes(c),h=!i||i===2&&u||n.includes(r);return l._open=!!(o===42?d:d&&(i||!h)),l._close=!!(o===42?h:h&&(u||!d)),t(c)}}function Kx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lN={name:"autolink",tokenize:uN};function uN(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return qn(f)?(e.consume(f),s):l(f)}function s(f){return f===43||f===45||f===46||An(f)?(r=1,a(f)):l(f)}function a(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||An(f))&&r++<32?(e.consume(f),a):(r=0,l(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||jl(f)?n(f):(e.consume(f),c)}function l(f){return f===64?(e.consume(f),u):QD(f)?(e.consume(f),l):n(f)}function u(f){return An(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||An(f))&&r++<63){const p=f===45?h:d;return e.consume(f),p}return n(f)}}const aa={tokenize:dN,partial:!0};function dN(e,t,n){return r;function r(o){return yt(o)?St(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||We(o)?t(o):n(o)}}const Jx={name:"blockQuote",tokenize:fN,continuation:{tokenize:pN},exit:hN};function fN(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return yt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function pN(e,t,n){const r=this;return i;function i(s){return yt(s)?St(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Jx,t,n)(s)}}function hN(e){e.exit("blockQuote")}const Yx={name:"characterEscape",tokenize:mN};function mN(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return tN(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Gx={name:"characterReference",tokenize:yN};function yN(e,t,n){const r=this;let i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,s=An,u(d))}function l(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=eN,u):(e.enter("characterReferenceValue"),o=7,s=xp,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return s===An&&!wp(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const Xx={tokenize:vN,partial:!0},Qx={name:"codeFenced",tokenize:gN,concrete:!0};function gN(e,t,n){const r=this,i={tokenize:E,partial:!0};let o=0,s=0,a;return c;function c(_){return l(_)}function l(_){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(_)}function u(_){return _===a?(s++,e.consume(_),u):s<3?n(_):(e.exit("codeFencedFenceSequence"),yt(_)?St(e,d,"whitespace")(_):d(_))}function d(_){return _===null||We(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(Xx,m,S)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(_))}function h(_){return _===null||We(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(_)):yt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),St(e,f,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),h)}function f(_){return _===null||We(_)?d(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||We(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(_)):_===96&&_===a?n(_):(e.consume(_),p)}function m(_){return e.attempt(i,S,y)(_)}function y(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),v}function v(_){return o>0&&yt(_)?St(e,g,"linePrefix",o+1)(_):g(_)}function g(_){return _===null||We(_)?e.check(Xx,m,S)(_):(e.enter("codeFlowValue"),b(_))}function b(_){return _===null||We(_)?(e.exit("codeFlowValue"),g(_)):(e.consume(_),b)}function S(_){return e.exit("codeFenced"),t(_)}function E(_,I,P){let $=0;return O;function O(D){return _.enter("lineEnding"),_.consume(D),_.exit("lineEnding"),q}function q(D){return _.enter("codeFencedFence"),yt(D)?St(_,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):H(D)}function H(D){return D===a?(_.enter("codeFencedFenceSequence"),B(D)):P(D)}function B(D){return D===a?($++,_.consume(D),B):$>=s?(_.exit("codeFencedFenceSequence"),yt(D)?St(_,F,"whitespace")(D):F(D)):P(D)}function F(D){return D===null||We(D)?(_.exit("codeFencedFence"),I(D)):P(D)}}}function vN(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Sp={name:"codeIndented",tokenize:wN},bN={tokenize:xN,partial:!0};function wN(e,t,n){const r=this;return i;function i(l){return e.enter("codeIndented"),St(e,o,"linePrefix",4+1)(l)}function o(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?c(l):We(l)?e.attempt(bN,s,c)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||We(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),a)}function c(l){return e.exit("codeIndented"),t(l)}}function xN(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):We(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):St(e,o,"linePrefix",4+1)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):We(s)?i(s):n(s)}}const _N={name:"codeText",tokenize:kN,resolve:SN,previous:EN};function SN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function EN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kN(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):We(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||We(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),l)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",l(d))}}function e0(e){const t={};let n=-1,r,i,o,s,a,c,l;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,o=0,o<c.length&&c[o][1].type==="lineEndingBlank"&&(o+=2),o<c.length&&c[o][1].type==="content"))for(;++o<c.length&&c[o][1].type!=="content";)c[o][1].type==="chunkText"&&(c[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,CN(e,n)),n=t[n],l=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Gn(e,i,n-i+1,a))}}return!l}function CN(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,c=[],l={};let u,d,h=-1,f=n,p=0,m=0;const y=[m];for(;f;){for(;e[++i][1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),h=y.length;h--;){const v=a.slice(y[h],y[h+1]),g=o.pop();c.unshift([g,g+v.length-1]),Gn(e,g,2,v)}for(h=-1;++h<c.length;)l[p+c[h][0]]=p+c[h][1],p+=c[h][1]-c[h][0]-1;return l}const TN={tokenize:IN,resolve:ON},AN={tokenize:RN,partial:!0};function ON(e){return e0(e),e}function IN(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):We(a)?e.check(AN,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function RN(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),St(e,o,"linePrefix")}function o(s){if(s===null||We(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function t0(e,t,n,r,i,o,s,a,c){const l=c||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),h):v===null||v===32||v===41||jl(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(v))}function h(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||We(v)?n(v):(e.consume(v),v===92?p:f)}function p(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function m(v){return!u&&(v===null||v===41||$t(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):u<l&&v===40?(e.consume(v),u++,m):v===41?(e.consume(v),u--,m):v===null||v===32||v===40||jl(v)?n(v):(e.consume(v),v===92?y:m)}function y(v){return v===40||v===41||v===92?(e.consume(v),m):m(v)}}function n0(e,t,n,r,i,o){const s=this;let a=0,c;return l;function l(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return a>999||f===null||f===91||f===93&&!c||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):We(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||We(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),c||(c=!yt(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function r0(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,c):n(h)}function c(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),l(h))}function l(h){return h===s?(e.exit(o),c(s)):h===null?n(h):We(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),St(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||We(h)?(e.exit("chunkString"),l(h)):(e.consume(h),h===92?d:u)}function d(h){return h===s||h===92?(e.consume(h),u):u(h)}}function ca(e,t){let n;return r;function r(i){return We(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):yt(i)?St(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const PN={name:"definition",tokenize:DN},$N={tokenize:NN,partial:!0};function DN(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),s(f)}function s(f){return n0.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return $t(f)?ca(e,l)(f):l(f)}function l(f){return t0(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt($N,d,d)(f)}function d(f){return yt(f)?St(e,h,"whitespace")(f):h(f)}function h(f){return f===null||We(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function NN(e,t,n){return r;function r(a){return $t(a)?ca(e,i)(a):n(a)}function i(a){return r0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return yt(a)?St(e,s,"whitespace")(a):s(a)}function s(a){return a===null||We(a)?t(a):n(a)}}const jN={name:"hardBreakEscape",tokenize:MN};function MN(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return We(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const qN={name:"headingAtx",tokenize:FN,resolve:LN};function LN(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Gn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function FN(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||$t(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||We(u)?(e.exit("atxHeading"),t(u)):yt(u)?St(e,a,"whitespace")(u):(e.enter("atxHeadingText"),l(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),a(u))}function l(u){return u===null||u===35||$t(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),l)}}const UN=["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"],i0=["pre","script","style","textarea"],BN={name:"htmlFlow",tokenize:HN,resolveTo:VN,concrete:!0},zN={tokenize:KN,partial:!0},ZN={tokenize:WN,partial:!0};function VN(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(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}function HN(e,t,n){const r=this;let i,o,s,a,c;return l;function l(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),o=!0,m):A===63?(e.consume(A),i=3,r.interrupt?t:C):qn(A)?(e.consume(A),s=String.fromCharCode(A),y):n(A)}function h(A){return A===45?(e.consume(A),i=2,f):A===91?(e.consume(A),i=5,a=0,p):qn(A)?(e.consume(A),i=4,r.interrupt?t:C):n(A)}function f(A){return A===45?(e.consume(A),r.interrupt?t:C):n(A)}function p(A){const we="CDATA[";return A===we.charCodeAt(a++)?(e.consume(A),a===we.length?r.interrupt?t:H:p):n(A)}function m(A){return qn(A)?(e.consume(A),s=String.fromCharCode(A),y):n(A)}function y(A){if(A===null||A===47||A===62||$t(A)){const we=A===47,Te=s.toLowerCase();return!we&&!o&&i0.includes(Te)?(i=1,r.interrupt?t(A):H(A)):UN.includes(s.toLowerCase())?(i=6,we?(e.consume(A),v):r.interrupt?t(A):H(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?g(A):b(A))}return A===45||An(A)?(e.consume(A),s+=String.fromCharCode(A),y):n(A)}function v(A){return A===62?(e.consume(A),r.interrupt?t:H):n(A)}function g(A){return yt(A)?(e.consume(A),g):O(A)}function b(A){return A===47?(e.consume(A),O):A===58||A===95||qn(A)?(e.consume(A),S):yt(A)?(e.consume(A),b):O(A)}function S(A){return A===45||A===46||A===58||A===95||An(A)?(e.consume(A),S):E(A)}function E(A){return A===61?(e.consume(A),_):yt(A)?(e.consume(A),E):b(A)}function _(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),c=A,I):yt(A)?(e.consume(A),_):P(A)}function I(A){return A===c?(e.consume(A),c=null,$):A===null||We(A)?n(A):(e.consume(A),I)}function P(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||$t(A)?E(A):(e.consume(A),P)}function $(A){return A===47||A===62||yt(A)?b(A):n(A)}function O(A){return A===62?(e.consume(A),q):n(A)}function q(A){return A===null||We(A)?H(A):yt(A)?(e.consume(A),q):n(A)}function H(A){return A===45&&i===2?(e.consume(A),M):A===60&&i===1?(e.consume(A),Z):A===62&&i===4?(e.consume(A),te):A===63&&i===3?(e.consume(A),C):A===93&&i===5?(e.consume(A),Q):We(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(zN,fe,B)(A)):A===null||We(A)?(e.exit("htmlFlowData"),B(A)):(e.consume(A),H)}function B(A){return e.check(ZN,F,fe)(A)}function F(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),D}function D(A){return A===null||We(A)?B(A):(e.enter("htmlFlowData"),H(A))}function M(A){return A===45?(e.consume(A),C):H(A)}function Z(A){return A===47?(e.consume(A),s="",W):H(A)}function W(A){if(A===62){const we=s.toLowerCase();return i0.includes(we)?(e.consume(A),te):H(A)}return qn(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),W):H(A)}function Q(A){return A===93?(e.consume(A),C):H(A)}function C(A){return A===62?(e.consume(A),te):A===45&&i===2?(e.consume(A),C):H(A)}function te(A){return A===null||We(A)?(e.exit("htmlFlowData"),fe(A)):(e.consume(A),te)}function fe(A){return e.exit("htmlFlow"),t(A)}}function WN(e,t,n){const r=this;return i;function i(s){return We(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function KN(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(aa,t,n)}}const JN={name:"htmlText",tokenize:YN};function YN(e,t,n){const r=this;let i,o,s;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),c}function c(C){return C===33?(e.consume(C),l):C===47?(e.consume(C),E):C===63?(e.consume(C),b):qn(C)?(e.consume(C),P):n(C)}function l(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),o=0,p):qn(C)?(e.consume(C),g):n(C)}function u(C){return C===45?(e.consume(C),f):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),h):We(C)?(s=d,Z(C)):(e.consume(C),d)}function h(C){return C===45?(e.consume(C),f):d(C)}function f(C){return C===62?M(C):C===45?h(C):d(C)}function p(C){const te="CDATA[";return C===te.charCodeAt(o++)?(e.consume(C),o===te.length?m:p):n(C)}function m(C){return C===null?n(C):C===93?(e.consume(C),y):We(C)?(s=m,Z(C)):(e.consume(C),m)}function y(C){return C===93?(e.consume(C),v):m(C)}function v(C){return C===62?M(C):C===93?(e.consume(C),v):m(C)}function g(C){return C===null||C===62?M(C):We(C)?(s=g,Z(C)):(e.consume(C),g)}function b(C){return C===null?n(C):C===63?(e.consume(C),S):We(C)?(s=b,Z(C)):(e.consume(C),b)}function S(C){return C===62?M(C):b(C)}function E(C){return qn(C)?(e.consume(C),_):n(C)}function _(C){return C===45||An(C)?(e.consume(C),_):I(C)}function I(C){return We(C)?(s=I,Z(C)):yt(C)?(e.consume(C),I):M(C)}function P(C){return C===45||An(C)?(e.consume(C),P):C===47||C===62||$t(C)?$(C):n(C)}function $(C){return C===47?(e.consume(C),M):C===58||C===95||qn(C)?(e.consume(C),O):We(C)?(s=$,Z(C)):yt(C)?(e.consume(C),$):M(C)}function O(C){return C===45||C===46||C===58||C===95||An(C)?(e.consume(C),O):q(C)}function q(C){return C===61?(e.consume(C),H):We(C)?(s=q,Z(C)):yt(C)?(e.consume(C),q):$(C)}function H(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),i=C,B):We(C)?(s=H,Z(C)):yt(C)?(e.consume(C),H):(e.consume(C),F)}function B(C){return C===i?(e.consume(C),i=void 0,D):C===null?n(C):We(C)?(s=B,Z(C)):(e.consume(C),B)}function F(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||$t(C)?$(C):(e.consume(C),F)}function D(C){return C===47||C===62||$t(C)?$(C):n(C)}function M(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function Z(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),W}function W(C){return yt(C)?St(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):Q(C)}function Q(C){return e.enter("htmlTextData"),s(C)}}const Ep={name:"labelEnd",tokenize:nj,resolveTo:tj,resolveAll:ej},GN={tokenize:rj},XN={tokenize:ij},QN={tokenize:oj};function ej(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function tj(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const c={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",c,t],["enter",l,t]],a=ur(a,e.slice(o+1,o+r+3)),a=ur(a,[["enter",u,t]]),a=ur(a,Ll(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=ur(a,[["exit",u,t],e[s-2],e[s-1],["exit",l,t]]),a=ur(a,e.slice(s+1)),a=ur(a,[["exit",c,t]]),Gn(e,o,e.length,a),e}function nj(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?d(h):(s=r.parser.defined.includes(xr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(GN,u,s?u:d)(h):h===91?e.attempt(XN,u,s?l:d)(h):s?u(h):d(h)}function l(h){return e.attempt(QN,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function rj(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return $t(d)?ca(e,o)(d):o(d)}function o(d){return d===41?u(d):t0(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return $t(d)?ca(e,c)(d):u(d)}function a(d){return n(d)}function c(d){return d===34||d===39||d===40?r0(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function l(d){return $t(d)?ca(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function ij(e,t,n){const r=this;return i;function i(a){return n0.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function oj(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const sj={name:"labelStartImage",tokenize:aj,resolveAll:Ep.resolveAll};function aj(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const cj={name:"labelStartLink",tokenize:lj,resolveAll:Ep.resolveAll};function lj(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const kp={name:"lineEnding",tokenize:uj};function uj(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),St(e,t,"linePrefix")}}const Fl={name:"thematicBreak",tokenize:dj};function dj(e,t,n){let r=0,i;return o;function o(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),c(l)):r>=3&&(l===null||We(l))?(e.exit("thematicBreak"),t(l)):n(l)}function c(l){return l===i?(e.consume(l),r++,c):(e.exit("thematicBreakSequence"),yt(l)?St(e,a,"whitespace")(l):a(l))}}const Bn={name:"list",tokenize:hj,continuation:{tokenize:mj},exit:gj},fj={tokenize:vj,partial:!0},pj={tokenize:yj,partial:!0};function hj(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:xp(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Fl,n,l)(f):l(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return xp(f)&&++s<10?(e.consume(f),c):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),l(f)):n(f)}function l(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(aa,r.interrupt?n:u,e.attempt(fj,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return yt(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function mj(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(aa,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,St(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!yt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pj,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,St(e,e.attempt(Bn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function yj(e,t,n){const r=this;return St(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function gj(e){e.exit(this.containerState.type)}function vj(e,t,n){const r=this;return St(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const s=r.events[r.events.length-1];return!yt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const o0={name:"setextUnderline",tokenize:wj,resolveTo:bj};function bj(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function wj(e,t,n){const r=this;let i;return o;function o(l){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),yt(l)?St(e,c,"lineSuffix")(l):c(l))}function c(l){return l===null||We(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const xj={tokenize:_j};function _j(e){const t=this,n=e.attempt(aa,r,e.attempt(this.parser.constructs.flowInitial,i,St(e,e.attempt(this.parser.constructs.flow,i,e.attempt(TN,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Sj={resolveAll:a0()},Ej=s0("string"),kj=s0("text");function s0(e){return{tokenize:t,resolveAll:a0(e==="text"?Cj:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return l(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),c}function c(u){return l(u)?(n.exit("data"),o(u)):(n.consume(u),c)}function l(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function a0(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Cj(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,c;for(;o--;){const l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)c=!0,a++;else if(l!==-1){o++;break}}if(a){const l={type:n===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+o,_bufferIndex:o?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},l.start),r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}function Tj(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const c={consume:g,enter:b,exit:S,attempt:I(E),check:I(_),interrupt:I(_,{interrupt:!0})},l={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:f,sliceSerialize:h,now:p,defineSkip:m,write:d};let u=t.tokenize.call(l,c);return t.resolveAll&&o.push(t),l;function d(q){return s=ur(s,q),y(),s[s.length-1]!==null?[]:(P(t,0),l.events=Ll(o,l.events,l),l.events)}function h(q,H){return Oj(f(q),H)}function f(q){return Aj(s,q)}function p(){const{line:q,column:H,offset:B,_index:F,_bufferIndex:D}=r;return{line:q,column:H,offset:B,_index:F,_bufferIndex:D}}function m(q){i[q.line]=q.column,O()}function y(){let q;for(;r._index<s.length;){const H=s[r._index];if(typeof H=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<H.length;)v(H.charCodeAt(r._bufferIndex));else v(H)}}function v(q){u=u(q)}function g(q){We(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,O()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=q}function b(q,H){const B=H||{};return B.type=q,B.start=p(),l.events.push(["enter",B,l]),a.push(B),B}function S(q){const H=a.pop();return H.end=p(),l.events.push(["exit",H,l]),H}function E(q,H){P(q,H.from)}function _(q,H){H.restore()}function I(q,H){return B;function B(F,D,M){let Z,W,Q,C;return Array.isArray(F)?fe(F):"tokenize"in F?fe([F]):te(F);function te(Ee){return Pe;function Pe(Fe){const Re=Fe!==null&&Ee[Fe],he=Fe!==null&&Ee.null,de=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(he)?he:he?[he]:[]];return fe(de)(Fe)}}function fe(Ee){return Z=Ee,W=0,Ee.length===0?M:A(Ee[W])}function A(Ee){return Pe;function Pe(Fe){return C=$(),Q=Ee,Ee.partial||(l.currentConstruct=Ee),Ee.name&&l.parser.constructs.disable.null.includes(Ee.name)?Te():Ee.tokenize.call(H?Object.assign(Object.create(l),H):l,c,we,Te)(Fe)}}function we(Ee){return q(Q,C),D}function Te(Ee){return C.restore(),++W<Z.length?A(Z[W]):M}}}function P(q,H){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&Gn(l.events,H,l.events.length-H,q.resolve(l.events.slice(H),l)),q.resolveTo&&(l.events=q.resolveTo(l.events,l))}function $(){const q=p(),H=l.previous,B=l.currentConstruct,F=l.events.length,D=Array.from(a);return{restore:M,from:F};function M(){r=q,l.previous=H,l.currentConstruct=B,l.events.length=F,a=D,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Aj(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Oj(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
103
|
+
Check the top-level render call using <`+ve+">.")}return le}}function Ht(j,le){{if(!j._store||j._store.validated||j.key!=null)return;j._store.validated=!0;var ve=xt(le);if(It[ve])return;It[ve]=!0;var Ue="";j&&j._owner&&j._owner!==At.current&&(Ue=" It was passed a child from "+B(j._owner.type)+"."),cn(j),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ve,Ue),cn(null)}}function zt(j,le){{if(typeof j!="object")return;if(Be(j))for(var ve=0;ve<j.length;ve++){var Ue=j[ve];Vt(Ue)&&Ht(Ue,le)}else if(Vt(j))j._store&&(j._store.validated=!0);else if(j){var bt=y(j);if(typeof bt=="function"&&bt!==j.entries)for(var _t=bt.call(j),ut;!(ut=_t.next()).done;)Vt(ut.value)&&Ht(ut.value,le)}}}function Wt(j){{var le=j.type;if(le==null||typeof le=="string")return;var ve;if(typeof le=="function")ve=le.propTypes;else if(typeof le=="object"&&(le.$$typeof===c||le.$$typeof===d))ve=le.propTypes;else return;if(ve){var Ue=B(le);Ne(ve,j.props,"prop",Ue,j)}else if(le.PropTypes!==void 0&&!Un){Un=!0;var bt=B(le);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",bt||"Unknown")}typeof le.getDefaultProps=="function"&&!le.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pt(j){{for(var le=Object.keys(j.props),ve=0;ve<le.length;ve++){var Ue=le[ve];if(Ue!=="children"&&Ue!=="key"){cn(j),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ue),cn(null);break}}j.ref!==null&&(cn(j),v("Invalid attribute `ref` supplied to `React.Fragment`."),cn(null))}}function fn(j,le,ve,Ue,bt,_t){{var ut=O(j);if(!ut){var ot="";(j===void 0||typeof j=="object"&&j!==null&&Object.keys(j).length===0)&&(ot+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Kt=ir(bt);Kt?ot+=Kt:ot+=_n();var Lt;j===null?Lt="null":Be(j)?Lt="array":j!==void 0&&j.$$typeof===t?(Lt="<"+(B(j.type)||"Unknown")+" />",ot=" Did you accidentally export a JSX literal instead of a component?"):Lt=typeof j,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Lt,ot)}var Ft=rt(j,le,ve,bt,_t);if(Ft==null)return Ft;if(ut){var Kn=le.children;if(Kn!==void 0)if(Ue)if(Be(Kn)){for(var Hr=0;Hr<Kn.length;Hr++)zt(Kn[Hr],j);Object.freeze&&Object.freeze(Kn)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zt(Kn,j)}return j===r?Pt(Ft):Wt(Ft),Ft}}function pn(j,le,ve){return fn(j,le,ve,!0)}function Nn(j,le,ve){return fn(j,le,ve,!1)}var So=Nn,Eo=pn;ra.Fragment=r,ra.jsx=So,ra.jsxs=Eo}()),ra}process.env.NODE_ENV==="production"?rp.exports=$$():rp.exports=D$();var U=rp.exports;function mt(){return mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mt.apply(this,arguments)}function Nl(e,t=[]){let n=[];function r(o,s){const a=w.createContext(s),c=n.length;n=[...n,s];function l(d){const{scope:p,children:f,...h}=d,m=(p==null?void 0:p[e][c])||a,y=w.useMemo(()=>h,Object.values(h));return w.createElement(m.Provider,{value:y},f)}function u(d,p){const f=(p==null?void 0:p[e][c])||a,h=w.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return l.displayName=o+"Provider",[l,u]}const i=()=>{const o=n.map(s=>w.createContext(s));return function(a){const c=(a==null?void 0:a[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return i.scopeName=e,[r,N$(i,...t)]}function N$(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(o)[`__scope${l}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Mn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const zo=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function Xi(){return Xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xi.apply(null,arguments)}function j$(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cx(...e){return t=>e.forEach(n=>j$(n,t))}function Jn(...e){return w.useCallback(cx(...e),e)}const ip=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(q$);if(o){const s=o.props.children,a=i.map(c=>c===o?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:c);return w.createElement(op,Xi({},r,{ref:t}),w.isValidElement(s)?w.cloneElement(s,void 0,a):null)}return w.createElement(op,Xi({},r,{ref:t}),n)});ip.displayName="Slot";const op=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...L$(r,n.props),ref:t?cx(t,n.ref):n.ref}):w.Children.count(n)>1?w.Children.only(null):null});op.displayName="SlotClone";const M$=({children:e})=>w.createElement(w.Fragment,null,e);function q$(e){return w.isValidElement(e)&&e.type===M$}function L$(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const bn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?ip:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(a,Xi({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function F$(e,t){e&&Ar.flushSync(()=>e.dispatchEvent(t))}const lx="Avatar",[U$,bW]=Nl(lx),[B$,ux]=U$(lx),dx=w.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=w.useState("idle");return w.createElement(B$,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o},w.createElement(bn.span,mt({},r,{ref:t})))}),z$="AvatarImage",fx=w.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=ux(z$,n),a=V$(r),c=Mn(l=>{i(l),s.onImageLoadingStatusChange(l)});return zo(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?w.createElement(bn.img,mt({},o,{ref:t,src:r})):null}),Z$="AvatarFallback",px=w.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=ux(Z$,n),[s,a]=w.useState(r===void 0);return w.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),s&&o.imageLoadingStatus!=="loaded"?w.createElement(bn.span,mt({},i,{ref:t})):null});function V$(e){const[t,n]=w.useState("idle");return w.useEffect(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,o=s=>()=>{r&&n(s)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,()=>{r=!1}},[e]),t}let sp=class{constructor(){k(this,"eventMap");this.eventMap={}}on(t,n){var r;return this.eventMap[t]||(this.eventMap[t]=new Set),(r=this.eventMap[t])==null||r.add(n),()=>{var i;(i=this.eventMap[t])==null||i.delete(n)}}emit(t,n){var r,i;(r=this.eventMap[t])==null||r.forEach(o=>{o(n)}),(i=this.eventMap["*"])==null||i.forEach(o=>{o({type:t,payload:n})})}};const H$=new sp;function hx(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const ap=w.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=hx(e??"",15);return U.jsxs(dx,{ref:s,"data-color":a,...n,...o,children:[U.jsx(fx,{src:t,...r}),U.jsx(px,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});function wW(){}function xW(){}function W$(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const K$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Y$={};function mx(e,t){return((t||Y$).jsx?J$:K$).test(e)}const G$=/[ \t\n\f\r]/g;function X$(e){return typeof e=="object"?e.type==="text"?yx(e.value):!1:yx(e)}function yx(e){return e.replace(G$,"")===""}class ia{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}ia.prototype.property={},ia.prototype.normal={},ia.prototype.space=null;function gx(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new ia(n,r,t)}function cp(e){return e.toLowerCase()}class lr{constructor(t,n){this.property=t,this.attribute=n}}lr.prototype.space=null,lr.prototype.boolean=!1,lr.prototype.booleanish=!1,lr.prototype.overloadedBoolean=!1,lr.prototype.number=!1,lr.prototype.commaSeparated=!1,lr.prototype.spaceSeparated=!1,lr.prototype.commaOrSpaceSeparated=!1,lr.prototype.mustUseProperty=!1,lr.prototype.defined=!1;let Q$=0;const dt=Qi(),en=Qi(),vx=Qi(),ye=Qi(),qt=Qi(),Zo=Qi(),Yn=Qi();function Qi(){return 2**++Q$}const lp=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:en,commaOrSpaceSeparated:Yn,commaSeparated:Zo,number:ye,overloadedBoolean:vx,spaceSeparated:qt},Symbol.toStringTag,{value:"Module"})),up=Object.keys(lp);class dp extends lr{constructor(t,n,r,i){let o=-1;if(super(t,n),bx(this,"space",i),typeof r=="number")for(;++o<up.length;){const s=up[o];bx(this,up[o],(r&lp[s])===lp[s])}}}dp.prototype.defined=!0;function bx(e,t,n){n&&(e[t]=n)}const eD={}.hasOwnProperty;function Vo(e){const t={},n={};let r;for(r in e.properties)if(eD.call(e.properties,r)){const i=e.properties[r],o=new dp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[cp(r)]=r,n[cp(o.attribute)]=r}return new ia(t,n,e.space)}const wx=Vo({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),xx=Vo({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function _x(e,t){return t in e?e[t]:t}function Sx(e,t){return _x(e,t.toLowerCase())}const Ex=Vo({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Sx,properties:{xmlns:null,xmlnsXLink:null}}),kx=Vo({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:en,ariaAutoComplete:null,ariaBusy:en,ariaChecked:en,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:qt,ariaCurrent:null,ariaDescribedBy:qt,ariaDetails:null,ariaDisabled:en,ariaDropEffect:qt,ariaErrorMessage:null,ariaExpanded:en,ariaFlowTo:qt,ariaGrabbed:en,ariaHasPopup:null,ariaHidden:en,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qt,ariaLevel:ye,ariaLive:null,ariaModal:en,ariaMultiLine:en,ariaMultiSelectable:en,ariaOrientation:null,ariaOwns:qt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:en,ariaReadOnly:en,ariaRelevant:null,ariaRequired:en,ariaRoleDescription:qt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:en,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null}}),tD=Vo({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Sx,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zo,acceptCharset:qt,accessKey:qt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:qt,autoFocus:dt,autoPlay:dt,capture:dt,charSet:null,checked:dt,cite:null,className:qt,cols:ye,colSpan:null,content:null,contentEditable:en,controls:dt,controlsList:qt,coords:ye|Zo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:vx,draggable:en,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:qt,height:ye,hidden:dt,high:ye,href:null,hrefLang:null,htmlFor:qt,httpEquiv:qt,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:qt,itemRef:qt,itemScope:dt,itemType:qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint: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:dt,optimum:ye,pattern:null,ping:qt,placeholder:null,playsInline:dt,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:qt,required:dt,reversed:dt,rows:ye,rowSpan:ye,sandbox:qt,scope:null,scoped:dt,seamless:dt,selected:dt,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:en,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:en,width:ye,wrap:null,align:null,aLink:null,archive:qt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:en,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:ye,security:null,unselectable:null}}),nD=Vo({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:_x,properties:{about:Yn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:qt,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:Zo,g2:Zo,glyphName:Zo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yn,rev:Yn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yn,requiredFeatures:Yn,requiredFonts:Yn,requiredFormats:Yn,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),rD=/^data[-\w.:]+$/i,Cx=/-[a-z]/g,iD=/[A-Z]/g;function oD(e,t){const n=cp(t);let r=t,i=lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rD.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Cx,aD);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Cx.test(o)){let s=o.replace(iD,sD);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=dp}return new i(r,t)}function sD(e){return"-"+e.toLowerCase()}function aD(e){return e.charAt(1).toUpperCase()}const cD={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"},lD=gx([xx,wx,Ex,kx,tD],"html"),fp=gx([xx,wx,Ex,kx,nD],"svg");function uD(e){return e.join(" ").trim()}var Tx={},Ax=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dD=/\n/g,fD=/^\s*/,pD=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,hD=/^:\s*/,mD=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,yD=/^[;\s]*/,gD=/^\s+|\s+$/g,vD=`
|
|
104
|
+
`,Ox="/",Ix="*",eo="",bD="comment",wD="declaration",xD=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(h){var m=h.match(dD);m&&(n+=m.length);var y=h.lastIndexOf(vD);r=~y?h.length-y:r+h.length}function o(){var h={line:n,column:r};return function(m){return m.position=new s(h),l(),m}}function s(h){this.start=h,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(h){var m=new Error(t.source+":"+n+":"+r+": "+h);if(m.reason=h,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function c(h){var m=h.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function l(){c(fD)}function u(h){var m;for(h=h||[];m=d();)m!==!1&&h.push(m);return h}function d(){var h=o();if(!(Ox!=e.charAt(0)||Ix!=e.charAt(1))){for(var m=2;eo!=e.charAt(m)&&(Ix!=e.charAt(m)||Ox!=e.charAt(m+1));)++m;if(m+=2,eo===e.charAt(m-1))return a("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,h({type:bD,comment:y})}}function p(){var h=o(),m=c(pD);if(m){if(d(),!c(hD))return a("property missing ':'");var y=c(mD),g=h({type:wD,property:Rx(m[0].replace(Ax,eo)),value:y?Rx(y[0].replace(Ax,eo)):eo});return c(yD),g}}function f(){var h=[];u(h);for(var m;m=p();)m!==!1&&(h.push(m),u(h));return h}return l(),f()};function Rx(e){return e?e.replace(gD,eo):eo}var _D=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tx,"__esModule",{value:!0});var SD=_D(xD);function ED(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,SD.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var Px=Tx.default=ED;const kD=Px.default||Px,$x=Dx("end"),pp=Dx("start");function Dx(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function CD(e){const t=pp(e),n=$x(e);if(t&&n)return{start:t,end:n}}function oa(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nx(e.position):"start"in e||"end"in e?Nx(e):"line"in e||"column"in e?hp(e):""}function hp(e){return jx(e&&e.line)+":"+jx(e&&e.column)}function Nx(e){return hp(e&&e.start)+"-"+hp(e&&e.end)}function jx(e){return e&&typeof e=="number"?e:1}class Tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=oa(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Tn.prototype.file="",Tn.prototype.name="",Tn.prototype.reason="",Tn.prototype.message="",Tn.prototype.stack="",Tn.prototype.column=void 0,Tn.prototype.line=void 0,Tn.prototype.ancestors=void 0,Tn.prototype.cause=void 0,Tn.prototype.fatal=void 0,Tn.prototype.place=void 0,Tn.prototype.ruleId=void 0,Tn.prototype.source=void 0;const mp={}.hasOwnProperty,TD=new Map,AD=/[A-Z]/g,OD=/-([a-z])/g,ID=new Set(["table","tbody","thead","tfoot","tr"]),RD=new Set(["td","th"]),Mx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=FD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=LD(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fp:lD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=qx(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function qx(e,t,n){if(t.type==="element")return $D(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return DD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return jD(e,t,n);if(t.type==="mdxjsEsm")return ND(e,t);if(t.type==="root")return MD(e,t,n);if(t.type==="text")return qD(e,t)}function $D(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=fp,e.schema=i),e.ancestors.push(t);const o=Fx(e,t.tagName,!1),s=UD(e,t);let a=gp(e,t);return ID.has(t.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!X$(c):!0})),Lx(e,s,o,t),yp(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function DD(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}sa(e,t.position)}function ND(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sa(e,t.position)}function jD(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=fp,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Fx(e,t.name,!0),s=BD(e,t),a=gp(e,t);return Lx(e,s,o,t),yp(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function MD(e,t,n){const r={};return yp(r,gp(e,t)),e.create(t,e.Fragment,r,n)}function qD(e,t){return t.value}function Lx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function yp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function LD(e,t,n){return r;function r(i,o,s,a){const l=Array.isArray(s.children)?n:t;return a?l(o,s,a):l(o,s)}}function FD(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),c=pp(r);return t(i,o,s,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function UD(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&mp.call(t.properties,i)){const o=zD(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&RD.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function BD(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else sa(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else sa(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function gp(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:TD;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const c=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(c){const l=i.get(c)||0;s=c+"-"+l,i.set(c,l+1)}}const a=qx(e,o,s);a!==void 0&&n.push(a)}return n}function zD(e,t,n){const r=oD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?W$(n):uD(n)),r.property==="style"){let i=typeof n=="object"?n:ZD(e,String(n));return e.stylePropertyNameCase==="css"&&(i=VD(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?cD[r.property]||r.property:r.attribute,n]}}function ZD(e,t){const n={};try{kD(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Mx+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(OD,WD)),n[s]=o}}function Fx(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=mx(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=mx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return mp.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);sa(e)}function sa(e,t){const n=new Tn("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=Mx+"#cannot-handle-mdx-estrees-without-createevaluater",n}function VD(e){const t={};let n;for(n in e)mp.call(e,n)&&(t[HD(n)]=e[n]);return t}function HD(e){let t=e.replace(AD,KD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function WD(e,t){return t.toUpperCase()}function KD(e){return"-"+e.toLowerCase()}const vp={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"]},JD={};function bp(e,t){const n=t||JD,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ux(e,r,i)}function Ux(e,t,n){if(YD(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Bx(e.children,t,n)}return Array.isArray(e)?Bx(e,t,n):""}function Bx(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ux(e[i],t,n);return r.join("")}function YD(e){return!!(e&&typeof e=="object")}const zx=document.createElement("i");function wp(e){const t="&"+e+";";zx.innerHTML=t;const n=zx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gn(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function ur(e,t){return e.length>0?(Gn(e,e.length,0,t),e):t}const Zx={}.hasOwnProperty;function Vx(e){const t={};let n=-1;for(;++n<e.length;)GD(t,e[n]);return t}function GD(e,t){let n;for(n in t){const i=(Zx.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Zx.call(i,s)||(i[s]=[]);const a=o[s];XD(i[s],Array.isArray(a)?a:a?[a]:[])}}}function XD(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Gn(e,0,0,r)}function Hx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function xr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qn=wi(/[A-Za-z]/),An=wi(/[\dA-Za-z]/),QD=wi(/[#-'*+\--9=?A-Z^-~]/);function jl(e){return e!==null&&(e<32||e===127)}const xp=wi(/\d/),eN=wi(/[\dA-Fa-f]/),tN=wi(/[!-/:-@[-`{-~]/);function We(e){return e!==null&&e<-2}function $t(e){return e!==null&&(e<0||e===32)}function yt(e){return e===-2||e===-1||e===32}const Ml=wi(/\p{P}|\p{S}/u),to=wi(/\s/);function wi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ho(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&An(e.charCodeAt(n+1))&&An(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function St(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(c){return yt(c)?(e.enter(n),a(c)):t(c)}function a(c){return yt(c)&&o++<i?(e.consume(c),a):(e.exit(n),t(c))}}const nN={tokenize:rN};function rN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),St(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return We(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const iN={tokenize:oN},Wx={tokenize:sN};function oN(e){const t=this,n=[];let r=0,i,o,s;return a;function a(b){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,l)(b)}return l(b)}function c(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const S=t.events.length;let E=S,_;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){_=t.events[E][1].end;break}g(r);let I=S;for(;I<t.events.length;)t.events[I][1].end=Object.assign({},_),I++;return Gn(t.events,E+1,0,t.events.slice(S)),t.events.length=I,l(b)}return a(b)}function l(b){if(r===n.length){if(!i)return p(b);if(i.currentConstruct&&i.currentConstruct.concrete)return h(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Wx,u,d)(b)}function u(b){return i&&v(),g(r),p(b)}function d(b){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,h(b)}function p(b){return t.containerState={},e.attempt(Wx,f,h)(b)}function f(b){return r++,n.push([t.currentConstruct,t.containerState]),p(b)}function h(b){if(b===null){i&&v(),g(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),m(b)}function m(b){if(b===null){y(e.exit("chunkFlow"),!0),g(0),e.consume(b);return}return We(b)?(e.consume(b),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),m)}function y(b,S){const E=t.sliceStream(b);if(S&&E.push(null),b.previous=o,o&&(o.next=b),o=b,i.defineSkip(b.start),i.write(E),t.parser.lazy[b.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<s&&(!i.events[_][1].end||i.events[_][1].end.offset>s))return;const I=t.events.length;let P=I,$,O;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if($){O=t.events[P][1].end;break}$=!0}for(g(r),_=I;_<t.events.length;)t.events[_][1].end=Object.assign({},O),_++;Gn(t.events,P+1,0,t.events.slice(I)),t.events.length=_}}function g(b){let S=n.length;for(;S-- >b;){const E=n[S];t.containerState=E[1],E[0].exit.call(t,e)}n.length=b}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function sN(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ql(e){if(e===null||$t(e)||to(e))return 1;if(Ml(e))return 2}function Ll(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _p={name:"attention",tokenize:cN,resolveAll:aN};function aN(e,t){let n=-1,r,i,o,s,a,c,l,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);Kx(d,-c),Kx(p,c),s={type:c>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},a={type:c>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},o={type:c>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:c>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ur(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=ur(l,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),l=ur(l,Ll(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ur(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ur(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Gn(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function cN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ql(r);let o;return s;function s(c){return o=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===o)return e.consume(c),a;const l=e.exit("attentionSequence"),u=ql(c),d=!u||u===2&&i||n.includes(c),p=!i||i===2&&u||n.includes(r);return l._open=!!(o===42?d:d&&(i||!p)),l._close=!!(o===42?p:p&&(u||!d)),t(c)}}function Kx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lN={name:"autolink",tokenize:uN};function uN(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return qn(f)?(e.consume(f),s):l(f)}function s(f){return f===43||f===45||f===46||An(f)?(r=1,a(f)):l(f)}function a(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||An(f))&&r++<32?(e.consume(f),a):(r=0,l(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||jl(f)?n(f):(e.consume(f),c)}function l(f){return f===64?(e.consume(f),u):QD(f)?(e.consume(f),l):n(f)}function u(f){return An(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||An(f))&&r++<63){const h=f===45?p:d;return e.consume(f),h}return n(f)}}const aa={tokenize:dN,partial:!0};function dN(e,t,n){return r;function r(o){return yt(o)?St(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||We(o)?t(o):n(o)}}const Jx={name:"blockQuote",tokenize:fN,continuation:{tokenize:pN},exit:hN};function fN(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return yt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function pN(e,t,n){const r=this;return i;function i(s){return yt(s)?St(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Jx,t,n)(s)}}function hN(e){e.exit("blockQuote")}const Yx={name:"characterEscape",tokenize:mN};function mN(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return tN(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Gx={name:"characterReference",tokenize:yN};function yN(e,t,n){const r=this;let i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,s=An,u(d))}function l(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=eN,u):(e.enter("characterReferenceValue"),o=7,s=xp,u(d))}function u(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return s===An&&!wp(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const Xx={tokenize:vN,partial:!0},Qx={name:"codeFenced",tokenize:gN,concrete:!0};function gN(e,t,n){const r=this,i={tokenize:E,partial:!0};let o=0,s=0,a;return c;function c(_){return l(_)}function l(_){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(_)}function u(_){return _===a?(s++,e.consume(_),u):s<3?n(_):(e.exit("codeFencedFenceSequence"),yt(_)?St(e,d,"whitespace")(_):d(_))}function d(_){return _===null||We(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(Xx,m,S)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||We(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(_)):yt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),St(e,f,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),p)}function f(_){return _===null||We(_)?d(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(_))}function h(_){return _===null||We(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(_)):_===96&&_===a?n(_):(e.consume(_),h)}function m(_){return e.attempt(i,S,y)(_)}function y(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),g}function g(_){return o>0&&yt(_)?St(e,v,"linePrefix",o+1)(_):v(_)}function v(_){return _===null||We(_)?e.check(Xx,m,S)(_):(e.enter("codeFlowValue"),b(_))}function b(_){return _===null||We(_)?(e.exit("codeFlowValue"),v(_)):(e.consume(_),b)}function S(_){return e.exit("codeFenced"),t(_)}function E(_,I,P){let $=0;return O;function O(D){return _.enter("lineEnding"),_.consume(D),_.exit("lineEnding"),q}function q(D){return _.enter("codeFencedFence"),yt(D)?St(_,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):H(D)}function H(D){return D===a?(_.enter("codeFencedFenceSequence"),B(D)):P(D)}function B(D){return D===a?($++,_.consume(D),B):$>=s?(_.exit("codeFencedFenceSequence"),yt(D)?St(_,F,"whitespace")(D):F(D)):P(D)}function F(D){return D===null||We(D)?(_.exit("codeFencedFence"),I(D)):P(D)}}}function vN(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Sp={name:"codeIndented",tokenize:wN},bN={tokenize:xN,partial:!0};function wN(e,t,n){const r=this;return i;function i(l){return e.enter("codeIndented"),St(e,o,"linePrefix",4+1)(l)}function o(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?c(l):We(l)?e.attempt(bN,s,c)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||We(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),a)}function c(l){return e.exit("codeIndented"),t(l)}}function xN(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):We(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):St(e,o,"linePrefix",4+1)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):We(s)?i(s):n(s)}}const _N={name:"codeText",tokenize:kN,resolve:SN,previous:EN};function SN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function EN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kN(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):We(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||We(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),l)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",l(d))}}function e0(e){const t={};let n=-1,r,i,o,s,a,c,l;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,o=0,o<c.length&&c[o][1].type==="lineEndingBlank"&&(o+=2),o<c.length&&c[o][1].type==="content"))for(;++o<c.length&&c[o][1].type!=="content";)c[o][1].type==="chunkText"&&(c[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,CN(e,n)),n=t[n],l=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Gn(e,i,n-i+1,a))}}return!l}function CN(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,c=[],l={};let u,d,p=-1,f=n,h=0,m=0;const y=[m];for(;f;){for(;e[++i][1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(m=p+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),p=y.length;p--;){const g=a.slice(y[p],y[p+1]),v=o.pop();c.unshift([v,v+g.length-1]),Gn(e,v,2,g)}for(p=-1;++p<c.length;)l[h+c[p][0]]=h+c[p][1],h+=c[p][1]-c[p][0]-1;return l}const TN={tokenize:IN,resolve:ON},AN={tokenize:RN,partial:!0};function ON(e){return e0(e),e}function IN(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):We(a)?e.check(AN,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function RN(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),St(e,o,"linePrefix")}function o(s){if(s===null||We(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function t0(e,t,n,r,i,o,s,a,c){const l=c||Number.POSITIVE_INFINITY;let u=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),p):g===null||g===32||g===41||jl(g)?n(g):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(g))}function p(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===62?(e.exit("chunkString"),e.exit(a),p(g)):g===null||g===60||We(g)?n(g):(e.consume(g),g===92?h:f)}function h(g){return g===60||g===62||g===92?(e.consume(g),f):f(g)}function m(g){return!u&&(g===null||g===41||$t(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):u<l&&g===40?(e.consume(g),u++,m):g===41?(e.consume(g),u--,m):g===null||g===32||g===40||jl(g)?n(g):(e.consume(g),g===92?y:m)}function y(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function n0(e,t,n,r,i,o){const s=this;let a=0,c;return l;function l(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return a>999||f===null||f===91||f===93&&!c||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):We(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||We(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),c||(c=!yt(f)),f===92?p:d)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function r0(e,t,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,c):n(p)}function c(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),l(p))}function l(p){return p===s?(e.exit(o),c(s)):p===null?n(p):We(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),St(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||We(p)?(e.exit("chunkString"),l(p)):(e.consume(p),p===92?d:u)}function d(p){return p===s||p===92?(e.consume(p),u):u(p)}}function ca(e,t){let n;return r;function r(i){return We(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):yt(i)?St(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const PN={name:"definition",tokenize:DN},$N={tokenize:NN,partial:!0};function DN(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),s(f)}function s(f){return n0.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return $t(f)?ca(e,l)(f):l(f)}function l(f){return t0(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt($N,d,d)(f)}function d(f){return yt(f)?St(e,p,"whitespace")(f):p(f)}function p(f){return f===null||We(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function NN(e,t,n){return r;function r(a){return $t(a)?ca(e,i)(a):n(a)}function i(a){return r0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return yt(a)?St(e,s,"whitespace")(a):s(a)}function s(a){return a===null||We(a)?t(a):n(a)}}const jN={name:"hardBreakEscape",tokenize:MN};function MN(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return We(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const qN={name:"headingAtx",tokenize:FN,resolve:LN};function LN(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Gn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function FN(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||$t(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||We(u)?(e.exit("atxHeading"),t(u)):yt(u)?St(e,a,"whitespace")(u):(e.enter("atxHeadingText"),l(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),a(u))}function l(u){return u===null||u===35||$t(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),l)}}const UN=["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"],i0=["pre","script","style","textarea"],BN={name:"htmlFlow",tokenize:HN,resolveTo:VN,concrete:!0},zN={tokenize:KN,partial:!0},ZN={tokenize:WN,partial:!0};function VN(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(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}function HN(e,t,n){const r=this;let i,o,s,a,c;return l;function l(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),p):A===47?(e.consume(A),o=!0,m):A===63?(e.consume(A),i=3,r.interrupt?t:C):qn(A)?(e.consume(A),s=String.fromCharCode(A),y):n(A)}function p(A){return A===45?(e.consume(A),i=2,f):A===91?(e.consume(A),i=5,a=0,h):qn(A)?(e.consume(A),i=4,r.interrupt?t:C):n(A)}function f(A){return A===45?(e.consume(A),r.interrupt?t:C):n(A)}function h(A){const we="CDATA[";return A===we.charCodeAt(a++)?(e.consume(A),a===we.length?r.interrupt?t:H:h):n(A)}function m(A){return qn(A)?(e.consume(A),s=String.fromCharCode(A),y):n(A)}function y(A){if(A===null||A===47||A===62||$t(A)){const we=A===47,Te=s.toLowerCase();return!we&&!o&&i0.includes(Te)?(i=1,r.interrupt?t(A):H(A)):UN.includes(s.toLowerCase())?(i=6,we?(e.consume(A),g):r.interrupt?t(A):H(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?v(A):b(A))}return A===45||An(A)?(e.consume(A),s+=String.fromCharCode(A),y):n(A)}function g(A){return A===62?(e.consume(A),r.interrupt?t:H):n(A)}function v(A){return yt(A)?(e.consume(A),v):O(A)}function b(A){return A===47?(e.consume(A),O):A===58||A===95||qn(A)?(e.consume(A),S):yt(A)?(e.consume(A),b):O(A)}function S(A){return A===45||A===46||A===58||A===95||An(A)?(e.consume(A),S):E(A)}function E(A){return A===61?(e.consume(A),_):yt(A)?(e.consume(A),E):b(A)}function _(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),c=A,I):yt(A)?(e.consume(A),_):P(A)}function I(A){return A===c?(e.consume(A),c=null,$):A===null||We(A)?n(A):(e.consume(A),I)}function P(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||$t(A)?E(A):(e.consume(A),P)}function $(A){return A===47||A===62||yt(A)?b(A):n(A)}function O(A){return A===62?(e.consume(A),q):n(A)}function q(A){return A===null||We(A)?H(A):yt(A)?(e.consume(A),q):n(A)}function H(A){return A===45&&i===2?(e.consume(A),M):A===60&&i===1?(e.consume(A),Z):A===62&&i===4?(e.consume(A),te):A===63&&i===3?(e.consume(A),C):A===93&&i===5?(e.consume(A),Q):We(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(zN,fe,B)(A)):A===null||We(A)?(e.exit("htmlFlowData"),B(A)):(e.consume(A),H)}function B(A){return e.check(ZN,F,fe)(A)}function F(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),D}function D(A){return A===null||We(A)?B(A):(e.enter("htmlFlowData"),H(A))}function M(A){return A===45?(e.consume(A),C):H(A)}function Z(A){return A===47?(e.consume(A),s="",W):H(A)}function W(A){if(A===62){const we=s.toLowerCase();return i0.includes(we)?(e.consume(A),te):H(A)}return qn(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),W):H(A)}function Q(A){return A===93?(e.consume(A),C):H(A)}function C(A){return A===62?(e.consume(A),te):A===45&&i===2?(e.consume(A),C):H(A)}function te(A){return A===null||We(A)?(e.exit("htmlFlowData"),fe(A)):(e.consume(A),te)}function fe(A){return e.exit("htmlFlow"),t(A)}}function WN(e,t,n){const r=this;return i;function i(s){return We(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function KN(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(aa,t,n)}}const JN={name:"htmlText",tokenize:YN};function YN(e,t,n){const r=this;let i,o,s;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),c}function c(C){return C===33?(e.consume(C),l):C===47?(e.consume(C),E):C===63?(e.consume(C),b):qn(C)?(e.consume(C),P):n(C)}function l(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),o=0,h):qn(C)?(e.consume(C),v):n(C)}function u(C){return C===45?(e.consume(C),f):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),p):We(C)?(s=d,Z(C)):(e.consume(C),d)}function p(C){return C===45?(e.consume(C),f):d(C)}function f(C){return C===62?M(C):C===45?p(C):d(C)}function h(C){const te="CDATA[";return C===te.charCodeAt(o++)?(e.consume(C),o===te.length?m:h):n(C)}function m(C){return C===null?n(C):C===93?(e.consume(C),y):We(C)?(s=m,Z(C)):(e.consume(C),m)}function y(C){return C===93?(e.consume(C),g):m(C)}function g(C){return C===62?M(C):C===93?(e.consume(C),g):m(C)}function v(C){return C===null||C===62?M(C):We(C)?(s=v,Z(C)):(e.consume(C),v)}function b(C){return C===null?n(C):C===63?(e.consume(C),S):We(C)?(s=b,Z(C)):(e.consume(C),b)}function S(C){return C===62?M(C):b(C)}function E(C){return qn(C)?(e.consume(C),_):n(C)}function _(C){return C===45||An(C)?(e.consume(C),_):I(C)}function I(C){return We(C)?(s=I,Z(C)):yt(C)?(e.consume(C),I):M(C)}function P(C){return C===45||An(C)?(e.consume(C),P):C===47||C===62||$t(C)?$(C):n(C)}function $(C){return C===47?(e.consume(C),M):C===58||C===95||qn(C)?(e.consume(C),O):We(C)?(s=$,Z(C)):yt(C)?(e.consume(C),$):M(C)}function O(C){return C===45||C===46||C===58||C===95||An(C)?(e.consume(C),O):q(C)}function q(C){return C===61?(e.consume(C),H):We(C)?(s=q,Z(C)):yt(C)?(e.consume(C),q):$(C)}function H(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),i=C,B):We(C)?(s=H,Z(C)):yt(C)?(e.consume(C),H):(e.consume(C),F)}function B(C){return C===i?(e.consume(C),i=void 0,D):C===null?n(C):We(C)?(s=B,Z(C)):(e.consume(C),B)}function F(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||$t(C)?$(C):(e.consume(C),F)}function D(C){return C===47||C===62||$t(C)?$(C):n(C)}function M(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function Z(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),W}function W(C){return yt(C)?St(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):Q(C)}function Q(C){return e.enter("htmlTextData"),s(C)}}const Ep={name:"labelEnd",tokenize:nj,resolveTo:tj,resolveAll:ej},GN={tokenize:rj},XN={tokenize:ij},QN={tokenize:oj};function ej(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function tj(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const c={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",c,t],["enter",l,t]],a=ur(a,e.slice(o+1,o+r+3)),a=ur(a,[["enter",u,t]]),a=ur(a,Ll(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=ur(a,[["exit",u,t],e[s-2],e[s-1],["exit",l,t]]),a=ur(a,e.slice(s+1)),a=ur(a,[["exit",c,t]]),Gn(e,o,e.length,a),e}function nj(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?d(p):(s=r.parser.defined.includes(xr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),c):n(p)}function c(p){return p===40?e.attempt(GN,u,s?u:d)(p):p===91?e.attempt(XN,u,s?l:d)(p):s?u(p):d(p)}function l(p){return e.attempt(QN,u,d)(p)}function u(p){return t(p)}function d(p){return o._balanced=!0,n(p)}}function rj(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return $t(d)?ca(e,o)(d):o(d)}function o(d){return d===41?u(d):t0(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return $t(d)?ca(e,c)(d):u(d)}function a(d){return n(d)}function c(d){return d===34||d===39||d===40?r0(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function l(d){return $t(d)?ca(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function ij(e,t,n){const r=this;return i;function i(a){return n0.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function oj(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const sj={name:"labelStartImage",tokenize:aj,resolveAll:Ep.resolveAll};function aj(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const cj={name:"labelStartLink",tokenize:lj,resolveAll:Ep.resolveAll};function lj(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const kp={name:"lineEnding",tokenize:uj};function uj(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),St(e,t,"linePrefix")}}const Fl={name:"thematicBreak",tokenize:dj};function dj(e,t,n){let r=0,i;return o;function o(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),c(l)):r>=3&&(l===null||We(l))?(e.exit("thematicBreak"),t(l)):n(l)}function c(l){return l===i?(e.consume(l),r++,c):(e.exit("thematicBreakSequence"),yt(l)?St(e,a,"whitespace")(l):a(l))}}const Bn={name:"list",tokenize:hj,continuation:{tokenize:mj},exit:gj},fj={tokenize:vj,partial:!0},pj={tokenize:yj,partial:!0};function hj(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(f){const h=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:xp(f)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Fl,n,l)(f):l(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return xp(f)&&++s<10?(e.consume(f),c):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),l(f)):n(f)}function l(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(aa,r.interrupt?n:u,e.attempt(fj,p,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function d(f){return yt(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function mj(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(aa,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,St(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!yt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pj,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,St(e,e.attempt(Bn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function yj(e,t,n){const r=this;return St(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function gj(e){e.exit(this.containerState.type)}function vj(e,t,n){const r=this;return St(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const s=r.events[r.events.length-1];return!yt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const o0={name:"setextUnderline",tokenize:wj,resolveTo:bj};function bj(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function wj(e,t,n){const r=this;let i;return o;function o(l){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),yt(l)?St(e,c,"lineSuffix")(l):c(l))}function c(l){return l===null||We(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const xj={tokenize:_j};function _j(e){const t=this,n=e.attempt(aa,r,e.attempt(this.parser.constructs.flowInitial,i,St(e,e.attempt(this.parser.constructs.flow,i,e.attempt(TN,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Sj={resolveAll:a0()},Ej=s0("string"),kj=s0("text");function s0(e){return{tokenize:t,resolveAll:a0(e==="text"?Cj:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return l(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),c}function c(u){return l(u)?(n.exit("data"),o(u)):(n.consume(u),c)}function l(u){if(u===null)return!0;const d=i[u];let p=-1;if(d)for(;++p<d.length;){const f=d[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function a0(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Cj(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,c;for(;o--;){const l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)c=!0,a++;else if(l!==-1){o++;break}}if(a){const l={type:n===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+o,_bufferIndex:o?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},l.start),r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}function Tj(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const c={consume:v,enter:b,exit:S,attempt:I(E),check:I(_),interrupt:I(_,{interrupt:!0})},l={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:f,sliceSerialize:p,now:h,defineSkip:m,write:d};let u=t.tokenize.call(l,c);return t.resolveAll&&o.push(t),l;function d(q){return s=ur(s,q),y(),s[s.length-1]!==null?[]:(P(t,0),l.events=Ll(o,l.events,l),l.events)}function p(q,H){return Oj(f(q),H)}function f(q){return Aj(s,q)}function h(){const{line:q,column:H,offset:B,_index:F,_bufferIndex:D}=r;return{line:q,column:H,offset:B,_index:F,_bufferIndex:D}}function m(q){i[q.line]=q.column,O()}function y(){let q;for(;r._index<s.length;){const H=s[r._index];if(typeof H=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<H.length;)g(H.charCodeAt(r._bufferIndex));else g(H)}}function g(q){u=u(q)}function v(q){We(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,O()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=q}function b(q,H){const B=H||{};return B.type=q,B.start=h(),l.events.push(["enter",B,l]),a.push(B),B}function S(q){const H=a.pop();return H.end=h(),l.events.push(["exit",H,l]),H}function E(q,H){P(q,H.from)}function _(q,H){H.restore()}function I(q,H){return B;function B(F,D,M){let Z,W,Q,C;return Array.isArray(F)?fe(F):"tokenize"in F?fe([F]):te(F);function te(Ee){return $e;function $e(Fe){const Pe=Fe!==null&&Ee[Fe],he=Fe!==null&&Ee.null,de=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(he)?he:he?[he]:[]];return fe(de)(Fe)}}function fe(Ee){return Z=Ee,W=0,Ee.length===0?M:A(Ee[W])}function A(Ee){return $e;function $e(Fe){return C=$(),Q=Ee,Ee.partial||(l.currentConstruct=Ee),Ee.name&&l.parser.constructs.disable.null.includes(Ee.name)?Te():Ee.tokenize.call(H?Object.assign(Object.create(l),H):l,c,we,Te)(Fe)}}function we(Ee){return q(Q,C),D}function Te(Ee){return C.restore(),++W<Z.length?A(Z[W]):M}}}function P(q,H){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&Gn(l.events,H,l.events.length-H,q.resolve(l.events.slice(H),l)),q.resolveTo&&(l.events=q.resolveTo(l.events,l))}function $(){const q=h(),H=l.previous,B=l.currentConstruct,F=l.events.length,D=Array.from(a);return{restore:M,from:F};function M(){r=q,l.previous=H,l.currentConstruct=B,l.events.length=F,a=D,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Aj(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Oj(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
105
105
|
`;break}case-3:{s=`\r
|
|
106
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const Ij=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:PN},disable:{null:[]},document:{42:Bn,43:Bn,45:Bn,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,62:Jx},flow:{35:qN,42:Fl,45:[o0,Fl],60:BN,61:o0,95:Fl,96:Qx,126:Qx},flowInitial:{[-2]:Sp,[-1]:Sp,32:Sp},insideSpan:{null:[_p,Sj]},string:{38:Gx,92:Yx},text:{[-5]:kp,[-4]:kp,[-3]:kp,33:sj,38:Gx,42:_p,60:[lN,JN],91:cj,92:[jN,Yx],93:Ep,95:_p,96:_N}},Symbol.toStringTag,{value:"Module"}));function Rj(e){const n=Vx([Ij,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(nN),document:i(iN),flow:i(xj),string:i(Ej),text:i(kj)};return r;function i(o){return s;function s(a){return Tj(r,o,a)}}}function Pj(e){for(;!e0(e););return e}const c0=/[\0\t\n\r]/g;function $j(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const c=[];let l,u,d,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(c0.lastIndex=d,l=c0.exec(o),h=l&&l.index!==void 0?l.index:o.length,f=o.charCodeAt(h),!l){t=o.slice(d);break}if(f===10&&d===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<h&&(c.push(o.slice(d,h)),e+=h-d),f){case 0:{c.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,c.push(-2);e++<u;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Dj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Nj(e){return e.replace(Dj,jj)}function jj(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Hx(n.slice(o?2:1),o?16:10)}return wp(n)||e}const l0={}.hasOwnProperty;function Mj(e,t,n){return typeof t!="string"&&(n=t,t=void 0),qj(n)(Pj(Rj(n).document().write($j()(e,t,!0))))}function qj(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ce),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(De),blockQuote:o(Re),characterEscape:$,characterReference:$,codeFenced:o(he),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(he,s),codeText:o(de,s),codeTextData:$,data:$,codeFlowValue:$,definition:o(_e),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(pe),hardBreakEscape:o(et),hardBreakTrailing:o(et),htmlFlow:o(L,s),htmlFlowData:$,htmlText:o(L,s),htmlTextData:$,image:o(oe),label:s,link:o(ce),listItem:o(Ne),listItemValue:h,listOrdered:o(ue,d),listUnordered:o(ue),paragraph:o(Se),reference:A,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(De),strong:o(Be),thematicBreak:o(Ge)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:Fe,autolinkProtocol:Pe,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:Ee,codeFenced:c(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:O,codeIndented:c(v),codeText:c(D),codeTextData:O,data:O,definition:c(),definitionDestinationString:S,definitionLabelString:g,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(H),hardBreakTrailing:c(H),htmlFlow:c(B),htmlFlowData:O,htmlText:c(F),htmlTextData:O,image:c(Z),label:Q,labelText:W,lineEnding:q,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:we,resourceDestinationString:C,resourceTitleString:te,resource:fe,setextHeading:c(P),setextHeadingLineSequence:I,setextHeadingText:_,strong:c(),thematicBreak:c()}};u0(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let ie={type:"root",children:[]};const ae={stack:[ie],tokenStack:[],config:t,enter:a,exit:l,buffer:s,resume:u,data:n},Ae=[];let Je=-1;for(;++Je<K.length;)if(K[Je][1].type==="listOrdered"||K[Je][1].type==="listUnordered")if(K[Je][0]==="enter")Ae.push(Je);else{const Mt=Ae.pop();Je=i(K,Mt,Je)}for(Je=-1;++Je<K.length;){const Mt=t[K[Je][0]];l0.call(Mt,K[Je][1].type)&&Mt[K[Je][1].type].call(Object.assign({sliceSerialize:K[Je][2].sliceSerialize},ae),K[Je][1])}if(ae.tokenStack.length>0){const Mt=ae.tokenStack[ae.tokenStack.length-1];(Mt[1]||d0).call(ae,void 0,Mt[0])}for(ie.position={start:xi(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:xi(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},Je=-1;++Je<t.transforms.length;)ie=t.transforms[Je](ie)||ie;return ie}function i(K,ie,ae){let Ae=ie-1,Je=-1,Mt=!1,Ot,Et,Nt,Yt;for(;++Ae<=ae;){const z=K[Ae];switch(z[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{z[0]==="enter"?Je++:Je--,Yt=void 0;break}case"lineEndingBlank":{z[0]==="enter"&&(Ot&&!Yt&&!Je&&!Nt&&(Nt=Ae),Yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yt=void 0}if(!Je&&z[0]==="enter"&&z[1].type==="listItemPrefix"||Je===-1&&z[0]==="exit"&&(z[1].type==="listUnordered"||z[1].type==="listOrdered")){if(Ot){let J=Ae;for(Et=void 0;J--;){const Xe=K[J];if(Xe[1].type==="lineEnding"||Xe[1].type==="lineEndingBlank"){if(Xe[0]==="exit")continue;Et&&(K[Et][1].type="lineEndingBlank",Mt=!0),Xe[1].type="lineEnding",Et=J}else if(!(Xe[1].type==="linePrefix"||Xe[1].type==="blockQuotePrefix"||Xe[1].type==="blockQuotePrefixWhitespace"||Xe[1].type==="blockQuoteMarker"||Xe[1].type==="listItemIndent"))break}Nt&&(!Et||Nt<Et)&&(Ot._spread=!0),Ot.end=Object.assign({},Et?K[Et][1].start:z[1].end),K.splice(Et||Ae,0,["exit",Ot,z[2]]),Ae++,ae++}if(z[1].type==="listItemPrefix"){const J={type:"listItem",_spread:!1,start:Object.assign({},z[1].start),end:void 0};Ot=J,K.splice(Ae,0,["enter",J,z[2]]),Ae++,ae++,Nt=void 0,Yt=!0}}}return K[ie][1]._spread=Mt,ae}function o(K,ie){return ae;function ae(Ae){a.call(this,K(Ae),Ae),ie&&ie.call(this,Ae)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(K,ie,ae){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([ie,ae]),K.position={start:xi(ie.start),end:void 0}}function c(K){return ie;function ie(ae){K&&K.call(this,ae),l.call(this,ae)}}function l(K,ie){const ae=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==K.type&&(ie?ie.call(this,K,Ae[0]):(Ae[1]||d0).call(this,K,Ae[0]));else throw new Error("Cannot close `"+K.type+"` ("+oa({start:K.start,end:K.end})+"): it’s not open");ae.position.end=xi(K.end)}function u(){return bp(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(K){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function f(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=K}function p(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=K}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K.replace(/(\r?\n|\r)$/g,"")}function g(K){const ie=this.resume(),ae=this.stack[this.stack.length-1];ae.label=ie,ae.identifier=xr(this.sliceSerialize(K)).toLowerCase()}function b(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.title=K}function S(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.url=K}function E(K){const ie=this.stack[this.stack.length-1];if(!ie.depth){const ae=this.sliceSerialize(K).length;ie.depth=ae}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function I(K){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function $(K){const ae=this.stack[this.stack.length-1].children;let Ae=ae[ae.length-1];(!Ae||Ae.type!=="text")&&(Ae=pt(),Ae.position={start:xi(K.start),end:void 0},ae.push(Ae)),this.stack.push(Ae)}function O(K){const ie=this.stack.pop();ie.value+=this.sliceSerialize(K),ie.position.end=xi(K.end)}function q(K){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=ie.children[ie.children.length-1];ae.position.end=xi(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ie.type)&&($.call(this,K),O.call(this,K))}function H(){this.data.atHardBreak=!0}function B(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K}function F(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K}function D(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K}function M(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ie,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function Z(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ie,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function W(K){const ie=this.sliceSerialize(K),ae=this.stack[this.stack.length-2];ae.label=Nj(ie),ae.identifier=xr(ie).toLowerCase()}function Q(){const K=this.stack[this.stack.length-1],ie=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const Ae=K.children;ae.children=Ae}else ae.alt=ie}function C(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.url=K}function te(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.title=K}function fe(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function we(K){const ie=this.resume(),ae=this.stack[this.stack.length-1];ae.label=ie,ae.identifier=xr(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function Te(K){this.data.characterReferenceType=K.type}function Ee(K){const ie=this.sliceSerialize(K),ae=this.data.characterReferenceType;let Ae;ae?(Ae=Hx(ie,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=wp(ie);const Je=this.stack.pop();Je.value+=Ae,Je.position.end=xi(K.end)}function Pe(K){O.call(this,K);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(K)}function Fe(K){O.call(this,K);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(K)}function Re(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function pe(){return{type:"emphasis",children:[]}}function De(){return{type:"heading",depth:0,children:[]}}function et(){return{type:"break"}}function L(){return{type:"html",value:""}}function oe(){return{type:"image",title:null,url:"",alt:null}}function ce(){return{type:"link",title:null,url:"",children:[]}}function ue(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function Ne(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Se(){return{type:"paragraph",children:[]}}function Be(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function Ge(){return{type:"thematicBreak"}}}function xi(e){return{line:e.line,column:e.column,offset:e.offset}}function u0(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?u0(e,r):Lj(e,r)}}function Lj(e,t){let n;for(n in t)if(l0.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function d0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oa({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oa({start:t.start,end:t.end})+") is still open")}function Fj(e){const t=this;t.parser=n;function n(r){return Mj(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Uj(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Bj(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
106
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const Ij=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:PN},disable:{null:[]},document:{42:Bn,43:Bn,45:Bn,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,62:Jx},flow:{35:qN,42:Fl,45:[o0,Fl],60:BN,61:o0,95:Fl,96:Qx,126:Qx},flowInitial:{[-2]:Sp,[-1]:Sp,32:Sp},insideSpan:{null:[_p,Sj]},string:{38:Gx,92:Yx},text:{[-5]:kp,[-4]:kp,[-3]:kp,33:sj,38:Gx,42:_p,60:[lN,JN],91:cj,92:[jN,Yx],93:Ep,95:_p,96:_N}},Symbol.toStringTag,{value:"Module"}));function Rj(e){const n=Vx([Ij,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(nN),document:i(iN),flow:i(xj),string:i(Ej),text:i(kj)};return r;function i(o){return s;function s(a){return Tj(r,o,a)}}}function Pj(e){for(;!e0(e););return e}const c0=/[\0\t\n\r]/g;function $j(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const c=[];let l,u,d,p,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(c0.lastIndex=d,l=c0.exec(o),p=l&&l.index!==void 0?l.index:o.length,f=o.charCodeAt(p),!l){t=o.slice(d);break}if(f===10&&d===p&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<p&&(c.push(o.slice(d,p)),e+=p-d),f){case 0:{c.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,c.push(-2);e++<u;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return a&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Dj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Nj(e){return e.replace(Dj,jj)}function jj(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Hx(n.slice(o?2:1),o?16:10)}return wp(n)||e}const l0={}.hasOwnProperty;function Mj(e,t,n){return typeof t!="string"&&(n=t,t=void 0),qj(n)(Pj(Rj(n).document().write($j()(e,t,!0))))}function qj(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ce),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(De),blockQuote:o(Pe),characterEscape:$,characterReference:$,codeFenced:o(he),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(he,s),codeText:o(de,s),codeTextData:$,data:$,codeFlowValue:$,definition:o(_e),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(pe),hardBreakEscape:o(et),hardBreakTrailing:o(et),htmlFlow:o(L,s),htmlFlowData:$,htmlText:o(L,s),htmlTextData:$,image:o(oe),label:s,link:o(ce),listItem:o(Ne),listItemValue:p,listOrdered:o(ue,d),listUnordered:o(ue),paragraph:o(Se),reference:A,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(De),strong:o(Be),thematicBreak:o(Ge)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:Fe,autolinkProtocol:$e,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:Ee,codeFenced:c(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:h,codeFlowValue:O,codeIndented:c(g),codeText:c(D),codeTextData:O,data:O,definition:c(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(H),hardBreakTrailing:c(H),htmlFlow:c(B),htmlFlowData:O,htmlText:c(F),htmlTextData:O,image:c(Z),label:Q,labelText:W,lineEnding:q,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:we,resourceDestinationString:C,resourceTitleString:te,resource:fe,setextHeading:c(P),setextHeadingLineSequence:I,setextHeadingText:_,strong:c(),thematicBreak:c()}};u0(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let ie={type:"root",children:[]};const ae={stack:[ie],tokenStack:[],config:t,enter:a,exit:l,buffer:s,resume:u,data:n},Ae=[];let Je=-1;for(;++Je<K.length;)if(K[Je][1].type==="listOrdered"||K[Je][1].type==="listUnordered")if(K[Je][0]==="enter")Ae.push(Je);else{const Mt=Ae.pop();Je=i(K,Mt,Je)}for(Je=-1;++Je<K.length;){const Mt=t[K[Je][0]];l0.call(Mt,K[Je][1].type)&&Mt[K[Je][1].type].call(Object.assign({sliceSerialize:K[Je][2].sliceSerialize},ae),K[Je][1])}if(ae.tokenStack.length>0){const Mt=ae.tokenStack[ae.tokenStack.length-1];(Mt[1]||d0).call(ae,void 0,Mt[0])}for(ie.position={start:xi(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:xi(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},Je=-1;++Je<t.transforms.length;)ie=t.transforms[Je](ie)||ie;return ie}function i(K,ie,ae){let Ae=ie-1,Je=-1,Mt=!1,Ot,Et,Nt,Yt;for(;++Ae<=ae;){const z=K[Ae];switch(z[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{z[0]==="enter"?Je++:Je--,Yt=void 0;break}case"lineEndingBlank":{z[0]==="enter"&&(Ot&&!Yt&&!Je&&!Nt&&(Nt=Ae),Yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yt=void 0}if(!Je&&z[0]==="enter"&&z[1].type==="listItemPrefix"||Je===-1&&z[0]==="exit"&&(z[1].type==="listUnordered"||z[1].type==="listOrdered")){if(Ot){let J=Ae;for(Et=void 0;J--;){const Xe=K[J];if(Xe[1].type==="lineEnding"||Xe[1].type==="lineEndingBlank"){if(Xe[0]==="exit")continue;Et&&(K[Et][1].type="lineEndingBlank",Mt=!0),Xe[1].type="lineEnding",Et=J}else if(!(Xe[1].type==="linePrefix"||Xe[1].type==="blockQuotePrefix"||Xe[1].type==="blockQuotePrefixWhitespace"||Xe[1].type==="blockQuoteMarker"||Xe[1].type==="listItemIndent"))break}Nt&&(!Et||Nt<Et)&&(Ot._spread=!0),Ot.end=Object.assign({},Et?K[Et][1].start:z[1].end),K.splice(Et||Ae,0,["exit",Ot,z[2]]),Ae++,ae++}if(z[1].type==="listItemPrefix"){const J={type:"listItem",_spread:!1,start:Object.assign({},z[1].start),end:void 0};Ot=J,K.splice(Ae,0,["enter",J,z[2]]),Ae++,ae++,Nt=void 0,Yt=!0}}}return K[ie][1]._spread=Mt,ae}function o(K,ie){return ae;function ae(Ae){a.call(this,K(Ae),Ae),ie&&ie.call(this,Ae)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(K,ie,ae){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([ie,ae]),K.position={start:xi(ie.start),end:void 0}}function c(K){return ie;function ie(ae){K&&K.call(this,ae),l.call(this,ae)}}function l(K,ie){const ae=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==K.type&&(ie?ie.call(this,K,Ae[0]):(Ae[1]||d0).call(this,K,Ae[0]));else throw new Error("Cannot close `"+K.type+"` ("+oa({start:K.start,end:K.end})+"): it’s not open");ae.position.end=xi(K.end)}function u(){return bp(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(K){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function f(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=K}function h(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=K}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K.replace(/(\r?\n|\r)$/g,"")}function v(K){const ie=this.resume(),ae=this.stack[this.stack.length-1];ae.label=ie,ae.identifier=xr(this.sliceSerialize(K)).toLowerCase()}function b(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.title=K}function S(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.url=K}function E(K){const ie=this.stack[this.stack.length-1];if(!ie.depth){const ae=this.sliceSerialize(K).length;ie.depth=ae}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function I(K){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function $(K){const ae=this.stack[this.stack.length-1].children;let Ae=ae[ae.length-1];(!Ae||Ae.type!=="text")&&(Ae=pt(),Ae.position={start:xi(K.start),end:void 0},ae.push(Ae)),this.stack.push(Ae)}function O(K){const ie=this.stack.pop();ie.value+=this.sliceSerialize(K),ie.position.end=xi(K.end)}function q(K){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=ie.children[ie.children.length-1];ae.position.end=xi(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ie.type)&&($.call(this,K),O.call(this,K))}function H(){this.data.atHardBreak=!0}function B(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K}function F(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K}function D(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.value=K}function M(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ie,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function Z(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ie,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function W(K){const ie=this.sliceSerialize(K),ae=this.stack[this.stack.length-2];ae.label=Nj(ie),ae.identifier=xr(ie).toLowerCase()}function Q(){const K=this.stack[this.stack.length-1],ie=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const Ae=K.children;ae.children=Ae}else ae.alt=ie}function C(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.url=K}function te(){const K=this.resume(),ie=this.stack[this.stack.length-1];ie.title=K}function fe(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function we(K){const ie=this.resume(),ae=this.stack[this.stack.length-1];ae.label=ie,ae.identifier=xr(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function Te(K){this.data.characterReferenceType=K.type}function Ee(K){const ie=this.sliceSerialize(K),ae=this.data.characterReferenceType;let Ae;ae?(Ae=Hx(ie,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=wp(ie);const Je=this.stack.pop();Je.value+=Ae,Je.position.end=xi(K.end)}function $e(K){O.call(this,K);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(K)}function Fe(K){O.call(this,K);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(K)}function Pe(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function pe(){return{type:"emphasis",children:[]}}function De(){return{type:"heading",depth:0,children:[]}}function et(){return{type:"break"}}function L(){return{type:"html",value:""}}function oe(){return{type:"image",title:null,url:"",alt:null}}function ce(){return{type:"link",title:null,url:"",children:[]}}function ue(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function Ne(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Se(){return{type:"paragraph",children:[]}}function Be(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function Ge(){return{type:"thematicBreak"}}}function xi(e){return{line:e.line,column:e.column,offset:e.offset}}function u0(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?u0(e,r):Lj(e,r)}}function Lj(e,t){let n;for(n in t)if(l0.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function d0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oa({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oa({start:t.start,end:t.end})+") is still open")}function Fj(e){const t=this;t.parser=n;function n(r){return Mj(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Uj(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Bj(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
107
107
|
`}]}function zj(e,t){const n=t.value?t.value+`
|
|
108
108
|
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Zj(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vj(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hj(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ho(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const l={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Wj(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kj(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function f0(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Jj(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return f0(e,t);const i={src:Ho(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Yj(e,t){const n={src:Ho(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Gj(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Xj(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return f0(e,t);const i={href:Ho(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Qj(e,t){const n={href:Ho(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eM(e,t,n){const r=e.all(t),i=n?tM(n):p0(t),o={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
109
109
|
`}),u.type==="element"&&u.tagName==="p"&&!i?s.push(...u.children):s.push(u)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
|
|
110
|
-
`});const l={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,l),e.applyData(t,l)}function tM(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=p0(n[r])}return t}function p0(e){const t=e.spread;return t??e.children.length>1}function nM(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function rM(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iM(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function oM(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sM(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=pp(t.children[1]),c=$x(t.children[t.children.length-1]);a&&c&&(s.position={start:a,end:c}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function aM(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let c=-1;const l=[];for(;++c<a;){const d=t.children[c],
|
|
110
|
+
`});const l={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,l),e.applyData(t,l)}function tM(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=p0(n[r])}return t}function p0(e){const t=e.spread;return t??e.children.length>1}function nM(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function rM(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iM(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function oM(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sM(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=pp(t.children[1]),c=$x(t.children[t.children.length-1]);a&&c&&(s.position={start:a,end:c}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function aM(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let c=-1;const l=[];for(;++c<a;){const d=t.children[c],p={},f=s?s[c]:void 0;f&&(p.align=f);let h={type:"element",tagName:o,properties:p,children:[]};d&&(h.children=e.all(d),e.patch(d,h),h=e.applyData(d,h)),l.push(h)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,u),e.applyData(t,u)}function cM(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const h0=9,m0=32;function lM(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(y0(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(y0(t.slice(i),i>0,!1)),o.join("")}function y0(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===h0||o===m0;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===h0||o===m0;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function uM(e,t){const n={type:"text",value:lM(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dM(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const fM={blockquote:Uj,break:Bj,code:zj,delete:Zj,emphasis:Vj,footnoteReference:Hj,heading:Wj,html:Kj,imageReference:Jj,image:Yj,inlineCode:Gj,linkReference:Xj,link:Qj,listItem:eM,list:nM,paragraph:rM,root:iM,strong:oM,table:sM,tableCell:cM,tableRow:aM,text:uM,thematicBreak:dM,toml:Ul,yaml:Ul,definition:Ul,footnoteDefinition:Ul};function Ul(){}const g0=-1,Bl=0,zl=1,Zl=2,Cp=3,Tp=4,Ap=5,Op=6,v0=7,b0=8,w0=typeof self=="object"?self:globalThis,pM=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Bl:case g0:return n(s,i);case zl:{const a=n([],i);for(const c of s)a.push(r(c));return a}case Zl:{const a=n({},i);for(const[c,l]of s)a[r(c)]=r(l);return a}case Cp:return n(new Date(s),i);case Tp:{const{source:a,flags:c}=s;return n(new RegExp(a,c),i)}case Ap:{const a=n(new Map,i);for(const[c,l]of s)a.set(r(c),r(l));return a}case Op:{const a=n(new Set,i);for(const c of s)a.add(r(c));return a}case v0:{const{name:a,message:c}=s;return n(new w0[a](c),i)}case b0:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new w0[o](s),i)};return r},x0=e=>pM(new Map,e)(0),Wo="",{toString:hM}={},{keys:mM}=Object,la=e=>{const t=typeof e;if(t!=="object"||!e)return[Bl,t];const n=hM.call(e).slice(8,-1);switch(n){case"Array":return[zl,Wo];case"Object":return[Zl,Wo];case"Date":return[Cp,Wo];case"RegExp":return[Tp,Wo];case"Map":return[Ap,Wo];case"Set":return[Op,Wo]}return n.includes("Array")?[zl,n]:n.includes("Error")?[v0,n]:[Zl,n]},Vl=([e,t])=>e===Bl&&(t==="function"||t==="symbol"),yM=(e,t,n,r)=>{const i=(s,a)=>{const c=r.push(s)-1;return n.set(a,c),c},o=s=>{if(n.has(s))return n.get(s);let[a,c]=la(s);switch(a){case Bl:{let u=s;switch(c){case"bigint":a=b0,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);u=null;break;case"undefined":return i([g0],s)}return i([a,u],s)}case zl:{if(c)return i([c,[...s]],s);const u=[],d=i([a,u],s);for(const p of s)u.push(o(p));return d}case Zl:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const u=[],d=i([a,u],s);for(const p of mM(s))(e||!Vl(la(s[p])))&&u.push([o(p),o(s[p])]);return d}case Cp:return i([a,s.toISOString()],s);case Tp:{const{source:u,flags:d}=s;return i([a,{source:u,flags:d}],s)}case Ap:{const u=[],d=i([a,u],s);for(const[p,f]of s)(e||!(Vl(la(p))||Vl(la(f))))&&u.push([o(p),o(f)]);return d}case Op:{const u=[],d=i([a,u],s);for(const p of s)(e||!Vl(la(p)))&&u.push(o(p));return d}}const{message:l}=s;return i([a,{name:c,message:l}],s)};return o},_0=(e,{json:t,lossy:n}={})=>{const r=[];return yM(!(t||n),!!t,new Map,r)(e),r},Hl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?x0(_0(e,t)):structuredClone(e):(e,t)=>x0(_0(e,t));function gM(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function vM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bM(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||gM,r=e.options.footnoteBackLabel||vM,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<e.footnoteOrder.length;){const l=e.footnoteById.get(e.footnoteOrder[c]);if(!l)continue;const u=e.all(l),d=String(l.identifier).toUpperCase(),p=Ho(d.toLowerCase());let f=0;const h=[],m=e.footnoteCounts.get(d);for(;m!==void 0&&++f<=m;){h.length>0&&h.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,f);typeof v=="string"&&(v={type:"text",value:v}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...h)}else u.push(...h);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(l,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Hl(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
111
111
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
112
|
-
`}]}}const Wl=function(e){if(e==null)return SM;if(typeof e=="function")return Kl(e);if(typeof e=="object")return Array.isArray(e)?wM(e):xM(e);if(typeof e=="string")return _M(e);throw new Error("Expected function, string, or object as test")};function wM(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Wl(e[n]);return Kl(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function xM(e){const t=e;return Kl(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function _M(e){return Kl(t);function t(n){return n&&n.type===e}}function Kl(e){return t;function t(n,r,i){return!!(EM(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function SM(){return!0}function EM(e){return e!==null&&typeof e=="object"&&"type"in e}function RW(e){return e}const S0=[],kM=!0,Ip=!1,CM="skip";function E0(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Wl(i),s=r?-1:1;a(e,void 0,[])();function a(c,l,u){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(
|
|
112
|
+
`}]}}const Wl=function(e){if(e==null)return SM;if(typeof e=="function")return Kl(e);if(typeof e=="object")return Array.isArray(e)?wM(e):xM(e);if(typeof e=="string")return _M(e);throw new Error("Expected function, string, or object as test")};function wM(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Wl(e[n]);return Kl(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function xM(e){const t=e;return Kl(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function _M(e){return Kl(t);function t(n){return n&&n.type===e}}function Kl(e){return t;function t(n,r,i){return!!(EM(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function SM(){return!0}function EM(e){return e!==null&&typeof e=="object"&&"type"in e}function RW(e){return e}const S0=[],kM=!0,Ip=!1,CM="skip";function E0(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Wl(i),s=r?-1:1;a(e,void 0,[])();function a(c,l,u){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(c.type+(f?"<"+f+">":""))+")"})}return p;function p(){let f=S0,h,m,y;if((!t||o(c,l,u[u.length-1]||void 0))&&(f=TM(n(c,u)),f[0]===Ip))return f;if("children"in c&&c.children){const g=c;if(g.children&&f[0]!==CM)for(m=(r?g.children.length:-1)+s,y=u.concat(g);m>-1&&m<g.children.length;){const v=g.children[m];if(h=a(v,m,y)(),h[0]===Ip)return h;m=typeof h[1]=="number"?h[1]:m+s}}return f}}}function TM(e){return Array.isArray(e)?e:typeof e=="number"?[kM,e]:e==null?S0:[e]}function Rp(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),E0(e,o,a,i);function a(c,l){const u=l[l.length-1],d=u?u.children.indexOf(c):void 0;return s(c,d,u)}}const Pp={}.hasOwnProperty,AM={};function OM(e,t){const n=t||AM,r=new Map,i=new Map,o=new Map,s={...fM,...n.handlers},a={all:l,applyData:RM,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:c,options:n,patch:IM,wrap:$M};return Rp(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,p=String(u.identifier).toUpperCase();d.has(p)||d.set(p,u)}}),a;function c(u,d){const p=u.type,f=a.handlers[p];if(Pp.call(a.handlers,p)&&f)return f(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:m,...y}=u,g=Hl(y);return g.children=a.all(u),g}return Hl(u)}return(a.options.unknownHandler||PM)(a,u,d)}function l(u){const d=[];if("children"in u){const p=u.children;let f=-1;for(;++f<p.length;){const h=a.one(p[f],u);if(h){if(f&&p[f-1].type==="break"&&(!Array.isArray(h)&&h.type==="text"&&(h.value=k0(h.value)),!Array.isArray(h)&&h.type==="element")){const m=h.children[0];m&&m.type==="text"&&(m.value=k0(m.value))}Array.isArray(h)?d.push(...h):d.push(h)}}}return d}}function IM(e,t){e.position&&(t.position=CD(e))}function RM(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Hl(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function PM(e,t){const n=t.data||{},r="value"in t&&!(Pp.call(n,"hProperties")||Pp.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)}function $M(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
113
113
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
114
114
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
115
115
|
`}),n}function k0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function C0(e,t){const n=OM(e,t),r=n.one(e,void 0),i=bM(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
116
|
-
`},i),o}function DM(e,t){return e&&"run"in e?async function(n,r){const i=C0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return C0(n,{file:r,...t||e})}}function T0(e){if(e)throw e}var Jl=Object.prototype.hasOwnProperty,A0=Object.prototype.toString,O0=Object.defineProperty,I0=Object.getOwnPropertyDescriptor,R0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):A0.call(t)==="[object Array]"},P0=function(t){if(!t||A0.call(t)!=="[object Object]")return!1;var n=Jl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Jl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Jl.call(t,i)},$0=function(t,n){O0&&n.name==="__proto__"?O0(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},D0=function(t,n){if(n==="__proto__")if(Jl.call(t,n)){if(I0)return I0(t,n).value}else return;return t[n]},NM=function e(){var t,n,r,i,o,s,a=arguments[0],c=1,l=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},c=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});c<l;++c)if(t=arguments[c],t!=null)for(n in t)r=D0(a,n),i=D0(t,n),a!==i&&(u&&i&&(P0(i)||(o=R0(i)))?(o?(o=!1,s=r&&R0(r)?r:[]):s=r&&P0(r)?r:{},$0(a,{name:n,newValue:e(u,s,i)})):typeof i<"u"&&$0(a,{name:n,newValue:i}));return a};const $p=mi(NM);function Dp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jM(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(c,...l){const u=e[++o];let d=-1;if(c){s(c);return}for(;++d<i.length;)(l[d]===null||l[d]===void 0)&&(l[d]=i[d]);i=l,u?MM(u,a)(...l):s(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function MM(e,t){let n;return r;function r(...s){const a=e.length>s.length;let c;a&&s.push(i);try{c=e.apply(this,s)}catch(l){const u=l;if(a&&n)throw u;return i(u)}a||(c instanceof Promise?c.then(o,i):c instanceof Error?i(c):o(c))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Pr={basename:qM,dirname:LM,extname:FM,join:UM,sep:"/"};function qM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ua(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function LM(e){if(ua(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function FM(e){ua(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function UM(...e){let t=-1,n;for(;++t<e.length;)ua(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":BM(n)}function BM(e){ua(e);const t=e.codePointAt(0)===47;let n=zM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zM(e,t){let n="",r=0,i=-1,o=0,s=-1,a,c;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function ua(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ZM={cwd:VM};function VM(){return"/"}function Np(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function HM(e){if(typeof e=="string")e=new URL(e);else if(!Np(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return WM(e)}function WM(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const jp=["history","path","basename","stem","extname","dirname"];class N0{constructor(t){let n;t?Np(t)?n={path:t}:typeof t=="string"||KM(t)?n={value:t}:n=t:n={},this.cwd=ZM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<jp.length;){const o=jp[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)jp.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Pr.basename(this.path):void 0}set basename(t){qp(t,"basename"),Mp(t,"basename"),this.path=Pr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Pr.dirname(this.path):void 0}set dirname(t){j0(this.basename,"dirname"),this.path=Pr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Pr.extname(this.path):void 0}set extname(t){if(Mp(t,"extname"),j0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Pr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Np(t)&&(t=HM(t)),qp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Pr.basename(this.path,this.extname):void 0}set stem(t){qp(t,"stem"),Mp(t,"stem"),this.path=Pr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Tn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Mp(e,t){if(e&&e.includes(Pr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Pr.sep+"`")}function qp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function j0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JM=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};Object.setPrototypeOf(o,r);const s=Object.getOwnPropertyNames(i);for(const a of s){const c=Object.getOwnPropertyDescriptor(i,a);c&&Object.defineProperty(o,a,c)}return o},YM={}.hasOwnProperty;class Lp extends JM{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=jM()}copy(){const t=new Lp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($p(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Bp("data",this.frozen),this.namespace[t]=n,this):YM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Yl(t),r=this.parser||this.Parser;return Fp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Fp("process",this.parser||this.Parser),Up("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Yl(t),c=r.parse(a);r.run(c,a,function(u,d,h){if(u||!d||!h)return l(u);const f=d,p=r.stringify(f,h);QM(p)?h.value=p:h.result=p,l(u,h)});function l(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Fp("processSync",this.parser||this.Parser),Up("processSync",this.compiler||this.Compiler),this.process(t,i),q0("processSync","process",n),r;function i(o,s){n=!0,T0(o),r=s}}run(t,n,r){M0(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const c=Yl(n);i.run(t,c,l);function l(u,d,h){const f=d||t;u?a(u):s?s(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),q0("runSync","run",r),i;function o(s,a){T0(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Yl(n),i=this.compiler||this.Compiler;return Up("stringify",i),M0(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Bp("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(l){if(typeof l=="function")c(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[u,...d]=l;c(u,d)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new 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");a(l.plugins),l.settings&&(i.settings=$p(!0,i.settings,l.settings))}function a(l){let u=-1;if(l!=null)if(Array.isArray(l))for(;++u<l.length;){const d=l[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function c(l,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===l){h=d;break}if(h===-1)r.push([l,...u]);else if(u.length>0){let[f,...p]=u;const m=r[h][1];Dp(m)&&Dp(f)&&(f=$p(!0,m,f)),r[h]=[l,f,...p]}}}}const GM=new Lp().freeze();function Fp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Up(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function M0(e){if(!Dp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function q0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Yl(e){return XM(e)?e:new N0(e)}function XM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function QM(e){return typeof e=="string"||e2(e)}function e2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const t2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",L0=[],F0={allowDangerousHtml:!0},n2=/^(https?|ircs?|mailto|xmpp)$/i,r2=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function i2(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||L0,c=e.remarkPlugins||L0,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...F0}:F0,u=e.skipHtml,d=e.unwrapDisallowed,h=e.urlTransform||o2,f=GM().use(Fj).use(c).use(DM,l).use(a),p=new N0;typeof r=="string"&&(p.value=r);for(const g of r2)Object.hasOwn(e,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+t2+g.id,void 0);const m=f.parse(p);let y=f.runSync(m,p);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),Rp(y,v),PD(y,{Fragment:U.Fragment,components:o,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0});function v(g,b,S){if(g.type==="raw"&&S&&typeof b=="number")return u?S.children.splice(b,1):S.children[b]={type:"text",value:g.value},b;if(g.type==="element"){let E;for(E in vp)if(Object.hasOwn(vp,E)&&Object.hasOwn(g.properties,E)){const _=g.properties[E],I=vp[E];(I===null||I.includes(g.tagName))&&(g.properties[E]=h(String(_||""),E,g))}}if(g.type==="element"){let E=t?!t.includes(g.tagName):s?s.includes(g.tagName):!1;if(!E&&n&&typeof b=="number"&&(E=!n(g,b,S)),E&&S&&typeof b=="number")return d&&g.children?S.children.splice(b,1,...g.children):S.children.splice(b,1),b}}}function o2(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||n2.test(e.slice(0,t))?e:""}function s2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function U0(e,t,n){const i=Wl((n||{}).ignore||[]),o=a2(t);let s=-1;for(;++s<o.length;)E0(e,"text",a);function a(l,u){let d=-1,h;for(;++d<u.length;){const f=u[d],p=h?h.children:void 0;if(i(f,p?p.indexOf(f):void 0,h))return;h=f}if(h)return c(l,u)}function c(l,u){const d=u[u.length-1],h=o[s][0],f=o[s][1];let p=0;const y=d.children.indexOf(l);let v=!1,g=[];h.lastIndex=0;let b=h.exec(l.value);for(;b;){const S=b.index,E={index:b.index,input:b.input,stack:[...u,l]};let _=f(...b,E);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?h.lastIndex=S+1:(p!==S&&g.push({type:"text",value:l.value.slice(p,S)}),Array.isArray(_)?g.push(..._):_&&g.push(_),p=S+b[0].length,v=!0),!h.global)break;b=h.exec(l.value)}return v?(p<l.value.length&&g.push({type:"text",value:l.value.slice(p)}),d.children.splice(y,1,...g)):g=[l],y+g.length}}function a2(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([c2(i[0]),l2(i[1])])}return t}function c2(e){return typeof e=="string"?new RegExp(s2(e),"g"):e}function l2(e){return typeof e=="function"?e:function(){return e}}function u2(e){U0(e,[/\r?\n|\r/g,d2])}function d2(){return{type:"break"}}function f2(){return function(e){u2(e)}}function B0(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const zp="phrasing",Zp=["autolink","link","image","label"];function p2(){return{transforms:[w2],enter:{literalAutolink:m2,literalAutolinkEmail:Vp,literalAutolinkHttp:Vp,literalAutolinkWww:Vp},exit:{literalAutolink:b2,literalAutolinkEmail:v2,literalAutolinkHttp:y2,literalAutolinkWww:g2}}}function h2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zp,notInConstruct:Zp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zp,notInConstruct:Zp},{character:":",before:"[ps]",after:"\\/",inConstruct:zp,notInConstruct:Zp}]}}function m2(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vp(e){this.config.enter.autolinkProtocol.call(this,e)}function y2(e){this.config.exit.autolinkProtocol.call(this,e)}function g2(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function v2(e){this.config.exit.autolinkEmail.call(this,e)}function b2(e){this.exit(e)}function w2(e){U0(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,x2],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,_2]],{ignore:["link","linkReference"]})}function x2(e,t,n,r,i){let o="";if(!z0(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!S2(n)))return!1;const s=E2(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function _2(e,t,n,r){return!z0(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function S2(e){const 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])))}function E2(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=B0(e,"(");let o=B0(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function z0(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Ml(n))&&(!t||n!==47)}Z0.peek=N2;function k2(){return{enter:{gfmFootnoteDefinition:T2,gfmFootnoteDefinitionLabelString:A2,gfmFootnoteCall:R2,gfmFootnoteCallString:P2},exit:{gfmFootnoteDefinition:I2,gfmFootnoteDefinitionLabelString:O2,gfmFootnoteCall:D2,gfmFootnoteCallString:$2}}}function C2(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:j2,footnoteReference:Z0}}}function T2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function A2(){this.buffer()}function O2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=xr(this.sliceSerialize(e)).toLowerCase()}function I2(e){this.exit(e)}function R2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function P2(){this.buffer()}function $2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=xr(this.sliceSerialize(e)).toLowerCase()}function D2(e){this.exit(e)}function Z0(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),a(),s(),o+=i.move("]"),o}function N2(){return"["}function j2(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteDefinition"),a=n.enter("label");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),a(),o+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),o+=i.move(n.indentLines(n.containerFlow(e,i.current()),M2)),s(),o}function M2(e,t,n){return t===0?e:(n?"":" ")+e}const q2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];V0.peek=z2;function L2(){return{canContainEols:["delete"],enter:{strikethrough:U2},exit:{strikethrough:B2}}}function F2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:q2}],handlers:{delete:V0}}}function U2(e){this.enter({type:"delete",children:[]},e)}function B2(e){this.exit(e)}function V0(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function z2(){return"~"}function Z2(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||H2,i=[],o=[],s=[],a=[];let c=0,l=-1;for(;++l<e.length;){const p=[],m=[];let y=-1;for(e[l].length>c&&(c=e[l].length);++y<e[l].length;){const v=V2(e[l][y]);if(t.alignDelimiters!==!1){const g=r(v);m[y]=g,(a[y]===void 0||g>a[y])&&(a[y]=g)}p.push(v)}o[l]=p,s[l]=m}let u=-1;if(typeof n=="object"&&"length"in n)for(;++u<c;)i[u]=H0(n[u]);else{const p=H0(n);for(;++u<c;)i[u]=p}u=-1;const d=[],h=[];for(;++u<c;){const p=i[u];let m="",y="";p===99?(m=":",y=":"):p===108?m=":":p===114&&(y=":");let v=t.alignDelimiters===!1?1:Math.max(1,a[u]-m.length-y.length);const g=m+"-".repeat(v)+y;t.alignDelimiters!==!1&&(v=m.length+v+y.length,v>a[u]&&(a[u]=v),h[u]=v),d[u]=g}o.splice(1,0,d),s.splice(1,0,h),l=-1;const f=[];for(;++l<o.length;){const p=o[l],m=s[l];u=-1;const y=[];for(;++u<c;){const v=p[u]||"";let g="",b="";if(t.alignDelimiters!==!1){const S=a[u]-(m[u]||0),E=i[u];E===114?g=" ".repeat(S):E===99?S%2?(g=" ".repeat(S/2+.5),b=" ".repeat(S/2-.5)):(g=" ".repeat(S/2),b=g):b=" ".repeat(S)}t.delimiterStart!==!1&&!u&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||u)&&y.push(" "),t.alignDelimiters!==!1&&y.push(g),y.push(v),t.alignDelimiters!==!1&&y.push(b),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||u!==c-1)&&y.push("|")}f.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return f.join(`
|
|
116
|
+
`},i),o}function DM(e,t){return e&&"run"in e?async function(n,r){const i=C0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return C0(n,{file:r,...t||e})}}function T0(e){if(e)throw e}var Jl=Object.prototype.hasOwnProperty,A0=Object.prototype.toString,O0=Object.defineProperty,I0=Object.getOwnPropertyDescriptor,R0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):A0.call(t)==="[object Array]"},P0=function(t){if(!t||A0.call(t)!=="[object Object]")return!1;var n=Jl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Jl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Jl.call(t,i)},$0=function(t,n){O0&&n.name==="__proto__"?O0(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},D0=function(t,n){if(n==="__proto__")if(Jl.call(t,n)){if(I0)return I0(t,n).value}else return;return t[n]},NM=function e(){var t,n,r,i,o,s,a=arguments[0],c=1,l=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},c=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});c<l;++c)if(t=arguments[c],t!=null)for(n in t)r=D0(a,n),i=D0(t,n),a!==i&&(u&&i&&(P0(i)||(o=R0(i)))?(o?(o=!1,s=r&&R0(r)?r:[]):s=r&&P0(r)?r:{},$0(a,{name:n,newValue:e(u,s,i)})):typeof i<"u"&&$0(a,{name:n,newValue:i}));return a};const $p=mi(NM);function Dp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jM(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(c,...l){const u=e[++o];let d=-1;if(c){s(c);return}for(;++d<i.length;)(l[d]===null||l[d]===void 0)&&(l[d]=i[d]);i=l,u?MM(u,a)(...l):s(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function MM(e,t){let n;return r;function r(...s){const a=e.length>s.length;let c;a&&s.push(i);try{c=e.apply(this,s)}catch(l){const u=l;if(a&&n)throw u;return i(u)}a||(c instanceof Promise?c.then(o,i):c instanceof Error?i(c):o(c))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Pr={basename:qM,dirname:LM,extname:FM,join:UM,sep:"/"};function qM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ua(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function LM(e){if(ua(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function FM(e){ua(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function UM(...e){let t=-1,n;for(;++t<e.length;)ua(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":BM(n)}function BM(e){ua(e);const t=e.codePointAt(0)===47;let n=zM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zM(e,t){let n="",r=0,i=-1,o=0,s=-1,a,c;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function ua(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ZM={cwd:VM};function VM(){return"/"}function Np(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function HM(e){if(typeof e=="string")e=new URL(e);else if(!Np(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return WM(e)}function WM(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const jp=["history","path","basename","stem","extname","dirname"];class N0{constructor(t){let n;t?Np(t)?n={path:t}:typeof t=="string"||KM(t)?n={value:t}:n=t:n={},this.cwd=ZM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<jp.length;){const o=jp[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)jp.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Pr.basename(this.path):void 0}set basename(t){qp(t,"basename"),Mp(t,"basename"),this.path=Pr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Pr.dirname(this.path):void 0}set dirname(t){j0(this.basename,"dirname"),this.path=Pr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Pr.extname(this.path):void 0}set extname(t){if(Mp(t,"extname"),j0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Pr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Np(t)&&(t=HM(t)),qp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Pr.basename(this.path,this.extname):void 0}set stem(t){qp(t,"stem"),Mp(t,"stem"),this.path=Pr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Tn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Mp(e,t){if(e&&e.includes(Pr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Pr.sep+"`")}function qp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function j0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JM=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};Object.setPrototypeOf(o,r);const s=Object.getOwnPropertyNames(i);for(const a of s){const c=Object.getOwnPropertyDescriptor(i,a);c&&Object.defineProperty(o,a,c)}return o},YM={}.hasOwnProperty;class Lp extends JM{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=jM()}copy(){const t=new Lp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($p(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Bp("data",this.frozen),this.namespace[t]=n,this):YM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Yl(t),r=this.parser||this.Parser;return Fp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Fp("process",this.parser||this.Parser),Up("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Yl(t),c=r.parse(a);r.run(c,a,function(u,d,p){if(u||!d||!p)return l(u);const f=d,h=r.stringify(f,p);QM(h)?p.value=h:p.result=h,l(u,p)});function l(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Fp("processSync",this.parser||this.Parser),Up("processSync",this.compiler||this.Compiler),this.process(t,i),q0("processSync","process",n),r;function i(o,s){n=!0,T0(o),r=s}}run(t,n,r){M0(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const c=Yl(n);i.run(t,c,l);function l(u,d,p){const f=d||t;u?a(u):s?s(f):r(void 0,f,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),q0("runSync","run",r),i;function o(s,a){T0(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Yl(n),i=this.compiler||this.Compiler;return Up("stringify",i),M0(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Bp("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(l){if(typeof l=="function")c(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[u,...d]=l;c(u,d)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new 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");a(l.plugins),l.settings&&(i.settings=$p(!0,i.settings,l.settings))}function a(l){let u=-1;if(l!=null)if(Array.isArray(l))for(;++u<l.length;){const d=l[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function c(l,u){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===l){p=d;break}if(p===-1)r.push([l,...u]);else if(u.length>0){let[f,...h]=u;const m=r[p][1];Dp(m)&&Dp(f)&&(f=$p(!0,m,f)),r[p]=[l,f,...h]}}}}const GM=new Lp().freeze();function Fp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Up(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function M0(e){if(!Dp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function q0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Yl(e){return XM(e)?e:new N0(e)}function XM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function QM(e){return typeof e=="string"||e2(e)}function e2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const t2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",L0=[],F0={allowDangerousHtml:!0},n2=/^(https?|ircs?|mailto|xmpp)$/i,r2=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function i2(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||L0,c=e.remarkPlugins||L0,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...F0}:F0,u=e.skipHtml,d=e.unwrapDisallowed,p=e.urlTransform||o2,f=GM().use(Fj).use(c).use(DM,l).use(a),h=new N0;typeof r=="string"&&(h.value=r);for(const v of r2)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+t2+v.id,void 0);const m=f.parse(h);let y=f.runSync(m,h);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),Rp(y,g),PD(y,{Fragment:U.Fragment,components:o,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0});function g(v,b,S){if(v.type==="raw"&&S&&typeof b=="number")return u?S.children.splice(b,1):S.children[b]={type:"text",value:v.value},b;if(v.type==="element"){let E;for(E in vp)if(Object.hasOwn(vp,E)&&Object.hasOwn(v.properties,E)){const _=v.properties[E],I=vp[E];(I===null||I.includes(v.tagName))&&(v.properties[E]=p(String(_||""),E,v))}}if(v.type==="element"){let E=t?!t.includes(v.tagName):s?s.includes(v.tagName):!1;if(!E&&n&&typeof b=="number"&&(E=!n(v,b,S)),E&&S&&typeof b=="number")return d&&v.children?S.children.splice(b,1,...v.children):S.children.splice(b,1),b}}}function o2(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||n2.test(e.slice(0,t))?e:""}function s2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function U0(e,t,n){const i=Wl((n||{}).ignore||[]),o=a2(t);let s=-1;for(;++s<o.length;)E0(e,"text",a);function a(l,u){let d=-1,p;for(;++d<u.length;){const f=u[d],h=p?p.children:void 0;if(i(f,h?h.indexOf(f):void 0,p))return;p=f}if(p)return c(l,u)}function c(l,u){const d=u[u.length-1],p=o[s][0],f=o[s][1];let h=0;const y=d.children.indexOf(l);let g=!1,v=[];p.lastIndex=0;let b=p.exec(l.value);for(;b;){const S=b.index,E={index:b.index,input:b.input,stack:[...u,l]};let _=f(...b,E);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?p.lastIndex=S+1:(h!==S&&v.push({type:"text",value:l.value.slice(h,S)}),Array.isArray(_)?v.push(..._):_&&v.push(_),h=S+b[0].length,g=!0),!p.global)break;b=p.exec(l.value)}return g?(h<l.value.length&&v.push({type:"text",value:l.value.slice(h)}),d.children.splice(y,1,...v)):v=[l],y+v.length}}function a2(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([c2(i[0]),l2(i[1])])}return t}function c2(e){return typeof e=="string"?new RegExp(s2(e),"g"):e}function l2(e){return typeof e=="function"?e:function(){return e}}function u2(e){U0(e,[/\r?\n|\r/g,d2])}function d2(){return{type:"break"}}function f2(){return function(e){u2(e)}}function B0(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const zp="phrasing",Zp=["autolink","link","image","label"];function p2(){return{transforms:[w2],enter:{literalAutolink:m2,literalAutolinkEmail:Vp,literalAutolinkHttp:Vp,literalAutolinkWww:Vp},exit:{literalAutolink:b2,literalAutolinkEmail:v2,literalAutolinkHttp:y2,literalAutolinkWww:g2}}}function h2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zp,notInConstruct:Zp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zp,notInConstruct:Zp},{character:":",before:"[ps]",after:"\\/",inConstruct:zp,notInConstruct:Zp}]}}function m2(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vp(e){this.config.enter.autolinkProtocol.call(this,e)}function y2(e){this.config.exit.autolinkProtocol.call(this,e)}function g2(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function v2(e){this.config.exit.autolinkEmail.call(this,e)}function b2(e){this.exit(e)}function w2(e){U0(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,x2],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,_2]],{ignore:["link","linkReference"]})}function x2(e,t,n,r,i){let o="";if(!z0(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!S2(n)))return!1;const s=E2(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function _2(e,t,n,r){return!z0(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function S2(e){const 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])))}function E2(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=B0(e,"(");let o=B0(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function z0(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Ml(n))&&(!t||n!==47)}Z0.peek=N2;function k2(){return{enter:{gfmFootnoteDefinition:T2,gfmFootnoteDefinitionLabelString:A2,gfmFootnoteCall:R2,gfmFootnoteCallString:P2},exit:{gfmFootnoteDefinition:I2,gfmFootnoteDefinitionLabelString:O2,gfmFootnoteCall:D2,gfmFootnoteCallString:$2}}}function C2(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:j2,footnoteReference:Z0}}}function T2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function A2(){this.buffer()}function O2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=xr(this.sliceSerialize(e)).toLowerCase()}function I2(e){this.exit(e)}function R2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function P2(){this.buffer()}function $2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=xr(this.sliceSerialize(e)).toLowerCase()}function D2(e){this.exit(e)}function Z0(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),a(),s(),o+=i.move("]"),o}function N2(){return"["}function j2(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteDefinition"),a=n.enter("label");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),a(),o+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),o+=i.move(n.indentLines(n.containerFlow(e,i.current()),M2)),s(),o}function M2(e,t,n){return t===0?e:(n?"":" ")+e}const q2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];V0.peek=z2;function L2(){return{canContainEols:["delete"],enter:{strikethrough:U2},exit:{strikethrough:B2}}}function F2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:q2}],handlers:{delete:V0}}}function U2(e){this.enter({type:"delete",children:[]},e)}function B2(e){this.exit(e)}function V0(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function z2(){return"~"}function Z2(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||H2,i=[],o=[],s=[],a=[];let c=0,l=-1;for(;++l<e.length;){const h=[],m=[];let y=-1;for(e[l].length>c&&(c=e[l].length);++y<e[l].length;){const g=V2(e[l][y]);if(t.alignDelimiters!==!1){const v=r(g);m[y]=v,(a[y]===void 0||v>a[y])&&(a[y]=v)}h.push(g)}o[l]=h,s[l]=m}let u=-1;if(typeof n=="object"&&"length"in n)for(;++u<c;)i[u]=H0(n[u]);else{const h=H0(n);for(;++u<c;)i[u]=h}u=-1;const d=[],p=[];for(;++u<c;){const h=i[u];let m="",y="";h===99?(m=":",y=":"):h===108?m=":":h===114&&(y=":");let g=t.alignDelimiters===!1?1:Math.max(1,a[u]-m.length-y.length);const v=m+"-".repeat(g)+y;t.alignDelimiters!==!1&&(g=m.length+g+y.length,g>a[u]&&(a[u]=g),p[u]=g),d[u]=v}o.splice(1,0,d),s.splice(1,0,p),l=-1;const f=[];for(;++l<o.length;){const h=o[l],m=s[l];u=-1;const y=[];for(;++u<c;){const g=h[u]||"";let v="",b="";if(t.alignDelimiters!==!1){const S=a[u]-(m[u]||0),E=i[u];E===114?v=" ".repeat(S):E===99?S%2?(v=" ".repeat(S/2+.5),b=" ".repeat(S/2-.5)):(v=" ".repeat(S/2),b=v):b=" ".repeat(S)}t.delimiterStart!==!1&&!u&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&g==="")&&(t.delimiterStart!==!1||u)&&y.push(" "),t.alignDelimiters!==!1&&y.push(v),y.push(g),t.alignDelimiters!==!1&&y.push(b),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||u!==c-1)&&y.push("|")}f.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return f.join(`
|
|
117
117
|
`)}function V2(e){return e==null?"":String(e)}function H2(e){return e.length}function H0(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function W2(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),K2);return i(),s}function K2(e,t,n){return">"+(n?"":" ")+e}function J2(e,t){return W0(e,t.inConstruct,!0)&&!W0(e,t.notInConstruct,!1)}function W0(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function K0(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
118
118
|
`&&J2(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
119
|
-
`}function Y2(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function G2(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function X2(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Q2(e,t,n,r){const i=X2(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(G2(e,n)){const d=n.enter("codeIndented"),
|
|
119
|
+
`}function Y2(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function G2(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function X2(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Q2(e,t,n,r){const i=X2(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(G2(e,n)){const d=n.enter("codeIndented"),p=n.indentLines(o,eq);return d(),p}const a=n.createTracker(r),c=i.repeat(Math.max(Y2(o,i)+1,3)),l=n.enter("codeFenced");let u=a.move(c);if(e.lang){const d=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
|
|
120
120
|
`,encode:["`"],...a.current()})),d()}return u+=a.move(`
|
|
121
121
|
`),o&&(u+=a.move(o+`
|
|
122
122
|
`)),u+=a.move(c),l(),u}function eq(e,t,n){return(n?"":" ")+e}function Hp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function tq(e,t,n,r){const i=Hp(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const c=n.createTracker(r);let l=c.move("[");return l+=c.move(n.safe(n.associationId(e),{before:l,after:"]",...c.current()})),l+=c.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=c.move("<"),l+=c.move(n.safe(e.url,{before:l,after:">",...c.current()})),l+=c.move(">")):(a=n.enter("destinationRaw"),l+=c.move(n.safe(e.url,{before:l,after:e.title?" ":`
|
|
123
|
-
`,...c.current()}))),a(),e.title&&(a=n.enter(`title${o}`),l+=c.move(" "+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),a()),s(),l}function nq(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}J0.peek=rq;function J0(e,t,n,r){const i=nq(n),o=n.enter("emphasis"),s=n.createTracker(r);let a=s.move(i);return a+=s.move(n.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i),o(),a}function rq(e,t,n){return n.options.emphasis||"*"}function iq(e,t){let n=!1;return Rp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ip}),!!((!e.depth||e.depth<3)&&bp(e)&&(t.options.setext||n))}function oq(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(iq(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),
|
|
123
|
+
`,...c.current()}))),a(),e.title&&(a=n.enter(`title${o}`),l+=c.move(" "+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),a()),s(),l}function nq(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}J0.peek=rq;function J0(e,t,n,r){const i=nq(n),o=n.enter("emphasis"),s=n.createTracker(r);let a=s.move(i);return a+=s.move(n.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i),o(),a}function rq(e,t,n){return n.options.emphasis||"*"}function iq(e,t){let n=!1;return Rp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ip}),!!((!e.depth||e.depth<3)&&bp(e)&&(t.options.setext||n))}function oq(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(iq(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
|
|
124
124
|
`,after:`
|
|
125
|
-
`});return d(),u(),
|
|
126
|
-
`+(i===1?"=":"-").repeat(
|
|
125
|
+
`});return d(),u(),p+`
|
|
126
|
+
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
127
127
|
`))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),c=n.enter("phrasing");o.move(s+" ");let l=n.containerPhrasing(e,{before:"# ",after:`
|
|
128
|
-
`,...o.current()});return/^[\t ]/.test(l)&&(l="&#x"+l.charCodeAt(0).toString(16).toUpperCase()+";"+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),c(),a(),l}Y0.peek=sq;function Y0(e){return e.value||""}function sq(){return"<"}G0.peek=aq;function G0(e,t,n,r){const i=Hp(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const c=n.createTracker(r);let l=c.move("![");return l+=c.move(n.safe(e.alt,{before:l,after:"]",...c.current()})),l+=c.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=c.move("<"),l+=c.move(n.safe(e.url,{before:l,after:">",...c.current()})),l+=c.move(">")):(a=n.enter("destinationRaw"),l+=c.move(n.safe(e.url,{before:l,after:e.title?" ":")",...c.current()}))),a(),e.title&&(a=n.enter(`title${o}`),l+=c.move(" "+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),a()),l+=c.move(")"),s(),l}function aq(){return"!"}X0.peek=cq;function X0(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let c=a.move("![");const l=n.safe(e.alt,{before:c,after:"]",...a.current()});c+=a.move(l+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!l||l!==d?c+=a.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function cq(){return"!"}Q0.peek=lq;function Q0(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let c;if(s.atBreak)for(;c=a.exec(r);){let l=c.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(c.index+1)}}return i+r+i}function lq(){return"`"}function e_(e,t){const n=bp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}t_.peek=uq;function t_(e,t,n,r){const i=Hp(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,c;if(e_(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),a(),n.stack=u,d}a=n.enter("link"),c=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(e,{before:l,after:"](",...s.current()})),l+=s.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(c=n.enter("destinationRaw"),l+=s.move(n.safe(e.url,{before:l,after:e.title?" ":")",...s.current()}))),c(),e.title&&(c=n.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(n.safe(e.title,{before:l,after:i,...s.current()})),l+=s.move(i),c()),l+=s.move(")"),a(),l}function uq(e,t,n){return e_(e,n)?"<":"["}n_.peek=dq;function n_(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let c=a.move("[");const l=n.containerPhrasing(e,{before:c,after:"]",...a.current()});c+=a.move(l+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!l||l!==d?c+=a.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function dq(){return"["}function Wp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fq(e){const t=Wp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function pq(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function r_(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hq(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?pq(n):Wp(n);const a=e.ordered?s==="."?")":".":fq(n);let c=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),r_(n)===s&&u){let d=-1;for(;++d<e.children.length;){const
|
|
129
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:
|
|
130
|
-
`))}function c(f,p,m,y){const v=m.enter("tableCell"),g=m.enter("phrasing"),b=m.containerPhrasing(f,{...y,before:o,after:o});return g(),v(),b}function l(f,p){return Z2(f,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(f,p,m){const y=f.children;let v=-1;const g=[],b=p.enter("table");for(;++v<y.length;)g[v]=d(y[v],p,m);return b(),g}function d(f,p,m){const y=f.children;let v=-1;const g=[],b=p.enter("tableRow");for(;++v<y.length;)g[v]=c(y[v],f,p,m);return b(),g}function h(f,p,m){let y=o_.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Pq(){return{exit:{taskListCheckValueChecked:a_,taskListCheckValueUnchecked:a_,paragraph:Dq}}}function $q(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Nq}}}function a_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Dq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Nq(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let c=o_.listItem(e,t,n,{...r,...a.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(u){return u+s}}function jq(){return[p2(),k2(),L2(),kq(),Pq()]}function Mq(e){return{extensions:[h2(),C2(),F2(),Rq(e),$q()]}}const qq={tokenize:Zq,partial:!0},c_={tokenize:Vq,partial:!0},l_={tokenize:Hq,partial:!0},u_={tokenize:Wq,partial:!0},Lq={tokenize:Kq,partial:!0},d_={tokenize:Bq,previous:p_},f_={tokenize:zq,previous:h_},Qr={tokenize:Uq,previous:m_},$r={};function Fq(){return{text:$r}}let no=48;for(;no<123;)$r[no]=Qr,no++,no===58?no=65:no===91&&(no=97);$r[43]=Qr,$r[45]=Qr,$r[46]=Qr,$r[95]=Qr,$r[72]=[Qr,f_],$r[104]=[Qr,f_],$r[87]=[Qr,d_],$r[119]=[Qr,d_];function Uq(e,t,n){const r=this;let i,o;return s;function s(d){return!Jp(d)||!m_.call(r,r.previous)||Yp(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Jp(d)?(e.consume(d),a):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(Lq,u,l)(d):d===45||d===95||An(d)?(o=!0,e.consume(d),c):u(d)}function l(d){return e.consume(d),i=!0,c}function u(d){return o&&i&&qn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function Bq(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!p_.call(r,r.previous)||Yp(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(qq,e.attempt(c_,e.attempt(l_,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function zq(e,t,n){const r=this;let i="",o=!1;return s;function s(d){return(d===72||d===104)&&h_.call(r,r.previous)&&!Yp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(qn(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),o?l:(o=!0,c)):n(d)}function l(d){return d===null||jl(d)||$t(d)||to(d)||Ml(d)?n(d):e.attempt(c_,e.attempt(l_,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function Zq(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function Vq(e,t,n){let r,i,o;return s;function s(l){return l===46||l===95?e.check(u_,c,a)(l):l===null||$t(l)||to(l)||l!==45&&Ml(l)?c(l):(o=!0,e.consume(l),s)}function a(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),s}function c(l){return i||r||!o?n(l):t(l)}}function Hq(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):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?e.check(u_,t,o)(s):s===null||$t(s)||to(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function Wq(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||$t(a)||to(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||$t(a)||to(a)?t(a):r(a)}function o(a){return qn(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):qn(a)?(e.consume(a),s):n(a)}}function Kq(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return An(o)?n(o):t(o)}}function p_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$t(e)}function h_(e){return!qn(e)}function m_(e){return!(e===47||Jp(e))}function Jp(e){return e===43||e===45||e===46||e===95||An(e)}function Yp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Jq={tokenize:rL,partial:!0};function Yq(){return{document:{91:{tokenize:eL,continuation:{tokenize:tL},exit:nL}},text:{91:{tokenize:Qq},93:{add:"after",tokenize:Gq,resolveTo:Xq}}}}function Gq(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){s=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!s||!s._balanced)return n(c);const l=xr(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Xq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function Qq(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(d){if(o>999||d===93&&!s||d===null||d===91||$t(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(xr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return $t(d)||(s=!0),o++,e.consume(d),d===92?u:l}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,l):l(d)}}function eL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return c;function c(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(s>999||p===93&&!a||p===null||p===91||$t(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return o=xr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return $t(p)||(a=!0),s++,e.consume(p),p===92?d:u}function d(p){return p===91||p===92||p===93?(e.consume(p),s++,u):u(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(o)||i.push(o),St(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function tL(e,t,n){return e.check(aa,t,e.attempt(Jq,t,n))}function nL(e){e.exit("gfmFootnoteDefinition")}function rL(e,t,n){const r=this;return St(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function iL(e){let n=(e||{}).singleTilde;const r={tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let c=-1;for(;++c<s.length;)if(s[c][0]==="enter"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._close){let l=c;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[c][1].end.offset-s[c][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[c][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[c][1].end)},d={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[c][1].start)},h=[["enter",u,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",d,a]],f=a.parser.constructs.insideSpan.null;f&&Gn(h,h.length,0,Ll(f,s.slice(l+1,c),a)),Gn(h,h.length,0,[["exit",d,a],["enter",s[c][1],a],["exit",s[c][1],a],["exit",u,a]]),Gn(s,l-1,c-l+3,h),c=l+h.length-2;break}}for(c=-1;++c<s.length;)s[c][1].type==="strikethroughSequenceTemporary"&&(s[c][1].type="data");return s}function o(s,a,c){const l=this.previous,u=this.events;let d=0;return h;function h(p){return l===126&&u[u.length-1][1].type!=="characterEscape"?c(p):(s.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=ql(l);if(p===126)return d>1?c(p):(s.consume(p),d++,f);if(d<2&&!n)return c(p);const y=s.exit("strikethroughSequenceTemporary"),v=ql(p);return y._open=!v||v===2&&!!m,y._close=!m||m===2&&!!v,a(p)}}}class oL{constructor(){this.map=[]}add(t,n,r){sL(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function sL(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function aL(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function cL(){return{flow:{null:{tokenize:lL,resolveAll:uL}}}}function lL(e,t,n){const r=this;let i=0,o=0,s;return a;function a(O){let q=r.events.length-1;for(;q>-1;){const F=r.events[q][1].type;if(F==="lineEnding"||F==="linePrefix")q--;else break}const H=q>-1?r.events[q][1].type:null,B=H==="tableHead"||H==="tableRow"?_:c;return B===_&&r.parser.lazy[r.now().line]?n(O):B(O)}function c(O){return e.enter("tableHead"),e.enter("tableRow"),l(O)}function l(O){return O===124||(s=!0,o+=1),u(O)}function u(O){return O===null?n(O):We(O)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),f):n(O):yt(O)?St(e,u,"whitespace")(O):(o+=1,s&&(s=!1,i+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||$t(O)?(e.exit("data"),u(O)):(e.consume(O),O===92?h:d)}function h(O){return O===92||O===124?(e.consume(O),d):d(O)}function f(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),s=!1,yt(O)?St(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):p(O))}function p(O){return O===45||O===58?y(O):O===124?(s=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),m):E(O)}function m(O){return yt(O)?St(e,y,"whitespace")(O):y(O)}function y(O){return O===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),v):O===45?(o+=1,v(O)):O===null||We(O)?S(O):E(O)}function v(O){return O===45?(e.enter("tableDelimiterFiller"),g(O)):E(O)}function g(O){return O===45?(e.consume(O),g):O===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(O))}function b(O){return yt(O)?St(e,S,"whitespace")(O):S(O)}function S(O){return O===124?p(O):O===null||We(O)?!s||i!==o?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):E(O)}function E(O){return n(O)}function _(O){return e.enter("tableRow"),I(O)}function I(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),I):O===null||We(O)?(e.exit("tableRow"),t(O)):yt(O)?St(e,I,"whitespace")(O):(e.enter("data"),P(O))}function P(O){return O===null||O===124||$t(O)?(e.exit("data"),I(O)):(e.consume(O),O===92?$:P)}function $(O){return O===92||O===124?(e.consume(O),P):P(O)}}function uL(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,c=0,l,u,d;const h=new oL;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(a=!1,c!==0&&(y_(h,t,c,l,u),u=void 0,c=0),l={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",l,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",u,t]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=Gl(h,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=Gl(h,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):p.type==="tableHead"?(a=!0,c=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(c=n,o[1]!==0?(s[0]=s[1],d=Gl(h,t,o,i,n,d)):s[1]!==0&&(d=Gl(h,t,s,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(c!==0&&y_(h,t,c,l,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=aL(t.events,n))}return e}function Gl(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Ko(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const c=Ko(t.events,n[1]);if(o={type:s,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const l=Ko(t.events,n[2]),u=Ko(t.events,n[3]),d={type:a,start:Object.assign({},l),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},Ko(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function y_(e,t,n,r,i){const o=[],s=Ko(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Ko(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const dL={tokenize:pL};function fL(){return{text:{91:dL}}}function pL(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return $t(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),s):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),s):n(c)}function s(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(c)}function a(c){return We(c)?t(c):yt(c)?e.check({tokenize:hL},t,n)(c):n(c)}}function hL(e,t,n){return St(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function mL(e){return Vx([Fq(),Yq(),iL(e),cL(),fL()])}const yL={};function gL(e){const t=this,n=e||yL,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(mL(n)),o.push(jq()),s.push(Mq(n))}const vL=({text:e,type:t,styles:n})=>{const r=n==null?void 0:n[t],i={h1:({node:o,...s})=>U.jsx("h1",{...s,...r==null?void 0:r.heading1}),h2:({node:o,...s})=>U.jsx("h2",{...s,...r==null?void 0:r.heading2}),h3:({node:o,...s})=>U.jsx("h3",{...s,...r==null?void 0:r.heading3}),h4:"h3",h5:"h3",h6:"h3",em:({node:o,...s})=>U.jsx("em",{...s,...r==null?void 0:r.italic}),strong:({node:o,...s})=>U.jsx("strong",{...s,...r==null?void 0:r.bold}),p:({node:o,...s})=>U.jsx("p",{...s,...r==null?void 0:r.text}),hr:({node:o,...s})=>U.jsx("hr",{...s,...r==null?void 0:r.horizontalRule}),a:({node:o,...s})=>U.jsx("a",{...s,...r==null?void 0:r.link,target:"_blank"}),ol:({node:o,...s})=>U.jsx("ol",{...s,...r==null?void 0:r.orderedList}),ul:({node:o,...s})=>U.jsx("ul",{...s,...r==null?void 0:r.unorderedList}),li:({node:o,...s})=>U.jsx("li",{...s,...r==null?void 0:r.listItem}),br:({node:o,...s})=>U.jsx("br",{...s,...r==null?void 0:r.lineBreak}),img:()=>null,pre:({node:o,...s})=>U.jsx("pre",{...s,...r==null?void 0:r.pre})};return U.jsx(i2,{components:i,remarkPlugins:[gL,f2],children:e})},bL=(e,t,n=120)=>{w.useEffect(()=>{if(e){e.style.height="0px";const r=t?Math.min(e.scrollHeight,n):20;e.style.height=`${r}px`}},[e,t])};var g_={},Gp={},v_={};Object.defineProperty(v_,"__esModule",{value:!0});var Xl={},wL=tt&&tt.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.Emitter=void 0;let xL=class{constructor(){this.listeners={}}on(t,n,r=!1){const i=this.listeners[t];i?r?i.unshift(n):i.push(n):this.listeners[t]=[n]}emit(t,n){return wL(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}};Xl.Emitter=xL;var b_={};Object.defineProperty(b_,"__esModule",{value:!0});var w_={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HealthEventType=void 0,function(t){t.Create="create",t.Configure="configure",t.Start="start",t.StartFailure="start-failure",t.Initialize="initialize",t.InitializeFailure="initialize-failure",t.Sleep="sleep",t.Delete="delete"}(e.HealthEventType||(e.HealthEventType={}))})(w_);var x_={};Object.defineProperty(x_,"__esModule",{value:!0});var __={};Object.defineProperty(__,"__esModule",{value:!0});var S_={};Object.defineProperty(S_,"__esModule",{value:!0});var E_={};Object.defineProperty(E_,"__esModule",{value:!0}),function(e){var t=tt&&tt.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o),Object.defineProperty(r,s,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=tt&&tt.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(v_,e),n(Xl,e),n(b_,e),n(w_,e),n(x_,e),n(__,e),n(S_,e),n(E_,e)}(Gp);var Ql={},k_={},Xp={exports:{}},eu={},Qp={},tu={},da={},Jo={},ro={},Yo={},Go={},Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.ERROR_PACKET=Dr.PACKET_TYPES_REVERSE=Dr.PACKET_TYPES=void 0;const Nr=Object.create(null);Dr.PACKET_TYPES=Nr,Nr.open="0",Nr.close="1",Nr.ping="2",Nr.pong="3",Nr.message="4",Nr.upgrade="5",Nr.noop="6";const C_=Object.create(null);Dr.PACKET_TYPES_REVERSE=C_,Object.keys(Nr).forEach(e=>{C_[Nr[e]]=e});const _L={type:"error",data:"parser error"};Dr.ERROR_PACKET=_L,Object.defineProperty(Go,"__esModule",{value:!0}),Go.encodePacket=Go.encodePacketToBinary=void 0;const SL=Dr,T_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",A_=typeof ArrayBuffer=="function",O_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,I_=({type:e,data:t},n,r)=>T_&&t instanceof Blob?n?r(t):R_(t,r):A_&&(t instanceof ArrayBuffer||O_(t))?n?r(t):R_(new Blob([t]),r):r(SL.PACKET_TYPES[e]+(t||""));Go.encodePacket=I_;const R_=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function P_(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let eh;function EL(e,t){if(T_&&e.data instanceof Blob)return e.data.arrayBuffer().then(P_).then(t);if(A_&&(e.data instanceof ArrayBuffer||O_(e.data)))return t(P_(e.data));I_(e,!1,n=>{eh||(eh=new TextEncoder),t(eh.encode(n))})}Go.encodePacketToBinary=EL;var nu={},Xo={};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.decode=Xo.encode=void 0;const Qo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Qo.length;e++)fa[Qo.charCodeAt(e)]=e;const kL=e=>{let t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Qo[t[n]>>2],i+=Qo[(t[n]&3)<<4|t[n+1]>>4],i+=Qo[(t[n+1]&15)<<2|t[n+2]>>6],i+=Qo[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};Xo.encode=kL;const CL=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)o=fa[e.charCodeAt(r)],s=fa[e.charCodeAt(r+1)],a=fa[e.charCodeAt(r+2)],c=fa[e.charCodeAt(r+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|c&63;return l};Xo.decode=CL,Object.defineProperty(nu,"__esModule",{value:!0}),nu.decodePacket=void 0;const ru=Dr,TL=Xo,AL=typeof ArrayBuffer=="function",OL=(e,t)=>{if(typeof e!="string")return{type:"message",data:$_(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:IL(e.substring(1),t)}:ru.PACKET_TYPES_REVERSE[n]?e.length>1?{type:ru.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:ru.PACKET_TYPES_REVERSE[n]}:ru.ERROR_PACKET};nu.decodePacket=OL;const IL=(e,t)=>{if(AL){const n=(0,TL.decode)(e);return $_(n,t)}else return{base64:!0,data:e}},$_=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const t=Go;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=nu;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=Dr,i=String.fromCharCode(30),o=(h,f)=>{const p=h.length,m=new Array(p);let y=0;h.forEach((v,g)=>{(0,t.encodePacket)(v,!1,b=>{m[g]=b,++y===p&&f(m.join(i))})})};e.encodePayload=o;const s=(h,f)=>{const p=h.split(i),m=[];for(let y=0;y<p.length;y++){const v=(0,n.decodePacket)(p[y],f);if(m.push(v),v.type==="error")break}return m};e.decodePayload=s;function a(){return new TransformStream({transform(h,f){(0,t.encodePacketToBinary)(h,p=>{const m=p.length;let y;if(m<126)y=new Uint8Array(1),new DataView(y.buffer).setUint8(0,m);else if(m<65536){y=new Uint8Array(3);const v=new DataView(y.buffer);v.setUint8(0,126),v.setUint16(1,m)}else{y=new Uint8Array(9);const v=new DataView(y.buffer);v.setUint8(0,127),v.setBigUint64(1,BigInt(m))}h.data&&typeof h.data!="string"&&(y[0]|=128),f.enqueue(y),f.enqueue(p)})}})}e.createPacketEncoderStream=a;let c;function l(h){return h.reduce((f,p)=>f+p.length,0)}function u(h,f){if(h[0].length===f)return h.shift();const p=new Uint8Array(f);let m=0;for(let y=0;y<f;y++)p[y]=h[0][m++],m===h[0].length&&(h.shift(),m=0);return h.length&&m<h[0].length&&(h[0]=h[0].slice(m)),p}function d(h,f){c||(c=new TextDecoder);const p=[];let m=0,y=-1,v=!1;return new TransformStream({transform(g,b){for(p.push(g);;){if(m===0){if(l(p)<1)break;const S=u(p,1);v=(S[0]&128)===128,y=S[0]&127,y<126?m=3:y===126?m=1:m=2}else if(m===1){if(l(p)<2)break;const S=u(p,2);y=new DataView(S.buffer,S.byteOffset,S.length).getUint16(0),m=3}else if(m===2){if(l(p)<8)break;const S=u(p,8),E=new DataView(S.buffer,S.byteOffset,S.length),_=E.getUint32(0);if(_>Math.pow(2,53-32)-1){b.enqueue(r.ERROR_PACKET);break}y=_*Math.pow(2,32)+E.getUint32(4),m=3}else{if(l(p)<y)break;const S=u(p,y);b.enqueue((0,n.decodePacket)(v?S:c.decode(S),f)),m=0}if(y===0||y>h){b.enqueue(r.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=d,e.protocol=4})(Yo);function Ln(e){if(e)return RL(e)}function RL(e){for(var t in Ln.prototype)e[t]=Ln.prototype[t];return e}Ln.prototype.on=Ln.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Ln.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Ln.prototype.off=Ln.prototype.removeListener=Ln.prototype.removeAllListeners=Ln.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},Ln.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},Ln.prototype.emitReserved=Ln.prototype.emit,Ln.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Ln.prototype.hasListeners=function(e){return!!this.listeners(e).length};const es=zd(Object.freeze(Object.defineProperty({__proto__:null,Emitter:Ln},Symbol.toStringTag,{value:"Module"})));var dr={},io={};Object.defineProperty(io,"__esModule",{value:!0}),io.globalThisShim=void 0,io.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Object.defineProperty(dr,"__esModule",{value:!0}),dr.byteLength=dr.installTimerFunctions=dr.pick=void 0;const _i=io;function PL(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}dr.pick=PL;const $L=_i.globalThisShim.setTimeout,DL=_i.globalThisShim.clearTimeout;function NL(e,t){t.useNativeTimers?(e.setTimeoutFn=$L.bind(_i.globalThisShim),e.clearTimeoutFn=DL.bind(_i.globalThisShim)):(e.setTimeoutFn=_i.globalThisShim.setTimeout.bind(_i.globalThisShim),e.clearTimeoutFn=_i.globalThisShim.clearTimeout.bind(_i.globalThisShim))}dr.installTimerFunctions=NL;const jL=1.33;function ML(e){return typeof e=="string"?qL(e):Math.ceil((e.byteLength||e.size)*jL)}dr.byteLength=ML;function qL(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}var th={exports:{}},nh,D_;function LL(){if(D_)return nh;D_=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,o=r*365.25;nh=function(u,d){d=d||{};var h=typeof u;if(h==="string"&&u.length>0)return s(u);if(h==="number"&&isFinite(u))return d.long?c(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function s(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var h=parseFloat(d[1]),f=(d[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return h*o;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*r;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function c(u){var d=Math.abs(u);return d>=r?l(u,d,r,"day"):d>=n?l(u,d,n,"hour"):d>=t?l(u,d,t,"minute"):d>=e?l(u,d,e,"second"):u+" ms"}function l(u,d,h,f){var p=d>=h*1.5;return Math.round(u/h)+" "+f+(p?"s":"")}return nh}function FL(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=LL(),n.destroy=l,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,h=null,f,p;function m(...y){if(!m.enabled)return;const v=m,g=Number(new Date),b=g-(d||g);v.diff=b,v.prev=d,v.curr=g,d=g,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let S=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(_,I)=>{if(_==="%%")return"%";S++;const P=n.formatters[I];if(typeof P=="function"){const $=y[S];_=P.call(v,$),y.splice(S,1),S--}return _}),n.formatArgs.call(v,y),(v.log||n.log).apply(v,y)}return m.namespace=u,m.useColors=n.useColors(),m.color=n.selectColor(u),m.extend=r,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(f!==n.namespaces&&(f=n.namespaces,p=n.enabled(u)),p),set:y=>{h=y}}),typeof n.init=="function"&&n.init(m),m}function r(u,d){const h=n(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const h=(typeof u=="string"?u:"").split(/[\s,]+/),f=h.length;for(d=0;d<f;d++)h[d]&&(u=h[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(a),...n.skips.map(a).map(d=>"-"+d)].join(",");return n.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let d,h;for(d=0,h=n.skips.length;d<h;d++)if(n.skips[d].test(u))return!1;for(d=0,h=n.names.length;d<h;d++)if(n.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var UL=FL;(function(e,t){t.formatArgs=r,t.save=i,t.load=o,t.useColors=n,t.storage=s(),t.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let u=0,d=0;c[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(u++,h==="%c"&&(d=u))}),c.splice(d,0,l)}t.log=console.debug||console.log||(()=>{});function i(c){try{c?t.storage.setItem("debug",c):t.storage.removeItem("debug")}catch{}}function o(){let c;try{c=t.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function s(){try{return localStorage}catch{}}e.exports=UL(t);const{formatters:a}=e.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(th,th.exports);var jr=th.exports,oo={};Object.defineProperty(oo,"__esModule",{value:!0}),oo.decode=oo.encode=void 0;function BL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}oo.encode=BL;function zL(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}oo.decode=zL;var ZL=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ro,"__esModule",{value:!0}),ro.Transport=void 0;const VL=Yo,HL=es,WL=dr,KL=ZL(jr),JL=oo,YL=(0,KL.default)("engine.io-client:transport");class GL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class XL extends HL.Emitter{constructor(t){super(),this.writable=!1,(0,WL.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new GL(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"?this.write(t):YL("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=(0,VL.decodePacket)(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=(0,JL.encode)(t);return n.length?"?"+n:""}}ro.Transport=XL;var ei={};Object.defineProperty(ei,"__esModule",{value:!0}),ei.yeast=ei.decode=ei.encode=void 0;const N_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),iu=64,j_={};let M_=0,Si=0,q_;function rh(e){let t="";do t=N_[e%iu]+t,e=Math.floor(e/iu);while(e>0);return t}ei.encode=rh;function QL(e){let t=0;for(Si=0;Si<e.length;Si++)t=t*iu+j_[e.charAt(Si)];return t}ei.decode=QL;function eF(){const e=rh(+new Date);return e!==q_?(M_=0,q_=e):e+"."+rh(M_++)}for(ei.yeast=eF;Si<iu;Si++)j_[N_[Si]]=Si;var ts={},ou={};Object.defineProperty(ou,"__esModule",{value:!0}),ou.hasCORS=void 0;let L_=!1;try{L_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}ou.hasCORS=L_,Object.defineProperty(ts,"__esModule",{value:!0}),ts.createCookieJar=ts.XHR=void 0;const tF=ou,nF=io;function rF(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||tF.hasCORS))return new XMLHttpRequest}catch{}if(!t)try{return new nF.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}ts.XHR=rF;function iF(){}ts.createCookieJar=iF;var oF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.Request=Jo.Polling=void 0;const sF=ro,aF=oF(jr),cF=ei,F_=Yo,ih=ts,lF=es,U_=dr,uF=io,zn=(0,aF.default)("engine.io-client:polling");function dF(){}const fF=function(){return new ih.XHR({xdomain:!1}).responseType!=null}();class pF extends sF.Transport{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=fF&&!n,this.opts.withCredentials&&(this.cookieJar=(0,ih.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{zn("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(zn("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){zn("pre-pause polling complete"),--r||n()})),this.writable||(zn("we are currently writing - waiting to pause"),r++,this.once("drain",function(){zn("pre-pause writing complete"),--r||n()}))}else n()}poll(){zn("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){zn("polling got data %s",t);const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};(0,F_.decodePayload)(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():zn('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{zn("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(zn("transport open - closing"),t()):(zn("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,F_.encodePayload)(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=(0,cF.yeast)()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new so(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){zn("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}Jo.Polling=pF;let so=class Bd extends lF.Emitter{constructor(t,n){super(),(0,U_.installTimerFunctions)(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=(0,U_.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new ih.XHR(n);try{zn("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},zn("xhr data %s",this.data),r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Bd.requestsCount++,Bd.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=dF,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Bd.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};if(Jo.Request=so,so.requestsCount=0,so.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",B_);else if(typeof addEventListener=="function"){const e="onpagehide"in uF.globalThisShim?"pagehide":"unload";addEventListener(e,B_,!1)}}function B_(){for(let e in so.requests)so.requests.hasOwnProperty(e)&&so.requests[e].abort()}var su={},Xn={};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.defaultBinaryType=Xn.usingBrowserWebSocket=Xn.WebSocket=Xn.nextTick=void 0;const z_=io;Xn.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Xn.WebSocket=z_.globalThisShim.WebSocket||z_.globalThisShim.MozWebSocket,Xn.usingBrowserWebSocket=!0,Xn.defaultBinaryType="arraybuffer";var hF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(su,"__esModule",{value:!0}),su.WS=void 0;const mF=ro,yF=ei,gF=dr,Ei=Xn,vF=hF(jr),bF=Yo,wF=(0,vF.default)("engine.io-client:websocket"),Z_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xF extends mF.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=Z_?{}:(0,gF.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Ei.usingBrowserWebSocket&&!Z_?n?new Ei.WebSocket(t,n):new Ei.WebSocket(t):new Ei.WebSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;(0,bF.encodePacket)(r,this.supportsBinary,o=>{const s={};Ei.usingBrowserWebSocket||(r.options&&(s.compress=r.options.compress),this.opts.perMessageDeflate&&(typeof o=="string"?Buffer.byteLength(o):o.length)<this.opts.perMessageDeflate.threshold&&(s.compress=!1));try{Ei.usingBrowserWebSocket?this.ws.send(o):this.ws.send(o,s)}catch{wF("websocket closed before onclose event")}i&&(0,Ei.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=(0,yF.yeast)()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Ei.WebSocket}}su.WS=xF;var au={},_F=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(au,"__esModule",{value:!0}),au.WT=void 0;const SF=ro,EF=Xn,V_=Yo,pa=(0,_F(jr).default)("engine.io-client:webtransport");class kF extends SF.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{pa("transport closed gracefully"),this.onClose()}).catch(t=>{pa("transport closed due to %s",t),this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=(0,V_.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=(0,V_.createPacketEncoderStream)();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:c})=>{if(a){pa("session is closed");return}pa("received chunk: %o",c),this.onPacket(c),o()}).catch(a=>{pa("an error occurred while reading: %s",a)})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&(0,EF.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}au.WT=kF,Object.defineProperty(da,"__esModule",{value:!0}),da.transports=void 0;const CF=Jo,TF=su,AF=au;da.transports={websocket:TF.WS,webtransport:AF.WT,polling:CF.Polling};var ha={};Object.defineProperty(ha,"__esModule",{value:!0}),ha.parse=void 0;const OF=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IF=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function RF(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=OF.exec(e||""),o={},s=14;for(;s--;)o[IF[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=PF(o,o.path),o.queryKey=$F(o,o.query),o}ha.parse=RF;function PF(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function $F(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}var DF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tu,"__esModule",{value:!0}),tu.Socket=void 0;const NF=da,H_=dr,jF=oo,W_=ha,MF=DF(jr),qF=es,K_=Yo,LF=Xn,Ut=(0,MF.default)("engine.io-client:socket");let J_=class Ps extends qF.Emitter{constructor(t,n={}){super(),this.binaryType=LF.defaultBinaryType,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=(0,W_.parse)(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=(0,W_.parse)(n.host).host),(0,H_.installTimerFunctions)(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,jF.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){Ut('creating transport "%s"',t);const n=Object.assign({},this.opts.query);n.EIO=K_.protocol,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return Ut("options: %j",r),new NF.transports[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Ps.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){Ut("error while creating transport: %s",n),this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){Ut("setting transport %s",t.name),this.transport&&(Ut("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){Ut('probing transport "%s"',t);let n=this.createTransport(t),r=!1;Ps.priorWebsocketSuccess=!1;const i=()=>{r||(Ut('probe transport "%s" opened',t),n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(Ut('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ps.priorWebsocketSuccess=n.name==="websocket",Ut('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{r||this.readyState!=="closed"&&(Ut("changing transport and sending upgrade packet"),u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{Ut('probe transport "%s" failed',t);const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,o(),Ut('probe transport "%s" failed because of error: %s',t,d),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function c(){s("socket closed")}function l(d){n&&d.name!==n.name&&(Ut('"%s" works - aborting "%s"',d.name,n.name),o())}const u=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",l),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(Ut("socket open"),this.readyState="open",Ps.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){Ut("starting upgrade probes");let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(Ut('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}else Ut('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();Ut("flushing %d packets in socket",t.length),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=(0,H_.byteLength)(i)),r>0&&n>this.maxPayload)return Ut("only send %d out of %d packets",r,this.writeBuffer.length),this.writeBuffer.slice(0,r);n+=2}return Ut("payload size is %d (max: %d)",n,this.maxPayload),this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),Ut("socket closing - telling transport to close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Ut("socket error %j",t),Ps.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(Ut('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};tu.Socket=J_,J_.protocol=K_.protocol,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const t=tu;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return t.Socket}}),e.protocol=t.Socket.protocol;var n=ro;Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return n.Transport}});var r=da;Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return r.transports}});var i=dr;Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var o=ha;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return o.parse}});var s=Xn;Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return s.nextTick}})}(Qp);var FF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(eu,"__esModule",{value:!0}),eu.url=void 0;const UF=Qp,Y_=FF(jr).default("socket.io-client:url");function BF(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(Y_("protocol-less url %s",e),typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),Y_("parse %s",e),r=UF.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}eu.url=BF;var cu={},ma={},lu={},ns={},ao={};Object.defineProperty(ao,"__esModule",{value:!0}),ao.hasBinary=ao.isBinary=void 0;const zF=typeof ArrayBuffer=="function",ZF=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,G_=Object.prototype.toString,VF=typeof Blob=="function"||typeof Blob<"u"&&G_.call(Blob)==="[object BlobConstructor]",HF=typeof File=="function"||typeof File<"u"&&G_.call(File)==="[object FileConstructor]";function X_(e){return zF&&(e instanceof ArrayBuffer||ZF(e))||VF&&e instanceof Blob||HF&&e instanceof File}ao.isBinary=X_;function uu(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(uu(e[n]))return!0;return!1}if(X_(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return uu(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&uu(e[n]))return!0;return!1}ao.hasBinary=uu,Object.defineProperty(ns,"__esModule",{value:!0}),ns.reconstructPacket=ns.deconstructPacket=void 0;const WF=ao;function KF(e){const t=[],n=e.data,r=e;return r.data=oh(n,t),r.attachments=t.length,{packet:r,buffers:t}}ns.deconstructPacket=KF;function oh(e,t){if(!e)return e;if((0,WF.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=oh(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=oh(e[r],t));return n}return e}function JF(e,t){return e.data=sh(e.data,t),delete e.attachments,e}ns.reconstructPacket=JF;function sh(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=sh(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=sh(e[n],t));return e}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=es,n=ns,r=ao,o=(0,jr.default)("socket.io-parser"),s=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var a;(function(h){h[h.CONNECT=0]="CONNECT",h[h.DISCONNECT=1]="DISCONNECT",h[h.EVENT=2]="EVENT",h[h.ACK=3]="ACK",h[h.CONNECT_ERROR=4]="CONNECT_ERROR",h[h.BINARY_EVENT=5]="BINARY_EVENT",h[h.BINARY_ACK=6]="BINARY_ACK"})(a=e.PacketType||(e.PacketType={}));class c{constructor(f){this.replacer=f}encode(f){return o("encoding packet %j",f),(f.type===a.EVENT||f.type===a.ACK)&&(0,r.hasBinary)(f)?this.encodeAsBinary({type:f.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:f.nsp,data:f.data,id:f.id}):[this.encodeAsString(f)]}encodeAsString(f){let p=""+f.type;return(f.type===a.BINARY_EVENT||f.type===a.BINARY_ACK)&&(p+=f.attachments+"-"),f.nsp&&f.nsp!=="/"&&(p+=f.nsp+","),f.id!=null&&(p+=f.id),f.data!=null&&(p+=JSON.stringify(f.data,this.replacer)),o("encoded %j as %s",f,p),p}encodeAsBinary(f){const p=(0,n.deconstructPacket)(f),m=this.encodeAsString(p.packet),y=p.buffers;return y.unshift(m),y}}e.Encoder=c;function l(h){return Object.prototype.toString.call(h)==="[object Object]"}class u extends t.Emitter{constructor(f){super(),this.reviver=f}add(f){let p;if(typeof f=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");p=this.decodeString(f);const m=p.type===a.BINARY_EVENT;m||p.type===a.BINARY_ACK?(p.type=m?a.EVENT:a.ACK,this.reconstructor=new d(p),p.attachments===0&&super.emitReserved("decoded",p)):super.emitReserved("decoded",p)}else if((0,r.isBinary)(f)||f.base64)if(this.reconstructor)p=this.reconstructor.takeBinaryData(f),p&&(this.reconstructor=null,super.emitReserved("decoded",p));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+f)}decodeString(f){let p=0;const m={type:Number(f.charAt(0))};if(a[m.type]===void 0)throw new Error("unknown packet type "+m.type);if(m.type===a.BINARY_EVENT||m.type===a.BINARY_ACK){const v=p+1;for(;f.charAt(++p)!=="-"&&p!=f.length;);const g=f.substring(v,p);if(g!=Number(g)||f.charAt(p)!=="-")throw new Error("Illegal attachments");m.attachments=Number(g)}if(f.charAt(p+1)==="/"){const v=p+1;for(;++p&&!(f.charAt(p)===","||p===f.length););m.nsp=f.substring(v,p)}else m.nsp="/";const y=f.charAt(p+1);if(y!==""&&Number(y)==y){const v=p+1;for(;++p;){const g=f.charAt(p);if(g==null||Number(g)!=g){--p;break}if(p===f.length)break}m.id=Number(f.substring(v,p+1))}if(f.charAt(++p)){const v=this.tryParse(f.substr(p));if(u.isPayloadValid(m.type,v))m.data=v;else throw new Error("invalid payload")}return o("decoded %s as %j",f,m),m}tryParse(f){try{return JSON.parse(f,this.reviver)}catch{return!1}}static isPayloadValid(f,p){switch(f){case a.CONNECT:return l(p);case a.DISCONNECT:return p===void 0;case a.CONNECT_ERROR:return typeof p=="string"||l(p);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(p)&&(typeof p[0]=="number"||typeof p[0]=="string"&&s.indexOf(p[0])===-1);case a.ACK:case a.BINARY_ACK:return Array.isArray(p)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=u;class d{constructor(f){this.packet=f,this.buffers=[],this.reconPack=f}takeBinaryData(f){if(this.buffers.push(f),this.buffers.length===this.reconPack.attachments){const p=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),p}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}})(lu);var ya={};Object.defineProperty(ya,"__esModule",{value:!0}),ya.on=void 0;function YF(e,t,n){return e.on(t,n),function(){e.off(t,n)}}ya.on=YF;var GF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ma,"__esModule",{value:!0}),ma.Socket=void 0;const _r=lu,du=ya,XF=es,on=GF(jr).default("socket.io-client:socket"),QF=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class e3 extends XF.Emitter{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[du.on(t,"open",this.onopen.bind(this)),du.on(t,"packet",this.onpacket.bind(this)),du.on(t,"error",this.onerror.bind(this)),du.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(QF.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:_r.PacketType.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++;on("emitting packet with ack id %d",s);const a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)?on("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&(on("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(s,1));on("event with ack id %d has timed out after %d ms",t,i),n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...s)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(on("packet [%d] is discarded after %d tries",r.id,r.tryCount),this._queue.shift(),n&&n(i)):(on("packet [%d] was successfully sent",r.id),this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(on("draining queue"),!this.connected||this._queue.length===0)return;const n=this._queue[0];if(n.pending&&!t){on("packet [%d] has already been sent and is waiting for an ack",n.id);return}n.pending=!0,n.tryCount++,on("sending packet [%d] (try n°%d)",n.id,n.tryCount),this.flags=n.flags,this.emit.apply(this,n.args)}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){on("transport is open - connecting"),typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_r.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){on("close (%s)",t),this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _r.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _r.PacketType.EVENT:case _r.PacketType.BINARY_EVENT:this.onevent(t);break;case _r.PacketType.ACK:case _r.PacketType.BINARY_ACK:this.onack(t);break;case _r.PacketType.DISCONNECT:this.ondisconnect();break;case _r.PacketType.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];on("emitting event %j",n),t.id!=null&&(on("attaching ack callback to event"),n.push(this.ack(t.id))),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,on("sending ack %j",i),n.packet({type:_r.PacketType.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"?(on("calling ack %s with %j",t.id,t.data),n.apply(this,t.data),delete this.acks[t.id]):on("bad ack %s",t.id)}onconnect(t,n){on("socket connected with id %s",t),this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){on("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(on("performing disconnect (%s)",this.nsp),this.packet({type:_r.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}ma.Socket=e3;var fu={};Object.defineProperty(fu,"__esModule",{value:!0}),fu.Backoff=void 0;function rs(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}fu.Backoff=rs,rs.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},rs.prototype.reset=function(){this.attempts=0},rs.prototype.setMin=function(e){this.ms=e},rs.prototype.setMax=function(e){this.max=e},rs.prototype.setJitter=function(e){this.jitter=e};var t3=tt&&tt.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),n3=tt&&tt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r3=tt&&tt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&t3(t,e,n);return n3(t,e),t},i3=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cu,"__esModule",{value:!0}),cu.Manager=void 0;const ah=Qp,o3=ma,s3=r3(lu),co=ya,a3=fu,c3=es,wn=i3(jr).default("socket.io-client:manager");class l3 extends c3.Emitter{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ah.installTimerFunctions(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new a3.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||s3;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(wn("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;wn("opening %s",this.uri),this.engine=new ah.Socket(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=co.on(n,"open",function(){r.onopen(),t&&t()}),o=a=>{wn("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=co.on(n,"error",o);if(this._timeout!==!1){const a=this._timeout;wn("connect attempt will timeout after %d",a);const c=this.setTimeoutFn(()=>{wn("connect attempt timed out after %d",a),i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){wn("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(co.on(t,"ping",this.onping.bind(this)),co.on(t,"data",this.ondata.bind(this)),co.on(t,"error",this.onerror.bind(this)),co.on(t,"close",this.onclose.bind(this)),co.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){ah.nextTick(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){wn("error",t),this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new o3.Socket(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active){wn("socket %s is still active, skipping close",r);return}this._close()}_packet(t){wn("writing packet %j",t);const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){wn("cleanup"),this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){wn("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){wn("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)wn("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();wn("will wait %dms before reconnect attempt",n),this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(wn("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(wn("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):(wn("reconnect success"),t.onreconnect())}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}cu.Manager=l3,function(e,t){var n=tt&&tt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=eu,i=cu;Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const o=ma;Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return o.Socket}});const a=n(jr).default("socket.io-client"),c={};function l(d,h){typeof d=="object"&&(h=d,d=void 0),h=h||{};const f=r.url(d,h.path||"/socket.io"),p=f.source,m=f.id,y=f.path,v=c[m]&&y in c[m].nsps,g=h.forceNew||h["force new connection"]||h.multiplex===!1||v;let b;return g?(a("ignoring socket cache for %s",p),b=new i.Manager(p,h)):(c[m]||(a("new io instance for %s",p),c[m]=new i.Manager(p,h)),b=c[m]),f.query&&!h.query&&(h.query=f.queryKey),b.socket(f.path,h)}t.io=l,t.connect=l,t.default=l,Object.assign(l,{Manager:i.Manager,Socket:o.Socket,io:l,connect:l});var u=lu;Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return u.protocol}}),e.exports=l}(Xp,Xp.exports);var u3=Xp.exports;(function(e){var t=tt&&tt.__awaiter||function(c,l,u,d){function h(f){return f instanceof u?f:new u(function(p){p(f)})}return new(u||(u=Promise))(function(f,p){function m(g){try{v(d.next(g))}catch(b){p(b)}}function y(g){try{v(d.throw(g))}catch(b){p(b)}}function v(g){g.done?f(g.value):h(g.value).then(m,y)}v((d=d.apply(c,l||[])).next())})},n=tt&&tt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocketComEmitter=e.SocketComEvents=e.SocketCom=void 0;const r=Gp,i=n(u3);class o{constructor(l){this.url=l,this.pending={},this.emitter=new a,this.events=this.emitter}connect(l,u){return t(this,void 0,void 0,function*(){return new Promise((d,h)=>{this.disconnect(),this.socket=(0,i.default)(this.url,{transports:["websocket"],auth:l,autoConnect:!1,query:u});const f=setTimeout(()=>{h("connection timed out")},5e3);this.socket.on("login",p=>t(this,void 0,void 0,function*(){clearTimeout(f),d(p)})),this.socket.on("connect_error",p=>{var m;(m=this.socket)===null||m===void 0||m.close(),clearTimeout(f),h(p.message)}),this.socket.on("message",p=>t(this,void 0,void 0,function*(){var m;this.pending[p.request]&&(!((m=p.data)===null||m===void 0)&&m.error?this.pending[p.request].reject(new Error(p.data.message)):this.pending[p.request].resolve(p.data),delete this.pending[p.request]),yield this.emitter.emit(s.Message,p)})),this.socket.connect()})})}disconnect(){var l;this.socket&&!(!((l=this.socket)===null||l===void 0)&&l.disconnected)&&this.socket.disconnect()}request(l,u){var d;return t(this,void 0,void 0,function*(){if(!(!((d=this.socket)===null||d===void 0)&&d.connected))throw new Error("Client is disconnected");const h=this.random(32),f=new Promise((p,m)=>{this.pending[h]={resolve:p,reject:m}});return this.socket.send({request:h,type:l,data:u}),f})}random(l){const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let d="";for(let h=0;h<l;h++)d+=u.charAt(Math.floor(Math.random()*u.length));return d}}e.SocketCom=o;var s;(function(c){c.Message="message"})(s=e.SocketComEvents||(e.SocketComEvents={}));class a extends r.Emitter{}e.SocketComEmitter=a})(k_);var pu={},d3=tt&&tt.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(pu,"__esModule",{value:!0}),pu.SocketEmitter=void 0;class f3{constructor(){this.listeners={}}on(t,n){const r=this.listeners[t];r?r.push(n):this.listeners[t]=[n]}removeListeners(t){this.listeners[t]=[]}emit(t,n){return d3(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}}pu.SocketEmitter=f3;var Zn=tt&&tt.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(Ql,"__esModule",{value:!0}),Ql.MessagingSocket=void 0;const Q_=k_,p3=pu;class h3 extends p3.SocketEmitter{constructor(t){super(),this.clientId=t.clientId,this.com=new Q_.SocketCom(t.url),this.com.events.on(Q_.SocketComEvents.Message,n=>Zn(this,void 0,void 0,function*(){n.type==="message.new"&&(yield this.emit("message",n.data.message))}))}get creds(){return this._creds}get userId(){var t;return(t=this._creds)===null||t===void 0?void 0:t.userId}get conversationId(){return this._conversationId}connect(t,n){return Zn(this,void 0,void 0,function*(){const r=n?{userData:JSON.stringify(n)}:void 0,i=yield this.com.connect({clientId:this.clientId,creds:t},r);return i.userId===(t==null?void 0:t.userId)&&!i.userToken&&(i.userToken=t.userToken),this._creds=i,yield this.emit("connect",this._creds),yield this.emit("user",this._creds.userId),i})}disconnect(){return Zn(this,void 0,void 0,function*(){this.com.disconnect(),yield this.emit("disconnect",void 0)})}getUser(){return Zn(this,void 0,void 0,function*(){return this.request("users.get",{})})}switchConversation(t){return Zn(this,void 0,void 0,function*(){this._conversationId=t,yield this.emit("conversation",this._conversationId)})}createConversation(t){return Zn(this,void 0,void 0,function*(){const n=yield this.request("conversations.create",{});return(t==null?void 0:t.switch)!==!1&&(yield this.switchConversation(n.id)),n})}startConversation(t){return Zn(this,void 0,void 0,function*(){yield this.request("conversations.start",{id:t||this._conversationId})})}getConversation(t){return Zn(this,void 0,void 0,function*(){return this.request("conversations.get",{id:t||this._conversationId})})}deleteConversation(t){return Zn(this,void 0,void 0,function*(){const n=yield this.request("conversations.delete",{id:t||this._conversationId});return n&&(yield this.switchConversation(void 0)),n})}listConversations(t){return Zn(this,void 0,void 0,function*(){return this.request("conversations.list",{limit:t||20})})}sendText(t){return Zn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:{type:"text",text:t}})})}sendPayload(t){return Zn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:t})})}listMessages(t){return Zn(this,void 0,void 0,function*(){return this.request("messages.list",{conversationId:this._conversationId,limit:t||20})})}sendFeedback(t,n){return Zn(this,void 0,void 0,function*(){yield this.request("messages.feedback",{messageId:t,feedback:n})})}request(t,n){return this.com.request(t,n)}}Ql.MessagingSocket=h3,function(e){var t=tt&&tt.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o),Object.defineProperty(r,s,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=tt&&tt.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Gp,e),n(Ql,e)}(g_);class m3{constructor(t){k(this,"socket");k(this,"clientId");k(this,"apiUrl");k(this,"userId");k(this,"conversationId");k(this,"userToken");k(this,"connected",!1);k(this,"emitter");k(this,"on");k(this,"mode","messaging");this.socket=new g_.MessagingSocket(t),this.emitter=new sp,this.clientId=t.clientId,this.apiUrl=t.url,this.on=this.emitter.on.bind(this.emitter),this.socket.on("message",n=>{const r=n.payload;if(r.type==="trigger")switch(r.trigger.type){case"webchat-visibility":this.emitter.emit("webchatVisibility",r.trigger.visibility);break;case"webchat-config":this.emitter.emit("webchatConfig",r.trigger.config);break;case"custom-event":this.emitter.emit("customEvent",r.trigger.event);break}else{const i=Il.parse(r),{payload:o,disableInput:s}=np(i);this.emitter.emit("message",{...n,payload:o,disableInput:s})}}),this.socket.on("conversation",n=>{this.emitter.emit("conversation",n)})}async connect(t,n){if(this.connected)return;this.connected=!0;const r=await this.socket.connect(t,n).catch(i=>{throw this.connected=!1,i});return this.userId=r.userId,this.userToken=r.userToken,r}async disconnect(){await this.socket.disconnect(),this.connected=!1}async getUser(){throw new Error("Get user is not supported in messaging mode")}async updateUser(){throw new Error("Update user is not supported in messaging mode")}async sendFile(t){throw new Error("Send file is not supported in messaging mode")}async sendMessage(t){this.conversationId||await this.newConversation(),await this.socket.sendText(t),this.emitter.emit("messageSent",t)}async sendEvent(t){this.conversationId||await this.newConversation(),await this.socket.sendPayload({type:"trigger",payload:t})}async switchConversation(t){await this.socket.switchConversation(t),this.conversationId=t}async conversationExists(t){return(await this.socket.listConversations()).some(r=>r.id===t)}async newConversation(){const{id:t}=await this.socket.createConversation();await this.socket.startConversation(),this.conversationId=t}async listMessages(t){return(await this.socket.listMessages(t)).map(r=>{const i=Il.parse(r.payload),{payload:o,disableInput:s}=np(i);return{...r,payload:o,disableInput:s}})}}function e1(e,t){return function(){return e.apply(t,arguments)}}const{toString:t1}=Object.prototype,{getPrototypeOf:ch}=Object,lh=(e=>t=>{const n=t1.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ti=e=>(e=e.toLowerCase(),t=>lh(t)===e),hu=e=>t=>typeof t===e,{isArray:is}=Array,ga=hu("undefined");function y3(e){return e!==null&&!ga(e)&&e.constructor!==null&&!ga(e.constructor)&&lo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const n1=ti("ArrayBuffer");function g3(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&n1(e.buffer),t}const v3=hu("string"),lo=hu("function"),r1=hu("number"),uh=e=>e!==null&&typeof e=="object",b3=e=>e===!0||e===!1,mu=e=>{if(lh(e)!=="object")return!1;const t=ch(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},w3=ti("Date"),x3=ti("File"),_3=ti("Blob"),S3=ti("FileList"),E3=e=>uh(e)&&lo(e.pipe),k3=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||t1.call(e)===t||lo(e.toString)&&e.toString()===t)},C3=ti("URLSearchParams"),T3=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function va(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),is(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(r=0;r<s;r++)a=o[r],t.call(null,e[a],a,e)}}function i1(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const o1=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),s1=e=>!ga(e)&&e!==o1;function dh(){const{caseless:e}=s1(this)&&this||{},t={},n=(r,i)=>{const o=e&&i1(t,i)||i;mu(t[o])&&mu(r)?t[o]=dh(t[o],r):mu(r)?t[o]=dh({},r):is(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&va(arguments[r],n);return t}const A3=(e,t,n,{allOwnKeys:r}={})=>(va(t,(i,o)=>{n&&lo(i)?e[o]=e1(i,n):e[o]=i},{allOwnKeys:r}),e),O3=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),I3=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},R3=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&ch(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},P3=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},$3=e=>{if(!e)return null;if(is(e))return e;let t=e.length;if(!r1(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},D3=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ch(Uint8Array)),N3=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},j3=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},M3=ti("HTMLFormElement"),q3=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),a1=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),L3=ti("RegExp"),c1=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};va(n,(i,o)=>{t(i,o,e)!==!1&&(r[o]=i)}),Object.defineProperties(e,r)},se={isArray:is,isArrayBuffer:n1,isBuffer:y3,isFormData:k3,isArrayBufferView:g3,isString:v3,isNumber:r1,isBoolean:b3,isObject:uh,isPlainObject:mu,isUndefined:ga,isDate:w3,isFile:x3,isBlob:_3,isRegExp:L3,isFunction:lo,isStream:E3,isURLSearchParams:C3,isTypedArray:D3,isFileList:S3,forEach:va,merge:dh,extend:A3,trim:T3,stripBOM:O3,inherits:I3,toFlatObject:R3,kindOf:lh,kindOfTest:ti,endsWith:P3,toArray:$3,forEachEntry:N3,matchAll:j3,isHTMLForm:M3,hasOwnProperty:a1,hasOwnProp:a1,reduceDescriptors:c1,freezeMethods:e=>{c1(e,(t,n)=>{if(lo(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(lo(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return is(e)?r(e):r(String(e).split(t)),n},toCamelCase:q3,noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:i1,global:o1,isContextDefined:s1,toJSONObject:e=>{const t=new Array(10),n=(r,i)=>{if(uh(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=is(r)?[]:{};return va(r,(s,a)=>{const c=n(s,i+1);!ga(c)&&(o[a]=c)}),t[i]=void 0,o}}return r};return n(e,0)}};function kt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}se.inherits(kt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:se.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const l1=kt.prototype,u1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{u1[e]={value:e}}),Object.defineProperties(kt,u1),Object.defineProperty(l1,"isAxiosError",{value:!0}),kt.from=(e,t,n,r,i,o)=>{const s=Object.create(l1);return se.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),kt.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};var F3=typeof self=="object"?self.FormData:window.FormData;const U3=mi(F3);function fh(e){return se.isPlainObject(e)||se.isArray(e)}function d1(e){return se.endsWith(e,"[]")?e.slice(0,-2):e}function f1(e,t,n){return e?e.concat(t).map(function(i,o){return i=d1(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function B3(e){return se.isArray(e)&&!e.some(fh)}const z3=se.toFlatObject(se,{},null,function(t){return/^is[A-Z]/.test(t)});function Z3(e){return e&&se.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function yu(e,t,n){if(!se.isObject(e))throw new TypeError("target must be an object");t=t||new(U3||FormData),n=se.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!se.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Z3(t);if(!se.isFunction(i))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(se.isDate(p))return p.toISOString();if(!c&&se.isBlob(p))throw new kt("Blob is not supported. Use a Buffer instead.");return se.isArrayBuffer(p)||se.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let v=p;if(p&&!y&&typeof p=="object"){if(se.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(se.isArray(p)&&B3(p)||se.isFileList(p)||se.endsWith(m,"[]")&&(v=se.toArray(p)))return m=d1(m),v.forEach(function(b,S){!(se.isUndefined(b)||b===null)&&t.append(s===!0?f1([m],S,o):s===null?m:m+"[]",l(b))}),!1}return fh(p)?!0:(t.append(f1(y,m,o),l(p)),!1)}const d=[],h=Object.assign(z3,{defaultVisitor:u,convertValue:l,isVisitable:fh});function f(p,m){if(!se.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),se.forEach(p,function(v,g){(!(se.isUndefined(v)||v===null)&&i.call(t,v,se.isString(g)?g.trim():g,m,h))===!0&&f(v,m?m.concat(g):[g])}),d.pop()}}if(!se.isObject(e))throw new TypeError("data must be an object");return f(e),t}function p1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ph(e,t){this._pairs=[],e&&yu(e,this,t)}const h1=ph.prototype;h1.append=function(t,n){this._pairs.push([t,n])},h1.toString=function(t){const n=t?function(r){return t.call(this,r,p1)}:p1;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function V3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function m1(e,t,n){if(!t)return e;const r=n&&n.encode||V3,i=n&&n.serialize;let o;if(i?o=i(t,n):o=se.isURLSearchParams(t)?t.toString():new ph(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class H3{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){se.forEach(this.handlers,function(r){r!==null&&t(r)})}}const y1=H3,g1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},W3=typeof URLSearchParams<"u"?URLSearchParams:ph,K3=FormData,J3=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Y3=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Mr={isBrowser:!0,classes:{URLSearchParams:W3,FormData:K3,Blob},isStandardBrowserEnv:J3,isStandardBrowserWebWorkerEnv:Y3,protocols:["http","https","file","blob","url","data"]};function G3(e,t){return yu(e,new Mr.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Mr.isNode&&se.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function X3(e){return se.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Q3(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function v1(e){function t(n,r,i,o){let s=n[o++];const a=Number.isFinite(+s),c=o>=n.length;return s=!s&&se.isArray(i)?i.length:s,c?(se.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!se.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&se.isArray(i[s])&&(i[s]=Q3(i[s])),!a)}if(se.isFormData(e)&&se.isFunction(e.entries)){const n={};return se.forEachEntry(e,(r,i)=>{t(X3(r),i,n,0)}),n}return null}const e5={"Content-Type":void 0};function t5(e,t,n){if(se.isString(e))try{return(t||JSON.parse)(e),se.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const gu={transitional:g1,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=se.isObject(t);if(o&&se.isHTMLForm(t)&&(t=new FormData(t)),se.isFormData(t))return i&&i?JSON.stringify(v1(t)):t;if(se.isArrayBuffer(t)||se.isBuffer(t)||se.isStream(t)||se.isFile(t)||se.isBlob(t))return t;if(se.isArrayBufferView(t))return t.buffer;if(se.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return G3(t,this.formSerializer).toString();if((a=se.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return yu(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),t5(t)):t}],transformResponse:[function(t){const n=this.transitional||gu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&se.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?kt.from(a,kt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mr.classes.FormData,Blob:Mr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};se.forEach(["delete","get","head"],function(t){gu.headers[t]={}}),se.forEach(["post","put","patch"],function(t){gu.headers[t]=se.merge(e5)});const hh=gu,n5=se.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),r5=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
128
|
+
`,...o.current()});return/^[\t ]/.test(l)&&(l="&#x"+l.charCodeAt(0).toString(16).toUpperCase()+";"+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),c(),a(),l}Y0.peek=sq;function Y0(e){return e.value||""}function sq(){return"<"}G0.peek=aq;function G0(e,t,n,r){const i=Hp(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const c=n.createTracker(r);let l=c.move("![");return l+=c.move(n.safe(e.alt,{before:l,after:"]",...c.current()})),l+=c.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=c.move("<"),l+=c.move(n.safe(e.url,{before:l,after:">",...c.current()})),l+=c.move(">")):(a=n.enter("destinationRaw"),l+=c.move(n.safe(e.url,{before:l,after:e.title?" ":")",...c.current()}))),a(),e.title&&(a=n.enter(`title${o}`),l+=c.move(" "+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),a()),l+=c.move(")"),s(),l}function aq(){return"!"}X0.peek=cq;function X0(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let c=a.move("![");const l=n.safe(e.alt,{before:c,after:"]",...a.current()});c+=a.move(l+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!l||l!==d?c+=a.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function cq(){return"!"}Q0.peek=lq;function Q0(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let c;if(s.atBreak)for(;c=a.exec(r);){let l=c.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(c.index+1)}}return i+r+i}function lq(){return"`"}function e_(e,t){const n=bp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}t_.peek=uq;function t_(e,t,n,r){const i=Hp(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,c;if(e_(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),a(),n.stack=u,d}a=n.enter("link"),c=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(e,{before:l,after:"](",...s.current()})),l+=s.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(c=n.enter("destinationRaw"),l+=s.move(n.safe(e.url,{before:l,after:e.title?" ":")",...s.current()}))),c(),e.title&&(c=n.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(n.safe(e.title,{before:l,after:i,...s.current()})),l+=s.move(i),c()),l+=s.move(")"),a(),l}function uq(e,t,n){return e_(e,n)?"<":"["}n_.peek=dq;function n_(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let c=a.move("[");const l=n.containerPhrasing(e,{before:c,after:"]",...a.current()});c+=a.move(l+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!l||l!==d?c+=a.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function dq(){return"["}function Wp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fq(e){const t=Wp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function pq(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function r_(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hq(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?pq(n):Wp(n);const a=e.ordered?s==="."?")":".":fq(n);let c=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),r_(n)===s&&u){let d=-1;for(;++d<e.children.length;){const p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(s=a),n.bulletCurrent=s;const l=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),l}function mq(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function yq(e,t,n,r){const i=mq(n);let o=n.bulletCurrent||Wp(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const c=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,a.current()),u);return c(),l;function u(d,p,f){return p?(f?"":" ".repeat(s))+d:(f?o:o+" ".repeat(s-o.length))+d}}function gq(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const vq=Wl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function bq(e,t,n,r){return(e.children.some(function(s){return vq(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wq(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}i_.peek=xq;function i_(e,t,n,r){const i=wq(n),o=n.enter("strong"),s=n.createTracker(r);let a=s.move(i+i);return a+=s.move(n.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i+i),o(),a}function xq(e,t,n){return n.options.strong||"*"}function _q(e,t,n,r){return n.safe(e.value,r)}function Sq(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Eq(e,t,n){const r=(r_(n)+(n.options.ruleSpaces?" ":"")).repeat(Sq(n));return n.options.ruleSpaces?r.slice(0,-1):r}const o_={blockquote:W2,break:K0,code:Q2,definition:tq,emphasis:J0,hardBreak:K0,heading:oq,html:Y0,image:G0,imageReference:X0,inlineCode:Q0,link:t_,linkReference:n_,list:hq,listItem:yq,paragraph:gq,root:bq,strong:i_,text:_q,thematicBreak:Eq};function kq(){return{enter:{table:Cq,tableData:s_,tableHeader:s_,tableRow:Aq},exit:{codeText:Oq,table:Tq,tableData:Kp,tableHeader:Kp,tableRow:Kp}}}function Cq(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Tq(e){this.exit(e),this.data.inTable=void 0}function Aq(e){this.enter({type:"tableRow",children:[]},e)}function Kp(e){this.exit(e)}function s_(e){this.enter({type:"tableCell",children:[]},e)}function Oq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Iq));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Iq(e,t){return t==="|"?t:e}function Rq(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
129
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:c,tableRow:a}};function s(f,h,m,y){return l(u(f,m,y),f.align)}function a(f,h,m,y){const g=d(f,m,y),v=l([g]);return v.slice(0,v.indexOf(`
|
|
130
|
+
`))}function c(f,h,m,y){const g=m.enter("tableCell"),v=m.enter("phrasing"),b=m.containerPhrasing(f,{...y,before:o,after:o});return v(),g(),b}function l(f,h){return Z2(f,{align:h,alignDelimiters:r,padding:n,stringLength:i})}function u(f,h,m){const y=f.children;let g=-1;const v=[],b=h.enter("table");for(;++g<y.length;)v[g]=d(y[g],h,m);return b(),v}function d(f,h,m){const y=f.children;let g=-1;const v=[],b=h.enter("tableRow");for(;++g<y.length;)v[g]=c(y[g],f,h,m);return b(),v}function p(f,h,m){let y=o_.inlineCode(f,h,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Pq(){return{exit:{taskListCheckValueChecked:a_,taskListCheckValueUnchecked:a_,paragraph:Dq}}}function $q(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Nq}}}function a_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Dq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Nq(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let c=o_.listItem(e,t,n,{...r,...a.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(u){return u+s}}function jq(){return[p2(),k2(),L2(),kq(),Pq()]}function Mq(e){return{extensions:[h2(),C2(),F2(),Rq(e),$q()]}}const qq={tokenize:Zq,partial:!0},c_={tokenize:Vq,partial:!0},l_={tokenize:Hq,partial:!0},u_={tokenize:Wq,partial:!0},Lq={tokenize:Kq,partial:!0},d_={tokenize:Bq,previous:p_},f_={tokenize:zq,previous:h_},Qr={tokenize:Uq,previous:m_},$r={};function Fq(){return{text:$r}}let no=48;for(;no<123;)$r[no]=Qr,no++,no===58?no=65:no===91&&(no=97);$r[43]=Qr,$r[45]=Qr,$r[46]=Qr,$r[95]=Qr,$r[72]=[Qr,f_],$r[104]=[Qr,f_],$r[87]=[Qr,d_],$r[119]=[Qr,d_];function Uq(e,t,n){const r=this;let i,o;return s;function s(d){return!Jp(d)||!m_.call(r,r.previous)||Yp(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Jp(d)?(e.consume(d),a):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(Lq,u,l)(d):d===45||d===95||An(d)?(o=!0,e.consume(d),c):u(d)}function l(d){return e.consume(d),i=!0,c}function u(d){return o&&i&&qn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function Bq(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!p_.call(r,r.previous)||Yp(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(qq,e.attempt(c_,e.attempt(l_,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function zq(e,t,n){const r=this;let i="",o=!1;return s;function s(d){return(d===72||d===104)&&h_.call(r,r.previous)&&!Yp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(qn(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),o?l:(o=!0,c)):n(d)}function l(d){return d===null||jl(d)||$t(d)||to(d)||Ml(d)?n(d):e.attempt(c_,e.attempt(l_,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function Zq(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function Vq(e,t,n){let r,i,o;return s;function s(l){return l===46||l===95?e.check(u_,c,a)(l):l===null||$t(l)||to(l)||l!==45&&Ml(l)?c(l):(o=!0,e.consume(l),s)}function a(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),s}function c(l){return i||r||!o?n(l):t(l)}}function Hq(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):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?e.check(u_,t,o)(s):s===null||$t(s)||to(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function Wq(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||$t(a)||to(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||$t(a)||to(a)?t(a):r(a)}function o(a){return qn(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):qn(a)?(e.consume(a),s):n(a)}}function Kq(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return An(o)?n(o):t(o)}}function p_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$t(e)}function h_(e){return!qn(e)}function m_(e){return!(e===47||Jp(e))}function Jp(e){return e===43||e===45||e===46||e===95||An(e)}function Yp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Jq={tokenize:rL,partial:!0};function Yq(){return{document:{91:{tokenize:eL,continuation:{tokenize:tL},exit:nL}},text:{91:{tokenize:Qq},93:{add:"after",tokenize:Gq,resolveTo:Xq}}}}function Gq(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){s=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!s||!s._balanced)return n(c);const l=xr(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Xq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function Qq(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(d){if(o>999||d===93&&!s||d===null||d===91||$t(d))return n(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(xr(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return $t(d)||(s=!0),o++,e.consume(d),d===92?u:l}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,l):l(d)}}function eL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return c;function c(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(h)}function u(h){if(s>999||h===93&&!a||h===null||h===91||$t(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return o=xr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return $t(h)||(a=!0),s++,e.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,u):u(h)}function p(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),i.includes(o)||i.push(o),St(e,f,"gfmFootnoteDefinitionWhitespace")):n(h)}function f(h){return t(h)}}function tL(e,t,n){return e.check(aa,t,e.attempt(Jq,t,n))}function nL(e){e.exit("gfmFootnoteDefinition")}function rL(e,t,n){const r=this;return St(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function iL(e){let n=(e||{}).singleTilde;const r={tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let c=-1;for(;++c<s.length;)if(s[c][0]==="enter"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._close){let l=c;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[c][1].end.offset-s[c][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[c][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[c][1].end)},d={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[c][1].start)},p=[["enter",u,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",d,a]],f=a.parser.constructs.insideSpan.null;f&&Gn(p,p.length,0,Ll(f,s.slice(l+1,c),a)),Gn(p,p.length,0,[["exit",d,a],["enter",s[c][1],a],["exit",s[c][1],a],["exit",u,a]]),Gn(s,l-1,c-l+3,p),c=l+p.length-2;break}}for(c=-1;++c<s.length;)s[c][1].type==="strikethroughSequenceTemporary"&&(s[c][1].type="data");return s}function o(s,a,c){const l=this.previous,u=this.events;let d=0;return p;function p(h){return l===126&&u[u.length-1][1].type!=="characterEscape"?c(h):(s.enter("strikethroughSequenceTemporary"),f(h))}function f(h){const m=ql(l);if(h===126)return d>1?c(h):(s.consume(h),d++,f);if(d<2&&!n)return c(h);const y=s.exit("strikethroughSequenceTemporary"),g=ql(h);return y._open=!g||g===2&&!!m,y._close=!m||m===2&&!!g,a(h)}}}class oL{constructor(){this.map=[]}add(t,n,r){sL(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function sL(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function aL(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function cL(){return{flow:{null:{tokenize:lL,resolveAll:uL}}}}function lL(e,t,n){const r=this;let i=0,o=0,s;return a;function a(O){let q=r.events.length-1;for(;q>-1;){const F=r.events[q][1].type;if(F==="lineEnding"||F==="linePrefix")q--;else break}const H=q>-1?r.events[q][1].type:null,B=H==="tableHead"||H==="tableRow"?_:c;return B===_&&r.parser.lazy[r.now().line]?n(O):B(O)}function c(O){return e.enter("tableHead"),e.enter("tableRow"),l(O)}function l(O){return O===124||(s=!0,o+=1),u(O)}function u(O){return O===null?n(O):We(O)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),f):n(O):yt(O)?St(e,u,"whitespace")(O):(o+=1,s&&(s=!1,i+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||$t(O)?(e.exit("data"),u(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function f(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),s=!1,yt(O)?St(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):h(O))}function h(O){return O===45||O===58?y(O):O===124?(s=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),m):E(O)}function m(O){return yt(O)?St(e,y,"whitespace")(O):y(O)}function y(O){return O===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),g):O===45?(o+=1,g(O)):O===null||We(O)?S(O):E(O)}function g(O){return O===45?(e.enter("tableDelimiterFiller"),v(O)):E(O)}function v(O){return O===45?(e.consume(O),v):O===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(O))}function b(O){return yt(O)?St(e,S,"whitespace")(O):S(O)}function S(O){return O===124?h(O):O===null||We(O)?!s||i!==o?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):E(O)}function E(O){return n(O)}function _(O){return e.enter("tableRow"),I(O)}function I(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),I):O===null||We(O)?(e.exit("tableRow"),t(O)):yt(O)?St(e,I,"whitespace")(O):(e.enter("data"),P(O))}function P(O){return O===null||O===124||$t(O)?(e.exit("data"),I(O)):(e.consume(O),O===92?$:P)}function $(O){return O===92||O===124?(e.consume(O),P):P(O)}}function uL(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,c=0,l,u,d;const p=new oL;for(;++n<e.length;){const f=e[n],h=f[1];f[0]==="enter"?h.type==="tableHead"?(a=!1,c!==0&&(y_(p,t,c,l,u),u=void 0,c=0),l={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(n,0,[["enter",l,t]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(n,0,[["enter",u,t]])),i=h.type==="tableDelimiterRow"?2:u?3:1):i&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=Gl(p,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):h.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=Gl(p,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):h.type==="tableHead"?(a=!0,c=n):h.type==="tableRow"||h.type==="tableDelimiterRow"?(c=n,o[1]!==0?(s[0]=s[1],d=Gl(p,t,o,i,n,d)):s[1]!==0&&(d=Gl(p,t,s,i,n,d)),i=0):i&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(s[3]=n)}for(c!==0&&y_(p,t,c,l,u),p.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=aL(t.events,n))}return e}function Gl(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Ko(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const c=Ko(t.events,n[1]);if(o={type:s,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const l=Ko(t.events,n[2]),u=Ko(t.events,n[3]),d={type:a,start:Object.assign({},l),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const p=t.events[n[2]],f=t.events[n[3]];if(p[1].end=Object.assign({},f[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const h=n[2]+1,m=n[3]-n[2]-1;e.add(h,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},Ko(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function y_(e,t,n,r,i){const o=[],s=Ko(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Ko(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const dL={tokenize:pL};function fL(){return{text:{91:dL}}}function pL(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return $t(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),s):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),s):n(c)}function s(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(c)}function a(c){return We(c)?t(c):yt(c)?e.check({tokenize:hL},t,n)(c):n(c)}}function hL(e,t,n){return St(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function mL(e){return Vx([Fq(),Yq(),iL(e),cL(),fL()])}const yL={};function gL(e){const t=this,n=e||yL,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(mL(n)),o.push(jq()),s.push(Mq(n))}const vL=({text:e,type:t,styles:n})=>{const r=n==null?void 0:n[t],i={h1:({node:o,...s})=>U.jsx("h1",{...s,...r==null?void 0:r.heading1}),h2:({node:o,...s})=>U.jsx("h2",{...s,...r==null?void 0:r.heading2}),h3:({node:o,...s})=>U.jsx("h3",{...s,...r==null?void 0:r.heading3}),h4:"h3",h5:"h3",h6:"h3",em:({node:o,...s})=>U.jsx("em",{...s,...r==null?void 0:r.italic}),strong:({node:o,...s})=>U.jsx("strong",{...s,...r==null?void 0:r.bold}),p:({node:o,...s})=>U.jsx("p",{...s,...r==null?void 0:r.text}),hr:({node:o,...s})=>U.jsx("hr",{...s,...r==null?void 0:r.horizontalRule}),a:({node:o,...s})=>U.jsx("a",{...s,...r==null?void 0:r.link,target:"_blank"}),ol:({node:o,...s})=>U.jsx("ol",{...s,...r==null?void 0:r.orderedList}),ul:({node:o,...s})=>U.jsx("ul",{...s,...r==null?void 0:r.unorderedList}),li:({node:o,...s})=>U.jsx("li",{...s,...r==null?void 0:r.listItem}),br:({node:o,...s})=>U.jsx("br",{...s,...r==null?void 0:r.lineBreak}),img:()=>null,pre:({node:o,...s})=>U.jsx("pre",{...s,...r==null?void 0:r.pre})};return U.jsx(i2,{components:i,remarkPlugins:[gL,f2],children:e})},bL=(e,t,n=120)=>{w.useEffect(()=>{if(e){e.style.height="0px";const r=t?Math.min(e.scrollHeight,n):20;e.style.height=`${r}px`}},[e,t])};var g_={},Gp={},v_={};Object.defineProperty(v_,"__esModule",{value:!0});var Xl={},wL=tt&&tt.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.Emitter=void 0;let xL=class{constructor(){this.listeners={}}on(t,n,r=!1){const i=this.listeners[t];i?r?i.unshift(n):i.push(n):this.listeners[t]=[n]}emit(t,n){return wL(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}};Xl.Emitter=xL;var b_={};Object.defineProperty(b_,"__esModule",{value:!0});var w_={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HealthEventType=void 0,function(t){t.Create="create",t.Configure="configure",t.Start="start",t.StartFailure="start-failure",t.Initialize="initialize",t.InitializeFailure="initialize-failure",t.Sleep="sleep",t.Delete="delete"}(e.HealthEventType||(e.HealthEventType={}))})(w_);var x_={};Object.defineProperty(x_,"__esModule",{value:!0});var __={};Object.defineProperty(__,"__esModule",{value:!0});var S_={};Object.defineProperty(S_,"__esModule",{value:!0});var E_={};Object.defineProperty(E_,"__esModule",{value:!0}),function(e){var t=tt&&tt.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o),Object.defineProperty(r,s,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=tt&&tt.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(v_,e),n(Xl,e),n(b_,e),n(w_,e),n(x_,e),n(__,e),n(S_,e),n(E_,e)}(Gp);var Ql={},k_={},Xp={exports:{}},eu={},Qp={},tu={},da={},Jo={},ro={},Yo={},Go={},Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.ERROR_PACKET=Dr.PACKET_TYPES_REVERSE=Dr.PACKET_TYPES=void 0;const Nr=Object.create(null);Dr.PACKET_TYPES=Nr,Nr.open="0",Nr.close="1",Nr.ping="2",Nr.pong="3",Nr.message="4",Nr.upgrade="5",Nr.noop="6";const C_=Object.create(null);Dr.PACKET_TYPES_REVERSE=C_,Object.keys(Nr).forEach(e=>{C_[Nr[e]]=e});const _L={type:"error",data:"parser error"};Dr.ERROR_PACKET=_L,Object.defineProperty(Go,"__esModule",{value:!0}),Go.encodePacket=Go.encodePacketToBinary=void 0;const SL=Dr,T_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",A_=typeof ArrayBuffer=="function",O_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,I_=({type:e,data:t},n,r)=>T_&&t instanceof Blob?n?r(t):R_(t,r):A_&&(t instanceof ArrayBuffer||O_(t))?n?r(t):R_(new Blob([t]),r):r(SL.PACKET_TYPES[e]+(t||""));Go.encodePacket=I_;const R_=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function P_(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let eh;function EL(e,t){if(T_&&e.data instanceof Blob)return e.data.arrayBuffer().then(P_).then(t);if(A_&&(e.data instanceof ArrayBuffer||O_(e.data)))return t(P_(e.data));I_(e,!1,n=>{eh||(eh=new TextEncoder),t(eh.encode(n))})}Go.encodePacketToBinary=EL;var nu={},Xo={};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.decode=Xo.encode=void 0;const Qo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Qo.length;e++)fa[Qo.charCodeAt(e)]=e;const kL=e=>{let t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Qo[t[n]>>2],i+=Qo[(t[n]&3)<<4|t[n+1]>>4],i+=Qo[(t[n+1]&15)<<2|t[n+2]>>6],i+=Qo[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};Xo.encode=kL;const CL=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)o=fa[e.charCodeAt(r)],s=fa[e.charCodeAt(r+1)],a=fa[e.charCodeAt(r+2)],c=fa[e.charCodeAt(r+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|c&63;return l};Xo.decode=CL,Object.defineProperty(nu,"__esModule",{value:!0}),nu.decodePacket=void 0;const ru=Dr,TL=Xo,AL=typeof ArrayBuffer=="function",OL=(e,t)=>{if(typeof e!="string")return{type:"message",data:$_(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:IL(e.substring(1),t)}:ru.PACKET_TYPES_REVERSE[n]?e.length>1?{type:ru.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:ru.PACKET_TYPES_REVERSE[n]}:ru.ERROR_PACKET};nu.decodePacket=OL;const IL=(e,t)=>{if(AL){const n=(0,TL.decode)(e);return $_(n,t)}else return{base64:!0,data:e}},$_=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const t=Go;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=nu;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=Dr,i=String.fromCharCode(30),o=(p,f)=>{const h=p.length,m=new Array(h);let y=0;p.forEach((g,v)=>{(0,t.encodePacket)(g,!1,b=>{m[v]=b,++y===h&&f(m.join(i))})})};e.encodePayload=o;const s=(p,f)=>{const h=p.split(i),m=[];for(let y=0;y<h.length;y++){const g=(0,n.decodePacket)(h[y],f);if(m.push(g),g.type==="error")break}return m};e.decodePayload=s;function a(){return new TransformStream({transform(p,f){(0,t.encodePacketToBinary)(p,h=>{const m=h.length;let y;if(m<126)y=new Uint8Array(1),new DataView(y.buffer).setUint8(0,m);else if(m<65536){y=new Uint8Array(3);const g=new DataView(y.buffer);g.setUint8(0,126),g.setUint16(1,m)}else{y=new Uint8Array(9);const g=new DataView(y.buffer);g.setUint8(0,127),g.setBigUint64(1,BigInt(m))}p.data&&typeof p.data!="string"&&(y[0]|=128),f.enqueue(y),f.enqueue(h)})}})}e.createPacketEncoderStream=a;let c;function l(p){return p.reduce((f,h)=>f+h.length,0)}function u(p,f){if(p[0].length===f)return p.shift();const h=new Uint8Array(f);let m=0;for(let y=0;y<f;y++)h[y]=p[0][m++],m===p[0].length&&(p.shift(),m=0);return p.length&&m<p[0].length&&(p[0]=p[0].slice(m)),h}function d(p,f){c||(c=new TextDecoder);const h=[];let m=0,y=-1,g=!1;return new TransformStream({transform(v,b){for(h.push(v);;){if(m===0){if(l(h)<1)break;const S=u(h,1);g=(S[0]&128)===128,y=S[0]&127,y<126?m=3:y===126?m=1:m=2}else if(m===1){if(l(h)<2)break;const S=u(h,2);y=new DataView(S.buffer,S.byteOffset,S.length).getUint16(0),m=3}else if(m===2){if(l(h)<8)break;const S=u(h,8),E=new DataView(S.buffer,S.byteOffset,S.length),_=E.getUint32(0);if(_>Math.pow(2,53-32)-1){b.enqueue(r.ERROR_PACKET);break}y=_*Math.pow(2,32)+E.getUint32(4),m=3}else{if(l(h)<y)break;const S=u(h,y);b.enqueue((0,n.decodePacket)(g?S:c.decode(S),f)),m=0}if(y===0||y>p){b.enqueue(r.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=d,e.protocol=4})(Yo);function Ln(e){if(e)return RL(e)}function RL(e){for(var t in Ln.prototype)e[t]=Ln.prototype[t];return e}Ln.prototype.on=Ln.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Ln.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Ln.prototype.off=Ln.prototype.removeListener=Ln.prototype.removeAllListeners=Ln.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},Ln.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},Ln.prototype.emitReserved=Ln.prototype.emit,Ln.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Ln.prototype.hasListeners=function(e){return!!this.listeners(e).length};const es=zd(Object.freeze(Object.defineProperty({__proto__:null,Emitter:Ln},Symbol.toStringTag,{value:"Module"})));var dr={},io={};Object.defineProperty(io,"__esModule",{value:!0}),io.globalThisShim=void 0,io.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Object.defineProperty(dr,"__esModule",{value:!0}),dr.byteLength=dr.installTimerFunctions=dr.pick=void 0;const _i=io;function PL(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}dr.pick=PL;const $L=_i.globalThisShim.setTimeout,DL=_i.globalThisShim.clearTimeout;function NL(e,t){t.useNativeTimers?(e.setTimeoutFn=$L.bind(_i.globalThisShim),e.clearTimeoutFn=DL.bind(_i.globalThisShim)):(e.setTimeoutFn=_i.globalThisShim.setTimeout.bind(_i.globalThisShim),e.clearTimeoutFn=_i.globalThisShim.clearTimeout.bind(_i.globalThisShim))}dr.installTimerFunctions=NL;const jL=1.33;function ML(e){return typeof e=="string"?qL(e):Math.ceil((e.byteLength||e.size)*jL)}dr.byteLength=ML;function qL(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}var th={exports:{}},nh,D_;function LL(){if(D_)return nh;D_=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,o=r*365.25;nh=function(u,d){d=d||{};var p=typeof u;if(p==="string"&&u.length>0)return s(u);if(p==="number"&&isFinite(u))return d.long?c(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function s(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var p=parseFloat(d[1]),f=(d[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return p*o;case"weeks":case"week":case"w":return p*i;case"days":case"day":case"d":return p*r;case"hours":case"hour":case"hrs":case"hr":case"h":return p*n;case"minutes":case"minute":case"mins":case"min":case"m":return p*t;case"seconds":case"second":case"secs":case"sec":case"s":return p*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}}}function a(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function c(u){var d=Math.abs(u);return d>=r?l(u,d,r,"day"):d>=n?l(u,d,n,"hour"):d>=t?l(u,d,t,"minute"):d>=e?l(u,d,e,"second"):u+" ms"}function l(u,d,p,f){var h=d>=p*1.5;return Math.round(u/p)+" "+f+(h?"s":"")}return nh}function FL(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=LL(),n.destroy=l,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let p=0;p<u.length;p++)d=(d<<5)-d+u.charCodeAt(p),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,p=null,f,h;function m(...y){if(!m.enabled)return;const g=m,v=Number(new Date),b=v-(d||v);g.diff=b,g.prev=d,g.curr=v,d=v,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let S=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(_,I)=>{if(_==="%%")return"%";S++;const P=n.formatters[I];if(typeof P=="function"){const $=y[S];_=P.call(g,$),y.splice(S,1),S--}return _}),n.formatArgs.call(g,y),(g.log||n.log).apply(g,y)}return m.namespace=u,m.useColors=n.useColors(),m.color=n.selectColor(u),m.extend=r,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(f!==n.namespaces&&(f=n.namespaces,h=n.enabled(u)),h),set:y=>{p=y}}),typeof n.init=="function"&&n.init(m),m}function r(u,d){const p=n(this.namespace+(typeof d>"u"?":":d)+u);return p.log=this.log,p}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const p=(typeof u=="string"?u:"").split(/[\s,]+/),f=p.length;for(d=0;d<f;d++)p[d]&&(u=p[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(a),...n.skips.map(a).map(d=>"-"+d)].join(",");return n.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let d,p;for(d=0,p=n.skips.length;d<p;d++)if(n.skips[d].test(u))return!1;for(d=0,p=n.names.length;d<p;d++)if(n.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var UL=FL;(function(e,t){t.formatArgs=r,t.save=i,t.load=o,t.useColors=n,t.storage=s(),t.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let u=0,d=0;c[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(u++,p==="%c"&&(d=u))}),c.splice(d,0,l)}t.log=console.debug||console.log||(()=>{});function i(c){try{c?t.storage.setItem("debug",c):t.storage.removeItem("debug")}catch{}}function o(){let c;try{c=t.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function s(){try{return localStorage}catch{}}e.exports=UL(t);const{formatters:a}=e.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(th,th.exports);var jr=th.exports,oo={};Object.defineProperty(oo,"__esModule",{value:!0}),oo.decode=oo.encode=void 0;function BL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}oo.encode=BL;function zL(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}oo.decode=zL;var ZL=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ro,"__esModule",{value:!0}),ro.Transport=void 0;const VL=Yo,HL=es,WL=dr,KL=ZL(jr),JL=oo,YL=(0,KL.default)("engine.io-client:transport");class GL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class XL extends HL.Emitter{constructor(t){super(),this.writable=!1,(0,WL.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new GL(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"?this.write(t):YL("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=(0,VL.decodePacket)(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=(0,JL.encode)(t);return n.length?"?"+n:""}}ro.Transport=XL;var ei={};Object.defineProperty(ei,"__esModule",{value:!0}),ei.yeast=ei.decode=ei.encode=void 0;const N_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),iu=64,j_={};let M_=0,Si=0,q_;function rh(e){let t="";do t=N_[e%iu]+t,e=Math.floor(e/iu);while(e>0);return t}ei.encode=rh;function QL(e){let t=0;for(Si=0;Si<e.length;Si++)t=t*iu+j_[e.charAt(Si)];return t}ei.decode=QL;function eF(){const e=rh(+new Date);return e!==q_?(M_=0,q_=e):e+"."+rh(M_++)}for(ei.yeast=eF;Si<iu;Si++)j_[N_[Si]]=Si;var ts={},ou={};Object.defineProperty(ou,"__esModule",{value:!0}),ou.hasCORS=void 0;let L_=!1;try{L_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}ou.hasCORS=L_,Object.defineProperty(ts,"__esModule",{value:!0}),ts.createCookieJar=ts.XHR=void 0;const tF=ou,nF=io;function rF(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||tF.hasCORS))return new XMLHttpRequest}catch{}if(!t)try{return new nF.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}ts.XHR=rF;function iF(){}ts.createCookieJar=iF;var oF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.Request=Jo.Polling=void 0;const sF=ro,aF=oF(jr),cF=ei,F_=Yo,ih=ts,lF=es,U_=dr,uF=io,zn=(0,aF.default)("engine.io-client:polling");function dF(){}const fF=function(){return new ih.XHR({xdomain:!1}).responseType!=null}();class pF extends sF.Transport{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=fF&&!n,this.opts.withCredentials&&(this.cookieJar=(0,ih.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{zn("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(zn("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){zn("pre-pause polling complete"),--r||n()})),this.writable||(zn("we are currently writing - waiting to pause"),r++,this.once("drain",function(){zn("pre-pause writing complete"),--r||n()}))}else n()}poll(){zn("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){zn("polling got data %s",t);const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};(0,F_.decodePayload)(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():zn('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{zn("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(zn("transport open - closing"),t()):(zn("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,F_.encodePayload)(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=(0,cF.yeast)()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new so(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){zn("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}Jo.Polling=pF;let so=class Bd extends lF.Emitter{constructor(t,n){super(),(0,U_.installTimerFunctions)(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=(0,U_.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new ih.XHR(n);try{zn("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},zn("xhr data %s",this.data),r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Bd.requestsCount++,Bd.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=dF,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Bd.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};if(Jo.Request=so,so.requestsCount=0,so.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",B_);else if(typeof addEventListener=="function"){const e="onpagehide"in uF.globalThisShim?"pagehide":"unload";addEventListener(e,B_,!1)}}function B_(){for(let e in so.requests)so.requests.hasOwnProperty(e)&&so.requests[e].abort()}var su={},Xn={};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.defaultBinaryType=Xn.usingBrowserWebSocket=Xn.WebSocket=Xn.nextTick=void 0;const z_=io;Xn.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Xn.WebSocket=z_.globalThisShim.WebSocket||z_.globalThisShim.MozWebSocket,Xn.usingBrowserWebSocket=!0,Xn.defaultBinaryType="arraybuffer";var hF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(su,"__esModule",{value:!0}),su.WS=void 0;const mF=ro,yF=ei,gF=dr,Ei=Xn,vF=hF(jr),bF=Yo,wF=(0,vF.default)("engine.io-client:websocket"),Z_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xF extends mF.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=Z_?{}:(0,gF.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Ei.usingBrowserWebSocket&&!Z_?n?new Ei.WebSocket(t,n):new Ei.WebSocket(t):new Ei.WebSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;(0,bF.encodePacket)(r,this.supportsBinary,o=>{const s={};Ei.usingBrowserWebSocket||(r.options&&(s.compress=r.options.compress),this.opts.perMessageDeflate&&(typeof o=="string"?Buffer.byteLength(o):o.length)<this.opts.perMessageDeflate.threshold&&(s.compress=!1));try{Ei.usingBrowserWebSocket?this.ws.send(o):this.ws.send(o,s)}catch{wF("websocket closed before onclose event")}i&&(0,Ei.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=(0,yF.yeast)()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Ei.WebSocket}}su.WS=xF;var au={},_F=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(au,"__esModule",{value:!0}),au.WT=void 0;const SF=ro,EF=Xn,V_=Yo,pa=(0,_F(jr).default)("engine.io-client:webtransport");class kF extends SF.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{pa("transport closed gracefully"),this.onClose()}).catch(t=>{pa("transport closed due to %s",t),this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=(0,V_.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=(0,V_.createPacketEncoderStream)();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:c})=>{if(a){pa("session is closed");return}pa("received chunk: %o",c),this.onPacket(c),o()}).catch(a=>{pa("an error occurred while reading: %s",a)})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&(0,EF.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}au.WT=kF,Object.defineProperty(da,"__esModule",{value:!0}),da.transports=void 0;const CF=Jo,TF=su,AF=au;da.transports={websocket:TF.WS,webtransport:AF.WT,polling:CF.Polling};var ha={};Object.defineProperty(ha,"__esModule",{value:!0}),ha.parse=void 0;const OF=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IF=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function RF(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=OF.exec(e||""),o={},s=14;for(;s--;)o[IF[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=PF(o,o.path),o.queryKey=$F(o,o.query),o}ha.parse=RF;function PF(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function $F(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}var DF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tu,"__esModule",{value:!0}),tu.Socket=void 0;const NF=da,H_=dr,jF=oo,W_=ha,MF=DF(jr),qF=es,K_=Yo,LF=Xn,Ut=(0,MF.default)("engine.io-client:socket");let J_=class Ps extends qF.Emitter{constructor(t,n={}){super(),this.binaryType=LF.defaultBinaryType,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=(0,W_.parse)(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=(0,W_.parse)(n.host).host),(0,H_.installTimerFunctions)(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,jF.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){Ut('creating transport "%s"',t);const n=Object.assign({},this.opts.query);n.EIO=K_.protocol,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return Ut("options: %j",r),new NF.transports[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Ps.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){Ut("error while creating transport: %s",n),this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){Ut("setting transport %s",t.name),this.transport&&(Ut("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){Ut('probing transport "%s"',t);let n=this.createTransport(t),r=!1;Ps.priorWebsocketSuccess=!1;const i=()=>{r||(Ut('probe transport "%s" opened',t),n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(Ut('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ps.priorWebsocketSuccess=n.name==="websocket",Ut('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{r||this.readyState!=="closed"&&(Ut("changing transport and sending upgrade packet"),u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{Ut('probe transport "%s" failed',t);const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const p=new Error("probe error: "+d);p.transport=n.name,o(),Ut('probe transport "%s" failed because of error: %s',t,d),this.emitReserved("upgradeError",p)};function a(){s("transport closed")}function c(){s("socket closed")}function l(d){n&&d.name!==n.name&&(Ut('"%s" works - aborting "%s"',d.name,n.name),o())}const u=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",l),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(Ut("socket open"),this.readyState="open",Ps.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){Ut("starting upgrade probes");let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(Ut('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}else Ut('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();Ut("flushing %d packets in socket",t.length),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=(0,H_.byteLength)(i)),r>0&&n>this.maxPayload)return Ut("only send %d out of %d packets",r,this.writeBuffer.length),this.writeBuffer.slice(0,r);n+=2}return Ut("payload size is %d (max: %d)",n,this.maxPayload),this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),Ut("socket closing - telling transport to close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Ut("socket error %j",t),Ps.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(Ut('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};tu.Socket=J_,J_.protocol=K_.protocol,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const t=tu;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return t.Socket}}),e.protocol=t.Socket.protocol;var n=ro;Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return n.Transport}});var r=da;Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return r.transports}});var i=dr;Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var o=ha;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return o.parse}});var s=Xn;Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return s.nextTick}})}(Qp);var FF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(eu,"__esModule",{value:!0}),eu.url=void 0;const UF=Qp,Y_=FF(jr).default("socket.io-client:url");function BF(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(Y_("protocol-less url %s",e),typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),Y_("parse %s",e),r=UF.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}eu.url=BF;var cu={},ma={},lu={},ns={},ao={};Object.defineProperty(ao,"__esModule",{value:!0}),ao.hasBinary=ao.isBinary=void 0;const zF=typeof ArrayBuffer=="function",ZF=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,G_=Object.prototype.toString,VF=typeof Blob=="function"||typeof Blob<"u"&&G_.call(Blob)==="[object BlobConstructor]",HF=typeof File=="function"||typeof File<"u"&&G_.call(File)==="[object FileConstructor]";function X_(e){return zF&&(e instanceof ArrayBuffer||ZF(e))||VF&&e instanceof Blob||HF&&e instanceof File}ao.isBinary=X_;function uu(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(uu(e[n]))return!0;return!1}if(X_(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return uu(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&uu(e[n]))return!0;return!1}ao.hasBinary=uu,Object.defineProperty(ns,"__esModule",{value:!0}),ns.reconstructPacket=ns.deconstructPacket=void 0;const WF=ao;function KF(e){const t=[],n=e.data,r=e;return r.data=oh(n,t),r.attachments=t.length,{packet:r,buffers:t}}ns.deconstructPacket=KF;function oh(e,t){if(!e)return e;if((0,WF.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=oh(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=oh(e[r],t));return n}return e}function JF(e,t){return e.data=sh(e.data,t),delete e.attachments,e}ns.reconstructPacket=JF;function sh(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=sh(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=sh(e[n],t));return e}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=es,n=ns,r=ao,o=(0,jr.default)("socket.io-parser"),s=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var a;(function(p){p[p.CONNECT=0]="CONNECT",p[p.DISCONNECT=1]="DISCONNECT",p[p.EVENT=2]="EVENT",p[p.ACK=3]="ACK",p[p.CONNECT_ERROR=4]="CONNECT_ERROR",p[p.BINARY_EVENT=5]="BINARY_EVENT",p[p.BINARY_ACK=6]="BINARY_ACK"})(a=e.PacketType||(e.PacketType={}));class c{constructor(f){this.replacer=f}encode(f){return o("encoding packet %j",f),(f.type===a.EVENT||f.type===a.ACK)&&(0,r.hasBinary)(f)?this.encodeAsBinary({type:f.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:f.nsp,data:f.data,id:f.id}):[this.encodeAsString(f)]}encodeAsString(f){let h=""+f.type;return(f.type===a.BINARY_EVENT||f.type===a.BINARY_ACK)&&(h+=f.attachments+"-"),f.nsp&&f.nsp!=="/"&&(h+=f.nsp+","),f.id!=null&&(h+=f.id),f.data!=null&&(h+=JSON.stringify(f.data,this.replacer)),o("encoded %j as %s",f,h),h}encodeAsBinary(f){const h=(0,n.deconstructPacket)(f),m=this.encodeAsString(h.packet),y=h.buffers;return y.unshift(m),y}}e.Encoder=c;function l(p){return Object.prototype.toString.call(p)==="[object Object]"}class u extends t.Emitter{constructor(f){super(),this.reviver=f}add(f){let h;if(typeof f=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");h=this.decodeString(f);const m=h.type===a.BINARY_EVENT;m||h.type===a.BINARY_ACK?(h.type=m?a.EVENT:a.ACK,this.reconstructor=new d(h),h.attachments===0&&super.emitReserved("decoded",h)):super.emitReserved("decoded",h)}else if((0,r.isBinary)(f)||f.base64)if(this.reconstructor)h=this.reconstructor.takeBinaryData(f),h&&(this.reconstructor=null,super.emitReserved("decoded",h));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+f)}decodeString(f){let h=0;const m={type:Number(f.charAt(0))};if(a[m.type]===void 0)throw new Error("unknown packet type "+m.type);if(m.type===a.BINARY_EVENT||m.type===a.BINARY_ACK){const g=h+1;for(;f.charAt(++h)!=="-"&&h!=f.length;);const v=f.substring(g,h);if(v!=Number(v)||f.charAt(h)!=="-")throw new Error("Illegal attachments");m.attachments=Number(v)}if(f.charAt(h+1)==="/"){const g=h+1;for(;++h&&!(f.charAt(h)===","||h===f.length););m.nsp=f.substring(g,h)}else m.nsp="/";const y=f.charAt(h+1);if(y!==""&&Number(y)==y){const g=h+1;for(;++h;){const v=f.charAt(h);if(v==null||Number(v)!=v){--h;break}if(h===f.length)break}m.id=Number(f.substring(g,h+1))}if(f.charAt(++h)){const g=this.tryParse(f.substr(h));if(u.isPayloadValid(m.type,g))m.data=g;else throw new Error("invalid payload")}return o("decoded %s as %j",f,m),m}tryParse(f){try{return JSON.parse(f,this.reviver)}catch{return!1}}static isPayloadValid(f,h){switch(f){case a.CONNECT:return l(h);case a.DISCONNECT:return h===void 0;case a.CONNECT_ERROR:return typeof h=="string"||l(h);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(h)&&(typeof h[0]=="number"||typeof h[0]=="string"&&s.indexOf(h[0])===-1);case a.ACK:case a.BINARY_ACK:return Array.isArray(h)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=u;class d{constructor(f){this.packet=f,this.buffers=[],this.reconPack=f}takeBinaryData(f){if(this.buffers.push(f),this.buffers.length===this.reconPack.attachments){const h=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),h}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}})(lu);var ya={};Object.defineProperty(ya,"__esModule",{value:!0}),ya.on=void 0;function YF(e,t,n){return e.on(t,n),function(){e.off(t,n)}}ya.on=YF;var GF=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ma,"__esModule",{value:!0}),ma.Socket=void 0;const _r=lu,du=ya,XF=es,on=GF(jr).default("socket.io-client:socket"),QF=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class e3 extends XF.Emitter{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[du.on(t,"open",this.onopen.bind(this)),du.on(t,"packet",this.onpacket.bind(this)),du.on(t,"error",this.onerror.bind(this)),du.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(QF.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:_r.PacketType.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++;on("emitting packet with ack id %d",s);const a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)?on("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&(on("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(s,1));on("event with ack id %d has timed out after %d ms",t,i),n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...s)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(on("packet [%d] is discarded after %d tries",r.id,r.tryCount),this._queue.shift(),n&&n(i)):(on("packet [%d] was successfully sent",r.id),this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(on("draining queue"),!this.connected||this._queue.length===0)return;const n=this._queue[0];if(n.pending&&!t){on("packet [%d] has already been sent and is waiting for an ack",n.id);return}n.pending=!0,n.tryCount++,on("sending packet [%d] (try n°%d)",n.id,n.tryCount),this.flags=n.flags,this.emit.apply(this,n.args)}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){on("transport is open - connecting"),typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_r.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){on("close (%s)",t),this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _r.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _r.PacketType.EVENT:case _r.PacketType.BINARY_EVENT:this.onevent(t);break;case _r.PacketType.ACK:case _r.PacketType.BINARY_ACK:this.onack(t);break;case _r.PacketType.DISCONNECT:this.ondisconnect();break;case _r.PacketType.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];on("emitting event %j",n),t.id!=null&&(on("attaching ack callback to event"),n.push(this.ack(t.id))),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,on("sending ack %j",i),n.packet({type:_r.PacketType.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"?(on("calling ack %s with %j",t.id,t.data),n.apply(this,t.data),delete this.acks[t.id]):on("bad ack %s",t.id)}onconnect(t,n){on("socket connected with id %s",t),this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){on("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(on("performing disconnect (%s)",this.nsp),this.packet({type:_r.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}ma.Socket=e3;var fu={};Object.defineProperty(fu,"__esModule",{value:!0}),fu.Backoff=void 0;function rs(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}fu.Backoff=rs,rs.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},rs.prototype.reset=function(){this.attempts=0},rs.prototype.setMin=function(e){this.ms=e},rs.prototype.setMax=function(e){this.max=e},rs.prototype.setJitter=function(e){this.jitter=e};var t3=tt&&tt.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),n3=tt&&tt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r3=tt&&tt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&t3(t,e,n);return n3(t,e),t},i3=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cu,"__esModule",{value:!0}),cu.Manager=void 0;const ah=Qp,o3=ma,s3=r3(lu),co=ya,a3=fu,c3=es,wn=i3(jr).default("socket.io-client:manager");class l3 extends c3.Emitter{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ah.installTimerFunctions(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new a3.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||s3;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(wn("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;wn("opening %s",this.uri),this.engine=new ah.Socket(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=co.on(n,"open",function(){r.onopen(),t&&t()}),o=a=>{wn("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=co.on(n,"error",o);if(this._timeout!==!1){const a=this._timeout;wn("connect attempt will timeout after %d",a);const c=this.setTimeoutFn(()=>{wn("connect attempt timed out after %d",a),i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){wn("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(co.on(t,"ping",this.onping.bind(this)),co.on(t,"data",this.ondata.bind(this)),co.on(t,"error",this.onerror.bind(this)),co.on(t,"close",this.onclose.bind(this)),co.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){ah.nextTick(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){wn("error",t),this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new o3.Socket(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active){wn("socket %s is still active, skipping close",r);return}this._close()}_packet(t){wn("writing packet %j",t);const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){wn("cleanup"),this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){wn("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){wn("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)wn("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();wn("will wait %dms before reconnect attempt",n),this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(wn("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(wn("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):(wn("reconnect success"),t.onreconnect())}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}cu.Manager=l3,function(e,t){var n=tt&&tt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=eu,i=cu;Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const o=ma;Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return o.Socket}});const a=n(jr).default("socket.io-client"),c={};function l(d,p){typeof d=="object"&&(p=d,d=void 0),p=p||{};const f=r.url(d,p.path||"/socket.io"),h=f.source,m=f.id,y=f.path,g=c[m]&&y in c[m].nsps,v=p.forceNew||p["force new connection"]||p.multiplex===!1||g;let b;return v?(a("ignoring socket cache for %s",h),b=new i.Manager(h,p)):(c[m]||(a("new io instance for %s",h),c[m]=new i.Manager(h,p)),b=c[m]),f.query&&!p.query&&(p.query=f.queryKey),b.socket(f.path,p)}t.io=l,t.connect=l,t.default=l,Object.assign(l,{Manager:i.Manager,Socket:o.Socket,io:l,connect:l});var u=lu;Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return u.protocol}}),e.exports=l}(Xp,Xp.exports);var u3=Xp.exports;(function(e){var t=tt&&tt.__awaiter||function(c,l,u,d){function p(f){return f instanceof u?f:new u(function(h){h(f)})}return new(u||(u=Promise))(function(f,h){function m(v){try{g(d.next(v))}catch(b){h(b)}}function y(v){try{g(d.throw(v))}catch(b){h(b)}}function g(v){v.done?f(v.value):p(v.value).then(m,y)}g((d=d.apply(c,l||[])).next())})},n=tt&&tt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocketComEmitter=e.SocketComEvents=e.SocketCom=void 0;const r=Gp,i=n(u3);class o{constructor(l){this.url=l,this.pending={},this.emitter=new a,this.events=this.emitter}connect(l,u){return t(this,void 0,void 0,function*(){return new Promise((d,p)=>{this.disconnect(),this.socket=(0,i.default)(this.url,{transports:["websocket"],auth:l,autoConnect:!1,query:u});const f=setTimeout(()=>{p("connection timed out")},5e3);this.socket.on("login",h=>t(this,void 0,void 0,function*(){clearTimeout(f),d(h)})),this.socket.on("connect_error",h=>{var m;(m=this.socket)===null||m===void 0||m.close(),clearTimeout(f),p(h.message)}),this.socket.on("message",h=>t(this,void 0,void 0,function*(){var m;this.pending[h.request]&&(!((m=h.data)===null||m===void 0)&&m.error?this.pending[h.request].reject(new Error(h.data.message)):this.pending[h.request].resolve(h.data),delete this.pending[h.request]),yield this.emitter.emit(s.Message,h)})),this.socket.connect()})})}disconnect(){var l;this.socket&&!(!((l=this.socket)===null||l===void 0)&&l.disconnected)&&this.socket.disconnect()}request(l,u){var d;return t(this,void 0,void 0,function*(){if(!(!((d=this.socket)===null||d===void 0)&&d.connected))throw new Error("Client is disconnected");const p=this.random(32),f=new Promise((h,m)=>{this.pending[p]={resolve:h,reject:m}});return this.socket.send({request:p,type:l,data:u}),f})}random(l){const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let d="";for(let p=0;p<l;p++)d+=u.charAt(Math.floor(Math.random()*u.length));return d}}e.SocketCom=o;var s;(function(c){c.Message="message"})(s=e.SocketComEvents||(e.SocketComEvents={}));class a extends r.Emitter{}e.SocketComEmitter=a})(k_);var pu={},d3=tt&&tt.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(pu,"__esModule",{value:!0}),pu.SocketEmitter=void 0;class f3{constructor(){this.listeners={}}on(t,n){const r=this.listeners[t];r?r.push(n):this.listeners[t]=[n]}removeListeners(t){this.listeners[t]=[]}emit(t,n){return d3(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}}pu.SocketEmitter=f3;var Zn=tt&&tt.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(Ql,"__esModule",{value:!0}),Ql.MessagingSocket=void 0;const Q_=k_,p3=pu;class h3 extends p3.SocketEmitter{constructor(t){super(),this.clientId=t.clientId,this.com=new Q_.SocketCom(t.url),this.com.events.on(Q_.SocketComEvents.Message,n=>Zn(this,void 0,void 0,function*(){n.type==="message.new"&&(yield this.emit("message",n.data.message))}))}get creds(){return this._creds}get userId(){var t;return(t=this._creds)===null||t===void 0?void 0:t.userId}get conversationId(){return this._conversationId}connect(t,n){return Zn(this,void 0,void 0,function*(){const r=n?{userData:JSON.stringify(n)}:void 0,i=yield this.com.connect({clientId:this.clientId,creds:t},r);return i.userId===(t==null?void 0:t.userId)&&!i.userToken&&(i.userToken=t.userToken),this._creds=i,yield this.emit("connect",this._creds),yield this.emit("user",this._creds.userId),i})}disconnect(){return Zn(this,void 0,void 0,function*(){this.com.disconnect(),yield this.emit("disconnect",void 0)})}getUser(){return Zn(this,void 0,void 0,function*(){return this.request("users.get",{})})}switchConversation(t){return Zn(this,void 0,void 0,function*(){this._conversationId=t,yield this.emit("conversation",this._conversationId)})}createConversation(t){return Zn(this,void 0,void 0,function*(){const n=yield this.request("conversations.create",{});return(t==null?void 0:t.switch)!==!1&&(yield this.switchConversation(n.id)),n})}startConversation(t){return Zn(this,void 0,void 0,function*(){yield this.request("conversations.start",{id:t||this._conversationId})})}getConversation(t){return Zn(this,void 0,void 0,function*(){return this.request("conversations.get",{id:t||this._conversationId})})}deleteConversation(t){return Zn(this,void 0,void 0,function*(){const n=yield this.request("conversations.delete",{id:t||this._conversationId});return n&&(yield this.switchConversation(void 0)),n})}listConversations(t){return Zn(this,void 0,void 0,function*(){return this.request("conversations.list",{limit:t||20})})}sendText(t){return Zn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:{type:"text",text:t}})})}sendPayload(t){return Zn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:t})})}listMessages(t){return Zn(this,void 0,void 0,function*(){return this.request("messages.list",{conversationId:this._conversationId,limit:t||20})})}sendFeedback(t,n){return Zn(this,void 0,void 0,function*(){yield this.request("messages.feedback",{messageId:t,feedback:n})})}request(t,n){return this.com.request(t,n)}}Ql.MessagingSocket=h3,function(e){var t=tt&&tt.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o),Object.defineProperty(r,s,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=tt&&tt.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Gp,e),n(Ql,e)}(g_);class m3{constructor(t){k(this,"socket");k(this,"clientId");k(this,"apiUrl");k(this,"userId");k(this,"conversationId");k(this,"userToken");k(this,"connected",!1);k(this,"emitter");k(this,"on");k(this,"mode","messaging");this.socket=new g_.MessagingSocket(t),this.emitter=new sp,this.clientId=t.clientId,this.apiUrl=t.url,this.on=this.emitter.on.bind(this.emitter),this.socket.on("message",n=>{const r=n.payload;if(r.type==="trigger")switch(r.trigger.type){case"webchat-visibility":this.emitter.emit("webchatVisibility",r.trigger.visibility);break;case"webchat-config":this.emitter.emit("webchatConfig",r.trigger.config);break;case"custom-event":this.emitter.emit("customEvent",r.trigger.event);break}else{const i=Il.parse(r),{payload:o,disableInput:s}=np(i);this.emitter.emit("message",{...n,payload:o,disableInput:s})}}),this.socket.on("conversation",n=>{this.emitter.emit("conversation",n)})}async connect(t,n){if(this.connected)return;this.connected=!0;const r=await this.socket.connect(t,n).catch(i=>{throw this.connected=!1,i});return this.userId=r.userId,this.userToken=r.userToken,r}async disconnect(){await this.socket.disconnect(),this.connected=!1}async getUser(){throw new Error("Get user is not supported in messaging mode")}async updateUser(){throw new Error("Update user is not supported in messaging mode")}async sendFile(t){throw new Error("Send file is not supported in messaging mode")}async sendMessage(t){this.conversationId||await this.newConversation(),await this.socket.sendText(t),this.emitter.emit("messageSent",t)}async sendEvent(t){this.conversationId||await this.newConversation(),await this.socket.sendPayload({type:"trigger",payload:t})}async switchConversation(t){await this.socket.switchConversation(t),this.conversationId=t}async conversationExists(t){return(await this.socket.listConversations()).some(r=>r.id===t)}async newConversation(){const{id:t}=await this.socket.createConversation();await this.socket.startConversation(),this.conversationId=t}async listMessages(t){return(await this.socket.listMessages(t)).map(r=>{const i=Il.parse(r.payload),{payload:o,disableInput:s}=np(i);return{...r,payload:o,disableInput:s}})}}function e1(e,t){return function(){return e.apply(t,arguments)}}const{toString:t1}=Object.prototype,{getPrototypeOf:ch}=Object,lh=(e=>t=>{const n=t1.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ti=e=>(e=e.toLowerCase(),t=>lh(t)===e),hu=e=>t=>typeof t===e,{isArray:is}=Array,ga=hu("undefined");function y3(e){return e!==null&&!ga(e)&&e.constructor!==null&&!ga(e.constructor)&&lo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const n1=ti("ArrayBuffer");function g3(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&n1(e.buffer),t}const v3=hu("string"),lo=hu("function"),r1=hu("number"),uh=e=>e!==null&&typeof e=="object",b3=e=>e===!0||e===!1,mu=e=>{if(lh(e)!=="object")return!1;const t=ch(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},w3=ti("Date"),x3=ti("File"),_3=ti("Blob"),S3=ti("FileList"),E3=e=>uh(e)&&lo(e.pipe),k3=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||t1.call(e)===t||lo(e.toString)&&e.toString()===t)},C3=ti("URLSearchParams"),T3=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function va(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),is(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(r=0;r<s;r++)a=o[r],t.call(null,e[a],a,e)}}function i1(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const o1=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),s1=e=>!ga(e)&&e!==o1;function dh(){const{caseless:e}=s1(this)&&this||{},t={},n=(r,i)=>{const o=e&&i1(t,i)||i;mu(t[o])&&mu(r)?t[o]=dh(t[o],r):mu(r)?t[o]=dh({},r):is(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&va(arguments[r],n);return t}const A3=(e,t,n,{allOwnKeys:r}={})=>(va(t,(i,o)=>{n&&lo(i)?e[o]=e1(i,n):e[o]=i},{allOwnKeys:r}),e),O3=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),I3=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},R3=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&ch(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},P3=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},$3=e=>{if(!e)return null;if(is(e))return e;let t=e.length;if(!r1(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},D3=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ch(Uint8Array)),N3=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},j3=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},M3=ti("HTMLFormElement"),q3=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),a1=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),L3=ti("RegExp"),c1=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};va(n,(i,o)=>{t(i,o,e)!==!1&&(r[o]=i)}),Object.defineProperties(e,r)},se={isArray:is,isArrayBuffer:n1,isBuffer:y3,isFormData:k3,isArrayBufferView:g3,isString:v3,isNumber:r1,isBoolean:b3,isObject:uh,isPlainObject:mu,isUndefined:ga,isDate:w3,isFile:x3,isBlob:_3,isRegExp:L3,isFunction:lo,isStream:E3,isURLSearchParams:C3,isTypedArray:D3,isFileList:S3,forEach:va,merge:dh,extend:A3,trim:T3,stripBOM:O3,inherits:I3,toFlatObject:R3,kindOf:lh,kindOfTest:ti,endsWith:P3,toArray:$3,forEachEntry:N3,matchAll:j3,isHTMLForm:M3,hasOwnProperty:a1,hasOwnProp:a1,reduceDescriptors:c1,freezeMethods:e=>{c1(e,(t,n)=>{if(lo(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(lo(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return is(e)?r(e):r(String(e).split(t)),n},toCamelCase:q3,noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:i1,global:o1,isContextDefined:s1,toJSONObject:e=>{const t=new Array(10),n=(r,i)=>{if(uh(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=is(r)?[]:{};return va(r,(s,a)=>{const c=n(s,i+1);!ga(c)&&(o[a]=c)}),t[i]=void 0,o}}return r};return n(e,0)}};function kt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}se.inherits(kt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:se.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const l1=kt.prototype,u1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{u1[e]={value:e}}),Object.defineProperties(kt,u1),Object.defineProperty(l1,"isAxiosError",{value:!0}),kt.from=(e,t,n,r,i,o)=>{const s=Object.create(l1);return se.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),kt.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};var F3=typeof self=="object"?self.FormData:window.FormData;const U3=mi(F3);function fh(e){return se.isPlainObject(e)||se.isArray(e)}function d1(e){return se.endsWith(e,"[]")?e.slice(0,-2):e}function f1(e,t,n){return e?e.concat(t).map(function(i,o){return i=d1(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function B3(e){return se.isArray(e)&&!e.some(fh)}const z3=se.toFlatObject(se,{},null,function(t){return/^is[A-Z]/.test(t)});function Z3(e){return e&&se.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function yu(e,t,n){if(!se.isObject(e))throw new TypeError("target must be an object");t=t||new(U3||FormData),n=se.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!se.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Z3(t);if(!se.isFunction(i))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(se.isDate(h))return h.toISOString();if(!c&&se.isBlob(h))throw new kt("Blob is not supported. Use a Buffer instead.");return se.isArrayBuffer(h)||se.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,m,y){let g=h;if(h&&!y&&typeof h=="object"){if(se.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(se.isArray(h)&&B3(h)||se.isFileList(h)||se.endsWith(m,"[]")&&(g=se.toArray(h)))return m=d1(m),g.forEach(function(b,S){!(se.isUndefined(b)||b===null)&&t.append(s===!0?f1([m],S,o):s===null?m:m+"[]",l(b))}),!1}return fh(h)?!0:(t.append(f1(y,m,o),l(h)),!1)}const d=[],p=Object.assign(z3,{defaultVisitor:u,convertValue:l,isVisitable:fh});function f(h,m){if(!se.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),se.forEach(h,function(g,v){(!(se.isUndefined(g)||g===null)&&i.call(t,g,se.isString(v)?v.trim():v,m,p))===!0&&f(g,m?m.concat(v):[v])}),d.pop()}}if(!se.isObject(e))throw new TypeError("data must be an object");return f(e),t}function p1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ph(e,t){this._pairs=[],e&&yu(e,this,t)}const h1=ph.prototype;h1.append=function(t,n){this._pairs.push([t,n])},h1.toString=function(t){const n=t?function(r){return t.call(this,r,p1)}:p1;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function V3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function m1(e,t,n){if(!t)return e;const r=n&&n.encode||V3,i=n&&n.serialize;let o;if(i?o=i(t,n):o=se.isURLSearchParams(t)?t.toString():new ph(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class H3{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){se.forEach(this.handlers,function(r){r!==null&&t(r)})}}const y1=H3,g1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},W3=typeof URLSearchParams<"u"?URLSearchParams:ph,K3=FormData,J3=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Y3=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Mr={isBrowser:!0,classes:{URLSearchParams:W3,FormData:K3,Blob},isStandardBrowserEnv:J3,isStandardBrowserWebWorkerEnv:Y3,protocols:["http","https","file","blob","url","data"]};function G3(e,t){return yu(e,new Mr.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Mr.isNode&&se.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function X3(e){return se.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Q3(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function v1(e){function t(n,r,i,o){let s=n[o++];const a=Number.isFinite(+s),c=o>=n.length;return s=!s&&se.isArray(i)?i.length:s,c?(se.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!se.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&se.isArray(i[s])&&(i[s]=Q3(i[s])),!a)}if(se.isFormData(e)&&se.isFunction(e.entries)){const n={};return se.forEachEntry(e,(r,i)=>{t(X3(r),i,n,0)}),n}return null}const e5={"Content-Type":void 0};function t5(e,t,n){if(se.isString(e))try{return(t||JSON.parse)(e),se.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const gu={transitional:g1,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=se.isObject(t);if(o&&se.isHTMLForm(t)&&(t=new FormData(t)),se.isFormData(t))return i&&i?JSON.stringify(v1(t)):t;if(se.isArrayBuffer(t)||se.isBuffer(t)||se.isStream(t)||se.isFile(t)||se.isBlob(t))return t;if(se.isArrayBufferView(t))return t.buffer;if(se.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return G3(t,this.formSerializer).toString();if((a=se.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return yu(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),t5(t)):t}],transformResponse:[function(t){const n=this.transitional||gu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&se.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?kt.from(a,kt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mr.classes.FormData,Blob:Mr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};se.forEach(["delete","get","head"],function(t){gu.headers[t]={}}),se.forEach(["post","put","patch"],function(t){gu.headers[t]=se.merge(e5)});const hh=gu,n5=se.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),r5=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
131
131
|
`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&n5[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},b1=Symbol("internals");function ba(e){return e&&String(e).trim().toLowerCase()}function vu(e){return e===!1||e==null?e:se.isArray(e)?e.map(vu):String(e)}function i5(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function o5(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function w1(e,t,n,r){if(se.isFunction(r))return r.call(this,t,n);if(se.isString(t)){if(se.isString(r))return t.indexOf(r)!==-1;if(se.isRegExp(r))return r.test(t)}}function s5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function a5(e,t){const n=se.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}class bu{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,c,l){const u=ba(c);if(!u)throw new Error("header name must be a non-empty string");const d=se.findKey(i,u);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=vu(a))}const s=(a,c)=>se.forEach(a,(l,u)=>o(l,u,c));return se.isPlainObject(t)||t instanceof this.constructor?s(t,n):se.isString(t)&&(t=t.trim())&&!o5(t)?s(r5(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=ba(t),t){const r=se.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return i5(i);if(se.isFunction(n))return n.call(this,i,r);if(se.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ba(t),t){const r=se.findKey(this,t);return!!(r&&(!n||w1(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=ba(s),s){const a=se.findKey(r,s);a&&(!n||w1(r,r[a],a,n))&&(delete r[a],i=!0)}}return se.isArray(t)?t.forEach(o):o(t),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(t){const n=this,r={};return se.forEach(this,(i,o)=>{const s=se.findKey(r,o);if(s){n[s]=vu(i),delete n[o];return}const a=t?s5(o):String(o).trim();a!==o&&delete n[o],n[a]=vu(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return se.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&se.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
132
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[b1]=this[b1]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=ba(s);r[a]||(a5(i,s),r[a]=!0)}return se.isArray(t)?t.forEach(o):o(t),this}}bu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),se.freezeMethods(bu.prototype),se.freezeMethods(bu);const ni=bu;function mh(e,t){const n=this||hh,r=t||n,i=ni.from(r.headers);let o=r.data;return se.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function x1(e){return!!(e&&e.__CANCEL__)}function wa(e,t,n){kt.call(this,e??"canceled",kt.ERR_CANCELED,t,n),this.name="CanceledError"}se.inherits(wa,kt,{__CANCEL__:!0});const c5=null;function l5(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new kt("Request failed with status code "+n.status,[kt.ERR_BAD_REQUEST,kt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const u5=Mr.isStandardBrowserEnv?function(){return{write:function(n,r,i,o,s,a){const c=[];c.push(n+"="+encodeURIComponent(r)),se.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),se.isString(o)&&c.push("path="+o),se.isString(s)&&c.push("domain="+s),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function d5(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function f5(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function _1(e,t){return e&&!d5(t)?f5(e,t):t}const p5=Mr.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=se.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function h5(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function m5(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[o];s||(s=l),n[i]=c,r[i]=l;let d=o,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const f=u&&l-u;return f?Math.round(h*1e3/f):void 0}}function S1(e,t){let n=0;const r=m5(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a),l=o<=s;n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-o)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const wu={http:c5,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const o=ni.from(e.headers).normalize(),s=e.responseType;let a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}se.isFormData(i)&&(Mr.isStandardBrowserEnv||Mr.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let l=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",p=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(f+":"+p))}const u=_1(e.baseURL,e.url);l.open(e.method.toUpperCase(),m1(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function d(){if(!l)return;const f=ni.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),m={data:!s||s==="text"||s==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:f,config:e,request:l};l5(function(v){n(v),c()},function(v){r(v),c()},m),l=null}if("onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(d)},l.onabort=function(){l&&(r(new kt("Request aborted",kt.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new kt("Network Error",kt.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||g1;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),r(new kt(p,m.clarifyTimeoutError?kt.ETIMEDOUT:kt.ECONNABORTED,e,l)),l=null},Mr.isStandardBrowserEnv){const f=(e.withCredentials||p5(u))&&e.xsrfCookieName&&u5.read(e.xsrfCookieName);f&&o.set(e.xsrfHeaderName,f)}i===void 0&&o.setContentType(null),"setRequestHeader"in l&&se.forEach(o.toJSON(),function(p,m){l.setRequestHeader(m,p)}),se.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&s!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",S1(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",S1(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=f=>{l&&(r(!f||f.type?new wa(null,e,l):f),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const h=h5(u);if(h&&Mr.protocols.indexOf(h)===-1){r(new kt("Unsupported protocol "+h+":",kt.ERR_BAD_REQUEST,e));return}l.send(i||null)})}};se.forEach(wu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const y5={getAdapter:e=>{e=se.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=se.isString(n)?wu[n.toLowerCase()]:n));i++);if(!r)throw r===!1?new kt(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(se.hasOwnProp(wu,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!se.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:wu};function yh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wa(null,e)}function E1(e){return yh(e),e.headers=ni.from(e.headers),e.data=mh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),y5.getAdapter(e.adapter||hh.adapter)(e).then(function(r){return yh(e),r.data=mh.call(e,e.transformResponse,r),r.headers=ni.from(r.headers),r},function(r){return x1(r)||(yh(e),r&&r.response&&(r.response.data=mh.call(e,e.transformResponse,r.response),r.response.headers=ni.from(r.response.headers))),Promise.reject(r)})}const k1=e=>e instanceof ni?e.toJSON():e;function os(e,t){t=t||{};const n={};function r(l,u,d){return se.isPlainObject(l)&&se.isPlainObject(u)?se.merge.call({caseless:d},l,u):se.isPlainObject(u)?se.merge({},u):se.isArray(u)?u.slice():u}function i(l,u,d){if(se.isUndefined(u)){if(!se.isUndefined(l))return r(void 0,l,d)}else return r(l,u,d)}function o(l,u){if(!se.isUndefined(u))return r(void 0,u)}function s(l,u){if(se.isUndefined(u)){if(!se.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u)=>i(k1(l),k1(u),!0)};return se.forEach(Object.keys(e).concat(Object.keys(t)),function(u){const d=c[u]||i,h=d(e[u],t[u],u);se.isUndefined(h)&&d!==a||(n[u]=h)}),n}const C1="1.2.5",gh={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gh[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const T1={};gh.transitional=function(t,n,r){function i(o,s){return"[Axios v"+C1+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new kt(i(s," has been removed"+(n?" in "+n:"")),kt.ERR_DEPRECATED);return n&&!T1[s]&&(T1[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};function g5(e,t,n){if(typeof e!="object")throw new kt("options must be an object",kt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new kt("option "+o+" must be "+c,kt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new kt("Unknown option "+o,kt.ERR_BAD_OPTION)}}const vh={assertOptions:g5,validators:gh},ki=vh.validators;class xu{constructor(t){this.defaults=t,this.interceptors={request:new y1,response:new y1}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=os(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&vh.assertOptions(r,{silentJSONParsing:ki.transitional(ki.boolean),forcedJSONParsing:ki.transitional(ki.boolean),clarifyTimeoutError:ki.transitional(ki.boolean)},!1),i!==void 0&&vh.assertOptions(i,{encode:ki.function,serialize:ki.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=o&&se.merge(o.common,o[n.method]),s&&se.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=ni.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!c){const p=[E1.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(y){m.call(this,y);break}}try{u=E1.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=os(this.defaults,t);const n=_1(t.baseURL,t.url);return m1(n,t.params,t.paramsSerializer)}}se.forEach(["delete","get","head","options"],function(t){xu.prototype[t]=function(n,r){return this.request(os(r||{},{method:t,url:n,data:(r||{}).data}))}}),se.forEach(["post","put","patch"],function(t){function n(r){return function(o,s,a){return this.request(os(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}xu.prototype[t]=n(),xu.prototype[t+"Form"]=n(!0)});const _u=xu;class bh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new wa(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new bh(function(i){t=i}),cancel:t}}}const v5=bh;function b5(e){return function(n){return e.apply(null,n)}}function w5(e){return se.isObject(e)&&e.isAxiosError===!0}const wh={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wh).forEach(([e,t])=>{wh[t]=e});const x5=wh;function A1(e){const t=new _u(e),n=e1(_u.prototype.request,t);return se.extend(n,_u.prototype,t,{allOwnKeys:!0}),se.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return A1(os(e,i))},n}const sn=A1(hh);sn.Axios=_u,sn.CanceledError=wa,sn.CancelToken=v5,sn.isCancel=x1,sn.VERSION=C1,sn.toFormData=yu,sn.AxiosError=kt,sn.Cancel=sn.CanceledError,sn.all=function(t){return Promise.all(t)},sn.spread=b5,sn.isAxiosError=w5,sn.mergeConfig=os,sn.AxiosHeaders=ni,sn.formToJSON=e=>v1(se.isHTMLForm(e)?new FormData(e):e),sn.HttpStatusCode=x5,sn.default=sn;const O1=sn,_5={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))};let xh=typeof window<"u"&&typeof window.document<"u"?window.crypto:yf;xh.getRandomValues||(xh=_5);class Dt extends Error{constructor(n,r,i,o,s,a){super(o);k(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=o,this.error=s,this.id=a,this.id||(this.id=Dt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){const n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,o=Array.from(xh.getRandomValues(new Uint8Array(i))).map(s=>s.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${o}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}}const S5=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,_h=e=>e instanceof Dt||S5(e)&&e.isApiError===!0;class xa extends Dt{constructor(t,n,r){super(500,"An unknown error occurred","Unknown",t,n,r)}}class E5 extends Dt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}}class k5 extends Dt{constructor(t,n,r){super(401,"The request requires to be authenticated.","Unauthorized",t,n,r)}}class C5 extends Dt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}}class T5 extends Dt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}}class A5 extends Dt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}}class O5 extends Dt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}}class I5 extends Dt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}}class R5 extends Dt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}}class P5 extends Dt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}}class $5 extends Dt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}}class D5 extends Dt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}}class N5 extends Dt{constructor(t,n,r){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",t,n,r)}}class j5 extends Dt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}}class M5 extends Dt{constructor(t,n,r){super(409,"The resource is current locked and cannot be operated on until the lock is released.","ResourceLockedConflict",t,n,r)}}class q5 extends Dt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}}class L5 extends Dt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}}class F5 extends Dt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}}class U5 extends Dt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}}class B5 extends Dt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}}class z5 extends Dt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}}class Z5 extends Dt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}}class V5 extends Dt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}}class H5 extends Dt{constructor(t,n,r){super(400,"Request payload contains breaking changes which is not allowed for this resource without a version increment.","BreakingChanges",t,n,r)}}const W5={Unknown:xa,Internal:E5,Unauthorized:k5,Forbidden:C5,PayloadTooLarge:T5,InvalidPayload:A5,UnsupportedMediaType:O5,MethodNotFound:I5,ResourceNotFound:R5,InvalidJsonSchema:P5,InvalidDataFormat:$5,InvalidIdentifier:D5,RelationConflict:N5,ReferenceConstraint:j5,ResourceLockedConflict:M5,ReferenceNotFound:q5,InvalidQuery:L5,Runtime:F5,AlreadyExists:U5,RateLimited:B5,PaymentRequired:z5,QuotaExceeded:Z5,LimitExceeded:V5,BreakingChanges:H5},I1=e=>_h(e)?e:e instanceof Error?new xa(e.message,e):typeof e=="string"?new xa(e):K5(e);function K5(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){const t=W5[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new xa(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new xa("An invalid error occurred: "+JSON.stringify(e))}var J5=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},R1=typeof Symbol<"u"&&Symbol,Y5=J5,G5=function(){return typeof R1!="function"||typeof Symbol!="function"||typeof R1("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Y5()},P1={foo:{}},X5=Object,Q5=function(){return{__proto__:P1}.foo===P1.foo&&!({__proto__:null}instanceof X5)},eU="Function.prototype.bind called on incompatible ",tU=Object.prototype.toString,nU=Math.max,rU="[object Function]",$1=function(t,n){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var o=0;o<n.length;o+=1)r[o+t.length]=n[o];return r},iU=function(t,n){for(var r=[],i=n||0,o=0;i<t.length;i+=1,o+=1)r[o]=t[i];return r},oU=function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n},sU=function(t){var n=this;if(typeof n!="function"||tU.apply(n)!==rU)throw new TypeError(eU+n);for(var r=iU(arguments,1),i,o=function(){if(this instanceof i){var u=n.apply(this,$1(r,arguments));return Object(u)===u?u:this}return n.apply(t,$1(r,arguments))},s=nU(0,n.length-r.length),a=[],c=0;c<s;c++)a[c]="$"+c;if(i=Function("binder","return function ("+oU(a,",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var l=function(){};l.prototype=n.prototype,i.prototype=new l,l.prototype=null}return i},aU=sU,Sh=Function.prototype.bind||aU,cU=Sh,lU=cU.call(Function.call,Object.prototype.hasOwnProperty),vt,ss=SyntaxError,D1=Function,as=TypeError,Eh=function(e){try{return D1('"use strict"; return ('+e+").constructor;")()}catch{}},uo=Object.getOwnPropertyDescriptor;if(uo)try{uo({},"")}catch{uo=null}var kh=function(){throw new as},uU=uo?function(){try{return arguments.callee,kh}catch{try{return uo(arguments,"callee").get}catch{return kh}}}():kh,cs=G5(),dU=Q5(),un=Object.getPrototypeOf||(dU?function(e){return e.__proto__}:null),ls={},fU=typeof Uint8Array>"u"||!un?vt:un(Uint8Array),fo={"%AggregateError%":typeof AggregateError>"u"?vt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?vt:ArrayBuffer,"%ArrayIteratorPrototype%":cs&&un?un([][Symbol.iterator]()):vt,"%AsyncFromSyncIteratorPrototype%":vt,"%AsyncFunction%":ls,"%AsyncGenerator%":ls,"%AsyncGeneratorFunction%":ls,"%AsyncIteratorPrototype%":ls,"%Atomics%":typeof Atomics>"u"?vt:Atomics,"%BigInt%":typeof BigInt>"u"?vt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?vt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?vt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?vt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?vt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?vt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?vt:FinalizationRegistry,"%Function%":D1,"%GeneratorFunction%":ls,"%Int8Array%":typeof Int8Array>"u"?vt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?vt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?vt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":cs&&un?un(un([][Symbol.iterator]())):vt,"%JSON%":typeof JSON=="object"?JSON:vt,"%Map%":typeof Map>"u"?vt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!cs||!un?vt:un(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?vt:Promise,"%Proxy%":typeof Proxy>"u"?vt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?vt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?vt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!cs||!un?vt:un(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?vt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":cs&&un?un(""[Symbol.iterator]()):vt,"%Symbol%":cs?Symbol:vt,"%SyntaxError%":ss,"%ThrowTypeError%":uU,"%TypedArray%":fU,"%TypeError%":as,"%Uint8Array%":typeof Uint8Array>"u"?vt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?vt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?vt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?vt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?vt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?vt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?vt:WeakSet};if(un)try{null.error}catch(e){var pU=un(un(e));fo["%Error.prototype%"]=pU}var hU=function e(t){var n;if(t==="%AsyncFunction%")n=Eh("async function () {}");else if(t==="%GeneratorFunction%")n=Eh("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=Eh("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&un&&(n=un(i.prototype))}return fo[t]=n,n},N1={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_a=Sh,Su=lU,mU=_a.call(Function.call,Array.prototype.concat),yU=_a.call(Function.apply,Array.prototype.splice),j1=_a.call(Function.call,String.prototype.replace),Eu=_a.call(Function.call,String.prototype.slice),gU=_a.call(Function.call,RegExp.prototype.exec),vU=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,bU=/\\(\\)?/g,wU=function(t){var n=Eu(t,0,1),r=Eu(t,-1);if(n==="%"&&r!=="%")throw new ss("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new ss("invalid intrinsic syntax, expected opening `%`");var i=[];return j1(t,vU,function(o,s,a,c){i[i.length]=a?j1(c,bU,"$1"):s||o}),i},xU=function(t,n){var r=t,i;if(Su(N1,r)&&(i=N1[r],r="%"+i[0]+"%"),Su(fo,r)){var o=fo[r];if(o===ls&&(o=hU(r)),typeof o>"u"&&!n)throw new as("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new ss("intrinsic "+t+" does not exist!")},Ch=function(t,n){if(typeof t!="string"||t.length===0)throw new as("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new as('"allowMissing" argument must be a boolean');if(gU(/^%?[^%]*%?$/,t)===null)throw new ss("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=wU(t),i=r.length>0?r[0]:"",o=xU("%"+i+"%",n),s=o.name,a=o.value,c=!1,l=o.alias;l&&(i=l[0],yU(r,mU([0,1],l)));for(var u=1,d=!0;u<r.length;u+=1){var h=r[u],f=Eu(h,0,1),p=Eu(h,-1);if((f==='"'||f==="'"||f==="`"||p==='"'||p==="'"||p==="`")&&f!==p)throw new ss("property names with quotes must have matching quotes");if((h==="constructor"||!d)&&(c=!0),i+="."+h,s="%"+i+"%",Su(fo,s))a=fo[s];else if(a!=null){if(!(h in a)){if(!n)throw new as("base intrinsic for "+t+" exists, but the property is not available.");return}if(uo&&u+1>=r.length){var m=uo(a,h);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[h]}else d=Su(a,h),a=a[h];d&&!c&&(fo[s]=a)}}return a},M1={exports:{}};(function(e){var t=Sh,n=Ch,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||t.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),c=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}e.exports=function(d){var h=o(t,i,arguments);if(s&&a){var f=s(h,"length");f.configurable&&a(h,"length",{value:1+c(0,d.length-(arguments.length-1))})}return h};var l=function(){return o(t,r,arguments)};a?a(e.exports,"apply",{value:l}):e.exports.apply=l})(M1);var _U=M1.exports,q1=Ch,L1=_U,SU=L1(q1("String.prototype.indexOf")),EU=function(t,n){var r=q1(t,!!n);return typeof r=="function"&&SU(t,".prototype.")>-1?L1(r):r},Th=typeof Map=="function"&&Map.prototype,Ah=Object.getOwnPropertyDescriptor&&Th?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ku=Th&&Ah&&typeof Ah.get=="function"?Ah.get:null,F1=Th&&Map.prototype.forEach,Oh=typeof Set=="function"&&Set.prototype,Ih=Object.getOwnPropertyDescriptor&&Oh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Cu=Oh&&Ih&&typeof Ih.get=="function"?Ih.get:null,U1=Oh&&Set.prototype.forEach,kU=typeof WeakMap=="function"&&WeakMap.prototype,Sa=kU?WeakMap.prototype.has:null,CU=typeof WeakSet=="function"&&WeakSet.prototype,Ea=CU?WeakSet.prototype.has:null,TU=typeof WeakRef=="function"&&WeakRef.prototype,B1=TU?WeakRef.prototype.deref:null,AU=Boolean.prototype.valueOf,OU=Object.prototype.toString,IU=Function.prototype.toString,RU=String.prototype.match,Rh=String.prototype.slice,Ci=String.prototype.replace,PU=String.prototype.toUpperCase,z1=String.prototype.toLowerCase,Z1=RegExp.prototype.test,V1=Array.prototype.concat,qr=Array.prototype.join,$U=Array.prototype.slice,H1=Math.floor,Ph=typeof BigInt=="function"?BigInt.prototype.valueOf:null,$h=Object.getOwnPropertySymbols,Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,us=typeof Symbol=="function"&&typeof Symbol.iterator=="object",On=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===us||"symbol")?Symbol.toStringTag:null,W1=Object.prototype.propertyIsEnumerable,K1=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function J1(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Z1.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-H1(-e):H1(e);if(r!==e){var i=String(r),o=Rh.call(t,i.length+1);return Ci.call(i,n,"$&_")+"."+Ci.call(Ci.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ci.call(t,n,"$&_")}var Nh=gf,Y1=Nh.custom,G1=eS(Y1)?Y1:null,DU=function e(t,n,r,i){var o=n||{};if(Ti(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ti(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Ti(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ti(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ti(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return nS(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?J1(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return a?J1(t,l):l}var u=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof t=="object")return jh(t)?"[Array]":"[Object]";var d=XU(o,r);if(typeof i>"u")i=[];else if(tS(i,t)>=0)return"[Circular]";function h(B,F,D){if(F&&(i=$U.call(i),i.push(F)),D){var M={depth:o.depth};return Ti(o,"quoteStyle")&&(M.quoteStyle=o.quoteStyle),e(B,M,r+1,i)}return e(B,o,r+1,i)}if(typeof t=="function"&&!Q1(t)){var f=zU(t),p=Tu(t,h);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+qr.call(p,", ")+" }":"")}if(eS(t)){var m=us?Ci.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Dh.call(t);return typeof t=="object"&&!us?ka(m):m}if(JU(t)){for(var y="<"+z1.call(String(t.nodeName)),v=t.attributes||[],g=0;g<v.length;g++)y+=" "+v[g].name+"="+X1(NU(v[g].value),"double",o);return y+=">",t.childNodes&&t.childNodes.length&&(y+="..."),y+="</"+z1.call(String(t.nodeName))+">",y}if(jh(t)){if(t.length===0)return"[]";var b=Tu(t,h);return d&&!GU(b)?"["+qh(b,d)+"]":"[ "+qr.call(b,", ")+" ]"}if(MU(t)){var S=Tu(t,h);return!("cause"in Error.prototype)&&"cause"in t&&!W1.call(t,"cause")?"{ ["+String(t)+"] "+qr.call(V1.call("[cause]: "+h(t.cause),S),", ")+" }":S.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+qr.call(S,", ")+" }"}if(typeof t=="object"&&s){if(G1&&typeof t[G1]=="function"&&Nh)return Nh(t,{depth:u-r});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(ZU(t)){var E=[];return F1&&F1.call(t,function(B,F){E.push(h(F,t,!0)+" => "+h(B,t))}),rS("Map",ku.call(t),E,d)}if(WU(t)){var _=[];return U1&&U1.call(t,function(B){_.push(h(B,t))}),rS("Set",Cu.call(t),_,d)}if(VU(t))return Mh("WeakMap");if(KU(t))return Mh("WeakSet");if(HU(t))return Mh("WeakRef");if(LU(t))return ka(h(Number(t)));if(UU(t))return ka(h(Ph.call(t)));if(FU(t))return ka(AU.call(t));if(qU(t))return ka(h(String(t)));if(!jU(t)&&!Q1(t)){var I=Tu(t,h),P=K1?K1(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",O=!P&&On&&Object(t)===t&&On in t?Rh.call(Ai(t),8,-1):$?"Object":"",q=P||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",H=q+(O||$?"["+qr.call(V1.call([],O||[],$||[]),": ")+"] ":"");return I.length===0?H+"{}":d?H+"{"+qh(I,d)+"}":H+"{ "+qr.call(I,", ")+" }"}return String(t)};function X1(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function NU(e){return Ci.call(String(e),/"/g,""")}function jh(e){return Ai(e)==="[object Array]"&&(!On||!(typeof e=="object"&&On in e))}function jU(e){return Ai(e)==="[object Date]"&&(!On||!(typeof e=="object"&&On in e))}function Q1(e){return Ai(e)==="[object RegExp]"&&(!On||!(typeof e=="object"&&On in e))}function MU(e){return Ai(e)==="[object Error]"&&(!On||!(typeof e=="object"&&On in e))}function qU(e){return Ai(e)==="[object String]"&&(!On||!(typeof e=="object"&&On in e))}function LU(e){return Ai(e)==="[object Number]"&&(!On||!(typeof e=="object"&&On in e))}function FU(e){return Ai(e)==="[object Boolean]"&&(!On||!(typeof e=="object"&&On in e))}function eS(e){if(us)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Dh)return!1;try{return Dh.call(e),!0}catch{}return!1}function UU(e){if(!e||typeof e!="object"||!Ph)return!1;try{return Ph.call(e),!0}catch{}return!1}var BU=Object.prototype.hasOwnProperty||function(e){return e in this};function Ti(e,t){return BU.call(e,t)}function Ai(e){return OU.call(e)}function zU(e){if(e.name)return e.name;var t=RU.call(IU.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function tS(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function ZU(e){if(!ku||!e||typeof e!="object")return!1;try{ku.call(e);try{Cu.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function VU(e){if(!Sa||!e||typeof e!="object")return!1;try{Sa.call(e,Sa);try{Ea.call(e,Ea)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function HU(e){if(!B1||!e||typeof e!="object")return!1;try{return B1.call(e),!0}catch{}return!1}function WU(e){if(!Cu||!e||typeof e!="object")return!1;try{Cu.call(e);try{ku.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function KU(e){if(!Ea||!e||typeof e!="object")return!1;try{Ea.call(e,Ea);try{Sa.call(e,Sa)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function JU(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function nS(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return nS(Rh.call(e,0,t.maxStringLength),t)+r}var i=Ci.call(Ci.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,YU);return X1(i,"single",t)}function YU(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+PU.call(t.toString(16))}function ka(e){return"Object("+e+")"}function Mh(e){return e+" { ? }"}function rS(e,t,n,r){var i=r?qh(n,r):qr.call(n,", ");return e+" ("+t+") {"+i+"}"}function GU(e){for(var t=0;t<e.length;t++)if(tS(e[t],`
|
|
132
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[b1]=this[b1]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=ba(s);r[a]||(a5(i,s),r[a]=!0)}return se.isArray(t)?t.forEach(o):o(t),this}}bu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),se.freezeMethods(bu.prototype),se.freezeMethods(bu);const ni=bu;function mh(e,t){const n=this||hh,r=t||n,i=ni.from(r.headers);let o=r.data;return se.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function x1(e){return!!(e&&e.__CANCEL__)}function wa(e,t,n){kt.call(this,e??"canceled",kt.ERR_CANCELED,t,n),this.name="CanceledError"}se.inherits(wa,kt,{__CANCEL__:!0});const c5=null;function l5(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new kt("Request failed with status code "+n.status,[kt.ERR_BAD_REQUEST,kt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const u5=Mr.isStandardBrowserEnv?function(){return{write:function(n,r,i,o,s,a){const c=[];c.push(n+"="+encodeURIComponent(r)),se.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),se.isString(o)&&c.push("path="+o),se.isString(s)&&c.push("domain="+s),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function d5(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function f5(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function _1(e,t){return e&&!d5(t)?f5(e,t):t}const p5=Mr.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=se.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function h5(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function m5(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[o];s||(s=l),n[i]=c,r[i]=l;let d=o,p=0;for(;d!==i;)p+=n[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const f=u&&l-u;return f?Math.round(p*1e3/f):void 0}}function S1(e,t){let n=0;const r=m5(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a),l=o<=s;n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-o)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const wu={http:c5,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const o=ni.from(e.headers).normalize(),s=e.responseType;let a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}se.isFormData(i)&&(Mr.isStandardBrowserEnv||Mr.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let l=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(f+":"+h))}const u=_1(e.baseURL,e.url);l.open(e.method.toUpperCase(),m1(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function d(){if(!l)return;const f=ni.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),m={data:!s||s==="text"||s==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:f,config:e,request:l};l5(function(g){n(g),c()},function(g){r(g),c()},m),l=null}if("onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(d)},l.onabort=function(){l&&(r(new kt("Request aborted",kt.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new kt("Network Error",kt.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||g1;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),r(new kt(h,m.clarifyTimeoutError?kt.ETIMEDOUT:kt.ECONNABORTED,e,l)),l=null},Mr.isStandardBrowserEnv){const f=(e.withCredentials||p5(u))&&e.xsrfCookieName&&u5.read(e.xsrfCookieName);f&&o.set(e.xsrfHeaderName,f)}i===void 0&&o.setContentType(null),"setRequestHeader"in l&&se.forEach(o.toJSON(),function(h,m){l.setRequestHeader(m,h)}),se.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&s!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",S1(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",S1(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=f=>{l&&(r(!f||f.type?new wa(null,e,l):f),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const p=h5(u);if(p&&Mr.protocols.indexOf(p)===-1){r(new kt("Unsupported protocol "+p+":",kt.ERR_BAD_REQUEST,e));return}l.send(i||null)})}};se.forEach(wu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const y5={getAdapter:e=>{e=se.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=se.isString(n)?wu[n.toLowerCase()]:n));i++);if(!r)throw r===!1?new kt(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(se.hasOwnProp(wu,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!se.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:wu};function yh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wa(null,e)}function E1(e){return yh(e),e.headers=ni.from(e.headers),e.data=mh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),y5.getAdapter(e.adapter||hh.adapter)(e).then(function(r){return yh(e),r.data=mh.call(e,e.transformResponse,r),r.headers=ni.from(r.headers),r},function(r){return x1(r)||(yh(e),r&&r.response&&(r.response.data=mh.call(e,e.transformResponse,r.response),r.response.headers=ni.from(r.response.headers))),Promise.reject(r)})}const k1=e=>e instanceof ni?e.toJSON():e;function os(e,t){t=t||{};const n={};function r(l,u,d){return se.isPlainObject(l)&&se.isPlainObject(u)?se.merge.call({caseless:d},l,u):se.isPlainObject(u)?se.merge({},u):se.isArray(u)?u.slice():u}function i(l,u,d){if(se.isUndefined(u)){if(!se.isUndefined(l))return r(void 0,l,d)}else return r(l,u,d)}function o(l,u){if(!se.isUndefined(u))return r(void 0,u)}function s(l,u){if(se.isUndefined(u)){if(!se.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u)=>i(k1(l),k1(u),!0)};return se.forEach(Object.keys(e).concat(Object.keys(t)),function(u){const d=c[u]||i,p=d(e[u],t[u],u);se.isUndefined(p)&&d!==a||(n[u]=p)}),n}const C1="1.2.5",gh={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gh[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const T1={};gh.transitional=function(t,n,r){function i(o,s){return"[Axios v"+C1+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new kt(i(s," has been removed"+(n?" in "+n:"")),kt.ERR_DEPRECATED);return n&&!T1[s]&&(T1[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};function g5(e,t,n){if(typeof e!="object")throw new kt("options must be an object",kt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new kt("option "+o+" must be "+c,kt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new kt("Unknown option "+o,kt.ERR_BAD_OPTION)}}const vh={assertOptions:g5,validators:gh},ki=vh.validators;class xu{constructor(t){this.defaults=t,this.interceptors={request:new y1,response:new y1}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=os(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&vh.assertOptions(r,{silentJSONParsing:ki.transitional(ki.boolean),forcedJSONParsing:ki.transitional(ki.boolean),clarifyTimeoutError:ki.transitional(ki.boolean)},!1),i!==void 0&&vh.assertOptions(i,{encode:ki.function,serialize:ki.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=o&&se.merge(o.common,o[n.method]),s&&se.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=ni.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,p;if(!c){const h=[E1.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,l),p=h.length,u=Promise.resolve(n);d<p;)u=u.then(h[d++],h[d++]);return u}p=a.length;let f=n;for(d=0;d<p;){const h=a[d++],m=a[d++];try{f=h(f)}catch(y){m.call(this,y);break}}try{u=E1.call(this,f)}catch(h){return Promise.reject(h)}for(d=0,p=l.length;d<p;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=os(this.defaults,t);const n=_1(t.baseURL,t.url);return m1(n,t.params,t.paramsSerializer)}}se.forEach(["delete","get","head","options"],function(t){xu.prototype[t]=function(n,r){return this.request(os(r||{},{method:t,url:n,data:(r||{}).data}))}}),se.forEach(["post","put","patch"],function(t){function n(r){return function(o,s,a){return this.request(os(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}xu.prototype[t]=n(),xu.prototype[t+"Form"]=n(!0)});const _u=xu;class bh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new wa(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new bh(function(i){t=i}),cancel:t}}}const v5=bh;function b5(e){return function(n){return e.apply(null,n)}}function w5(e){return se.isObject(e)&&e.isAxiosError===!0}const wh={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wh).forEach(([e,t])=>{wh[t]=e});const x5=wh;function A1(e){const t=new _u(e),n=e1(_u.prototype.request,t);return se.extend(n,_u.prototype,t,{allOwnKeys:!0}),se.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return A1(os(e,i))},n}const sn=A1(hh);sn.Axios=_u,sn.CanceledError=wa,sn.CancelToken=v5,sn.isCancel=x1,sn.VERSION=C1,sn.toFormData=yu,sn.AxiosError=kt,sn.Cancel=sn.CanceledError,sn.all=function(t){return Promise.all(t)},sn.spread=b5,sn.isAxiosError=w5,sn.mergeConfig=os,sn.AxiosHeaders=ni,sn.formToJSON=e=>v1(se.isHTMLForm(e)?new FormData(e):e),sn.HttpStatusCode=x5,sn.default=sn;const O1=sn,_5={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))};let xh=typeof window<"u"&&typeof window.document<"u"?window.crypto:yf;xh.getRandomValues||(xh=_5);class Dt extends Error{constructor(n,r,i,o,s,a){super(o);k(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=o,this.error=s,this.id=a,this.id||(this.id=Dt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){const n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,o=Array.from(xh.getRandomValues(new Uint8Array(i))).map(s=>s.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${o}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}}const S5=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,_h=e=>e instanceof Dt||S5(e)&&e.isApiError===!0;class xa extends Dt{constructor(t,n,r){super(500,"An unknown error occurred","Unknown",t,n,r)}}class E5 extends Dt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}}class k5 extends Dt{constructor(t,n,r){super(401,"The request requires to be authenticated.","Unauthorized",t,n,r)}}class C5 extends Dt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}}class T5 extends Dt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}}class A5 extends Dt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}}class O5 extends Dt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}}class I5 extends Dt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}}class R5 extends Dt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}}class P5 extends Dt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}}class $5 extends Dt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}}class D5 extends Dt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}}class N5 extends Dt{constructor(t,n,r){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",t,n,r)}}class j5 extends Dt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}}class M5 extends Dt{constructor(t,n,r){super(409,"The resource is current locked and cannot be operated on until the lock is released.","ResourceLockedConflict",t,n,r)}}class q5 extends Dt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}}class L5 extends Dt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}}class F5 extends Dt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}}class U5 extends Dt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}}class B5 extends Dt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}}class z5 extends Dt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}}class Z5 extends Dt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}}class V5 extends Dt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}}class H5 extends Dt{constructor(t,n,r){super(400,"Request payload contains breaking changes which is not allowed for this resource without a version increment.","BreakingChanges",t,n,r)}}const W5={Unknown:xa,Internal:E5,Unauthorized:k5,Forbidden:C5,PayloadTooLarge:T5,InvalidPayload:A5,UnsupportedMediaType:O5,MethodNotFound:I5,ResourceNotFound:R5,InvalidJsonSchema:P5,InvalidDataFormat:$5,InvalidIdentifier:D5,RelationConflict:N5,ReferenceConstraint:j5,ResourceLockedConflict:M5,ReferenceNotFound:q5,InvalidQuery:L5,Runtime:F5,AlreadyExists:U5,RateLimited:B5,PaymentRequired:z5,QuotaExceeded:Z5,LimitExceeded:V5,BreakingChanges:H5},I1=e=>_h(e)?e:e instanceof Error?new xa(e.message,e):typeof e=="string"?new xa(e):K5(e);function K5(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){const t=W5[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new xa(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new xa("An invalid error occurred: "+JSON.stringify(e))}var J5=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},R1=typeof Symbol<"u"&&Symbol,Y5=J5,G5=function(){return typeof R1!="function"||typeof Symbol!="function"||typeof R1("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Y5()},P1={foo:{}},X5=Object,Q5=function(){return{__proto__:P1}.foo===P1.foo&&!({__proto__:null}instanceof X5)},eU="Function.prototype.bind called on incompatible ",tU=Object.prototype.toString,nU=Math.max,rU="[object Function]",$1=function(t,n){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var o=0;o<n.length;o+=1)r[o+t.length]=n[o];return r},iU=function(t,n){for(var r=[],i=n||0,o=0;i<t.length;i+=1,o+=1)r[o]=t[i];return r},oU=function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n},sU=function(t){var n=this;if(typeof n!="function"||tU.apply(n)!==rU)throw new TypeError(eU+n);for(var r=iU(arguments,1),i,o=function(){if(this instanceof i){var u=n.apply(this,$1(r,arguments));return Object(u)===u?u:this}return n.apply(t,$1(r,arguments))},s=nU(0,n.length-r.length),a=[],c=0;c<s;c++)a[c]="$"+c;if(i=Function("binder","return function ("+oU(a,",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var l=function(){};l.prototype=n.prototype,i.prototype=new l,l.prototype=null}return i},aU=sU,Sh=Function.prototype.bind||aU,cU=Sh,lU=cU.call(Function.call,Object.prototype.hasOwnProperty),vt,ss=SyntaxError,D1=Function,as=TypeError,Eh=function(e){try{return D1('"use strict"; return ('+e+").constructor;")()}catch{}},uo=Object.getOwnPropertyDescriptor;if(uo)try{uo({},"")}catch{uo=null}var kh=function(){throw new as},uU=uo?function(){try{return arguments.callee,kh}catch{try{return uo(arguments,"callee").get}catch{return kh}}}():kh,cs=G5(),dU=Q5(),un=Object.getPrototypeOf||(dU?function(e){return e.__proto__}:null),ls={},fU=typeof Uint8Array>"u"||!un?vt:un(Uint8Array),fo={"%AggregateError%":typeof AggregateError>"u"?vt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?vt:ArrayBuffer,"%ArrayIteratorPrototype%":cs&&un?un([][Symbol.iterator]()):vt,"%AsyncFromSyncIteratorPrototype%":vt,"%AsyncFunction%":ls,"%AsyncGenerator%":ls,"%AsyncGeneratorFunction%":ls,"%AsyncIteratorPrototype%":ls,"%Atomics%":typeof Atomics>"u"?vt:Atomics,"%BigInt%":typeof BigInt>"u"?vt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?vt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?vt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?vt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?vt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?vt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?vt:FinalizationRegistry,"%Function%":D1,"%GeneratorFunction%":ls,"%Int8Array%":typeof Int8Array>"u"?vt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?vt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?vt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":cs&&un?un(un([][Symbol.iterator]())):vt,"%JSON%":typeof JSON=="object"?JSON:vt,"%Map%":typeof Map>"u"?vt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!cs||!un?vt:un(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?vt:Promise,"%Proxy%":typeof Proxy>"u"?vt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?vt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?vt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!cs||!un?vt:un(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?vt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":cs&&un?un(""[Symbol.iterator]()):vt,"%Symbol%":cs?Symbol:vt,"%SyntaxError%":ss,"%ThrowTypeError%":uU,"%TypedArray%":fU,"%TypeError%":as,"%Uint8Array%":typeof Uint8Array>"u"?vt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?vt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?vt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?vt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?vt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?vt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?vt:WeakSet};if(un)try{null.error}catch(e){var pU=un(un(e));fo["%Error.prototype%"]=pU}var hU=function e(t){var n;if(t==="%AsyncFunction%")n=Eh("async function () {}");else if(t==="%GeneratorFunction%")n=Eh("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=Eh("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&un&&(n=un(i.prototype))}return fo[t]=n,n},N1={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_a=Sh,Su=lU,mU=_a.call(Function.call,Array.prototype.concat),yU=_a.call(Function.apply,Array.prototype.splice),j1=_a.call(Function.call,String.prototype.replace),Eu=_a.call(Function.call,String.prototype.slice),gU=_a.call(Function.call,RegExp.prototype.exec),vU=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,bU=/\\(\\)?/g,wU=function(t){var n=Eu(t,0,1),r=Eu(t,-1);if(n==="%"&&r!=="%")throw new ss("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new ss("invalid intrinsic syntax, expected opening `%`");var i=[];return j1(t,vU,function(o,s,a,c){i[i.length]=a?j1(c,bU,"$1"):s||o}),i},xU=function(t,n){var r=t,i;if(Su(N1,r)&&(i=N1[r],r="%"+i[0]+"%"),Su(fo,r)){var o=fo[r];if(o===ls&&(o=hU(r)),typeof o>"u"&&!n)throw new as("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new ss("intrinsic "+t+" does not exist!")},Ch=function(t,n){if(typeof t!="string"||t.length===0)throw new as("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new as('"allowMissing" argument must be a boolean');if(gU(/^%?[^%]*%?$/,t)===null)throw new ss("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=wU(t),i=r.length>0?r[0]:"",o=xU("%"+i+"%",n),s=o.name,a=o.value,c=!1,l=o.alias;l&&(i=l[0],yU(r,mU([0,1],l)));for(var u=1,d=!0;u<r.length;u+=1){var p=r[u],f=Eu(p,0,1),h=Eu(p,-1);if((f==='"'||f==="'"||f==="`"||h==='"'||h==="'"||h==="`")&&f!==h)throw new ss("property names with quotes must have matching quotes");if((p==="constructor"||!d)&&(c=!0),i+="."+p,s="%"+i+"%",Su(fo,s))a=fo[s];else if(a!=null){if(!(p in a)){if(!n)throw new as("base intrinsic for "+t+" exists, but the property is not available.");return}if(uo&&u+1>=r.length){var m=uo(a,p);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[p]}else d=Su(a,p),a=a[p];d&&!c&&(fo[s]=a)}}return a},M1={exports:{}};(function(e){var t=Sh,n=Ch,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||t.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),c=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}e.exports=function(d){var p=o(t,i,arguments);if(s&&a){var f=s(p,"length");f.configurable&&a(p,"length",{value:1+c(0,d.length-(arguments.length-1))})}return p};var l=function(){return o(t,r,arguments)};a?a(e.exports,"apply",{value:l}):e.exports.apply=l})(M1);var _U=M1.exports,q1=Ch,L1=_U,SU=L1(q1("String.prototype.indexOf")),EU=function(t,n){var r=q1(t,!!n);return typeof r=="function"&&SU(t,".prototype.")>-1?L1(r):r},Th=typeof Map=="function"&&Map.prototype,Ah=Object.getOwnPropertyDescriptor&&Th?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ku=Th&&Ah&&typeof Ah.get=="function"?Ah.get:null,F1=Th&&Map.prototype.forEach,Oh=typeof Set=="function"&&Set.prototype,Ih=Object.getOwnPropertyDescriptor&&Oh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Cu=Oh&&Ih&&typeof Ih.get=="function"?Ih.get:null,U1=Oh&&Set.prototype.forEach,kU=typeof WeakMap=="function"&&WeakMap.prototype,Sa=kU?WeakMap.prototype.has:null,CU=typeof WeakSet=="function"&&WeakSet.prototype,Ea=CU?WeakSet.prototype.has:null,TU=typeof WeakRef=="function"&&WeakRef.prototype,B1=TU?WeakRef.prototype.deref:null,AU=Boolean.prototype.valueOf,OU=Object.prototype.toString,IU=Function.prototype.toString,RU=String.prototype.match,Rh=String.prototype.slice,Ci=String.prototype.replace,PU=String.prototype.toUpperCase,z1=String.prototype.toLowerCase,Z1=RegExp.prototype.test,V1=Array.prototype.concat,qr=Array.prototype.join,$U=Array.prototype.slice,H1=Math.floor,Ph=typeof BigInt=="function"?BigInt.prototype.valueOf:null,$h=Object.getOwnPropertySymbols,Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,us=typeof Symbol=="function"&&typeof Symbol.iterator=="object",On=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===us||"symbol")?Symbol.toStringTag:null,W1=Object.prototype.propertyIsEnumerable,K1=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function J1(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Z1.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-H1(-e):H1(e);if(r!==e){var i=String(r),o=Rh.call(t,i.length+1);return Ci.call(i,n,"$&_")+"."+Ci.call(Ci.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ci.call(t,n,"$&_")}var Nh=gf,Y1=Nh.custom,G1=eS(Y1)?Y1:null,DU=function e(t,n,r,i){var o=n||{};if(Ti(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ti(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Ti(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ti(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ti(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return nS(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?J1(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return a?J1(t,l):l}var u=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof t=="object")return jh(t)?"[Array]":"[Object]";var d=XU(o,r);if(typeof i>"u")i=[];else if(tS(i,t)>=0)return"[Circular]";function p(B,F,D){if(F&&(i=$U.call(i),i.push(F)),D){var M={depth:o.depth};return Ti(o,"quoteStyle")&&(M.quoteStyle=o.quoteStyle),e(B,M,r+1,i)}return e(B,o,r+1,i)}if(typeof t=="function"&&!Q1(t)){var f=zU(t),h=Tu(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(h.length>0?" { "+qr.call(h,", ")+" }":"")}if(eS(t)){var m=us?Ci.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Dh.call(t);return typeof t=="object"&&!us?ka(m):m}if(JU(t)){for(var y="<"+z1.call(String(t.nodeName)),g=t.attributes||[],v=0;v<g.length;v++)y+=" "+g[v].name+"="+X1(NU(g[v].value),"double",o);return y+=">",t.childNodes&&t.childNodes.length&&(y+="..."),y+="</"+z1.call(String(t.nodeName))+">",y}if(jh(t)){if(t.length===0)return"[]";var b=Tu(t,p);return d&&!GU(b)?"["+qh(b,d)+"]":"[ "+qr.call(b,", ")+" ]"}if(MU(t)){var S=Tu(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!W1.call(t,"cause")?"{ ["+String(t)+"] "+qr.call(V1.call("[cause]: "+p(t.cause),S),", ")+" }":S.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+qr.call(S,", ")+" }"}if(typeof t=="object"&&s){if(G1&&typeof t[G1]=="function"&&Nh)return Nh(t,{depth:u-r});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(ZU(t)){var E=[];return F1&&F1.call(t,function(B,F){E.push(p(F,t,!0)+" => "+p(B,t))}),rS("Map",ku.call(t),E,d)}if(WU(t)){var _=[];return U1&&U1.call(t,function(B){_.push(p(B,t))}),rS("Set",Cu.call(t),_,d)}if(VU(t))return Mh("WeakMap");if(KU(t))return Mh("WeakSet");if(HU(t))return Mh("WeakRef");if(LU(t))return ka(p(Number(t)));if(UU(t))return ka(p(Ph.call(t)));if(FU(t))return ka(AU.call(t));if(qU(t))return ka(p(String(t)));if(!jU(t)&&!Q1(t)){var I=Tu(t,p),P=K1?K1(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",O=!P&&On&&Object(t)===t&&On in t?Rh.call(Ai(t),8,-1):$?"Object":"",q=P||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",H=q+(O||$?"["+qr.call(V1.call([],O||[],$||[]),": ")+"] ":"");return I.length===0?H+"{}":d?H+"{"+qh(I,d)+"}":H+"{ "+qr.call(I,", ")+" }"}return String(t)};function X1(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function NU(e){return Ci.call(String(e),/"/g,""")}function jh(e){return Ai(e)==="[object Array]"&&(!On||!(typeof e=="object"&&On in e))}function jU(e){return Ai(e)==="[object Date]"&&(!On||!(typeof e=="object"&&On in e))}function Q1(e){return Ai(e)==="[object RegExp]"&&(!On||!(typeof e=="object"&&On in e))}function MU(e){return Ai(e)==="[object Error]"&&(!On||!(typeof e=="object"&&On in e))}function qU(e){return Ai(e)==="[object String]"&&(!On||!(typeof e=="object"&&On in e))}function LU(e){return Ai(e)==="[object Number]"&&(!On||!(typeof e=="object"&&On in e))}function FU(e){return Ai(e)==="[object Boolean]"&&(!On||!(typeof e=="object"&&On in e))}function eS(e){if(us)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Dh)return!1;try{return Dh.call(e),!0}catch{}return!1}function UU(e){if(!e||typeof e!="object"||!Ph)return!1;try{return Ph.call(e),!0}catch{}return!1}var BU=Object.prototype.hasOwnProperty||function(e){return e in this};function Ti(e,t){return BU.call(e,t)}function Ai(e){return OU.call(e)}function zU(e){if(e.name)return e.name;var t=RU.call(IU.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function tS(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function ZU(e){if(!ku||!e||typeof e!="object")return!1;try{ku.call(e);try{Cu.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function VU(e){if(!Sa||!e||typeof e!="object")return!1;try{Sa.call(e,Sa);try{Ea.call(e,Ea)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function HU(e){if(!B1||!e||typeof e!="object")return!1;try{return B1.call(e),!0}catch{}return!1}function WU(e){if(!Cu||!e||typeof e!="object")return!1;try{Cu.call(e);try{ku.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function KU(e){if(!Ea||!e||typeof e!="object")return!1;try{Ea.call(e,Ea);try{Sa.call(e,Sa)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function JU(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function nS(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return nS(Rh.call(e,0,t.maxStringLength),t)+r}var i=Ci.call(Ci.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,YU);return X1(i,"single",t)}function YU(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+PU.call(t.toString(16))}function ka(e){return"Object("+e+")"}function Mh(e){return e+" { ? }"}function rS(e,t,n,r){var i=r?qh(n,r):qr.call(n,", ");return e+" ("+t+") {"+i+"}"}function GU(e){for(var t=0;t<e.length;t++)if(tS(e[t],`
|
|
133
133
|
`)>=0)return!1;return!0}function XU(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=qr.call(Array(e.indent+1)," ");else return null;return{base:n,prev:qr.call(Array(t+1),n)}}function qh(e,t){if(e.length===0)return"";var n=`
|
|
134
134
|
`+t.prev+t.base;return n+qr.call(e,","+n)+`
|
|
135
|
-
`+t.prev}function Tu(e,t){var n=jh(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=Ti(e,i)?t(e[i],e):""}var o=typeof $h=="function"?$h(e):[],s;if(us){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var c in e)Ti(e,c)&&(n&&String(Number(c))===c&&c<e.length||us&&s["$"+c]instanceof Symbol||(Z1.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if(typeof $h=="function")for(var l=0;l<o.length;l++)W1.call(e,o[l])&&r.push("["+t(o[l])+"]: "+t(e[o[l]],e));return r}var Lh=Ch,ds=EU,QU=DU,eB=Lh("%TypeError%"),Au=Lh("%WeakMap%",!0),Ou=Lh("%Map%",!0),tB=ds("WeakMap.prototype.get",!0),nB=ds("WeakMap.prototype.set",!0),rB=ds("WeakMap.prototype.has",!0),iB=ds("Map.prototype.get",!0),oB=ds("Map.prototype.set",!0),sB=ds("Map.prototype.has",!0),Fh=function(e,t){for(var n=e,r;(r=n.next)!==null;n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},aB=function(e,t){var n=Fh(e,t);return n&&n.value},cB=function(e,t,n){var r=Fh(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},lB=function(e,t){return!!Fh(e,t)},uB=function(){var t,n,r,i={assert:function(o){if(!i.has(o))throw new eB("Side channel does not contain "+QU(o))},get:function(o){if(Au&&o&&(typeof o=="object"||typeof o=="function")){if(t)return tB(t,o)}else if(Ou){if(n)return iB(n,o)}else if(r)return aB(r,o)},has:function(o){if(Au&&o&&(typeof o=="object"||typeof o=="function")){if(t)return rB(t,o)}else if(Ou){if(n)return sB(n,o)}else if(r)return lB(r,o);return!1},set:function(o,s){Au&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new Au),nB(t,o,s)):Ou?(n||(n=new Ou),oB(n,o,s)):(r||(r={key:{},next:null}),cB(r,o,s))}};return i},dB=String.prototype.replace,fB=/%20/g,Uh={RFC1738:"RFC1738",RFC3986:"RFC3986"},Bh={default:Uh.RFC3986,formatters:{RFC1738:function(e){return dB.call(e,fB,"+")},RFC3986:function(e){return String(e)}},RFC1738:Uh.RFC1738,RFC3986:Uh.RFC3986},pB=Bh,zh=Object.prototype.hasOwnProperty,po=Array.isArray,Lr=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),hB=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(po(r)){for(var i=[],o=0;o<r.length;++o)typeof r[o]<"u"&&i.push(r[o]);n.obj[n.prop]=i}}},iS=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(r[i]=t[i]);return r},mB=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(po(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!zh.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var i=t;return po(t)&&!po(n)&&(i=iS(t,r)),po(t)&&po(n)?(n.forEach(function(o,s){if(zh.call(t,s)){var a=t[s];a&&typeof a=="object"&&o&&typeof o=="object"?t[s]=e(a,o,r):t.push(o)}else t[s]=o}),t):Object.keys(n).reduce(function(o,s){var a=n[s];return zh.call(o,s)?o[s]=e(o[s],a,r):o[s]=a,o},i)},yB=function(t,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},t)},gB=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},vB=function(t,n,r,i,o){if(t.length===0)return t;var s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});for(var a="",c=0;c<s.length;++c){var l=s.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||o===pB.RFC1738&&(l===40||l===41)){a+=s.charAt(c);continue}if(l<128){a=a+Lr[l];continue}if(l<2048){a=a+(Lr[192|l>>6]+Lr[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Lr[224|l>>12]+Lr[128|l>>6&63]+Lr[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|s.charCodeAt(c)&1023),a+=Lr[240|l>>18]+Lr[128|l>>12&63]+Lr[128|l>>6&63]+Lr[128|l&63]}return a},bB=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],i=0;i<n.length;++i)for(var o=n[i],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],u=s[l];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:s,prop:l}),r.push(u))}return hB(n),t},wB=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},xB=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},_B=function(t,n){return[].concat(t,n)},SB=function(t,n){if(po(t)){for(var r=[],i=0;i<t.length;i+=1)r.push(n(t[i]));return r}return n(t)},oS={arrayToObject:iS,assign:yB,combine:_B,compact:bB,decode:gB,encode:vB,isBuffer:xB,isRegExp:wB,maybeMap:SB,merge:mB},sS=uB,Iu=oS,Ca=Bh,EB=Object.prototype.hasOwnProperty,aS={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},ri=Array.isArray,kB=Array.prototype.push,cS=function(e,t){kB.apply(e,ri(t)?t:[t])},CB=Date.prototype.toISOString,lS=Ca.default,In={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Iu.encode,encodeValuesOnly:!1,format:lS,formatter:Ca.formatters[lS],indices:!1,serializeDate:function(t){return CB.call(t)},skipNulls:!1,strictNullHandling:!1},TB=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Zh={},AB=function e(t,n,r,i,o,s,a,c,l,u,d,h,f,p,m,y){for(var v=t,g=y,b=0,S=!1;(g=g.get(Zh))!==void 0&&!S;){var E=g.get(t);if(b+=1,typeof E<"u"){if(E===b)throw new RangeError("Cyclic object value");S=!0}typeof g.get(Zh)>"u"&&(b=0)}if(typeof c=="function"?v=c(n,v):v instanceof Date?v=d(v):r==="comma"&&ri(v)&&(v=Iu.maybeMap(v,function(M){return M instanceof Date?d(M):M})),v===null){if(o)return a&&!p?a(n,In.encoder,m,"key",h):n;v=""}if(TB(v)||Iu.isBuffer(v)){if(a){var _=p?n:a(n,In.encoder,m,"key",h);return[f(_)+"="+f(a(v,In.encoder,m,"value",h))]}return[f(n)+"="+f(String(v))]}var I=[];if(typeof v>"u")return I;var P;if(r==="comma"&&ri(v))p&&a&&(v=Iu.maybeMap(v,a)),P=[{value:v.length>0?v.join(",")||null:void 0}];else if(ri(c))P=c;else{var $=Object.keys(v);P=l?$.sort(l):$}for(var O=i&&ri(v)&&v.length===1?n+"[]":n,q=0;q<P.length;++q){var H=P[q],B=typeof H=="object"&&typeof H.value<"u"?H.value:v[H];if(!(s&&B===null)){var F=ri(v)?typeof r=="function"?r(O,H):O:O+(u?"."+H:"["+H+"]");y.set(t,b);var D=sS();D.set(Zh,y),cS(I,e(B,F,r,i,o,s,r==="comma"&&p&&ri(v)?null:a,c,l,u,d,h,f,p,m,D))}}return I},OB=function(t){if(!t)return In;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||In.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Ca.default;if(typeof t.format<"u"){if(!EB.call(Ca.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var i=Ca.formatters[r],o=In.filter;return(typeof t.filter=="function"||ri(t.filter))&&(o=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:In.addQueryPrefix,allowDots:typeof t.allowDots>"u"?In.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:In.charsetSentinel,delimiter:typeof t.delimiter>"u"?In.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:In.encode,encoder:typeof t.encoder=="function"?t.encoder:In.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:In.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:In.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:In.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:In.strictNullHandling}},IB=function(e,t){var n=e,r=OB(t),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):ri(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;t&&t.arrayFormat in aS?a=t.arrayFormat:t&&"indices"in t?a=t.indices?"indices":"repeat":a="indices";var c=aS[a];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var u=sS(),d=0;d<i.length;++d){var h=i[d];r.skipNulls&&n[h]===null||cS(s,AB(n[h],h,c,l,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}var f=s.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},fs=oS,Vh=Object.prototype.hasOwnProperty,RB=Array.isArray,dn={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:fs.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},PB=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},uS=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},$B="utf8=%26%2310003%3B",DB="utf8=%E2%9C%93",NB=function(t,n){var r={__proto__:null},i=n.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),a=-1,c,l=n.charset;if(n.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===DB?l="utf-8":s[c]===$B&&(l="iso-8859-1"),a=c,c=s.length);for(c=0;c<s.length;++c)if(c!==a){var u=s[c],d=u.indexOf("]="),h=d===-1?u.indexOf("="):d+1,f,p;h===-1?(f=n.decoder(u,dn.decoder,l,"key"),p=n.strictNullHandling?null:""):(f=n.decoder(u.slice(0,h),dn.decoder,l,"key"),p=fs.maybeMap(uS(u.slice(h+1),n),function(m){return n.decoder(m,dn.decoder,l,"value")})),p&&n.interpretNumericEntities&&l==="iso-8859-1"&&(p=PB(p)),u.indexOf("[]=")>-1&&(p=RB(p)?[p]:p),Vh.call(r,f)?r[f]=fs.combine(r[f],p):r[f]=p}return r},jB=function(e,t,n,r){for(var i=r?t:uS(t,n),o=e.length-1;o>=0;--o){var s,a=e[o];if(a==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!n.parseArrays&&c===""?s={0:i}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(s=[],s[l]=i):c!=="__proto__"&&(s[c]=i)}i=s}return i},MB=function(t,n,r,i){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&s.exec(o),l=c?o.slice(0,c.index):o,u=[];if(l){if(!r.plainObjects&&Vh.call(Object.prototype,l)&&!r.allowPrototypes)return;u.push(l)}for(var d=0;r.depth>0&&(c=a.exec(o))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&Vh.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(c[1])}return c&&u.push("["+o.slice(c.index)+"]"),jB(u,n,r,i)}},qB=function(t){if(!t)return dn;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof t.charset>"u"?dn.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?dn.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:dn.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:dn.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:dn.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:dn.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:dn.comma,decoder:typeof t.decoder=="function"?t.decoder:dn.decoder,delimiter:typeof t.delimiter=="string"||fs.isRegExp(t.delimiter)?t.delimiter:dn.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:dn.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:dn.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:dn.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:dn.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:dn.strictNullHandling}},LB=function(e,t){var n=qB(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?NB(e,n):e,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],c=MB(a,r[a],n,typeof e=="string");i=fs.merge(i,c,n)}return n.allowSparse===!0?i:fs.compact(i)},FB=IB,UB=LB,BB=Bh,zB={formats:BB,parse:UB,stringify:FB};const ZB=mi(zB),VB=e=>e[1]!==void 0,tn=e=>{const{method:t,path:n,query:r,headers:i,body:o}=e,s=Object.entries(i).filter(VB),a=Object.fromEntries(s),c=ZB.stringify(r,{encode:!0,arrayFormat:"repeat",allowDots:!0}),l=c?[n,c].join("?"):n;return{method:t,url:l,headers:a,data:o}},HB=e=>({path:`/conversations/${encodeURIComponent(e.id)}/participants`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{userId:e.userId}}),WB=e=>({path:"/conversations",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{_:e._}}),KB=e=>({path:`/conversations/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),JB=e=>({path:`/conversations/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),YB=e=>({path:`/conversations/${encodeURIComponent(e.id)}/participants/${encodeURIComponent(e.userId)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id,userId:e.userId},body:{}}),GB=e=>({path:`/conversations/${encodeURIComponent(e.id)}/messages`,headers:{"x-user-key":e["x-user-key"]},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),XB=e=>({path:"/conversations",headers:{"x-user-key":e["x-user-key"]},query:{nextToken:e.nextToken},params:{},body:{}}),QB=e=>({path:`/conversations/${encodeURIComponent(e.id)}/participants`,headers:{"x-user-key":e["x-user-key"]},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),ez=e=>({path:`/conversations/${encodeURIComponent(e.id)}/listen`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),tz=e=>({path:`/conversations/${encodeURIComponent(e.id)}/participants/${encodeURIComponent(e.userId)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id,userId:e.userId},body:{}}),nz=e=>({path:"/messages",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{payload:e.payload,conversationId:e.conversationId}}),rz=e=>({path:`/messages/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),iz=e=>({path:`/messages/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),oz=e=>({path:"/users",headers:{},query:{},params:{},body:{name:e.name,pictureUrl:e.pictureUrl,userData:e.userData}}),sz=e=>({path:"/users/me",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{}}),az=e=>({path:"/users/me",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{}}),cz=e=>({path:"/users/me",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{name:e.name,pictureUrl:e.pictureUrl,userData:e.userData}}),lz=e=>({path:"/events",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{payload:e.payload,conversationId:e.conversationId}}),uz=e=>({path:`/events/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),dz=e=>({path:"/files",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{key:e.key,size:e.size,accessPolicies:e.accessPolicies,index:e.index,contentType:e.contentType,tags:e.tags}});let fz=class{constructor(t,n={}){k(this,"addParticipant",async t=>{const{path:n,headers:r,query:i,body:o}=HB(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createConversation",async t=>{const{path:n,headers:r,query:i,body:o}=WB(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"deleteConversation",async t=>{const{path:n,headers:r,query:i,body:o}=KB(t),a=(this.props.toAxiosRequest??tn)({method:"delete",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getConversation",async t=>{const{path:n,headers:r,query:i,body:o}=JB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getParticipant",async t=>{const{path:n,headers:r,query:i,body:o}=YB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"listConversationMessages",async t=>{const{path:n,headers:r,query:i,body:o}=GB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"listConversations",async t=>{const{path:n,headers:r,query:i,body:o}=XB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"listParticipants",async t=>{const{path:n,headers:r,query:i,body:o}=QB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"listenConversation",async t=>{const{path:n,headers:r,query:i,body:o}=ez(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"removeParticipant",async t=>{const{path:n,headers:r,query:i,body:o}=tz(t),a=(this.props.toAxiosRequest??tn)({method:"delete",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createMessage",async t=>{const{path:n,headers:r,query:i,body:o}=nz(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"deleteMessage",async t=>{const{path:n,headers:r,query:i,body:o}=rz(t),a=(this.props.toAxiosRequest??tn)({method:"delete",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getMessage",async t=>{const{path:n,headers:r,query:i,body:o}=iz(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createUser",async t=>{const{path:n,headers:r,query:i,body:o}=oz(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"deleteUser",async t=>{const{path:n,headers:r,query:i,body:o}=sz(t),a=(this.props.toAxiosRequest??tn)({method:"delete",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getUser",async t=>{const{path:n,headers:r,query:i,body:o}=az(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"updateUser",async t=>{const{path:n,headers:r,query:i,body:o}=cz(t),a=(this.props.toAxiosRequest??tn)({method:"put",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createEvent",async t=>{const{path:n,headers:r,query:i,body:o}=lz(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getEvent",async t=>{const{path:n,headers:r,query:i,body:o}=uz(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createFile",async t=>{const{path:n,headers:r,query:i,body:o}=dz(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});this.axiosInstance=t,this.props=n}};function nn(e){var t;return O1.isAxiosError(e)&&((t=e.response)!=null&&t.data)?I1(e.response.data):I1(e)}class dS{constructor(){k(this,"listeners",{})}emit(t,n){const r=this.listeners[t];if(r)for(const i of[...r])i(n)}onceOrMore(t,n){const r=i=>{n(i)==="stop-listening"&&this.off(t,r)};this.on(t,r)}once(t,n){const r=i=>{this.off(t,r),n(i)};this.on(t,r)}on(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}off(t,n){const r=this.listeners[t];if(!r)return;const i=r.indexOf(n);i!==-1&&r.splice(i,1)}cleanup(){this.listeners={}}}var Hh={exports:{}};/** @license
|
|
135
|
+
`+t.prev}function Tu(e,t){var n=jh(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=Ti(e,i)?t(e[i],e):""}var o=typeof $h=="function"?$h(e):[],s;if(us){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var c in e)Ti(e,c)&&(n&&String(Number(c))===c&&c<e.length||us&&s["$"+c]instanceof Symbol||(Z1.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if(typeof $h=="function")for(var l=0;l<o.length;l++)W1.call(e,o[l])&&r.push("["+t(o[l])+"]: "+t(e[o[l]],e));return r}var Lh=Ch,ds=EU,QU=DU,eB=Lh("%TypeError%"),Au=Lh("%WeakMap%",!0),Ou=Lh("%Map%",!0),tB=ds("WeakMap.prototype.get",!0),nB=ds("WeakMap.prototype.set",!0),rB=ds("WeakMap.prototype.has",!0),iB=ds("Map.prototype.get",!0),oB=ds("Map.prototype.set",!0),sB=ds("Map.prototype.has",!0),Fh=function(e,t){for(var n=e,r;(r=n.next)!==null;n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},aB=function(e,t){var n=Fh(e,t);return n&&n.value},cB=function(e,t,n){var r=Fh(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},lB=function(e,t){return!!Fh(e,t)},uB=function(){var t,n,r,i={assert:function(o){if(!i.has(o))throw new eB("Side channel does not contain "+QU(o))},get:function(o){if(Au&&o&&(typeof o=="object"||typeof o=="function")){if(t)return tB(t,o)}else if(Ou){if(n)return iB(n,o)}else if(r)return aB(r,o)},has:function(o){if(Au&&o&&(typeof o=="object"||typeof o=="function")){if(t)return rB(t,o)}else if(Ou){if(n)return sB(n,o)}else if(r)return lB(r,o);return!1},set:function(o,s){Au&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new Au),nB(t,o,s)):Ou?(n||(n=new Ou),oB(n,o,s)):(r||(r={key:{},next:null}),cB(r,o,s))}};return i},dB=String.prototype.replace,fB=/%20/g,Uh={RFC1738:"RFC1738",RFC3986:"RFC3986"},Bh={default:Uh.RFC3986,formatters:{RFC1738:function(e){return dB.call(e,fB,"+")},RFC3986:function(e){return String(e)}},RFC1738:Uh.RFC1738,RFC3986:Uh.RFC3986},pB=Bh,zh=Object.prototype.hasOwnProperty,po=Array.isArray,Lr=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),hB=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(po(r)){for(var i=[],o=0;o<r.length;++o)typeof r[o]<"u"&&i.push(r[o]);n.obj[n.prop]=i}}},iS=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(r[i]=t[i]);return r},mB=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(po(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!zh.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var i=t;return po(t)&&!po(n)&&(i=iS(t,r)),po(t)&&po(n)?(n.forEach(function(o,s){if(zh.call(t,s)){var a=t[s];a&&typeof a=="object"&&o&&typeof o=="object"?t[s]=e(a,o,r):t.push(o)}else t[s]=o}),t):Object.keys(n).reduce(function(o,s){var a=n[s];return zh.call(o,s)?o[s]=e(o[s],a,r):o[s]=a,o},i)},yB=function(t,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},t)},gB=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},vB=function(t,n,r,i,o){if(t.length===0)return t;var s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});for(var a="",c=0;c<s.length;++c){var l=s.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||o===pB.RFC1738&&(l===40||l===41)){a+=s.charAt(c);continue}if(l<128){a=a+Lr[l];continue}if(l<2048){a=a+(Lr[192|l>>6]+Lr[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Lr[224|l>>12]+Lr[128|l>>6&63]+Lr[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|s.charCodeAt(c)&1023),a+=Lr[240|l>>18]+Lr[128|l>>12&63]+Lr[128|l>>6&63]+Lr[128|l&63]}return a},bB=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],i=0;i<n.length;++i)for(var o=n[i],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],u=s[l];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:s,prop:l}),r.push(u))}return hB(n),t},wB=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},xB=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},_B=function(t,n){return[].concat(t,n)},SB=function(t,n){if(po(t)){for(var r=[],i=0;i<t.length;i+=1)r.push(n(t[i]));return r}return n(t)},oS={arrayToObject:iS,assign:yB,combine:_B,compact:bB,decode:gB,encode:vB,isBuffer:xB,isRegExp:wB,maybeMap:SB,merge:mB},sS=uB,Iu=oS,Ca=Bh,EB=Object.prototype.hasOwnProperty,aS={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},ri=Array.isArray,kB=Array.prototype.push,cS=function(e,t){kB.apply(e,ri(t)?t:[t])},CB=Date.prototype.toISOString,lS=Ca.default,In={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Iu.encode,encodeValuesOnly:!1,format:lS,formatter:Ca.formatters[lS],indices:!1,serializeDate:function(t){return CB.call(t)},skipNulls:!1,strictNullHandling:!1},TB=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Zh={},AB=function e(t,n,r,i,o,s,a,c,l,u,d,p,f,h,m,y){for(var g=t,v=y,b=0,S=!1;(v=v.get(Zh))!==void 0&&!S;){var E=v.get(t);if(b+=1,typeof E<"u"){if(E===b)throw new RangeError("Cyclic object value");S=!0}typeof v.get(Zh)>"u"&&(b=0)}if(typeof c=="function"?g=c(n,g):g instanceof Date?g=d(g):r==="comma"&&ri(g)&&(g=Iu.maybeMap(g,function(M){return M instanceof Date?d(M):M})),g===null){if(o)return a&&!h?a(n,In.encoder,m,"key",p):n;g=""}if(TB(g)||Iu.isBuffer(g)){if(a){var _=h?n:a(n,In.encoder,m,"key",p);return[f(_)+"="+f(a(g,In.encoder,m,"value",p))]}return[f(n)+"="+f(String(g))]}var I=[];if(typeof g>"u")return I;var P;if(r==="comma"&&ri(g))h&&a&&(g=Iu.maybeMap(g,a)),P=[{value:g.length>0?g.join(",")||null:void 0}];else if(ri(c))P=c;else{var $=Object.keys(g);P=l?$.sort(l):$}for(var O=i&&ri(g)&&g.length===1?n+"[]":n,q=0;q<P.length;++q){var H=P[q],B=typeof H=="object"&&typeof H.value<"u"?H.value:g[H];if(!(s&&B===null)){var F=ri(g)?typeof r=="function"?r(O,H):O:O+(u?"."+H:"["+H+"]");y.set(t,b);var D=sS();D.set(Zh,y),cS(I,e(B,F,r,i,o,s,r==="comma"&&h&&ri(g)?null:a,c,l,u,d,p,f,h,m,D))}}return I},OB=function(t){if(!t)return In;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||In.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Ca.default;if(typeof t.format<"u"){if(!EB.call(Ca.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var i=Ca.formatters[r],o=In.filter;return(typeof t.filter=="function"||ri(t.filter))&&(o=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:In.addQueryPrefix,allowDots:typeof t.allowDots>"u"?In.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:In.charsetSentinel,delimiter:typeof t.delimiter>"u"?In.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:In.encode,encoder:typeof t.encoder=="function"?t.encoder:In.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:In.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:In.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:In.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:In.strictNullHandling}},IB=function(e,t){var n=e,r=OB(t),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):ri(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;t&&t.arrayFormat in aS?a=t.arrayFormat:t&&"indices"in t?a=t.indices?"indices":"repeat":a="indices";var c=aS[a];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var u=sS(),d=0;d<i.length;++d){var p=i[d];r.skipNulls&&n[p]===null||cS(s,AB(n[p],p,c,l,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}var f=s.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),f.length>0?h+f:""},fs=oS,Vh=Object.prototype.hasOwnProperty,RB=Array.isArray,dn={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:fs.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},PB=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},uS=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},$B="utf8=%26%2310003%3B",DB="utf8=%E2%9C%93",NB=function(t,n){var r={__proto__:null},i=n.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),a=-1,c,l=n.charset;if(n.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===DB?l="utf-8":s[c]===$B&&(l="iso-8859-1"),a=c,c=s.length);for(c=0;c<s.length;++c)if(c!==a){var u=s[c],d=u.indexOf("]="),p=d===-1?u.indexOf("="):d+1,f,h;p===-1?(f=n.decoder(u,dn.decoder,l,"key"),h=n.strictNullHandling?null:""):(f=n.decoder(u.slice(0,p),dn.decoder,l,"key"),h=fs.maybeMap(uS(u.slice(p+1),n),function(m){return n.decoder(m,dn.decoder,l,"value")})),h&&n.interpretNumericEntities&&l==="iso-8859-1"&&(h=PB(h)),u.indexOf("[]=")>-1&&(h=RB(h)?[h]:h),Vh.call(r,f)?r[f]=fs.combine(r[f],h):r[f]=h}return r},jB=function(e,t,n,r){for(var i=r?t:uS(t,n),o=e.length-1;o>=0;--o){var s,a=e[o];if(a==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!n.parseArrays&&c===""?s={0:i}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(s=[],s[l]=i):c!=="__proto__"&&(s[c]=i)}i=s}return i},MB=function(t,n,r,i){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&s.exec(o),l=c?o.slice(0,c.index):o,u=[];if(l){if(!r.plainObjects&&Vh.call(Object.prototype,l)&&!r.allowPrototypes)return;u.push(l)}for(var d=0;r.depth>0&&(c=a.exec(o))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&Vh.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(c[1])}return c&&u.push("["+o.slice(c.index)+"]"),jB(u,n,r,i)}},qB=function(t){if(!t)return dn;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof t.charset>"u"?dn.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?dn.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:dn.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:dn.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:dn.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:dn.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:dn.comma,decoder:typeof t.decoder=="function"?t.decoder:dn.decoder,delimiter:typeof t.delimiter=="string"||fs.isRegExp(t.delimiter)?t.delimiter:dn.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:dn.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:dn.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:dn.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:dn.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:dn.strictNullHandling}},LB=function(e,t){var n=qB(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?NB(e,n):e,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],c=MB(a,r[a],n,typeof e=="string");i=fs.merge(i,c,n)}return n.allowSparse===!0?i:fs.compact(i)},FB=IB,UB=LB,BB=Bh,zB={formats:BB,parse:UB,stringify:FB};const ZB=mi(zB),VB=e=>e[1]!==void 0,tn=e=>{const{method:t,path:n,query:r,headers:i,body:o}=e,s=Object.entries(i).filter(VB),a=Object.fromEntries(s),c=ZB.stringify(r,{encode:!0,arrayFormat:"repeat",allowDots:!0}),l=c?[n,c].join("?"):n;return{method:t,url:l,headers:a,data:o}},HB=e=>({path:`/conversations/${encodeURIComponent(e.id)}/participants`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{userId:e.userId}}),WB=e=>({path:"/conversations",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{_:e._}}),KB=e=>({path:`/conversations/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),JB=e=>({path:`/conversations/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),YB=e=>({path:`/conversations/${encodeURIComponent(e.id)}/participants/${encodeURIComponent(e.userId)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id,userId:e.userId},body:{}}),GB=e=>({path:`/conversations/${encodeURIComponent(e.id)}/messages`,headers:{"x-user-key":e["x-user-key"]},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),XB=e=>({path:"/conversations",headers:{"x-user-key":e["x-user-key"]},query:{nextToken:e.nextToken},params:{},body:{}}),QB=e=>({path:`/conversations/${encodeURIComponent(e.id)}/participants`,headers:{"x-user-key":e["x-user-key"]},query:{nextToken:e.nextToken},params:{id:e.id},body:{}}),ez=e=>({path:`/conversations/${encodeURIComponent(e.id)}/listen`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),tz=e=>({path:`/conversations/${encodeURIComponent(e.id)}/participants/${encodeURIComponent(e.userId)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id,userId:e.userId},body:{}}),nz=e=>({path:"/messages",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{payload:e.payload,conversationId:e.conversationId}}),rz=e=>({path:`/messages/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),iz=e=>({path:`/messages/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),oz=e=>({path:"/users",headers:{},query:{},params:{},body:{name:e.name,pictureUrl:e.pictureUrl,userData:e.userData}}),sz=e=>({path:"/users/me",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{}}),az=e=>({path:"/users/me",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{}}),cz=e=>({path:"/users/me",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{name:e.name,pictureUrl:e.pictureUrl,userData:e.userData}}),lz=e=>({path:"/events",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{payload:e.payload,conversationId:e.conversationId}}),uz=e=>({path:`/events/${encodeURIComponent(e.id)}`,headers:{"x-user-key":e["x-user-key"]},query:{},params:{id:e.id},body:{}}),dz=e=>({path:"/files",headers:{"x-user-key":e["x-user-key"]},query:{},params:{},body:{key:e.key,size:e.size,accessPolicies:e.accessPolicies,index:e.index,contentType:e.contentType,tags:e.tags}});let fz=class{constructor(t,n={}){k(this,"addParticipant",async t=>{const{path:n,headers:r,query:i,body:o}=HB(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createConversation",async t=>{const{path:n,headers:r,query:i,body:o}=WB(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"deleteConversation",async t=>{const{path:n,headers:r,query:i,body:o}=KB(t),a=(this.props.toAxiosRequest??tn)({method:"delete",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getConversation",async t=>{const{path:n,headers:r,query:i,body:o}=JB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getParticipant",async t=>{const{path:n,headers:r,query:i,body:o}=YB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"listConversationMessages",async t=>{const{path:n,headers:r,query:i,body:o}=GB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"listConversations",async t=>{const{path:n,headers:r,query:i,body:o}=XB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"listParticipants",async t=>{const{path:n,headers:r,query:i,body:o}=QB(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"listenConversation",async t=>{const{path:n,headers:r,query:i,body:o}=ez(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"removeParticipant",async t=>{const{path:n,headers:r,query:i,body:o}=tz(t),a=(this.props.toAxiosRequest??tn)({method:"delete",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createMessage",async t=>{const{path:n,headers:r,query:i,body:o}=nz(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"deleteMessage",async t=>{const{path:n,headers:r,query:i,body:o}=rz(t),a=(this.props.toAxiosRequest??tn)({method:"delete",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getMessage",async t=>{const{path:n,headers:r,query:i,body:o}=iz(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createUser",async t=>{const{path:n,headers:r,query:i,body:o}=oz(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"deleteUser",async t=>{const{path:n,headers:r,query:i,body:o}=sz(t),a=(this.props.toAxiosRequest??tn)({method:"delete",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getUser",async t=>{const{path:n,headers:r,query:i,body:o}=az(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"updateUser",async t=>{const{path:n,headers:r,query:i,body:o}=cz(t),a=(this.props.toAxiosRequest??tn)({method:"put",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createEvent",async t=>{const{path:n,headers:r,query:i,body:o}=lz(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"getEvent",async t=>{const{path:n,headers:r,query:i,body:o}=uz(t),a=(this.props.toAxiosRequest??tn)({method:"get",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});k(this,"createFile",async t=>{const{path:n,headers:r,query:i,body:o}=dz(t),a=(this.props.toAxiosRequest??tn)({method:"post",path:n,headers:{...r},query:{...i},body:o});return this.axiosInstance.request(a).then(c=>c.data).catch(c=>{throw nn(c)})});this.axiosInstance=t,this.props=n}};function nn(e){var t;return O1.isAxiosError(e)&&((t=e.response)!=null&&t.data)?I1(e.response.data):I1(e)}class dS{constructor(){k(this,"listeners",{})}emit(t,n){const r=this.listeners[t];if(r)for(const i of[...r])i(n)}onceOrMore(t,n){const r=i=>{n(i)==="stop-listening"&&this.off(t,r)};this.on(t,r)}once(t,n){const r=i=>{this.off(t,r),n(i)};this.on(t,r)}on(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}off(t,n){const r=this.listeners[t];if(!r)return;const i=r.indexOf(n);i!==-1&&r.splice(i,1)}cleanup(){this.listeners={}}}var Hh={exports:{}};/** @license
|
|
136
136
|
* eventsource.js
|
|
137
137
|
* Available under MIT License (MIT)
|
|
138
138
|
* https://github.com/Yaffle/EventSource/
|
|
139
|
-
*/(function(e,t){(function(n){var r=n.setTimeout,i=n.clearTimeout,o=n.XMLHttpRequest,s=n.XDomainRequest,a=n.ActiveXObject,c=n.EventSource,l=n.document,u=n.Promise,d=n.fetch,
|
|
140
|
-
`),ue=0;ue<ce.length;ue+=1){var Ne=ce[ue],Se=Ne.split(": "),Be=Se.shift(),pt=Se.join(": ");oe[E(Be)]=pt}this._map=oe}_.prototype.get=function(L){return this._map[E(L)]},o!=null&&o.HEADERS_RECEIVED==null&&(o.HEADERS_RECEIVED=2);function I(){}I.prototype.open=function(L,oe,ce,ue,Ne,Se,Be){L.open("GET",Ne);var pt=0;L.onprogress=function(){var K=L.responseText,ie=K.slice(pt);pt+=ie.length,ce(ie)},L.onerror=function(K){K.preventDefault(),ue(new Error("NetworkError"))},L.onload=function(){ue(null)},L.onabort=function(){ue(null)},L.onreadystatechange=function(){if(L.readyState===o.HEADERS_RECEIVED){var K=L.status,ie=L.statusText,ae=L.getResponseHeader("Content-Type"),Ae=L.getAllResponseHeaders();oe(K,ie,ae,new _(Ae))}},L.withCredentials=Se;for(var Ge in Be)Object.prototype.hasOwnProperty.call(Be,Ge)&&L.setRequestHeader(Ge,Be[Ge]);return L.send(),L};function P(L){this._headers=L}P.prototype.get=function(L){return this._headers.get(L)};function $(){}$.prototype.open=function(L,oe,ce,ue,Ne,Se,Be){var pt=null,Ge=new m,K=Ge.signal,ie=new f;return d(Ne,{headers:Be,credentials:Se?"include":"same-origin",signal:K,cache:"no-store"}).then(function(ae){return pt=ae.body.getReader(),oe(ae.status,ae.statusText,ae.headers.get("Content-Type"),new P(ae.headers)),new u(function(Ae,Je){var Mt=function(){pt.read().then(function(Ot){if(Ot.done)Ae(void 0);else{var Et=ie.decode(Ot.value,{stream:!0});ce(Et),Mt()}}).catch(function(Ot){Je(Ot)})};Mt()})}).catch(function(ae){if(ae.name!=="AbortError")return ae}).then(function(ae){ue(ae)}),{abort:function(){pt!=null&&pt.cancel(),Ge.abort()}}};function O(){this._listeners=Object.create(null)}function q(L){r(function(){throw L},0)}O.prototype.dispatchEvent=function(L){L.target=this;var oe=this._listeners[L.type];if(oe!=null)for(var ce=oe.length,ue=0;ue<ce;ue+=1){var Ne=oe[ue];try{typeof Ne.handleEvent=="function"?Ne.handleEvent(L):Ne.call(this,L)}catch(Se){q(Se)}}},O.prototype.addEventListener=function(L,oe){L=String(L);var ce=this._listeners,ue=ce[L];ue==null&&(ue=[],ce[L]=ue);for(var Ne=!1,Se=0;Se<ue.length;Se+=1)ue[Se]===oe&&(Ne=!0);Ne||ue.push(oe)},O.prototype.removeEventListener=function(L,oe){L=String(L);var ce=this._listeners,ue=ce[L];if(ue!=null){for(var Ne=[],Se=0;Se<ue.length;Se+=1)ue[Se]!==oe&&Ne.push(ue[Se]);Ne.length===0?delete ce[L]:ce[L]=Ne}};function H(L){this.type=L,this.target=void 0}function B(L,oe){H.call(this,L),this.data=oe.data,this.lastEventId=oe.lastEventId}B.prototype=Object.create(H.prototype);function F(L,oe){H.call(this,L),this.status=oe.status,this.statusText=oe.statusText,this.headers=oe.headers}F.prototype=Object.create(H.prototype);function D(L,oe){H.call(this,L),this.error=oe.error}D.prototype=Object.create(H.prototype);var M=-1,Z=0,W=1,Q=2,C=-1,te=0,fe=1,A=2,we=3,Te=/^text\/event\-stream(;.*)?$/i,Ee=1e3
|
|
139
|
+
*/(function(e,t){(function(n){var r=n.setTimeout,i=n.clearTimeout,o=n.XMLHttpRequest,s=n.XDomainRequest,a=n.ActiveXObject,c=n.EventSource,l=n.document,u=n.Promise,d=n.fetch,p=n.Response,f=n.TextDecoder,h=n.TextEncoder,m=n.AbortController;if(typeof window<"u"&&typeof l<"u"&&!("readyState"in l)&&l.body==null&&(l.readyState="loading",window.addEventListener("load",function(L){l.readyState="complete"},!1)),o==null&&a!=null&&(o=function(){return new a("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(L){function oe(){}return oe.prototype=L,new oe}),Date.now||(Date.now=function(){return new Date().getTime()}),m==null){var y=d;d=function(L,oe){var ce=oe.signal;return y(L,{headers:oe.headers,credentials:oe.credentials,cache:oe.cache}).then(function(ue){var Ne=ue.body.getReader();return ce._reader=Ne,ce._aborted&&ce._reader.cancel(),{status:ue.status,statusText:ue.statusText,headers:ue.headers,body:{getReader:function(){return Ne}}}})},m=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function g(){this.bitsNeeded=0,this.codePoint=0}g.prototype.decode=function(L){function oe(K,ie,ae){if(ae===1)return K>=128>>ie&&K<<ie<=2047;if(ae===2)return K>=2048>>ie&&K<<ie<=55295||K>=57344>>ie&&K<<ie<=65535;if(ae===3)return K>=65536>>ie&&K<<ie<=1114111;throw new Error}function ce(K,ie){if(K===6*1)return ie>>6>15?3:ie>31?2:1;if(K===6*2)return ie>15?3:2;if(K===6*3)return 3;throw new Error}for(var ue=65533,Ne="",Se=this.bitsNeeded,Be=this.codePoint,pt=0;pt<L.length;pt+=1){var Ge=L[pt];Se!==0&&(Ge<128||Ge>191||!oe(Be<<6|Ge&63,Se-6,ce(Se,Be)))&&(Se=0,Be=ue,Ne+=String.fromCharCode(Be)),Se===0?(Ge>=0&&Ge<=127?(Se=0,Be=Ge):Ge>=192&&Ge<=223?(Se=6*1,Be=Ge&31):Ge>=224&&Ge<=239?(Se=6*2,Be=Ge&15):Ge>=240&&Ge<=247?(Se=6*3,Be=Ge&7):(Se=0,Be=ue),Se!==0&&!oe(Be,Se,ce(Se,Be))&&(Se=0,Be=ue)):(Se-=6,Be=Be<<6|Ge&63),Se===0&&(Be<=65535?Ne+=String.fromCharCode(Be):(Ne+=String.fromCharCode(55296+(Be-65535-1>>10)),Ne+=String.fromCharCode(56320+(Be-65535-1&1023))))}return this.bitsNeeded=Se,this.codePoint=Be,Ne};var v=function(){try{return new f().decode(new h().encode("test"),{stream:!0})==="test"}catch(L){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+L)}return!1};(f==null||h==null||!v())&&(f=g);var b=function(){};function S(L){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=b,this.onload=b,this.onerror=b,this.onreadystatechange=b,this._contentType="",this._xhr=L,this._sendTimeout=0,this._abort=b}S.prototype.open=function(L,oe){this._abort(!0);var ce=this,ue=this._xhr,Ne=1,Se=0;this._abort=function(ae){ce._sendTimeout!==0&&(i(ce._sendTimeout),ce._sendTimeout=0),(Ne===1||Ne===2||Ne===3)&&(Ne=4,ue.onload=b,ue.onerror=b,ue.onabort=b,ue.onprogress=b,ue.onreadystatechange=b,ue.abort(),Se!==0&&(i(Se),Se=0),ae||(ce.readyState=4,ce.onabort(null),ce.onreadystatechange())),Ne=0};var Be=function(){if(Ne===1){var ae=0,Ae="",Je=void 0;if("contentType"in ue)ae=200,Ae="OK",Je=ue.contentType;else try{ae=ue.status,Ae=ue.statusText,Je=ue.getResponseHeader("Content-Type")}catch{ae=0,Ae="",Je=void 0}ae!==0&&(Ne=2,ce.readyState=2,ce.status=ae,ce.statusText=Ae,ce._contentType=Je,ce.onreadystatechange())}},pt=function(){if(Be(),Ne===2||Ne===3){Ne=3;var ae="";try{ae=ue.responseText}catch{}ce.readyState=3,ce.responseText=ae,ce.onprogress()}},Ge=function(ae,Ae){if((Ae==null||Ae.preventDefault==null)&&(Ae={preventDefault:b}),pt(),Ne===1||Ne===2||Ne===3){if(Ne=4,Se!==0&&(i(Se),Se=0),ce.readyState=4,ae==="load")ce.onload(Ae);else if(ae==="error")ce.onerror(Ae);else if(ae==="abort")ce.onabort(Ae);else throw new TypeError;ce.onreadystatechange()}},K=function(ae){ue!=null&&(ue.readyState===4?(!("onload"in ue)||!("onerror"in ue)||!("onabort"in ue))&&Ge(ue.responseText===""?"error":"load",ae):ue.readyState===3?"onprogress"in ue||pt():ue.readyState===2&&Be())},ie=function(){Se=r(function(){ie()},500),ue.readyState===3&&pt()};"onload"in ue&&(ue.onload=function(ae){Ge("load",ae)}),"onerror"in ue&&(ue.onerror=function(ae){Ge("error",ae)}),"onabort"in ue&&(ue.onabort=function(ae){Ge("abort",ae)}),"onprogress"in ue&&(ue.onprogress=pt),"onreadystatechange"in ue&&(ue.onreadystatechange=function(ae){K(ae)}),("contentType"in ue||!("ontimeout"in o.prototype))&&(oe+=(oe.indexOf("?")===-1?"?":"&")+"padding=true"),ue.open(L,oe,!0),"readyState"in ue&&(Se=r(function(){ie()},0))},S.prototype.abort=function(){this._abort(!1)},S.prototype.getResponseHeader=function(L){return this._contentType},S.prototype.setRequestHeader=function(L,oe){var ce=this._xhr;"setRequestHeader"in ce&&ce.setRequestHeader(L,oe)},S.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},S.prototype.send=function(){if((!("ontimeout"in o.prototype)||!("sendAsBinary"in o.prototype)&&!("mozAnon"in o.prototype))&&l!=null&&l.readyState!=null&&l.readyState!=="complete"){var L=this;L._sendTimeout=r(function(){L._sendTimeout=0,L.send()},4);return}var oe=this._xhr;"withCredentials"in oe&&(oe.withCredentials=this.withCredentials);try{oe.send(void 0)}catch(ce){throw ce}};function E(L){return L.replace(/[A-Z]/g,function(oe){return String.fromCharCode(oe.charCodeAt(0)+32)})}function _(L){for(var oe=Object.create(null),ce=L.split(`\r
|
|
140
|
+
`),ue=0;ue<ce.length;ue+=1){var Ne=ce[ue],Se=Ne.split(": "),Be=Se.shift(),pt=Se.join(": ");oe[E(Be)]=pt}this._map=oe}_.prototype.get=function(L){return this._map[E(L)]},o!=null&&o.HEADERS_RECEIVED==null&&(o.HEADERS_RECEIVED=2);function I(){}I.prototype.open=function(L,oe,ce,ue,Ne,Se,Be){L.open("GET",Ne);var pt=0;L.onprogress=function(){var K=L.responseText,ie=K.slice(pt);pt+=ie.length,ce(ie)},L.onerror=function(K){K.preventDefault(),ue(new Error("NetworkError"))},L.onload=function(){ue(null)},L.onabort=function(){ue(null)},L.onreadystatechange=function(){if(L.readyState===o.HEADERS_RECEIVED){var K=L.status,ie=L.statusText,ae=L.getResponseHeader("Content-Type"),Ae=L.getAllResponseHeaders();oe(K,ie,ae,new _(Ae))}},L.withCredentials=Se;for(var Ge in Be)Object.prototype.hasOwnProperty.call(Be,Ge)&&L.setRequestHeader(Ge,Be[Ge]);return L.send(),L};function P(L){this._headers=L}P.prototype.get=function(L){return this._headers.get(L)};function $(){}$.prototype.open=function(L,oe,ce,ue,Ne,Se,Be){var pt=null,Ge=new m,K=Ge.signal,ie=new f;return d(Ne,{headers:Be,credentials:Se?"include":"same-origin",signal:K,cache:"no-store"}).then(function(ae){return pt=ae.body.getReader(),oe(ae.status,ae.statusText,ae.headers.get("Content-Type"),new P(ae.headers)),new u(function(Ae,Je){var Mt=function(){pt.read().then(function(Ot){if(Ot.done)Ae(void 0);else{var Et=ie.decode(Ot.value,{stream:!0});ce(Et),Mt()}}).catch(function(Ot){Je(Ot)})};Mt()})}).catch(function(ae){if(ae.name!=="AbortError")return ae}).then(function(ae){ue(ae)}),{abort:function(){pt!=null&&pt.cancel(),Ge.abort()}}};function O(){this._listeners=Object.create(null)}function q(L){r(function(){throw L},0)}O.prototype.dispatchEvent=function(L){L.target=this;var oe=this._listeners[L.type];if(oe!=null)for(var ce=oe.length,ue=0;ue<ce;ue+=1){var Ne=oe[ue];try{typeof Ne.handleEvent=="function"?Ne.handleEvent(L):Ne.call(this,L)}catch(Se){q(Se)}}},O.prototype.addEventListener=function(L,oe){L=String(L);var ce=this._listeners,ue=ce[L];ue==null&&(ue=[],ce[L]=ue);for(var Ne=!1,Se=0;Se<ue.length;Se+=1)ue[Se]===oe&&(Ne=!0);Ne||ue.push(oe)},O.prototype.removeEventListener=function(L,oe){L=String(L);var ce=this._listeners,ue=ce[L];if(ue!=null){for(var Ne=[],Se=0;Se<ue.length;Se+=1)ue[Se]!==oe&&Ne.push(ue[Se]);Ne.length===0?delete ce[L]:ce[L]=Ne}};function H(L){this.type=L,this.target=void 0}function B(L,oe){H.call(this,L),this.data=oe.data,this.lastEventId=oe.lastEventId}B.prototype=Object.create(H.prototype);function F(L,oe){H.call(this,L),this.status=oe.status,this.statusText=oe.statusText,this.headers=oe.headers}F.prototype=Object.create(H.prototype);function D(L,oe){H.call(this,L),this.error=oe.error}D.prototype=Object.create(H.prototype);var M=-1,Z=0,W=1,Q=2,C=-1,te=0,fe=1,A=2,we=3,Te=/^text\/event\-stream(;.*)?$/i,Ee=1e3,$e=18e6,Fe=function(L,oe){var ce=L==null?oe:parseInt(L,10);return ce!==ce&&(ce=oe),Pe(ce)},Pe=function(L){return Math.min(Math.max(L,Ee),$e)},he=function(L,oe,ce){try{typeof oe=="function"&&oe.call(L,ce)}catch(ue){q(ue)}};function de(L,oe){O.call(this),oe=oe||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,De(this,L,oe)}function _e(){return o!=null&&"withCredentials"in o.prototype||s==null?new o:new s}var pe=d!=null&&p!=null&&"body"in p.prototype;function De(L,oe,ce){oe=String(oe);var ue=!!ce.withCredentials,Ne=ce.lastEventIdQueryParameterName||"lastEventId",Se=Pe(1e3),Be=Fe(ce.heartbeatTimeout,45e3),pt="",Ge=Se,K=!1,ie=0,ae=ce.headers||{},Ae=ce.Transport,Je=pe&&Ae==null?void 0:new S(Ae!=null?new Ae:_e()),Mt=Ae!=null&&typeof Ae!="string"?new Ae:Je==null?new $:new I,Ot=void 0,Et=0,Nt=M,Yt="",z="",J="",Xe="",rt=te,At=0,Ye=0,cn=function(It,xt,Ht,zt){if(Nt===Z)if(It===200&&Ht!=null&&Te.test(Ht)){Nt=W,K=Date.now(),Ge=Se,L.readyState=W;var Wt=new F("open",{status:It,statusText:xt,headers:zt});L.dispatchEvent(Wt),he(L,L.onopen,Wt)}else{var Pt="";It!==200?(xt&&(xt=xt.replace(/\s+/g," ")),Pt="EventSource's response has a status "+It+" "+xt+" that is not 200. Aborting the connection."):Pt="EventSource's response has a Content-Type specifying an unsupported type: "+(Ht==null?"-":Ht.replace(/\s+/g," "))+". Aborting the connection.",_n();var Wt=new F("error",{status:It,statusText:xt,headers:zt});L.dispatchEvent(Wt),he(L,L.onerror,Wt),console.error(Pt)}},Un=function(It){if(Nt===W){for(var xt=-1,Ht=0;Ht<It.length;Ht+=1){var zt=It.charCodeAt(Ht);(zt===`
|
|
141
141
|
`.charCodeAt(0)||zt==="\r".charCodeAt(0))&&(xt=Ht)}var Wt=(xt!==-1?Xe:"")+It.slice(0,xt+1);Xe=(xt===-1?Xe:"")+It.slice(xt+1),It!==""&&(K=Date.now(),ie+=It.length);for(var Pt=0;Pt<Wt.length;Pt+=1){var zt=Wt.charCodeAt(Pt);if(rt===C&&zt===`
|
|
142
142
|
`.charCodeAt(0))rt=te;else if(rt===C&&(rt=te),zt==="\r".charCodeAt(0)||zt===`
|
|
143
143
|
`.charCodeAt(0)){if(rt!==te){rt===fe&&(Ye=Pt+1);var fn=Wt.slice(At,Ye-1),pn=Wt.slice(Ye+(Ye<Pt&&Wt.charCodeAt(Ye)===" ".charCodeAt(0)?1:0),Pt);fn==="data"?(Yt+=`
|
|
144
|
-
`,Yt+=pn):fn==="id"?z=pn:fn==="event"?J=pn:fn==="retry"?(Se=Fe(pn,Se),Ge=Se):fn==="heartbeatTimeout"&&(Be=Fe(pn,Be),Et!==0&&(i(Et),Et=r(function(){ir()},Be)))}if(rt===te){if(Yt!==""){pt=z,J===""&&(J="message");var Nn=new B(J,{data:Yt.slice(1),lastEventId:z});if(L.dispatchEvent(Nn),J==="open"?he(L,L.onopen,Nn):J==="message"?he(L,L.onmessage,Nn):J==="error"&&he(L,L.onerror,Nn),Nt===Q)return}Yt="",J=""}rt=zt==="\r".charCodeAt(0)?C:te}else rt===te&&(At=Pt,rt=fe),rt===fe?zt===":".charCodeAt(0)&&(Ye=Pt+1,rt=A):rt===A&&(rt=we)}}},Vt=function(It){if(Nt===W||Nt===Z){Nt=M,Et!==0&&(i(Et),Et=0),Et=r(function(){ir()},Ge),Ge=Re(Math.min(Se*16,Ge*2)),L.readyState=Z;var xt=new D("error",{error:It});L.dispatchEvent(xt),he(L,L.onerror,xt),It!=null&&console.error(It)}},_n=function(){Nt=Q,Ot!=null&&(Ot.abort(),Ot=void 0),Et!==0&&(i(Et),Et=0),L.readyState=Q},ir=function(){if(Et=0,Nt!==M){if(!K&&Ot!=null)Vt(new Error("No activity within "+Be+" milliseconds. "+(Nt===Z?"No response received.":ie+" chars received.")+" Reconnecting.")),Ot!=null&&(Ot.abort(),Ot=void 0);else{var It=Math.max((K||Date.now())+Be-Date.now(),1);K=!1,Et=r(function(){ir()},It)}return}K=!1,ie=0,Et=r(function(){ir()},Be),Nt=Z,Yt="",J="",z=pt,Xe="",At=0,Ye=0,rt=te;var xt=oe;if(oe.slice(0,5)!=="data:"&&oe.slice(0,5)!=="blob:"&&pt!==""){var Ht=oe.indexOf("?");xt=Ht===-1?oe:oe.slice(0,Ht+1)+oe.slice(Ht+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(pn,Nn){return Nn===Ne?"":pn}),xt+=(oe.indexOf("?")===-1?"?":"&")+Ne+"="+encodeURIComponent(pt)}var zt=L.withCredentials,Wt={};Wt.Accept="text/event-stream";var Pt=L.headers;if(Pt!=null)for(var fn in Pt)Object.prototype.hasOwnProperty.call(Pt,fn)&&(Wt[fn]=Pt[fn]);try{Ot=Mt.open(Je,cn,Un,Vt,xt,zt,Wt)}catch(pn){throw _n(),pn}};L.url=oe,L.readyState=Z,L.withCredentials=ue,L.headers=ae,L._close=_n,ir()}de.prototype=Object.create(O.prototype),de.prototype.CONNECTING=Z,de.prototype.OPEN=W,de.prototype.CLOSED=Q,de.prototype.close=function(){this._close()},de.CONNECTING=Z,de.OPEN=W,de.CLOSED=Q,de.prototype.withCredentials=void 0;var et=c;o!=null&&(c==null||!("withCredentials"in c.prototype))&&(et=de),function(L){{var oe=L(t);oe!==void 0&&(e.exports=oe)}}(function(L){L.EventSourcePolyfill=de,L.NativeEventSource=c,L.EventSource=et})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:tt:globalThis)})(Hh,Hh.exports);var pz=Hh.exports;const hz=mi(pz),mz=(e,t={})=>{const n=new hz.EventSourcePolyfill(e,{headers:t.headers}),r=new dS;return n.onopen=i=>r.emit("open",i),n.onmessage=i=>r.emit("message",i),n.onerror=i=>r.emit("error",i),{emitter:r,source:n}},yz=async(e,t={})=>{const{emitter:n,source:r}=mz(e,t);return await new Promise((i,o)=>{n.on("open",()=>{i()}),n.on("error",s=>{o(s)})}).finally(()=>n.cleanup()),{on:n.on.bind(n),close:()=>{n.cleanup(),r.close()}}};var Tt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Tt||(Tt={}));var Wh;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Wh||(Wh={}));const Oe=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},ge=Tt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Sr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,c=0;for(;c<s.path.length;){const l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Sr.create=e=>new Sr(e);const Ta=(e,t)=>{let n;switch(e.code){case ge.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Tt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tt.joinValues(e.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tt.joinValues(e.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Tt.joinValues(e.options)}, received '${e.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Tt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ge.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ge.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=t.defaultError,Tt.assertNever(e)}return{message:n}};let fS=Ta;function vz(e){fS=e}function Ru(){return fS}const Pu=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},bz=[];function Ie(e,t){const n=Pu({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ru(),Ta].filter(r=>!!r)});e.common.issues.push(n)}class Rn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return st;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Rn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return st;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const st=Object.freeze({status:"aborted"}),pS=e=>({status:"dirty",value:e}),Fn=e=>({status:"valid",value:e}),Kh=e=>e.status==="aborted",Jh=e=>e.status==="dirty",Aa=e=>e.status==="valid",$u=e=>typeof Promise<"u"&&e instanceof Promise;var Ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ze||(Ze={}));class Fr{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const hS=(e,t)=>{if(Aa(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Sr(e.common.issues);return this._error=n,this._error}}};function lt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class ft{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Oi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rn,ctx:{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if($u(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},o=this._parseSync({data:t,path:i.path,parent:i});return hS(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await($u(i)?i:Promise.resolve(i));return hS(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:ge.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Cr({schema:this,typeName:Qe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return oi.create(this,this._def)}nullable(){return go.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return ys.create(this,this._def)}or(t){return Pa.create([this,t],this._def)}and(t){return $a.create(this,t,this._def)}transform(t){return new Cr({...lt(this._def),schema:this,typeName:Qe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new qa({...lt(this._def),innerType:this,defaultValue:n,typeName:Qe.ZodDefault})}brand(){return new yS({typeName:Qe.ZodBranded,type:this,...lt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Lu({...lt(this._def),innerType:this,catchValue:n,typeName:Qe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return La.create(this,t)}readonly(){return Uu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wz=/^c[^\s-]{8,}$/i,xz=/^[a-z][a-z0-9]*$/,_z=/^[0-9A-HJKMNP-TV-Z]{26}$/,Sz=/^[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,Ez=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Yh;const Cz=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Tz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Az=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Oz(e,t){return!!((t==="v4"||!t)&&Cz.test(e)||(t==="v6"||!t)&&Tz.test(e))}class Er extends ft{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),st}const r=new Rn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Ie(i,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Ie(i,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Ez.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Yh||(Yh=new RegExp(kz,"u")),Yh.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Sz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")wz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")xz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")_z.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"ulid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ie(i,{validation:"url",code:ge.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"regex",code:ge.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Az(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Oz(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:ge.invalid_string,...Ze.errToObj(r)})}_addCheck(t){return new Er({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ze.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ze.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ze.errToObj(n)})}nonempty(t){return this.min(1,Ze.errToObj(t))}trim(){return new Er({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Er.create=e=>{var t;return new Er({checks:[],typeName:Qe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...lt(e)})};function Iz(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class Ii extends ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),st}let r;const i=new Rn;for(const o of this._def.checks)o.kind==="int"?Tt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Iz(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_finite,message:o.message}),i.dirty()):Tt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new Ii({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new Ii({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Tt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ii.create=e=>new Ii({checks:[],typeName:Qe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...lt(e)});class Ri extends ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.bigint,received:o.parsedType}),st}let r;const i=new Rn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Tt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new Ri({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new Ri({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ri.create=e=>{var t;return new Ri({checks:[],typeName:Qe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...lt(e)})};class Oa extends ft{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),st}return Fn(t.data)}}Oa.create=e=>new Oa({typeName:Qe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...lt(e)});class ho extends ft{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),st}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_date}),st}const r=new Rn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ho({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ho.create=e=>new ho({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Qe.ZodDate,...lt(e)});class Du extends ft{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),st}return Fn(t.data)}}Du.create=e=>new Du({typeName:Qe.ZodSymbol,...lt(e)});class Ia extends ft{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),st}return Fn(t.data)}}Ia.create=e=>new Ia({typeName:Qe.ZodUndefined,...lt(e)});class Ra extends ft{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),st}return Fn(t.data)}}Ra.create=e=>new Ra({typeName:Qe.ZodNull,...lt(e)});class ps extends ft{constructor(){super(...arguments),this._any=!0}_parse(t){return Fn(t.data)}}ps.create=e=>new ps({typeName:Qe.ZodAny,...lt(e)});class mo extends ft{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fn(t.data)}}mo.create=e=>new mo({typeName:Qe.ZodUnknown,...lt(e)});class ii extends ft{_parse(t){const n=this._getOrReturnCtx(t);return Ie(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),st}}ii.create=e=>new ii({typeName:Qe.ZodNever,...lt(e)});class Nu extends ft{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),st}return Fn(t.data)}}Nu.create=e=>new Nu({typeName:Qe.ZodVoid,...lt(e)});class kr extends ft{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Ie(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),st;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Ie(n,{code:s?ge.too_big:ge.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ie(n,{code:ge.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ie(n,{code:ge.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Fr(n,s,n.path,a)))).then(s=>Rn.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Fr(n,s,n.path,a)));return Rn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new kr({...this._def,minLength:{value:t,message:Ze.toString(n)}})}max(t,n){return new kr({...this._def,maxLength:{value:t,message:Ze.toString(n)}})}length(t,n){return new kr({...this._def,exactLength:{value:t,message:Ze.toString(n)}})}nonempty(t){return this.min(1,t)}}kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Qe.ZodArray,...lt(t)});function hs(e){if(e instanceof Bt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=oi.create(hs(r))}return new Bt({...e._def,shape:()=>t})}else return e instanceof kr?new kr({...e._def,type:hs(e.element)}):e instanceof oi?oi.create(hs(e.unwrap())):e instanceof go?go.create(hs(e.unwrap())):e instanceof Ur?Ur.create(e.items.map(t=>hs(t))):e}class Bt extends ft{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Tt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const l=this._getOrReturnCtx(t);return Ie(l,{code:ge.invalid_type,expected:Oe.object,received:l.parsedType}),st}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ii&&this._def.unknownKeys==="strip"))for(const l in i.data)s.includes(l)||a.push(l);const c=[];for(const l of s){const u=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Fr(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof ii){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(Ie(i,{code:ge.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Fr(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key;l.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return l}).then(l=>Rn.mergeObjectSync(r,l)):Rn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Ze.errToObj,new Bt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const c=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ze.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Bt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Bt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Qe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Bt({...this._def,catchall:t})}pick(t){const n={};return Tt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Bt({...this._def,shape:()=>n})}omit(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Bt({...this._def,shape:()=>n})}deepPartial(){return hs(this)}partial(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Bt({...this._def,shape:()=>n})}required(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof oi;)o=o._def.innerType;n[r]=o}}),new Bt({...this._def,shape:()=>n})}keyof(){return mS(Tt.objectKeys(this.shape))}}Bt.create=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strip",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)}),Bt.strictCreate=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strict",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)}),Bt.lazycreate=(e,t)=>new Bt({shape:e,unknownKeys:"strip",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)});class Pa extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Sr(a.ctx.common.issues));return Ie(n,{code:ge.invalid_union,unionErrors:s}),st}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const c of r){const l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(c=>new Sr(c));return Ie(n,{code:ge.invalid_union,unionErrors:a}),st}}get options(){return this._def.options}}Pa.create=(e,t)=>new Pa({options:e,typeName:Qe.ZodUnion,...lt(t)});const ju=e=>e instanceof Na?ju(e.schema):e instanceof Cr?ju(e.innerType()):e instanceof ja?[e.value]:e instanceof Pi?e.options:e instanceof Ma?Object.keys(e.enum):e instanceof qa?ju(e._def.innerType):e instanceof Ia?[void 0]:e instanceof Ra?[null]:null;class Mu extends ft{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Ie(n,{code:ge.invalid_type,expected:Oe.object,received:n.parsedType}),st;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Ie(n,{code:ge.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),st)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=ju(o.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Mu({typeName:Qe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...lt(r)})}}function Gh(e,t){const n=Oi(e),r=Oi(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=Tt.objectKeys(t),o=Tt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const c=Gh(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],c=Gh(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class $a extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(Kh(o)||Kh(s))return st;const a=Gh(o.value,s.value);return a.valid?((Jh(o)||Jh(s))&&n.dirty(),{status:n.value,value:a.data}):(Ie(r,{code:ge.invalid_intersection_types}),st)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}$a.create=(e,t,n)=>new $a({left:e,right:t,typeName:Qe.ZodIntersection,...lt(n)});class Ur extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Ie(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),st;if(r.data.length<this._def.items.length)return Ie(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),st;!this._def.rest&&r.data.length>this._def.items.length&&(Ie(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Fr(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Rn.mergeArray(n,s)):Rn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ur({...this._def,rest:t})}}Ur.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ur({items:e,typeName:Qe.ZodTuple,rest:null,...lt(t)})};class Da extends ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Ie(r,{code:ge.invalid_type,expected:Oe.object,received:r.parsedType}),st;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Fr(r,a,r.path,a)),value:s._parse(new Fr(r,r.data[a],r.path,a))});return r.common.async?Rn.mergeObjectAsync(n,i):Rn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ft?new Da({keyType:t,valueType:n,typeName:Qe.ZodRecord,...lt(r)}):new Da({keyType:Er.create(),valueType:t,typeName:Qe.ZodRecord,...lt(n)})}}class qu extends ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Ie(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),st;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new Fr(r,a,r.path,[l,"key"])),value:o._parse(new Fr(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return st;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of s){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return st;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}}qu.create=(e,t,n)=>new qu({valueType:t,keyType:e,typeName:Qe.ZodMap,...lt(n)});class yo extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Ie(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),st;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ie(r,{code:ge.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ie(r,{code:ge.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(c){const l=new Set;for(const u of c){if(u.status==="aborted")return st;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>o._parse(new Fr(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,n){return new yo({...this._def,minSize:{value:t,message:Ze.toString(n)}})}max(t,n){return new yo({...this._def,maxSize:{value:t,message:Ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yo.create=(e,t)=>new yo({valueType:e,minSize:null,maxSize:null,typeName:Qe.ZodSet,...lt(t)});class ms extends ft{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Ie(n,{code:ge.invalid_type,expected:Oe.function,received:n.parsedType}),st;function r(a,c){return Pu({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Ta].filter(l=>!!l),issueData:{code:ge.invalid_arguments,argumentsError:c}})}function i(a,c){return Pu({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Ta].filter(l=>!!l),issueData:{code:ge.invalid_return_type,returnTypeError:c}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof ys){const a=this;return Fn(async function(...c){const l=new Sr([]),u=await a._def.args.parseAsync(c,o).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(i(d,f)),l})})}else{const a=this;return Fn(function(...c){const l=a._def.args.safeParse(c,o);if(!l.success)throw new Sr([r(c,l.error)]);const u=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Sr([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ms({...this._def,args:Ur.create(t).rest(mo.create())})}returns(t){return new ms({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ms({args:t||Ur.create([]).rest(mo.create()),returns:n||mo.create(),typeName:Qe.ZodFunction,...lt(r)})}}class Na extends ft{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Na.create=(e,t)=>new Na({getter:e,typeName:Qe.ZodLazy,...lt(t)});class ja extends ft{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ie(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),st}return{status:"valid",value:t.data}}get value(){return this._def.value}}ja.create=(e,t)=>new ja({value:e,typeName:Qe.ZodLiteral,...lt(t)});function mS(e,t){return new Pi({values:e,typeName:Qe.ZodEnum,...lt(t)})}class Pi extends ft{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ie(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),st}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ie(n,{received:n.data,code:ge.invalid_enum_value,options:r}),st}return Fn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Pi.create(t)}exclude(t){return Pi.create(this.options.filter(n=>!t.includes(n)))}}Pi.create=mS;class Ma extends ft{_parse(t){const n=Tt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=Tt.objectValues(n);return Ie(r,{expected:Tt.joinValues(i),received:r.parsedType,code:ge.invalid_type}),st}if(n.indexOf(t.data)===-1){const i=Tt.objectValues(n);return Ie(r,{received:r.data,code:ge.invalid_enum_value,options:i}),st}return Fn(t.data)}get enum(){return this._def.values}}Ma.create=(e,t)=>new Ma({values:e,typeName:Qe.ZodNativeEnum,...lt(t)});class ys extends ft{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ie(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),st;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return Fn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ys.create=(e,t)=>new ys({type:e,typeName:Qe.ZodPromise,...lt(t)});class Cr extends ft{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{Ie(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(i.type==="refinement"){const s=a=>{const c=i.refinement(a,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?st:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?st:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Aa(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Aa(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);Tt.assertNever(i)}}Cr.create=(e,t,n)=>new Cr({schema:e,typeName:Qe.ZodEffects,effect:t,...lt(n)}),Cr.createWithPreprocess=(e,t,n)=>new Cr({schema:t,effect:{type:"preprocess",transform:e},typeName:Qe.ZodEffects,...lt(n)});class oi extends ft{_parse(t){return this._getType(t)===Oe.undefined?Fn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:Qe.ZodOptional,...lt(t)});class go extends ft{_parse(t){return this._getType(t)===Oe.null?Fn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}go.create=(e,t)=>new go({innerType:e,typeName:Qe.ZodNullable,...lt(t)});class qa extends ft{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}qa.create=(e,t)=>new qa({innerType:e,typeName:Qe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...lt(t)});class Lu extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $u(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Lu.create=(e,t)=>new Lu({innerType:e,typeName:Qe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...lt(t)});class Fu extends ft{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),st}return{status:"valid",value:t.data}}}Fu.create=e=>new Fu({typeName:Qe.ZodNaN,...lt(e)});const Rz=Symbol("zod_brand");class yS extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class La extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?st:o.status==="dirty"?(n.dirty(),pS(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?st:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new La({in:t,out:n,typeName:Qe.ZodPipeline})}}class Uu extends ft{_parse(t){const n=this._def.innerType._parse(t);return Aa(n)&&(n.value=Object.freeze(n.value)),n}}Uu.create=(e,t)=>new Uu({innerType:e,typeName:Qe.ZodReadonly,...lt(t)});const gS=(e,t={},n)=>e?ps.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):ps.create(),Pz={object:Bt.lazycreate};var Qe;(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"})(Qe||(Qe={}));const $z=(e,t={message:`Input not instance of ${e.name}`})=>gS(n=>n instanceof e,t),vS=Er.create,bS=Ii.create,Dz=Fu.create,Nz=Ri.create,wS=Oa.create,jz=ho.create,Mz=Du.create,qz=Ia.create,Lz=Ra.create,Fz=ps.create,Uz=mo.create,Bz=ii.create,zz=Nu.create,Zz=kr.create,Vz=Bt.create,Hz=Bt.strictCreate,Wz=Pa.create,Kz=Mu.create,Jz=$a.create,Yz=Ur.create,Gz=Da.create,Xz=qu.create,Qz=yo.create,e4=ms.create,t4=Na.create,n4=ja.create,r4=Pi.create,i4=Ma.create,o4=ys.create,xS=Cr.create,s4=oi.create,a4=go.create,c4=Cr.createWithPreprocess,l4=La.create;var V=Object.freeze({__proto__:null,defaultErrorMap:Ta,setErrorMap:vz,getErrorMap:Ru,makeIssue:Pu,EMPTY_PATH:bz,addIssueToContext:Ie,ParseStatus:Rn,INVALID:st,DIRTY:pS,OK:Fn,isAborted:Kh,isDirty:Jh,isValid:Aa,isAsync:$u,get util(){return Tt},get objectUtil(){return Wh},ZodParsedType:Oe,getParsedType:Oi,ZodType:ft,ZodString:Er,ZodNumber:Ii,ZodBigInt:Ri,ZodBoolean:Oa,ZodDate:ho,ZodSymbol:Du,ZodUndefined:Ia,ZodNull:Ra,ZodAny:ps,ZodUnknown:mo,ZodNever:ii,ZodVoid:Nu,ZodArray:kr,ZodObject:Bt,ZodUnion:Pa,ZodDiscriminatedUnion:Mu,ZodIntersection:$a,ZodTuple:Ur,ZodRecord:Da,ZodMap:qu,ZodSet:yo,ZodFunction:ms,ZodLazy:Na,ZodLiteral:ja,ZodEnum:Pi,ZodNativeEnum:Ma,ZodPromise:ys,ZodEffects:Cr,ZodTransformer:Cr,ZodOptional:oi,ZodNullable:go,ZodDefault:qa,ZodCatch:Lu,ZodNaN:Fu,BRAND:Rz,ZodBranded:yS,ZodPipeline:La,ZodReadonly:Uu,custom:gS,Schema:ft,ZodSchema:ft,late:Pz,get ZodFirstPartyTypeKind(){return Qe},coerce:{string:e=>Er.create({...e,coerce:!0}),number:e=>Ii.create({...e,coerce:!0}),boolean:e=>Oa.create({...e,coerce:!0}),bigint:e=>Ri.create({...e,coerce:!0}),date:e=>ho.create({...e,coerce:!0})},any:Fz,array:Zz,bigint:Nz,boolean:wS,date:jz,discriminatedUnion:Kz,effect:xS,enum:r4,function:e4,instanceof:$z,intersection:Jz,lazy:t4,literal:n4,map:Xz,nan:Dz,nativeEnum:i4,never:Bz,null:Lz,nullable:a4,number:bS,object:Vz,oboolean:()=>wS().optional(),onumber:()=>bS().optional(),optional:s4,ostring:()=>vS().optional(),pipeline:l4,preprocess:c4,promise:o4,record:Gz,set:Qz,strictObject:Hz,string:vS,symbol:Mz,transformer:xS,tuple:Yz,undefined:qz,union:Wz,unknown:Uz,void:zz,NEVER:st,ZodIssueCode:ge,quotelessJson:gz,ZodError:Sr});const u4=V.object({type:V.literal("message_created"),data:V.object({id:V.string().describe("Id of the [Message](#schema_message)"),createdAt:V.string().datetime().describe("Creation date of the [Message](#schema_message) in ISO 8601 format"),payload:V.union([V.object({audioUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("audio")}),V.object({title:V.string().min(1),subtitle:V.string().optional(),imageUrl:V.string().optional(),actions:V.array(V.object({action:V.enum(["postback","url","say"]),label:V.string().min(1),value:V.string().min(1)})),type:V.literal("card"),className:V.string().describe("CSS className to apply to the message").optional()}),V.object({items:V.array(V.object({title:V.string().min(1),subtitle:V.string().optional(),imageUrl:V.string().optional(),actions:V.array(V.object({action:V.enum(["postback","url","say"]),label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional()})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("carousel")}),V.object({text:V.string(),options:V.array(V.object({label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("choice"),disableFreeText:V.boolean().optional()}),V.object({text:V.string(),options:V.array(V.object({label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("dropdown")}),V.object({fileUrl:V.string().min(1),title:V.string().min(1).optional(),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("file")}),V.object({imageUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("image")}),V.object({latitude:V.number(),longitude:V.number(),address:V.string().optional(),title:V.string().optional(),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("location")}),V.object({markdown:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("markdown")}),V.object({text:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("text")}),V.object({videoUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("video")})]).describe("Payload is the content type of the message."),userId:V.string().describe("ID of the [User](#schema_user)"),conversationId:V.string().describe("ID of the [Conversation](#schema_conversation)")}).describe("The Message object represents a message in a [Conversation](#schema_conversation) for a specific [User](#schema_user).")}),d4=V.object({type:V.literal("webchat_visibility"),data:V.object({visibility:V.union([V.literal("show"),V.literal("hide"),V.literal("toggle")])})}),f4=V.object({type:V.literal("webchat_config"),data:V.object({config:V.record(V.union([V.any(),V.null()]))})}),p4=V.object({type:V.literal("custom"),data:V.object({event:V.record(V.union([V.any(),V.null()]))})}),h4=V.object({type:V.literal("typing_started"),data:V.object({timeout:V.number().optional()})}),m4=V.object({type:V.literal("typing_stopped"),data:V.record(V.never())}),y4={messageCreated:u4,webchatVisibility:d4,webchatConfig:f4,custom:p4,typingStarted:h4,typingStopped:m4},_S="unknown error",qd=class qd extends dS{constructor(n){super();k(this,"_state",{status:"disconnected"});k(this,"connect",async()=>{if(this._state.status==="connected")return;if(this._state.status==="connecting"){await this._state.connectionPromise;return}const n=this._connect();this._state={status:"connecting",connectionPromise:n},await n});k(this,"disconnect",async()=>{if(this._state.status==="disconnected")return;let n;this._state.status==="connecting"?n=await this._state.connectionPromise:n=this._state.source,this._disconnectSync(n)});k(this,"_connect",async()=>{const n=await yz(`${this._props.url}/conversations/${this._props.conversationId}/listen`,{headers:{"x-user-key":this._props.userKey}});return n.on("message",this._handleMessage),n.on("error",this._handleError(n)),this._state={status:"connected",source:n},n});k(this,"_disconnectSync",n=>{n.close(),this._state={status:"disconnected"}});k(this,"_handleMessage",n=>{const r=this._parseSignal(n.data);this.emit(r.type,r.data)});k(this,"_handleError",n=>r=>{this._disconnectSync(n);const i=this._toError(r);this.emit("error",i)});k(this,"_parseSignal",n=>{for(const r of Object.values(y4)){const i=this._safeJsonParse(n),o=r.safeParse(i);if(o.success)return o.data}return{type:"unknown",data:n}});k(this,"_safeJsonParse",n=>{try{return JSON.parse(n)}catch{return n}});k(this,"_toError",n=>{if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n===null)return new Error(_S);if(typeof n=="object"&&"message"in n)return this._toError(n.message);try{const r=JSON.stringify(n);return new Error(r)}catch{return new Error(_S)}});this._props=n}get status(){return this._state.status}};k(qd,"listen",async n=>{const r=new qd(n);return await r.connect(),r});let Xh=qd;const SS=100*1024*1024,g4=SS,v4=SS,b4=6e4;class w4{constructor(t){k(this,"_auto");k(this,"createConversation",t=>this._auto.createConversation(t));k(this,"getConversation",t=>this._auto.getConversation(t));k(this,"deleteConversation",t=>this._auto.deleteConversation(t));k(this,"listConversations",t=>this._auto.listConversations(t));k(this,"listConversationMessages",t=>this._auto.listConversationMessages(t));k(this,"addParticipant",t=>this._auto.addParticipant(t));k(this,"removeParticipant",t=>this._auto.removeParticipant(t));k(this,"getParticipant",t=>this._auto.getParticipant(t));k(this,"listParticipants",t=>this._auto.listParticipants(t));k(this,"createMessage",t=>this._auto.createMessage(t));k(this,"getMessage",t=>this._auto.getMessage(t));k(this,"deleteMessage",t=>this._auto.deleteMessage(t));k(this,"createFile",t=>this._auto.createFile(t));k(this,"createUser",t=>this._auto.createUser(t));k(this,"getUser",t=>this._auto.getUser(t));k(this,"updateUser",t=>this._auto.updateUser(t));k(this,"deleteUser",t=>this._auto.deleteUser(t));k(this,"createEvent",t=>this._auto.createEvent(t));k(this,"getEvent",t=>this._auto.getEvent(t));k(this,"listenConversation",async({id:t,"x-user-key":n})=>await Xh.listen({url:this.props.apiUrl,conversationId:t,userKey:n}));this.props=t;const{apiUrl:n}=t,r={...t.headers},i=t.timeout??b4,o=O1.create({baseURL:n,headers:r,withCredentials:!0,timeout:i,maxBodyLength:g4,maxContentLength:v4});this._auto=new fz(o)}}const Bu={disconnected:0,user_creating:1,user_created:2,conversation_creating:3,conversation_created:4},Vn=(e,t)=>e.status===t,Br=(e,t)=>Bu[e.status]<Bu[t],ES=(e,t)=>Bu[e.status]>=Bu[t];class zr extends Error{constructor(t){super(`Unexpected state: ${t.status}`),this.state=t}}const kS=["audio","file","image","video"],CS=e=>kS.includes(e);class x4 extends sp{constructor(n){super();k(this,"_client");k(this,"_webhookId");k(this,"_apiUrl");k(this,"_state",{status:"disconnected"});k(this,"mode","pushpin");k(this,"_initialConnect",async n=>{if(ES(this._state,"user_created"))throw new Error("Client is already connected. Please disconnect first.");if(Vn(this._state,"user_creating"))return;this._state={status:"user_creating"};const{user:{id:r},key:i}=await this._client.createUser({name:void 0,pictureUrl:void 0,userData:n});return this._state={status:"user_created",userId:r,userKey:i},{userId:r,userToken:i}});k(this,"_reConnect",async(n,r)=>{if(ES(this._state,"user_created")){if(this._state.userId!==n.userId)throw new Error("Client is already connected. Please disconnect first.");return n}return Vn(this._state,"user_creating")||(this._state={status:"user_created",userId:n.userId,userKey:n.userToken},await this._client.updateUser({"x-user-key":n.userToken,name:void 0,pictureUrl:void 0,userData:r})),n});k(this,"_mapMessage",n=>{const{payload:r,disableInput:i}=ox(n.payload);return{id:n.id,conversationId:n.conversationId,authorId:n.userId,sentOn:new Date(n.createdAt),payload:r,disableInput:i}});const r=`${n.apiUrl}/${n.clientId}`;this._webhookId=n.clientId,this._apiUrl=r,this._client=new w4({apiUrl:r})}get apiUrl(){return this._apiUrl}get clientId(){return this._webhookId}get userId(){if(!Br(this._state,"user_created"))return this._state.userId}async getUser(){if(Br(this._state,"user_created"))throw new zr(this._state);const{user:n}=await this._client.getUser({"x-user-key":this._state.userKey});return{data:n.data}}async updateUser(n){if(Br(this._state,"user_created"))throw new zr(this._state);const{user:r}=await this._client.updateUser({"x-user-key":this._state.userKey,name:n.name,pictureUrl:n.pictureUrl,userData:n.data});return r}get conversationId(){if(!Br(this._state,"conversation_created"))return this._state.conversationId}async connect(n,r){return n?await this.userExists(n)?this._reConnect(n,r):this._initialConnect(r):this._initialConnect(r)}async disconnect(){Vn(this._state,"conversation_created")?this._state.signalEmitter.cleanup():Vn(this._state,"conversation_creating")&&console.warn("zombie conversation..."),this._state={status:"disconnected"}}async sendFile(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state));const{size:i,name:o}=n,a=await(p=>new Promise((m,y)=>{const v=new FileReader;v.onload=g=>{var b;return m((b=g.target)==null?void 0:b.result)},v.onerror=g=>{var b;return y((b=g.target)==null?void 0:b.error)},v.readAsArrayBuffer(p)}))(n),{file:{uploadUrl:c,contentType:l,url:u}}=await this._client.createFile({"x-user-key":r.userKey,size:i,key:o,accessPolicies:["public_content"],index:!1});await fetch(c,{method:"PUT",body:a});const d=l.split("/").shift()??"",h=CS(d)?d:"file",f=h==="image"?{type:h,imageUrl:u}:h==="audio"?{type:h,audioUrl:u}:h==="video"?{type:h,videoUrl:u}:{type:h,fileUrl:u};return await this._client.createMessage({"x-user-key":r.userKey,conversationId:r.conversationId,payload:f}),this.emit("messageSent",u),{fileUrl:u,name:o,type:h}}async sendMessage(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),await this._client.createMessage({"x-user-key":r.userKey,conversationId:r.conversationId,payload:{type:"text",text:n}}),this.emit("messageSent",n)}async sendEvent(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),await this._client.createEvent({"x-user-key":r.userKey,conversationId:r.conversationId,payload:{type:"custom",data:n}})}async switchConversation(n){if(Br(this._state,"user_created"))throw new zr(this._state);Vn(this._state,"conversation_created")&&this._state.conversationId===n||Vn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._connectConversation(this._state,n))}async conversationExists(n){if(Br(this._state,"user_created"))return!1;try{return await this._client.getConversation({"x-user-key":this._state.userKey,id:n}),!0}catch(r){if(_h(r)&&r.code===404)return!1;throw r}}async userExists({userToken:n}){try{return await this._client.getUser({"x-user-key":n}),!0}catch(r){const i=o=>o.code===404||o.code===401;if(_h(r)&&i(r))return!1;throw r}}async newConversation(){if(Br(this._state,"user_created"))throw new zr(this._state);Vn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._createNewConversation(this._state))}async _createNewConversation(n){const{conversation:{id:r}}=await this._client.createConversation({"x-user-key":n.userKey}),i=await this._connectConversation(n,r);return await this._client.createEvent({"x-user-key":n.userKey,conversationId:r,payload:{type:"conversation_started",data:{}}}),i}async listMessages(){if(!Vn(this._state,"conversation_created"))return[];const{conversationId:n,userKey:r}=this._state,i=[];let o;do{const s=await this._client.listConversationMessages({id:n,"x-user-key":r,nextToken:o});i.push(...s.messages),o=s.meta.nextToken}while(o);return i.map(this._mapMessage)}async _connectConversation(n,r){const i=await this._client.listenConversation({id:r,"x-user-key":n.userKey});return i.on("unknown",o=>{typeof o=="string"&&o==="ping"||console.debug("unknown event",o)}),i.on("message_created",o=>{o.userId!==n.userId&&this.emit("message",this._mapMessage(o))}),i.on("error",()=>{this._state={status:"user_created",userId:n.userId,userKey:n.userKey},this.emit("error",new Error("Connection to conversation lost"))}),i.on("webchat_visibility",o=>{this.emit("webchatVisibility",o.visibility)}),i.on("webchat_config",o=>{this.emit("webchatConfig",o.config)}),i.on("typing_started",o=>{this.emit("isTyping",{isTyping:!0,timeout:o.timeout??5e3})}),i.on("typing_stopped",()=>{this.emit("isTyping",{isTyping:!1,timeout:0})}),i.on("custom",o=>{this.emit("customEvent",o.event)}),this.emit("conversation",r),this._state={status:"conversation_created",userId:n.userId,userKey:n.userKey,conversationId:r,signalEmitter:i},this._state}}const TS=({clientId:e,apiUrl:t="https://webchat.botpress.cloud",mode:n="pushpin"})=>n==="messaging"?new m3({url:t,clientId:e}):new x4({apiUrl:t,clientId:e}),_4=({clientId:e,apiUrl:t="https://webchat.botpress.cloud",mode:n="pushpin"})=>{const[r]=w.useState(TS({clientId:e,apiUrl:t,mode:n}));return r};function S4(e,t){const n=t?`The ${t} has been copied to your clipboard.`:"Copied to clipboard.";return navigator.clipboard.writeText(e).then(()=>L6({title:n,type:"success"}))}const E4=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});let k4={data:""},C4=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||k4,T4=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,A4=/\/\*[^]*?\*\/| +/g,AS=/\n+/g,$i=(e,t)=>{let n="",r="",i="";for(let o in e){let s=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+s+";":r+=o[1]=="f"?$i(s,o):o+"{"+$i(s,o[1]=="k"?"":t)+"}":typeof s=="object"?r+=$i(s,t?t.replace(/([^,])+/g,a=>o.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=$i.p?$i.p(o,s):o+":"+s+";")}return n+(t&&i?t+"{"+i+"}":i)+r},si={},OS=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+OS(e[n]);return t}return e},O4=(e,t,n,r,i)=>{let o=OS(e),s=si[o]||(si[o]=(c=>{let l=0,u=11;for(;l<c.length;)u=101*u+c.charCodeAt(l++)>>>0;return"go"+u})(o));if(!si[s]){let c=o!==e?e:(l=>{let u,d,h=[{}];for(;u=T4.exec(l.replace(A4,""));)u[4]?h.shift():u[3]?(d=u[3].replace(AS," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(AS," ").trim();return h[0]})(e);si[s]=$i(i?{["@keyframes "+s]:c}:c,n?"":"."+s)}let a=n&&si.g?si.g:null;return n&&(si.g=si[s]),((c,l,u,d)=>{d?l.data=l.data.replace(d,c):l.data.indexOf(c)===-1&&(l.data=u?c+l.data:l.data+c)})(si[s],t,r,a),s},I4=(e,t,n)=>e.reduce((r,i,o)=>{let s=t[o];if(s&&s.call){let a=s(n),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=c?"."+c:a&&typeof a=="object"?a.props?"":$i(a,""):a===!1?"":a}return r+i+(s??"")},"");function zu(e){let t=this||{},n=e.call?e(t.p):e;return O4(n.unshift?n.raw?I4(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,C4(t.target),t.g,t.o,t.k)}let IS,Qh,em;zu.bind({g:1});let ai=zu.bind({k:1});function R4(e,t,n,r){$i.p=t,IS=e,Qh=n,em=r}function Di(e,t){let n=this||{};return function(){let r=arguments;function i(o,s){let a=Object.assign({},o),c=a.className||i.className;n.p=Object.assign({theme:Qh&&Qh()},a),n.o=/ *go\d+/.test(c),a.className=zu.apply(n,r)+(c?" "+c:""),t&&(a.ref=s);let l=e;return e[0]&&(l=a.as||e,delete a.as),em&&l[0]&&em(a),IS(l,a)}return t?t(i):i}}var P4=e=>typeof e=="function",Zu=(e,t)=>P4(e)?e(t):e,$4=(()=>{let e=0;return()=>(++e).toString()})(),RS=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),D4=20,Vu=new Map,N4=1e3,PS=e=>{if(Vu.has(e))return;let t=setTimeout(()=>{Vu.delete(e),vo({type:4,toastId:e})},N4);Vu.set(e,t)},j4=e=>{let t=Vu.get(e);t&&clearTimeout(t)},tm=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,D4)};case 1:return t.toast.id&&j4(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?tm(e,{type:1,toast:n}):tm(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?PS(r):e.toasts.forEach(o=>{PS(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Hu=[],Wu={toasts:[],pausedAt:void 0},vo=e=>{Wu=tm(Wu,e),Hu.forEach(t=>{t(Wu)})},M4={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},q4=(e={})=>{let[t,n]=w.useState(Wu);w.useEffect(()=>(Hu.push(n),()=>{let i=Hu.indexOf(n);i>-1&&Hu.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,s;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||M4[i.type],style:{...e.style,...(s=e[i.type])==null?void 0:s.style,...i.style}}});return{...t,toasts:r}},L4=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||$4()}),Fa=e=>(t,n)=>{let r=L4(t,e,n);return vo({type:2,toast:r}),r.id},Hn=(e,t)=>Fa("blank")(e,t);Hn.error=Fa("error"),Hn.success=Fa("success"),Hn.loading=Fa("loading"),Hn.custom=Fa("custom"),Hn.dismiss=e=>{vo({type:3,toastId:e})},Hn.remove=e=>vo({type:4,toastId:e}),Hn.promise=(e,t,n)=>{let r=Hn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Hn.success(Zu(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Hn.error(Zu(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var F4=(e,t)=>{vo({type:1,toast:{id:e,height:t}})},U4=()=>{vo({type:5,time:Date.now()})},B4=e=>{let{toasts:t,pausedAt:n}=q4(e);w.useEffect(()=>{if(n)return;let o=Date.now(),s=t.map(a=>{if(a.duration===1/0)return;let c=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(c<0){a.visible&&Hn.dismiss(a.id);return}return setTimeout(()=>Hn.dismiss(a.id),c)});return()=>{s.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=w.useCallback(()=>{n&&vo({type:6,time:Date.now()})},[n]),i=w.useCallback((o,s)=>{let{reverseOrder:a=!1,gutter:c=8,defaultPosition:l}=s||{},u=t.filter(f=>(f.position||l)===(o.position||l)&&f.height),d=u.findIndex(f=>f.id===o.id),h=u.filter((f,p)=>p<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,p)=>f+(p.height||0)+c,0)},[t]);return{toasts:t,handlers:{updateHeight:F4,startPause:U4,endPause:r,calculateOffset:i}}},z4=ai`
|
|
144
|
+
`,Yt+=pn):fn==="id"?z=pn:fn==="event"?J=pn:fn==="retry"?(Se=Fe(pn,Se),Ge=Se):fn==="heartbeatTimeout"&&(Be=Fe(pn,Be),Et!==0&&(i(Et),Et=r(function(){ir()},Be)))}if(rt===te){if(Yt!==""){pt=z,J===""&&(J="message");var Nn=new B(J,{data:Yt.slice(1),lastEventId:z});if(L.dispatchEvent(Nn),J==="open"?he(L,L.onopen,Nn):J==="message"?he(L,L.onmessage,Nn):J==="error"&&he(L,L.onerror,Nn),Nt===Q)return}Yt="",J=""}rt=zt==="\r".charCodeAt(0)?C:te}else rt===te&&(At=Pt,rt=fe),rt===fe?zt===":".charCodeAt(0)&&(Ye=Pt+1,rt=A):rt===A&&(rt=we)}}},Vt=function(It){if(Nt===W||Nt===Z){Nt=M,Et!==0&&(i(Et),Et=0),Et=r(function(){ir()},Ge),Ge=Pe(Math.min(Se*16,Ge*2)),L.readyState=Z;var xt=new D("error",{error:It});L.dispatchEvent(xt),he(L,L.onerror,xt),It!=null&&console.error(It)}},_n=function(){Nt=Q,Ot!=null&&(Ot.abort(),Ot=void 0),Et!==0&&(i(Et),Et=0),L.readyState=Q},ir=function(){if(Et=0,Nt!==M){if(!K&&Ot!=null)Vt(new Error("No activity within "+Be+" milliseconds. "+(Nt===Z?"No response received.":ie+" chars received.")+" Reconnecting.")),Ot!=null&&(Ot.abort(),Ot=void 0);else{var It=Math.max((K||Date.now())+Be-Date.now(),1);K=!1,Et=r(function(){ir()},It)}return}K=!1,ie=0,Et=r(function(){ir()},Be),Nt=Z,Yt="",J="",z=pt,Xe="",At=0,Ye=0,rt=te;var xt=oe;if(oe.slice(0,5)!=="data:"&&oe.slice(0,5)!=="blob:"&&pt!==""){var Ht=oe.indexOf("?");xt=Ht===-1?oe:oe.slice(0,Ht+1)+oe.slice(Ht+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(pn,Nn){return Nn===Ne?"":pn}),xt+=(oe.indexOf("?")===-1?"?":"&")+Ne+"="+encodeURIComponent(pt)}var zt=L.withCredentials,Wt={};Wt.Accept="text/event-stream";var Pt=L.headers;if(Pt!=null)for(var fn in Pt)Object.prototype.hasOwnProperty.call(Pt,fn)&&(Wt[fn]=Pt[fn]);try{Ot=Mt.open(Je,cn,Un,Vt,xt,zt,Wt)}catch(pn){throw _n(),pn}};L.url=oe,L.readyState=Z,L.withCredentials=ue,L.headers=ae,L._close=_n,ir()}de.prototype=Object.create(O.prototype),de.prototype.CONNECTING=Z,de.prototype.OPEN=W,de.prototype.CLOSED=Q,de.prototype.close=function(){this._close()},de.CONNECTING=Z,de.OPEN=W,de.CLOSED=Q,de.prototype.withCredentials=void 0;var et=c;o!=null&&(c==null||!("withCredentials"in c.prototype))&&(et=de),function(L){{var oe=L(t);oe!==void 0&&(e.exports=oe)}}(function(L){L.EventSourcePolyfill=de,L.NativeEventSource=c,L.EventSource=et})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:tt:globalThis)})(Hh,Hh.exports);var pz=Hh.exports;const hz=mi(pz),mz=(e,t={})=>{const n=new hz.EventSourcePolyfill(e,{headers:t.headers}),r=new dS;return n.onopen=i=>r.emit("open",i),n.onmessage=i=>r.emit("message",i),n.onerror=i=>r.emit("error",i),{emitter:r,source:n}},yz=async(e,t={})=>{const{emitter:n,source:r}=mz(e,t);return await new Promise((i,o)=>{n.on("open",()=>{i()}),n.on("error",s=>{o(s)})}).finally(()=>n.cleanup()),{on:n.on.bind(n),close:()=>{n.cleanup(),r.close()}}};var Tt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Tt||(Tt={}));var Wh;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Wh||(Wh={}));const Oe=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},ge=Tt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Sr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,c=0;for(;c<s.path.length;){const l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Sr.create=e=>new Sr(e);const Ta=(e,t)=>{let n;switch(e.code){case ge.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Tt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tt.joinValues(e.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tt.joinValues(e.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Tt.joinValues(e.options)}, received '${e.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Tt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ge.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ge.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=t.defaultError,Tt.assertNever(e)}return{message:n}};let fS=Ta;function vz(e){fS=e}function Ru(){return fS}const Pu=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},bz=[];function Re(e,t){const n=Pu({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ru(),Ta].filter(r=>!!r)});e.common.issues.push(n)}class Rn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return st;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Rn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return st;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const st=Object.freeze({status:"aborted"}),pS=e=>({status:"dirty",value:e}),Fn=e=>({status:"valid",value:e}),Kh=e=>e.status==="aborted",Jh=e=>e.status==="dirty",Aa=e=>e.status==="valid",$u=e=>typeof Promise<"u"&&e instanceof Promise;var Ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ze||(Ze={}));class Fr{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const hS=(e,t)=>{if(Aa(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Sr(e.common.issues);return this._error=n,this._error}}};function lt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class ft{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Oi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rn,ctx:{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if($u(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},o=this._parseSync({data:t,path:i.path,parent:i});return hS(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await($u(i)?i:Promise.resolve(i));return hS(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:ge.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Cr({schema:this,typeName:Qe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return oi.create(this,this._def)}nullable(){return go.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return ys.create(this,this._def)}or(t){return Pa.create([this,t],this._def)}and(t){return $a.create(this,t,this._def)}transform(t){return new Cr({...lt(this._def),schema:this,typeName:Qe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new qa({...lt(this._def),innerType:this,defaultValue:n,typeName:Qe.ZodDefault})}brand(){return new yS({typeName:Qe.ZodBranded,type:this,...lt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Lu({...lt(this._def),innerType:this,catchValue:n,typeName:Qe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return La.create(this,t)}readonly(){return Uu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wz=/^c[^\s-]{8,}$/i,xz=/^[a-z][a-z0-9]*$/,_z=/^[0-9A-HJKMNP-TV-Z]{26}$/,Sz=/^[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,Ez=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Yh;const Cz=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Tz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Az=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Oz(e,t){return!!((t==="v4"||!t)&&Cz.test(e)||(t==="v6"||!t)&&Tz.test(e))}class Er extends ft{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const o=this._getOrReturnCtx(t);return Re(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),st}const r=new Rn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Re(i,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Re(i,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Re(i,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Re(i,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Ez.test(t.data)||(i=this._getOrReturnCtx(t,i),Re(i,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Yh||(Yh=new RegExp(kz,"u")),Yh.test(t.data)||(i=this._getOrReturnCtx(t,i),Re(i,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Sz.test(t.data)||(i=this._getOrReturnCtx(t,i),Re(i,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")wz.test(t.data)||(i=this._getOrReturnCtx(t,i),Re(i,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")xz.test(t.data)||(i=this._getOrReturnCtx(t,i),Re(i,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")_z.test(t.data)||(i=this._getOrReturnCtx(t,i),Re(i,{validation:"ulid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Re(i,{validation:"url",code:ge.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Re(i,{validation:"regex",code:ge.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Re(i,{code:ge.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Re(i,{code:ge.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Re(i,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Az(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Re(i,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Oz(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Re(i,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:ge.invalid_string,...Ze.errToObj(r)})}_addCheck(t){return new Er({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ze.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ze.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ze.errToObj(n)})}nonempty(t){return this.min(1,Ze.errToObj(t))}trim(){return new Er({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Er.create=e=>{var t;return new Er({checks:[],typeName:Qe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...lt(e)})};function Iz(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class Ii extends ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const o=this._getOrReturnCtx(t);return Re(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),st}let r;const i=new Rn;for(const o of this._def.checks)o.kind==="int"?Tt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Iz(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_finite,message:o.message}),i.dirty()):Tt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new Ii({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new Ii({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Tt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ii.create=e=>new Ii({checks:[],typeName:Qe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...lt(e)});class Ri extends ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const o=this._getOrReturnCtx(t);return Re(o,{code:ge.invalid_type,expected:Oe.bigint,received:o.parsedType}),st}let r;const i=new Rn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Tt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new Ri({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new Ri({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ri.create=e=>{var t;return new Ri({checks:[],typeName:Qe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...lt(e)})};class Oa extends ft{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),st}return Fn(t.data)}}Oa.create=e=>new Oa({typeName:Qe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...lt(e)});class ho extends ft{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const o=this._getOrReturnCtx(t);return Re(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),st}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Re(o,{code:ge.invalid_date}),st}const r=new Rn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Re(i,{code:ge.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Re(i,{code:ge.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ho({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ho.create=e=>new ho({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Qe.ZodDate,...lt(e)});class Du extends ft{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),st}return Fn(t.data)}}Du.create=e=>new Du({typeName:Qe.ZodSymbol,...lt(e)});class Ia extends ft{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),st}return Fn(t.data)}}Ia.create=e=>new Ia({typeName:Qe.ZodUndefined,...lt(e)});class Ra extends ft{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),st}return Fn(t.data)}}Ra.create=e=>new Ra({typeName:Qe.ZodNull,...lt(e)});class ps extends ft{constructor(){super(...arguments),this._any=!0}_parse(t){return Fn(t.data)}}ps.create=e=>new ps({typeName:Qe.ZodAny,...lt(e)});class mo extends ft{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fn(t.data)}}mo.create=e=>new mo({typeName:Qe.ZodUnknown,...lt(e)});class ii extends ft{_parse(t){const n=this._getOrReturnCtx(t);return Re(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),st}}ii.create=e=>new ii({typeName:Qe.ZodNever,...lt(e)});class Nu extends ft{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),st}return Fn(t.data)}}Nu.create=e=>new Nu({typeName:Qe.ZodVoid,...lt(e)});class kr extends ft{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Re(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),st;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Re(n,{code:s?ge.too_big:ge.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Re(n,{code:ge.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Re(n,{code:ge.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Fr(n,s,n.path,a)))).then(s=>Rn.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Fr(n,s,n.path,a)));return Rn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new kr({...this._def,minLength:{value:t,message:Ze.toString(n)}})}max(t,n){return new kr({...this._def,maxLength:{value:t,message:Ze.toString(n)}})}length(t,n){return new kr({...this._def,exactLength:{value:t,message:Ze.toString(n)}})}nonempty(t){return this.min(1,t)}}kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Qe.ZodArray,...lt(t)});function hs(e){if(e instanceof Bt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=oi.create(hs(r))}return new Bt({...e._def,shape:()=>t})}else return e instanceof kr?new kr({...e._def,type:hs(e.element)}):e instanceof oi?oi.create(hs(e.unwrap())):e instanceof go?go.create(hs(e.unwrap())):e instanceof Ur?Ur.create(e.items.map(t=>hs(t))):e}class Bt extends ft{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Tt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const l=this._getOrReturnCtx(t);return Re(l,{code:ge.invalid_type,expected:Oe.object,received:l.parsedType}),st}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ii&&this._def.unknownKeys==="strip"))for(const l in i.data)s.includes(l)||a.push(l);const c=[];for(const l of s){const u=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Fr(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof ii){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(Re(i,{code:ge.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Fr(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key;l.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return l}).then(l=>Rn.mergeObjectSync(r,l)):Rn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Ze.errToObj,new Bt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const c=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ze.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Bt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Bt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Qe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Bt({...this._def,catchall:t})}pick(t){const n={};return Tt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Bt({...this._def,shape:()=>n})}omit(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Bt({...this._def,shape:()=>n})}deepPartial(){return hs(this)}partial(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Bt({...this._def,shape:()=>n})}required(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof oi;)o=o._def.innerType;n[r]=o}}),new Bt({...this._def,shape:()=>n})}keyof(){return mS(Tt.objectKeys(this.shape))}}Bt.create=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strip",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)}),Bt.strictCreate=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strict",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)}),Bt.lazycreate=(e,t)=>new Bt({shape:e,unknownKeys:"strip",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)});class Pa extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Sr(a.ctx.common.issues));return Re(n,{code:ge.invalid_union,unionErrors:s}),st}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const c of r){const l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(c=>new Sr(c));return Re(n,{code:ge.invalid_union,unionErrors:a}),st}}get options(){return this._def.options}}Pa.create=(e,t)=>new Pa({options:e,typeName:Qe.ZodUnion,...lt(t)});const ju=e=>e instanceof Na?ju(e.schema):e instanceof Cr?ju(e.innerType()):e instanceof ja?[e.value]:e instanceof Pi?e.options:e instanceof Ma?Object.keys(e.enum):e instanceof qa?ju(e._def.innerType):e instanceof Ia?[void 0]:e instanceof Ra?[null]:null;class Mu extends ft{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Re(n,{code:ge.invalid_type,expected:Oe.object,received:n.parsedType}),st;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Re(n,{code:ge.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),st)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=ju(o.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Mu({typeName:Qe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...lt(r)})}}function Gh(e,t){const n=Oi(e),r=Oi(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=Tt.objectKeys(t),o=Tt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const c=Gh(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],c=Gh(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class $a extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(Kh(o)||Kh(s))return st;const a=Gh(o.value,s.value);return a.valid?((Jh(o)||Jh(s))&&n.dirty(),{status:n.value,value:a.data}):(Re(r,{code:ge.invalid_intersection_types}),st)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}$a.create=(e,t,n)=>new $a({left:e,right:t,typeName:Qe.ZodIntersection,...lt(n)});class Ur extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Re(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),st;if(r.data.length<this._def.items.length)return Re(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),st;!this._def.rest&&r.data.length>this._def.items.length&&(Re(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Fr(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Rn.mergeArray(n,s)):Rn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ur({...this._def,rest:t})}}Ur.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ur({items:e,typeName:Qe.ZodTuple,rest:null,...lt(t)})};class Da extends ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Re(r,{code:ge.invalid_type,expected:Oe.object,received:r.parsedType}),st;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Fr(r,a,r.path,a)),value:s._parse(new Fr(r,r.data[a],r.path,a))});return r.common.async?Rn.mergeObjectAsync(n,i):Rn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ft?new Da({keyType:t,valueType:n,typeName:Qe.ZodRecord,...lt(r)}):new Da({keyType:Er.create(),valueType:t,typeName:Qe.ZodRecord,...lt(n)})}}class qu extends ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Re(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),st;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new Fr(r,a,r.path,[l,"key"])),value:o._parse(new Fr(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return st;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of s){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return st;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}}qu.create=(e,t,n)=>new qu({valueType:t,keyType:e,typeName:Qe.ZodMap,...lt(n)});class yo extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Re(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),st;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Re(r,{code:ge.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Re(r,{code:ge.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(c){const l=new Set;for(const u of c){if(u.status==="aborted")return st;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>o._parse(new Fr(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,n){return new yo({...this._def,minSize:{value:t,message:Ze.toString(n)}})}max(t,n){return new yo({...this._def,maxSize:{value:t,message:Ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yo.create=(e,t)=>new yo({valueType:e,minSize:null,maxSize:null,typeName:Qe.ZodSet,...lt(t)});class ms extends ft{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Re(n,{code:ge.invalid_type,expected:Oe.function,received:n.parsedType}),st;function r(a,c){return Pu({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Ta].filter(l=>!!l),issueData:{code:ge.invalid_arguments,argumentsError:c}})}function i(a,c){return Pu({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Ta].filter(l=>!!l),issueData:{code:ge.invalid_return_type,returnTypeError:c}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof ys){const a=this;return Fn(async function(...c){const l=new Sr([]),u=await a._def.args.parseAsync(c,o).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(i(d,f)),l})})}else{const a=this;return Fn(function(...c){const l=a._def.args.safeParse(c,o);if(!l.success)throw new Sr([r(c,l.error)]);const u=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Sr([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ms({...this._def,args:Ur.create(t).rest(mo.create())})}returns(t){return new ms({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ms({args:t||Ur.create([]).rest(mo.create()),returns:n||mo.create(),typeName:Qe.ZodFunction,...lt(r)})}}class Na extends ft{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Na.create=(e,t)=>new Na({getter:e,typeName:Qe.ZodLazy,...lt(t)});class ja extends ft{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Re(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),st}return{status:"valid",value:t.data}}get value(){return this._def.value}}ja.create=(e,t)=>new ja({value:e,typeName:Qe.ZodLiteral,...lt(t)});function mS(e,t){return new Pi({values:e,typeName:Qe.ZodEnum,...lt(t)})}class Pi extends ft{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Re(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),st}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Re(n,{received:n.data,code:ge.invalid_enum_value,options:r}),st}return Fn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Pi.create(t)}exclude(t){return Pi.create(this.options.filter(n=>!t.includes(n)))}}Pi.create=mS;class Ma extends ft{_parse(t){const n=Tt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=Tt.objectValues(n);return Re(r,{expected:Tt.joinValues(i),received:r.parsedType,code:ge.invalid_type}),st}if(n.indexOf(t.data)===-1){const i=Tt.objectValues(n);return Re(r,{received:r.data,code:ge.invalid_enum_value,options:i}),st}return Fn(t.data)}get enum(){return this._def.values}}Ma.create=(e,t)=>new Ma({values:e,typeName:Qe.ZodNativeEnum,...lt(t)});class ys extends ft{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Re(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),st;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return Fn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ys.create=(e,t)=>new ys({type:e,typeName:Qe.ZodPromise,...lt(t)});class Cr extends ft{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{Re(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(i.type==="refinement"){const s=a=>{const c=i.refinement(a,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?st:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?st:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Aa(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Aa(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);Tt.assertNever(i)}}Cr.create=(e,t,n)=>new Cr({schema:e,typeName:Qe.ZodEffects,effect:t,...lt(n)}),Cr.createWithPreprocess=(e,t,n)=>new Cr({schema:t,effect:{type:"preprocess",transform:e},typeName:Qe.ZodEffects,...lt(n)});class oi extends ft{_parse(t){return this._getType(t)===Oe.undefined?Fn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:Qe.ZodOptional,...lt(t)});class go extends ft{_parse(t){return this._getType(t)===Oe.null?Fn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}go.create=(e,t)=>new go({innerType:e,typeName:Qe.ZodNullable,...lt(t)});class qa extends ft{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}qa.create=(e,t)=>new qa({innerType:e,typeName:Qe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...lt(t)});class Lu extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $u(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Lu.create=(e,t)=>new Lu({innerType:e,typeName:Qe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...lt(t)});class Fu extends ft{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),st}return{status:"valid",value:t.data}}}Fu.create=e=>new Fu({typeName:Qe.ZodNaN,...lt(e)});const Rz=Symbol("zod_brand");class yS extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class La extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?st:o.status==="dirty"?(n.dirty(),pS(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?st:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new La({in:t,out:n,typeName:Qe.ZodPipeline})}}class Uu extends ft{_parse(t){const n=this._def.innerType._parse(t);return Aa(n)&&(n.value=Object.freeze(n.value)),n}}Uu.create=(e,t)=>new Uu({innerType:e,typeName:Qe.ZodReadonly,...lt(t)});const gS=(e,t={},n)=>e?ps.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):ps.create(),Pz={object:Bt.lazycreate};var Qe;(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"})(Qe||(Qe={}));const $z=(e,t={message:`Input not instance of ${e.name}`})=>gS(n=>n instanceof e,t),vS=Er.create,bS=Ii.create,Dz=Fu.create,Nz=Ri.create,wS=Oa.create,jz=ho.create,Mz=Du.create,qz=Ia.create,Lz=Ra.create,Fz=ps.create,Uz=mo.create,Bz=ii.create,zz=Nu.create,Zz=kr.create,Vz=Bt.create,Hz=Bt.strictCreate,Wz=Pa.create,Kz=Mu.create,Jz=$a.create,Yz=Ur.create,Gz=Da.create,Xz=qu.create,Qz=yo.create,e4=ms.create,t4=Na.create,n4=ja.create,r4=Pi.create,i4=Ma.create,o4=ys.create,xS=Cr.create,s4=oi.create,a4=go.create,c4=Cr.createWithPreprocess,l4=La.create;var V=Object.freeze({__proto__:null,defaultErrorMap:Ta,setErrorMap:vz,getErrorMap:Ru,makeIssue:Pu,EMPTY_PATH:bz,addIssueToContext:Re,ParseStatus:Rn,INVALID:st,DIRTY:pS,OK:Fn,isAborted:Kh,isDirty:Jh,isValid:Aa,isAsync:$u,get util(){return Tt},get objectUtil(){return Wh},ZodParsedType:Oe,getParsedType:Oi,ZodType:ft,ZodString:Er,ZodNumber:Ii,ZodBigInt:Ri,ZodBoolean:Oa,ZodDate:ho,ZodSymbol:Du,ZodUndefined:Ia,ZodNull:Ra,ZodAny:ps,ZodUnknown:mo,ZodNever:ii,ZodVoid:Nu,ZodArray:kr,ZodObject:Bt,ZodUnion:Pa,ZodDiscriminatedUnion:Mu,ZodIntersection:$a,ZodTuple:Ur,ZodRecord:Da,ZodMap:qu,ZodSet:yo,ZodFunction:ms,ZodLazy:Na,ZodLiteral:ja,ZodEnum:Pi,ZodNativeEnum:Ma,ZodPromise:ys,ZodEffects:Cr,ZodTransformer:Cr,ZodOptional:oi,ZodNullable:go,ZodDefault:qa,ZodCatch:Lu,ZodNaN:Fu,BRAND:Rz,ZodBranded:yS,ZodPipeline:La,ZodReadonly:Uu,custom:gS,Schema:ft,ZodSchema:ft,late:Pz,get ZodFirstPartyTypeKind(){return Qe},coerce:{string:e=>Er.create({...e,coerce:!0}),number:e=>Ii.create({...e,coerce:!0}),boolean:e=>Oa.create({...e,coerce:!0}),bigint:e=>Ri.create({...e,coerce:!0}),date:e=>ho.create({...e,coerce:!0})},any:Fz,array:Zz,bigint:Nz,boolean:wS,date:jz,discriminatedUnion:Kz,effect:xS,enum:r4,function:e4,instanceof:$z,intersection:Jz,lazy:t4,literal:n4,map:Xz,nan:Dz,nativeEnum:i4,never:Bz,null:Lz,nullable:a4,number:bS,object:Vz,oboolean:()=>wS().optional(),onumber:()=>bS().optional(),optional:s4,ostring:()=>vS().optional(),pipeline:l4,preprocess:c4,promise:o4,record:Gz,set:Qz,strictObject:Hz,string:vS,symbol:Mz,transformer:xS,tuple:Yz,undefined:qz,union:Wz,unknown:Uz,void:zz,NEVER:st,ZodIssueCode:ge,quotelessJson:gz,ZodError:Sr});const u4=V.object({type:V.literal("message_created"),data:V.object({id:V.string().describe("Id of the [Message](#schema_message)"),createdAt:V.string().datetime().describe("Creation date of the [Message](#schema_message) in ISO 8601 format"),payload:V.union([V.object({audioUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("audio")}),V.object({title:V.string().min(1),subtitle:V.string().optional(),imageUrl:V.string().optional(),actions:V.array(V.object({action:V.enum(["postback","url","say"]),label:V.string().min(1),value:V.string().min(1)})),type:V.literal("card"),className:V.string().describe("CSS className to apply to the message").optional()}),V.object({items:V.array(V.object({title:V.string().min(1),subtitle:V.string().optional(),imageUrl:V.string().optional(),actions:V.array(V.object({action:V.enum(["postback","url","say"]),label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional()})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("carousel")}),V.object({text:V.string(),options:V.array(V.object({label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("choice"),disableFreeText:V.boolean().optional()}),V.object({text:V.string(),options:V.array(V.object({label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("dropdown")}),V.object({fileUrl:V.string().min(1),title:V.string().min(1).optional(),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("file")}),V.object({imageUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("image")}),V.object({latitude:V.number(),longitude:V.number(),address:V.string().optional(),title:V.string().optional(),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("location")}),V.object({markdown:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("markdown")}),V.object({text:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("text")}),V.object({videoUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("video")})]).describe("Payload is the content type of the message."),userId:V.string().describe("ID of the [User](#schema_user)"),conversationId:V.string().describe("ID of the [Conversation](#schema_conversation)")}).describe("The Message object represents a message in a [Conversation](#schema_conversation) for a specific [User](#schema_user).")}),d4=V.object({type:V.literal("webchat_visibility"),data:V.object({visibility:V.union([V.literal("show"),V.literal("hide"),V.literal("toggle")])})}),f4=V.object({type:V.literal("webchat_config"),data:V.object({config:V.record(V.union([V.any(),V.null()]))})}),p4=V.object({type:V.literal("custom"),data:V.object({event:V.record(V.union([V.any(),V.null()]))})}),h4=V.object({type:V.literal("typing_started"),data:V.object({timeout:V.number().optional()})}),m4=V.object({type:V.literal("typing_stopped"),data:V.record(V.never())}),y4={messageCreated:u4,webchatVisibility:d4,webchatConfig:f4,custom:p4,typingStarted:h4,typingStopped:m4},_S="unknown error",qd=class qd extends dS{constructor(n){super();k(this,"_state",{status:"disconnected"});k(this,"connect",async()=>{if(this._state.status==="connected")return;if(this._state.status==="connecting"){await this._state.connectionPromise;return}const n=this._connect();this._state={status:"connecting",connectionPromise:n},await n});k(this,"disconnect",async()=>{if(this._state.status==="disconnected")return;let n;this._state.status==="connecting"?n=await this._state.connectionPromise:n=this._state.source,this._disconnectSync(n)});k(this,"_connect",async()=>{const n=await yz(`${this._props.url}/conversations/${this._props.conversationId}/listen`,{headers:{"x-user-key":this._props.userKey}});return n.on("message",this._handleMessage),n.on("error",this._handleError(n)),this._state={status:"connected",source:n},n});k(this,"_disconnectSync",n=>{n.close(),this._state={status:"disconnected"}});k(this,"_handleMessage",n=>{const r=this._parseSignal(n.data);this.emit(r.type,r.data)});k(this,"_handleError",n=>r=>{this._disconnectSync(n);const i=this._toError(r);this.emit("error",i)});k(this,"_parseSignal",n=>{for(const r of Object.values(y4)){const i=this._safeJsonParse(n),o=r.safeParse(i);if(o.success)return o.data}return{type:"unknown",data:n}});k(this,"_safeJsonParse",n=>{try{return JSON.parse(n)}catch{return n}});k(this,"_toError",n=>{if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n===null)return new Error(_S);if(typeof n=="object"&&"message"in n)return this._toError(n.message);try{const r=JSON.stringify(n);return new Error(r)}catch{return new Error(_S)}});this._props=n}get status(){return this._state.status}};k(qd,"listen",async n=>{const r=new qd(n);return await r.connect(),r});let Xh=qd;const SS=100*1024*1024,g4=SS,v4=SS,b4=6e4;class w4{constructor(t){k(this,"_auto");k(this,"createConversation",t=>this._auto.createConversation(t));k(this,"getConversation",t=>this._auto.getConversation(t));k(this,"deleteConversation",t=>this._auto.deleteConversation(t));k(this,"listConversations",t=>this._auto.listConversations(t));k(this,"listConversationMessages",t=>this._auto.listConversationMessages(t));k(this,"addParticipant",t=>this._auto.addParticipant(t));k(this,"removeParticipant",t=>this._auto.removeParticipant(t));k(this,"getParticipant",t=>this._auto.getParticipant(t));k(this,"listParticipants",t=>this._auto.listParticipants(t));k(this,"createMessage",t=>this._auto.createMessage(t));k(this,"getMessage",t=>this._auto.getMessage(t));k(this,"deleteMessage",t=>this._auto.deleteMessage(t));k(this,"createFile",t=>this._auto.createFile(t));k(this,"createUser",t=>this._auto.createUser(t));k(this,"getUser",t=>this._auto.getUser(t));k(this,"updateUser",t=>this._auto.updateUser(t));k(this,"deleteUser",t=>this._auto.deleteUser(t));k(this,"createEvent",t=>this._auto.createEvent(t));k(this,"getEvent",t=>this._auto.getEvent(t));k(this,"listenConversation",async({id:t,"x-user-key":n})=>await Xh.listen({url:this.props.apiUrl,conversationId:t,userKey:n}));this.props=t;const{apiUrl:n}=t,r={...t.headers},i=t.timeout??b4,o=O1.create({baseURL:n,headers:r,withCredentials:!0,timeout:i,maxBodyLength:g4,maxContentLength:v4});this._auto=new fz(o)}}const Bu={disconnected:0,user_creating:1,user_created:2,conversation_creating:3,conversation_created:4},Vn=(e,t)=>e.status===t,Br=(e,t)=>Bu[e.status]<Bu[t],ES=(e,t)=>Bu[e.status]>=Bu[t];class zr extends Error{constructor(t){super(`Unexpected state: ${t.status}`),this.state=t}}const kS=["audio","file","image","video"],CS=e=>kS.includes(e);class x4 extends sp{constructor(n){super();k(this,"_client");k(this,"_webhookId");k(this,"_apiUrl");k(this,"_state",{status:"disconnected"});k(this,"mode","pushpin");k(this,"_initialConnect",async({data:n,name:r,pictureUrl:i})=>{if(ES(this._state,"user_created"))throw new Error("Client is already connected. Please disconnect first.");if(Vn(this._state,"user_creating"))return;this._state={status:"user_creating"};const{user:{id:o},key:s}=await this._client.createUser({name:r,pictureUrl:i,userData:n});return this._state={status:"user_created",userId:o,userKey:s},{userId:o,userToken:s}});k(this,"_reConnect",async(n,{data:r,name:i,pictureUrl:o})=>{if(ES(this._state,"user_created")){if(this._state.userId!==n.userId)throw new Error("Client is already connected. Please disconnect first.");return n}return Vn(this._state,"user_creating")||(this._state={status:"user_created",userId:n.userId,userKey:n.userToken},await this._client.updateUser({"x-user-key":n.userToken,name:i,pictureUrl:o,userData:r})),n});k(this,"_mapMessage",n=>{const{payload:r,disableInput:i}=ox(n.payload);return{id:n.id,conversationId:n.conversationId,authorId:n.userId,sentOn:new Date(n.createdAt),payload:r,disableInput:i}});const r=`${n.apiUrl}/${n.clientId}`;this._webhookId=n.clientId,this._apiUrl=r,this._client=new w4({apiUrl:r})}get apiUrl(){return this._apiUrl}get clientId(){return this._webhookId}get userId(){if(!Br(this._state,"user_created"))return this._state.userId}async getUser(){if(Br(this._state,"user_created"))throw new zr(this._state);const{user:n}=await this._client.getUser({"x-user-key":this._state.userKey});return{data:n.data}}async updateUser(n){if(Br(this._state,"user_created"))throw new zr(this._state);const{user:r}=await this._client.updateUser({"x-user-key":this._state.userKey,name:n.name,pictureUrl:n.pictureUrl,userData:n.data});return r}get conversationId(){if(!Br(this._state,"conversation_created"))return this._state.conversationId}async connect(n,r,i={}){const o={data:r,...i};return n?await this.userExists(n)?this._reConnect(n,o):this._initialConnect(o):this._initialConnect(o)}async disconnect(){Vn(this._state,"conversation_created")?this._state.signalEmitter.cleanup():Vn(this._state,"conversation_creating")&&console.warn("zombie conversation..."),this._state={status:"disconnected"}}async sendFile(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state));const{size:i,name:o}=n,a=await(h=>new Promise((m,y)=>{const g=new FileReader;g.onload=v=>{var b;return m((b=v.target)==null?void 0:b.result)},g.onerror=v=>{var b;return y((b=v.target)==null?void 0:b.error)},g.readAsArrayBuffer(h)}))(n),{file:{uploadUrl:c,contentType:l,url:u}}=await this._client.createFile({"x-user-key":r.userKey,size:i,key:o,accessPolicies:["public_content"],index:!1});await fetch(c,{method:"PUT",body:a});const d=l.split("/").shift()??"",p=CS(d)?d:"file",f=p==="image"?{type:p,imageUrl:u}:p==="audio"?{type:p,audioUrl:u}:p==="video"?{type:p,videoUrl:u}:{type:p,fileUrl:u};return await this._client.createMessage({"x-user-key":r.userKey,conversationId:r.conversationId,payload:f}),this.emit("messageSent",u),{fileUrl:u,name:o,type:p}}async sendMessage(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),await this._client.createMessage({"x-user-key":r.userKey,conversationId:r.conversationId,payload:{type:"text",text:n}}),this.emit("messageSent",n)}async sendEvent(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),await this._client.createEvent({"x-user-key":r.userKey,conversationId:r.conversationId,payload:{type:"custom",data:n}})}async switchConversation(n){if(Br(this._state,"user_created"))throw new zr(this._state);Vn(this._state,"conversation_created")&&this._state.conversationId===n||Vn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._connectConversation(this._state,n))}async conversationExists(n){if(Br(this._state,"user_created"))return!1;try{return await this._client.getConversation({"x-user-key":this._state.userKey,id:n}),!0}catch(r){if(_h(r)&&r.code===404)return!1;throw r}}async userExists({userToken:n}){try{return await this._client.getUser({"x-user-key":n}),!0}catch(r){const i=o=>o.code===404||o.code===401;if(_h(r)&&i(r))return!1;throw r}}async newConversation(){if(Br(this._state,"user_created"))throw new zr(this._state);Vn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._createNewConversation(this._state))}async _createNewConversation(n){const{conversation:{id:r}}=await this._client.createConversation({"x-user-key":n.userKey}),i=await this._connectConversation(n,r);return await this._client.createEvent({"x-user-key":n.userKey,conversationId:r,payload:{type:"conversation_started",data:{}}}),i}async listMessages(){if(!Vn(this._state,"conversation_created"))return[];const{conversationId:n,userKey:r}=this._state,i=[];let o;do{const s=await this._client.listConversationMessages({id:n,"x-user-key":r,nextToken:o});i.push(...s.messages),o=s.meta.nextToken}while(o);return i.map(this._mapMessage)}async _connectConversation(n,r){const i=await this._client.listenConversation({id:r,"x-user-key":n.userKey});return i.on("unknown",o=>{typeof o=="string"&&o==="ping"||console.debug("unknown event",o)}),i.on("message_created",o=>{o.userId!==n.userId&&this.emit("message",this._mapMessage(o))}),i.on("error",()=>{this._state={status:"user_created",userId:n.userId,userKey:n.userKey},this.emit("error",new Error("Connection to conversation lost"))}),i.on("webchat_visibility",o=>{this.emit("webchatVisibility",o.visibility)}),i.on("webchat_config",o=>{this.emit("webchatConfig",o.config)}),i.on("typing_started",o=>{this.emit("isTyping",{isTyping:!0,timeout:o.timeout??5e3})}),i.on("typing_stopped",()=>{this.emit("isTyping",{isTyping:!1,timeout:0})}),i.on("custom",o=>{this.emit("customEvent",o.event)}),this.emit("conversation",r),this._state={status:"conversation_created",userId:n.userId,userKey:n.userKey,conversationId:r,signalEmitter:i},this._state}}const TS=({clientId:e,apiUrl:t="https://webchat.botpress.cloud",mode:n="pushpin"})=>n==="messaging"?new m3({url:t,clientId:e}):new x4({apiUrl:t,clientId:e}),_4=({clientId:e,apiUrl:t="https://webchat.botpress.cloud",mode:n="pushpin"})=>{const[r]=w.useState(TS({clientId:e,apiUrl:t,mode:n}));return r};function S4(e,t){const n=t?`The ${t} has been copied to your clipboard.`:"Copied to clipboard.";return navigator.clipboard.writeText(e).then(()=>L6({title:n,type:"success"}))}const E4=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});let k4={data:""},C4=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||k4,T4=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,A4=/\/\*[^]*?\*\/| +/g,AS=/\n+/g,$i=(e,t)=>{let n="",r="",i="";for(let o in e){let s=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+s+";":r+=o[1]=="f"?$i(s,o):o+"{"+$i(s,o[1]=="k"?"":t)+"}":typeof s=="object"?r+=$i(s,t?t.replace(/([^,])+/g,a=>o.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=$i.p?$i.p(o,s):o+":"+s+";")}return n+(t&&i?t+"{"+i+"}":i)+r},si={},OS=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+OS(e[n]);return t}return e},O4=(e,t,n,r,i)=>{let o=OS(e),s=si[o]||(si[o]=(c=>{let l=0,u=11;for(;l<c.length;)u=101*u+c.charCodeAt(l++)>>>0;return"go"+u})(o));if(!si[s]){let c=o!==e?e:(l=>{let u,d,p=[{}];for(;u=T4.exec(l.replace(A4,""));)u[4]?p.shift():u[3]?(d=u[3].replace(AS," ").trim(),p.unshift(p[0][d]=p[0][d]||{})):p[0][u[1]]=u[2].replace(AS," ").trim();return p[0]})(e);si[s]=$i(i?{["@keyframes "+s]:c}:c,n?"":"."+s)}let a=n&&si.g?si.g:null;return n&&(si.g=si[s]),((c,l,u,d)=>{d?l.data=l.data.replace(d,c):l.data.indexOf(c)===-1&&(l.data=u?c+l.data:l.data+c)})(si[s],t,r,a),s},I4=(e,t,n)=>e.reduce((r,i,o)=>{let s=t[o];if(s&&s.call){let a=s(n),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=c?"."+c:a&&typeof a=="object"?a.props?"":$i(a,""):a===!1?"":a}return r+i+(s??"")},"");function zu(e){let t=this||{},n=e.call?e(t.p):e;return O4(n.unshift?n.raw?I4(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,C4(t.target),t.g,t.o,t.k)}let IS,Qh,em;zu.bind({g:1});let ai=zu.bind({k:1});function R4(e,t,n,r){$i.p=t,IS=e,Qh=n,em=r}function Di(e,t){let n=this||{};return function(){let r=arguments;function i(o,s){let a=Object.assign({},o),c=a.className||i.className;n.p=Object.assign({theme:Qh&&Qh()},a),n.o=/ *go\d+/.test(c),a.className=zu.apply(n,r)+(c?" "+c:""),t&&(a.ref=s);let l=e;return e[0]&&(l=a.as||e,delete a.as),em&&l[0]&&em(a),IS(l,a)}return t?t(i):i}}var P4=e=>typeof e=="function",Zu=(e,t)=>P4(e)?e(t):e,$4=(()=>{let e=0;return()=>(++e).toString()})(),RS=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),D4=20,Vu=new Map,N4=1e3,PS=e=>{if(Vu.has(e))return;let t=setTimeout(()=>{Vu.delete(e),vo({type:4,toastId:e})},N4);Vu.set(e,t)},j4=e=>{let t=Vu.get(e);t&&clearTimeout(t)},tm=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,D4)};case 1:return t.toast.id&&j4(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?tm(e,{type:1,toast:n}):tm(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?PS(r):e.toasts.forEach(o=>{PS(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Hu=[],Wu={toasts:[],pausedAt:void 0},vo=e=>{Wu=tm(Wu,e),Hu.forEach(t=>{t(Wu)})},M4={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},q4=(e={})=>{let[t,n]=w.useState(Wu);w.useEffect(()=>(Hu.push(n),()=>{let i=Hu.indexOf(n);i>-1&&Hu.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,s;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||M4[i.type],style:{...e.style,...(s=e[i.type])==null?void 0:s.style,...i.style}}});return{...t,toasts:r}},L4=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||$4()}),Fa=e=>(t,n)=>{let r=L4(t,e,n);return vo({type:2,toast:r}),r.id},Hn=(e,t)=>Fa("blank")(e,t);Hn.error=Fa("error"),Hn.success=Fa("success"),Hn.loading=Fa("loading"),Hn.custom=Fa("custom"),Hn.dismiss=e=>{vo({type:3,toastId:e})},Hn.remove=e=>vo({type:4,toastId:e}),Hn.promise=(e,t,n)=>{let r=Hn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Hn.success(Zu(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Hn.error(Zu(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var F4=(e,t)=>{vo({type:1,toast:{id:e,height:t}})},U4=()=>{vo({type:5,time:Date.now()})},B4=e=>{let{toasts:t,pausedAt:n}=q4(e);w.useEffect(()=>{if(n)return;let o=Date.now(),s=t.map(a=>{if(a.duration===1/0)return;let c=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(c<0){a.visible&&Hn.dismiss(a.id);return}return setTimeout(()=>Hn.dismiss(a.id),c)});return()=>{s.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=w.useCallback(()=>{n&&vo({type:6,time:Date.now()})},[n]),i=w.useCallback((o,s)=>{let{reverseOrder:a=!1,gutter:c=8,defaultPosition:l}=s||{},u=t.filter(f=>(f.position||l)===(o.position||l)&&f.height),d=u.findIndex(f=>f.id===o.id),p=u.filter((f,h)=>h<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[p+1]:[0,p]).reduce((f,h)=>f+(h.height||0)+c,0)},[t]);return{toasts:t,handlers:{updateHeight:F4,startPause:U4,endPause:r,calculateOffset:i}}},z4=ai`
|
|
145
145
|
from {
|
|
146
146
|
transform: scale(0) rotate(45deg);
|
|
147
147
|
opacity: 0;
|
|
@@ -317,10 +317,10 @@ to {
|
|
|
317
317
|
> * {
|
|
318
318
|
pointer-events: auto;
|
|
319
319
|
}
|
|
320
|
-
`,Ku=16,h6=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:s})=>{let{toasts:a,handlers:c}=B4(n);return N.createElement("div",{style:{position:"fixed",zIndex:9999,top:Ku,left:Ku,right:Ku,bottom:Ku,pointerEvents:"none",...o},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},a.map(l=>{let u=l.position||t,d=c.calculateOffset(l,{reverseOrder:e,gutter:r,defaultPosition:t}),
|
|
321
|
-
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(
|
|
320
|
+
`,Ku=16,h6=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:s})=>{let{toasts:a,handlers:c}=B4(n);return N.createElement("div",{style:{position:"fixed",zIndex:9999,top:Ku,left:Ku,right:Ku,bottom:Ku,pointerEvents:"none",...o},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},a.map(l=>{let u=l.position||t,d=c.calculateOffset(l,{reverseOrder:e,gutter:r,defaultPosition:t}),p=f6(u,d);return N.createElement(d6,{id:l.id,key:l.id,onHeightUpdate:c.updateHeight,className:l.visible?p6:"",style:p},l.type==="custom"?Zu(l.message,l):i?i(l):N.createElement(u6,{toast:l,position:u}))}))},m6=Object.defineProperty,y6=(e,t,n)=>t in e?m6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nm=(e,t,n)=>(y6(e,typeof t!="symbol"?t+"":t,n),n);let g6=class{constructor(){nm(this,"current",this.detect()),nm(this,"handoffState","pending"),nm(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ua=new g6,Ju=(e,t)=>{Ua.isServer?w.useEffect(e,t):w.useLayoutEffect(e,t)};function gs(e){let t=w.useRef(e);return Ju(()=>{t.current=e},[e]),t}function v6(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Yu(){let e=[],t=[],n={enqueue(r){t.push(r)},addEventListener(r,i,o,s){return r.addEventListener(i,o,s),n.add(()=>r.removeEventListener(i,o,s))},requestAnimationFrame(...r){let i=requestAnimationFrame(...r);return n.add(()=>cancelAnimationFrame(i))},nextFrame(...r){return n.requestAnimationFrame(()=>n.requestAnimationFrame(...r))},setTimeout(...r){let i=setTimeout(...r);return n.add(()=>clearTimeout(i))},microTask(...r){let i={current:!0};return v6(()=>{i.current&&r[0]()}),n.add(()=>{i.current=!1})},add(r){return e.push(r),()=>{let i=e.indexOf(r);if(i>=0){let[o]=e.splice(i,1);o()}}},dispose(){for(let r of e.splice(0))r()},async workQueue(){for(let r of t.splice(0))await r()},style(r,i,o){let s=r.style.getPropertyValue(i);return Object.assign(r.style,{[i]:o}),this.add(()=>{Object.assign(r.style,{[i]:s})})}};return n}function $S(){let[e]=w.useState(Yu);return w.useEffect(()=>()=>e.dispose(),[e]),e}let bo=function(e){let t=gs(e);return w.useCallback((...n)=>t.current(...n),[t])};function DS(){let[e,t]=w.useState(Ua.isHandoffComplete);return e&&Ua.isHandoffComplete===!1&&t(!1),w.useEffect(()=>{e!==!0&&t(!0)},[e]),w.useEffect(()=>Ua.handoff(),[]),e}function Zr(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Zr),r}let b6=Symbol();function NS(...e){let t=w.useRef(e);w.useEffect(()=>{t.current=e},[e]);let n=bo(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[b6]))?void 0:n}function jS(...e){return e.filter(Boolean).join(" ")}var MS=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(MS||{}),ci=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ci||{});function qS({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s}){let a=LS(t,e);if(o)return Gu(a,n,r,s);let c=i??0;if(c&2){let{static:l=!1,...u}=a;if(l)return Gu(u,n,r,s)}if(c&1){let{unmount:l=!0,...u}=a;return Zr(l?0:1,{0(){return null},1(){return Gu({...u,hidden:!0,style:{display:"none"}},n,r,s)}})}return Gu(a,n,r,s)}function Gu(e,t={},n,r){var i;let{as:o=n,children:s,refName:a="ref",...c}=im(e,["unmount","static"]),l=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;c.className&&typeof c.className=="function"&&(c.className=c.className(t));let d={};if(t){let p=!1,f=[];for(let[h,m]of Object.entries(t))typeof m=="boolean"&&(p=!0),m===!0&&f.push(h);p&&(d["data-headlessui-state"]=f.join(" "))}if(o===w.Fragment&&Object.keys(FS(c)).length>0){if(!w.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(c).map(h=>` - ${h}`).join(`
|
|
321
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(`
|
|
322
322
|
`)].join(`
|
|
323
|
-
`));let h=jS((i=u.props)==null?void 0:i.className,c.className),f=h?{className:h}:{};return w.cloneElement(u,Object.assign({},LS(u.props,FS(im(c,["ref"]))),d,l,w6(u.ref,l.ref),f))}return w.createElement(o,Object.assign({},im(c,["ref"]),o!==w.Fragment&&l,o!==w.Fragment&&d),u)}function w6(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function LS(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function rm(e){var t;return Object.assign(w.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function FS(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function im(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let om=w.createContext(null);om.displayName="OpenClosedContext";var li=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(li||{});function US(){return w.useContext(om)}function x6({value:e,children:t}){return w.createElement(om.Provider,{value:e},t)}function BS(){let e=w.useRef(!1);return Ju(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function _6(e=0){let[t,n]=w.useState(e),r=w.useCallback(a=>n(c=>c|a),[t]),i=w.useCallback(a=>!!(t&a),[t]),o=w.useCallback(a=>n(c=>c&~a),[n]),s=w.useCallback(a=>n(c=>c^a),[n]);return{flags:t,addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}function S6(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function sm(e,...t){e&&t.length>0&&e.classList.add(...t)}function am(e,...t){e&&t.length>0&&e.classList.remove(...t)}function E6(e,t){let n=Yu();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map(a=>{let[c=0]=a.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,u)=>u-l);return c});if(o+s!==0){let a=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),a())})}else t();return n.add(()=>t()),n.dispose}function k6(e,t,n,r){let i=n?"enter":"leave",o=Yu(),s=r!==void 0?S6(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Zr(i,{enter:()=>t.enter,leave:()=>t.leave}),c=Zr(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=Zr(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return am(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),sm(e,...a,...l),o.nextFrame(()=>{am(e,...l),sm(e,...c),E6(e,()=>(am(e,...a),sm(e,...t.entered),s()))}),o.dispose}function C6({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=BS(),s=$S(),a=gs(t);Ju(()=>{let c=Yu();s.add(c.dispose);let l=e.current;if(l&&a.current!=="idle"&&o.current)return c.dispose(),r.current(a.current),c.add(k6(l,n.current,a.current==="enter",()=>{c.dispose(),i.current(a.current)})),c.dispose},[t])}function wo(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Xu=w.createContext(null);Xu.displayName="TransitionContext";var T6=(e=>(e.Visible="visible",e.Hidden="hidden",e))(T6||{});function A6(){let e=w.useContext(Xu);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function O6(){let e=w.useContext(Qu);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qu=w.createContext(null);Qu.displayName="NestingContext";function ed(e){return"children"in e?ed(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function zS(e,t){let n=gs(e),r=w.useRef([]),i=BS(),o=$S(),s=bo((f,p=ci.Hidden)=>{let m=r.current.findIndex(({el:y})=>y===f);m!==-1&&(Zr(p,{[ci.Unmount](){r.current.splice(m,1)},[ci.Hidden](){r.current[m].state="hidden"}}),o.microTask(()=>{var y;!ed(r)&&i.current&&((y=n.current)==null||y.call(n))}))}),a=bo(f=>{let p=r.current.find(({el:m})=>m===f);return p?p.state!=="visible"&&(p.state="visible"):r.current.push({el:f,state:"visible"}),()=>s(f,ci.Unmount)}),c=w.useRef([]),l=w.useRef(Promise.resolve()),u=w.useRef({enter:[],leave:[],idle:[]}),d=bo((f,p,m)=>{c.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([y])=>y!==f)),t==null||t.chains.current[p].push([f,new Promise(y=>{c.current.push(y)})]),t==null||t.chains.current[p].push([f,new Promise(y=>{Promise.all(u.current[p].map(([v,g])=>g)).then(()=>y())})]),p==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(p)):m(p)}),h=bo((f,p,m)=>{Promise.all(u.current[p].splice(0).map(([y,v])=>v)).then(()=>{var y;(y=c.current.shift())==null||y()}).then(()=>m(p))});return w.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:h,wait:l,chains:u}),[a,s,r,d,h,u,l])}function I6(){}let R6=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function ZS(e){var t;let n={};for(let r of R6)n[r]=(t=e[r])!=null?t:I6;return n}function P6(e){let t=w.useRef(ZS(e));return w.useEffect(()=>{t.current=ZS(e)},[e]),t}let $6="div",VS=MS.RenderStrategy,HS=rm(function(e,t){let{beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:o,enter:s,enterFrom:a,enterTo:c,entered:l,leave:u,leaveFrom:d,leaveTo:h,...f}=e,p=w.useRef(null),m=NS(p,t),y=f.unmount?ci.Unmount:ci.Hidden,{show:v,appear:g,initial:b}=A6(),[S,E]=w.useState(v?"visible":"hidden"),_=O6(),{register:I,unregister:P}=_,$=w.useRef(null);w.useEffect(()=>I(p),[I,p]),w.useEffect(()=>{if(y===ci.Hidden&&p.current){if(v&&S!=="visible"){E("visible");return}return Zr(S,{hidden:()=>P(p),visible:()=>I(p)})}},[S,p,I,P,v,y]);let O=gs({enter:wo(s),enterFrom:wo(a),enterTo:wo(c),entered:wo(l),leave:wo(u),leaveFrom:wo(d),leaveTo:wo(h)}),q=P6({beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:o}),H=DS();w.useEffect(()=>{if(H&&S==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,S,H]);let B=b&&!g,F=(()=>!H||B||$.current===v?"idle":v?"enter":"leave")(),D=_6(0),M=bo(te=>Zr(te,{enter:()=>{D.addFlag(li.Opening),q.current.beforeEnter()},leave:()=>{D.addFlag(li.Closing),q.current.beforeLeave()},idle:()=>{}})),Z=bo(te=>Zr(te,{enter:()=>{D.removeFlag(li.Opening),q.current.afterEnter()},leave:()=>{D.removeFlag(li.Closing),q.current.afterLeave()},idle:()=>{}})),W=zS(()=>{E("hidden"),P(p)},_);C6({container:p,classes:O,direction:F,onStart:gs(te=>{W.onStart(p,te,M)}),onStop:gs(te=>{W.onStop(p,te,Z),te==="leave"&&!ed(W)&&(E("hidden"),P(p))})}),w.useEffect(()=>{!B||(y===ci.Hidden?$.current=null:$.current=v)},[v,B,S]);let Q=f,C={ref:m};return g&&v&&Ua.isServer&&(Q={...Q,className:jS(f.className,...O.current.enter,...O.current.enterFrom)}),w.createElement(Qu.Provider,{value:W},w.createElement(x6,{value:Zr(S,{visible:li.Open,hidden:li.Closed})|D.flags},qS({ourProps:C,theirProps:Q,defaultTag:$6,features:VS,visible:S==="visible",name:"Transition.Child"})))}),cm=rm(function(e,t){let{show:n,appear:r=!1,unmount:i,...o}=e,s=w.useRef(null),a=NS(s,t);DS();let c=US();if(n===void 0&&c!==null&&(n=(c&li.Open)===li.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,u]=w.useState(n?"visible":"hidden"),d=zS(()=>{u("hidden")}),[h,f]=w.useState(!0),p=w.useRef([n]);Ju(()=>{h!==!1&&p.current[p.current.length-1]!==n&&(p.current.push(n),f(!1))},[p,n]);let m=w.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);w.useEffect(()=>{if(n)u("visible");else if(!ed(d))u("hidden");else{let v=s.current;if(!v)return;let g=v.getBoundingClientRect();g.x===0&&g.y===0&&g.width===0&&g.height===0&&u("hidden")}},[n,d]);let y={unmount:i};return w.createElement(Qu.Provider,{value:d},w.createElement(Xu.Provider,{value:m},qS({ourProps:{...y,as:w.Fragment,children:w.createElement(HS,{ref:a,...y,...o})},theirProps:{},defaultTag:w.Fragment,features:VS,visible:l==="visible",name:"Transition"})))}),D6=rm(function(e,t){let n=w.useContext(Xu)!==null,r=US()!==null;return w.createElement(w.Fragment,null,!n&&r?w.createElement(cm,{ref:t,...e}):w.createElement(HS,{ref:t,...e}))}),N6=Object.assign(cm,{Child:D6,Root:cm});const j6=e=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"})),M6=e=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",...e},N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6 6 18M6 6l12 12"})),q6=e=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));function L6(e){return Hn.custom(t=>U.jsx(U6,{type:e.type,show:t.visible,children:e.type==="custom"?e.content:U.jsx(F6,{...e,toastId:t.id})}))}const F6=({icon:e,type:t,title:n,description:r,toastId:i})=>{const{notification:o}=$e(s=>s.theme);return U.jsxs(U.Fragment,{children:[e?U.jsx(e,{...o==null?void 0:o.icon}):U.jsx(B6,{...o==null?void 0:o.icon,type:t}),U.jsx("p",{...o==null?void 0:o.title,children:n}),r?U.jsx("p",{...o==null?void 0:o.description,children:r}):null,U.jsx(M6,{...o==null?void 0:o.closeIcon,onClick:()=>Hn.dismiss(i)})]})},U6=({type:e,...t})=>{const{notification:n}=$e(r=>r.theme);return U.jsx(N6,{...t,...n==null?void 0:n.container,appear:!0,"data-type":e??"neutral"})},B6=({type:e,className:t})=>{switch(e){case"success":return U.jsx(j6,{className:t});case"error":return U.jsx(q6,{className:t});default:return null}};var td=function(){return td=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},td.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function z6(){var e=w.useRef(!1),t=w.useCallback(function(){return e.current},[]);return w.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function Z6(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=w.useRef(0),i=z6(),o=w.useState(n),s=o[0],a=o[1],c=w.useCallback(function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];var d=++r.current;return s.loading||a(function(h){return td(td({},h),{loading:!0})}),e.apply(void 0,l).then(function(h){return i()&&d===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&d===r.current&&a({error:h,loading:!1}),h})},t);return[s,c]}function WS(e,t){t===void 0&&(t=[]);var n=Z6(e,t,{loading:!0}),r=n[0],i=n[1];return w.useEffect(function(){i()},[i]),r}function V6(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function H6(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var W6=function(e){w.useEffect(e,[])};const KS=W6;var K6=function(e){KS(function(){e()})};const J6=K6;var Y6=function(e){var t=w.useRef(e);t.current=e,KS(function(){return function(){return t.current()}})};const G6=Y6;var X6=function(e){var t=w.useRef(0),n=w.useState(e),r=n[0],i=n[1],o=w.useCallback(function(s){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(s)})},[]);return G6(function(){cancelAnimationFrame(t.current)}),[r,o]};const Q6=X6;var eZ=function(e){process.env.NODE_ENV==="development"&&(typeof e!="object"||typeof e.current>"u")&&console.error("`useScroll` expects a single ref argument.");var t=Q6({x:0,y:0}),n=t[0],r=t[1];return w.useEffect(function(){var i=function(){e.current&&r({x:e.current.scrollLeft,y:e.current.scrollTop})};return e.current&&V6(e.current,"scroll",i,{capture:!1,passive:!0}),function(){e.current&&H6(e.current,"scroll",i)}},[e]),n};const tZ=eZ,JS=e=>{let t;const n=new Set,r=(c,l)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const d=t;t=l??typeof u!="object"?u:Object.assign({},t,u),n.forEach(h=>h(t,d))}},i=()=>t,a={setState:r,getState:i,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},YS=e=>e?JS(e):JS;var lm={exports:{}},um={},nd={exports:{}},dm={};/**
|
|
323
|
+
`));let p=jS((i=u.props)==null?void 0:i.className,c.className),f=p?{className:p}:{};return w.cloneElement(u,Object.assign({},LS(u.props,FS(im(c,["ref"]))),d,l,w6(u.ref,l.ref),f))}return w.createElement(o,Object.assign({},im(c,["ref"]),o!==w.Fragment&&l,o!==w.Fragment&&d),u)}function w6(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function LS(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function rm(e){var t;return Object.assign(w.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function FS(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function im(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let om=w.createContext(null);om.displayName="OpenClosedContext";var li=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(li||{});function US(){return w.useContext(om)}function x6({value:e,children:t}){return w.createElement(om.Provider,{value:e},t)}function BS(){let e=w.useRef(!1);return Ju(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function _6(e=0){let[t,n]=w.useState(e),r=w.useCallback(a=>n(c=>c|a),[t]),i=w.useCallback(a=>!!(t&a),[t]),o=w.useCallback(a=>n(c=>c&~a),[n]),s=w.useCallback(a=>n(c=>c^a),[n]);return{flags:t,addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}function S6(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function sm(e,...t){e&&t.length>0&&e.classList.add(...t)}function am(e,...t){e&&t.length>0&&e.classList.remove(...t)}function E6(e,t){let n=Yu();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map(a=>{let[c=0]=a.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,u)=>u-l);return c});if(o+s!==0){let a=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),a())})}else t();return n.add(()=>t()),n.dispose}function k6(e,t,n,r){let i=n?"enter":"leave",o=Yu(),s=r!==void 0?S6(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Zr(i,{enter:()=>t.enter,leave:()=>t.leave}),c=Zr(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=Zr(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return am(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),sm(e,...a,...l),o.nextFrame(()=>{am(e,...l),sm(e,...c),E6(e,()=>(am(e,...a),sm(e,...t.entered),s()))}),o.dispose}function C6({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=BS(),s=$S(),a=gs(t);Ju(()=>{let c=Yu();s.add(c.dispose);let l=e.current;if(l&&a.current!=="idle"&&o.current)return c.dispose(),r.current(a.current),c.add(k6(l,n.current,a.current==="enter",()=>{c.dispose(),i.current(a.current)})),c.dispose},[t])}function wo(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Xu=w.createContext(null);Xu.displayName="TransitionContext";var T6=(e=>(e.Visible="visible",e.Hidden="hidden",e))(T6||{});function A6(){let e=w.useContext(Xu);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function O6(){let e=w.useContext(Qu);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qu=w.createContext(null);Qu.displayName="NestingContext";function ed(e){return"children"in e?ed(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function zS(e,t){let n=gs(e),r=w.useRef([]),i=BS(),o=$S(),s=bo((f,h=ci.Hidden)=>{let m=r.current.findIndex(({el:y})=>y===f);m!==-1&&(Zr(h,{[ci.Unmount](){r.current.splice(m,1)},[ci.Hidden](){r.current[m].state="hidden"}}),o.microTask(()=>{var y;!ed(r)&&i.current&&((y=n.current)==null||y.call(n))}))}),a=bo(f=>{let h=r.current.find(({el:m})=>m===f);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:f,state:"visible"}),()=>s(f,ci.Unmount)}),c=w.useRef([]),l=w.useRef(Promise.resolve()),u=w.useRef({enter:[],leave:[],idle:[]}),d=bo((f,h,m)=>{c.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([y])=>y!==f)),t==null||t.chains.current[h].push([f,new Promise(y=>{c.current.push(y)})]),t==null||t.chains.current[h].push([f,new Promise(y=>{Promise.all(u.current[h].map(([g,v])=>v)).then(()=>y())})]),h==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),p=bo((f,h,m)=>{Promise.all(u.current[h].splice(0).map(([y,g])=>g)).then(()=>{var y;(y=c.current.shift())==null||y()}).then(()=>m(h))});return w.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:p,wait:l,chains:u}),[a,s,r,d,p,u,l])}function I6(){}let R6=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function ZS(e){var t;let n={};for(let r of R6)n[r]=(t=e[r])!=null?t:I6;return n}function P6(e){let t=w.useRef(ZS(e));return w.useEffect(()=>{t.current=ZS(e)},[e]),t}let $6="div",VS=MS.RenderStrategy,HS=rm(function(e,t){let{beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:o,enter:s,enterFrom:a,enterTo:c,entered:l,leave:u,leaveFrom:d,leaveTo:p,...f}=e,h=w.useRef(null),m=NS(h,t),y=f.unmount?ci.Unmount:ci.Hidden,{show:g,appear:v,initial:b}=A6(),[S,E]=w.useState(g?"visible":"hidden"),_=O6(),{register:I,unregister:P}=_,$=w.useRef(null);w.useEffect(()=>I(h),[I,h]),w.useEffect(()=>{if(y===ci.Hidden&&h.current){if(g&&S!=="visible"){E("visible");return}return Zr(S,{hidden:()=>P(h),visible:()=>I(h)})}},[S,h,I,P,g,y]);let O=gs({enter:wo(s),enterFrom:wo(a),enterTo:wo(c),entered:wo(l),leave:wo(u),leaveFrom:wo(d),leaveTo:wo(p)}),q=P6({beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:o}),H=DS();w.useEffect(()=>{if(H&&S==="visible"&&h.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[h,S,H]);let B=b&&!v,F=(()=>!H||B||$.current===g?"idle":g?"enter":"leave")(),D=_6(0),M=bo(te=>Zr(te,{enter:()=>{D.addFlag(li.Opening),q.current.beforeEnter()},leave:()=>{D.addFlag(li.Closing),q.current.beforeLeave()},idle:()=>{}})),Z=bo(te=>Zr(te,{enter:()=>{D.removeFlag(li.Opening),q.current.afterEnter()},leave:()=>{D.removeFlag(li.Closing),q.current.afterLeave()},idle:()=>{}})),W=zS(()=>{E("hidden"),P(h)},_);C6({container:h,classes:O,direction:F,onStart:gs(te=>{W.onStart(h,te,M)}),onStop:gs(te=>{W.onStop(h,te,Z),te==="leave"&&!ed(W)&&(E("hidden"),P(h))})}),w.useEffect(()=>{!B||(y===ci.Hidden?$.current=null:$.current=g)},[g,B,S]);let Q=f,C={ref:m};return v&&g&&Ua.isServer&&(Q={...Q,className:jS(f.className,...O.current.enter,...O.current.enterFrom)}),w.createElement(Qu.Provider,{value:W},w.createElement(x6,{value:Zr(S,{visible:li.Open,hidden:li.Closed})|D.flags},qS({ourProps:C,theirProps:Q,defaultTag:$6,features:VS,visible:S==="visible",name:"Transition.Child"})))}),cm=rm(function(e,t){let{show:n,appear:r=!1,unmount:i,...o}=e,s=w.useRef(null),a=NS(s,t);DS();let c=US();if(n===void 0&&c!==null&&(n=(c&li.Open)===li.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,u]=w.useState(n?"visible":"hidden"),d=zS(()=>{u("hidden")}),[p,f]=w.useState(!0),h=w.useRef([n]);Ju(()=>{p!==!1&&h.current[h.current.length-1]!==n&&(h.current.push(n),f(!1))},[h,n]);let m=w.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);w.useEffect(()=>{if(n)u("visible");else if(!ed(d))u("hidden");else{let g=s.current;if(!g)return;let v=g.getBoundingClientRect();v.x===0&&v.y===0&&v.width===0&&v.height===0&&u("hidden")}},[n,d]);let y={unmount:i};return w.createElement(Qu.Provider,{value:d},w.createElement(Xu.Provider,{value:m},qS({ourProps:{...y,as:w.Fragment,children:w.createElement(HS,{ref:a,...y,...o})},theirProps:{},defaultTag:w.Fragment,features:VS,visible:l==="visible",name:"Transition"})))}),D6=rm(function(e,t){let n=w.useContext(Xu)!==null,r=US()!==null;return w.createElement(w.Fragment,null,!n&&r?w.createElement(cm,{ref:t,...e}):w.createElement(HS,{ref:t,...e}))}),N6=Object.assign(cm,{Child:D6,Root:cm});const j6=e=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"})),M6=e=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",...e},N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6 6 18M6 6l12 12"})),q6=e=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));function L6(e){return Hn.custom(t=>U.jsx(U6,{type:e.type,show:t.visible,children:e.type==="custom"?e.content:U.jsx(F6,{...e,toastId:t.id})}))}const F6=({icon:e,type:t,title:n,description:r,toastId:i})=>{const{notification:o}=Ie(s=>s.theme);return U.jsxs(U.Fragment,{children:[e?U.jsx(e,{...o==null?void 0:o.icon}):U.jsx(B6,{...o==null?void 0:o.icon,type:t}),U.jsx("p",{...o==null?void 0:o.title,children:n}),r?U.jsx("p",{...o==null?void 0:o.description,children:r}):null,U.jsx(M6,{...o==null?void 0:o.closeIcon,onClick:()=>Hn.dismiss(i)})]})},U6=({type:e,...t})=>{const{notification:n}=Ie(r=>r.theme);return U.jsx(N6,{...t,...n==null?void 0:n.container,appear:!0,"data-type":e??"neutral"})},B6=({type:e,className:t})=>{switch(e){case"success":return U.jsx(j6,{className:t});case"error":return U.jsx(q6,{className:t});default:return null}};var td=function(){return td=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},td.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function z6(){var e=w.useRef(!1),t=w.useCallback(function(){return e.current},[]);return w.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function Z6(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=w.useRef(0),i=z6(),o=w.useState(n),s=o[0],a=o[1],c=w.useCallback(function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];var d=++r.current;return s.loading||a(function(p){return td(td({},p),{loading:!0})}),e.apply(void 0,l).then(function(p){return i()&&d===r.current&&a({value:p,loading:!1}),p},function(p){return i()&&d===r.current&&a({error:p,loading:!1}),p})},t);return[s,c]}function WS(e,t){t===void 0&&(t=[]);var n=Z6(e,t,{loading:!0}),r=n[0],i=n[1];return w.useEffect(function(){i()},[i]),r}function V6(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function H6(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var W6=function(e){w.useEffect(e,[])};const KS=W6;var K6=function(e){KS(function(){e()})};const J6=K6;var Y6=function(e){var t=w.useRef(e);t.current=e,KS(function(){return function(){return t.current()}})};const G6=Y6;var X6=function(e){var t=w.useRef(0),n=w.useState(e),r=n[0],i=n[1],o=w.useCallback(function(s){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(s)})},[]);return G6(function(){cancelAnimationFrame(t.current)}),[r,o]};const Q6=X6;var eZ=function(e){process.env.NODE_ENV==="development"&&(typeof e!="object"||typeof e.current>"u")&&console.error("`useScroll` expects a single ref argument.");var t=Q6({x:0,y:0}),n=t[0],r=t[1];return w.useEffect(function(){var i=function(){e.current&&r({x:e.current.scrollLeft,y:e.current.scrollTop})};return e.current&&V6(e.current,"scroll",i,{capture:!1,passive:!0}),function(){e.current&&H6(e.current,"scroll",i)}},[e]),n};const tZ=eZ,JS=e=>{let t;const n=new Set,r=(c,l)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const d=t;t=l??typeof u!="object"?u:Object.assign({},t,u),n.forEach(p=>p(t,d))}},i=()=>t,a={setState:r,getState:i,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},YS=e=>e?JS(e):JS;var lm={exports:{}},um={},nd={exports:{}},dm={};/**
|
|
324
324
|
* @license React
|
|
325
325
|
* use-sync-external-store-shim.production.min.js
|
|
326
326
|
*
|
|
@@ -328,7 +328,7 @@ to {
|
|
|
328
328
|
*
|
|
329
329
|
* This source code is licensed under the MIT license found in the
|
|
330
330
|
* LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/var GS;function nZ(){if(GS)return dm;GS=1;var e=w;function t(d,
|
|
331
|
+
*/var GS;function nZ(){if(GS)return dm;GS=1;var e=w;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(d,p){var f=p(),h=r({inst:{value:f,getSnapshot:p}}),m=h[0].inst,y=h[1];return o(function(){m.value=f,m.getSnapshot=p,c(m)&&y({inst:m})},[d,f,p]),i(function(){return c(m)&&y({inst:m}),d(function(){c(m)&&y({inst:m})})},[d]),s(f),f}function c(d){var p=d.getSnapshot;d=d.value;try{var f=p();return!n(d,f)}catch{return!0}}function l(d,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return dm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,dm}var fm={};/**
|
|
332
332
|
* @license React
|
|
333
333
|
* use-sync-external-store-shim.development.js
|
|
334
334
|
*
|
|
@@ -336,7 +336,7 @@ to {
|
|
|
336
336
|
*
|
|
337
337
|
* This source code is licensed under the MIT license found in the
|
|
338
338
|
* LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/var XS;function rZ(){return XS||(XS=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(b){{for(var S=arguments.length,E=new Array(S>1?S-1:0),_=1;_<S;_++)E[_-1]=arguments[_];r("error",b,E)}}function r(b,S,E){{var _=t.ReactDebugCurrentFrame,I=_.getStackAddendum();I!==""&&(S+="%s",E=E.concat([I]));var P=E.map(function($){return String($)});P.unshift("Warning: "+S),Function.prototype.apply.call(console[b],console,P)}}function i(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,c=e.useLayoutEffect,l=e.useDebugValue,u=!1,d=!1;function
|
|
339
|
+
*/var XS;function rZ(){return XS||(XS=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(b){{for(var S=arguments.length,E=new Array(S>1?S-1:0),_=1;_<S;_++)E[_-1]=arguments[_];r("error",b,E)}}function r(b,S,E){{var _=t.ReactDebugCurrentFrame,I=_.getStackAddendum();I!==""&&(S+="%s",E=E.concat([I]));var P=E.map(function($){return String($)});P.unshift("Warning: "+S),Function.prototype.apply.call(console[b],console,P)}}function i(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,c=e.useLayoutEffect,l=e.useDebugValue,u=!1,d=!1;function p(b,S,E){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var _=S();if(!d){var I=S();o(_,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var P=s({inst:{value:_,getSnapshot:S}}),$=P[0].inst,O=P[1];return c(function(){$.value=_,$.getSnapshot=S,f($)&&O({inst:$})},[b,_,S]),a(function(){f($)&&O({inst:$});var q=function(){f($)&&O({inst:$})};return b(q)},[b]),l(_),_}function f(b){var S=b.getSnapshot,E=b.value;try{var _=S();return!o(E,_)}catch{return!0}}function h(b,S,E){return S()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!m,g=y?h:p,v=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g;fm.useSyncExternalStore=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),fm}var QS;function eE(){return QS||(QS=1,process.env.NODE_ENV==="production"?nd.exports=nZ():nd.exports=rZ()),nd.exports}/**
|
|
340
340
|
* @license React
|
|
341
341
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
342
342
|
*
|
|
@@ -344,7 +344,7 @@ to {
|
|
|
344
344
|
*
|
|
345
345
|
* This source code is licensed under the MIT license found in the
|
|
346
346
|
* LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/var tE;function iZ(){if(tE)return um;tE=1;var e=w,t=eE();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;return um.useSyncExternalStoreWithSelector=function(l,u,d,
|
|
347
|
+
*/var tE;function iZ(){if(tE)return um;tE=1;var e=w,t=eE();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;return um.useSyncExternalStoreWithSelector=function(l,u,d,p,f){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=a(function(){function g(_){if(!v){if(v=!0,b=_,_=p(_),f!==void 0&&m.hasValue){var I=m.value;if(f(I,_))return S=I}return S=_}if(I=S,r(b,_))return I;var P=p(_);return f!==void 0&&f(I,P)?I:(b=_,S=P)}var v=!1,b,S,E=d===void 0?null:d;return[function(){return g(u())},E===null?void 0:function(){return g(E())}]},[u,d,p,f]);var y=i(l,h[0],h[1]);return s(function(){m.hasValue=!0,m.value=y},[y]),c(y),y},um}var pm={};/**
|
|
348
348
|
* @license React
|
|
349
349
|
* use-sync-external-store-shim/with-selector.development.js
|
|
350
350
|
*
|
|
@@ -352,15 +352,15 @@ to {
|
|
|
352
352
|
*
|
|
353
353
|
* This source code is licensed under the MIT license found in the
|
|
354
354
|
* LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/var nE;function oZ(){return nE||(nE=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=eE();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;function l(u,d,
|
|
355
|
+
*/var nE;function oZ(){return nE||(nE=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=eE();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;function l(u,d,p,f,h){var m=o(null),y;m.current===null?(y={hasValue:!1,value:null},m.current=y):y=m.current;var g=a(function(){var E=!1,_,I,P=function(H){if(!E){E=!0,_=H;var B=f(H);if(h!==void 0&&y.hasValue){var F=y.value;if(h(F,B))return I=F,F}return I=B,B}var D=_,M=I;if(r(D,H))return M;var Z=f(H);return h!==void 0&&h(M,Z)?M:(_=H,I=Z,Z)},$=p===void 0?null:p,O=function(){return P(d())},q=$===null?void 0:function(){return P($())};return[O,q]},[d,p,f,h]),v=g[0],b=g[1],S=i(u,v,b);return s(function(){y.hasValue=!0,y.value=S},[S]),c(S),S}pm.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pm}process.env.NODE_ENV==="production"?lm.exports=iZ():lm.exports=oZ();var sZ=lm.exports;const aZ=mi(sZ),{useSyncExternalStoreWithSelector:cZ}=aZ;let JW=!1;function rE(e,t=e.getState,n){const r=cZ(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return w.useDebugValue(r),r}const iE=e=>{const t=typeof e=="function"?YS(e):e,n=(r,i)=>rE(t,r,i);return Object.assign(n,t),n},lZ=e=>e?iE(e):iE,hm=new Map,rd=e=>{const t=hm.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},uZ=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=hm.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return hm.set(n.name,i),{type:"tracked",store:e,...i}},oE=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...c}=t;let l;try{l=(o??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return e(n,r,i);const{connection:u,...d}=uZ(a,l,c);let p=!0;i.setState=(m,y,g)=>{const v=n(m,y);if(!p)return v;const b=g===void 0?{type:s||"anonymous"}:typeof g=="string"?{type:g}:g;return a===void 0?(u==null||u.send(b,r()),v):(u==null||u.send({...b,type:`${a}/${b.type}`},{...rd(c.name),[a]:i.getState()}),v)};const f=(...m)=>{const y=p;p=!1,n(...m),p=y},h=e(i.setState,r,i);if(d.type==="untracked"?u==null||u.init(h):(d.stores[d.store]=i,u==null||u.init(Object.fromEntries(Object.entries(d.stores).map(([m,y])=>[m,m===d.store?h:y.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let m=!1;const y=i.dispatch;i.dispatch=(...g)=>{y(...g)}}return u.subscribe(m=>{var y;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return mm(m.payload,g=>{if(g.type==="__setState"){if(a===void 0){f(g.state);return}Object.keys(g.state).length!==1&&console.error(`
|
|
356
356
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
357
357
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
358
358
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
359
|
-
`);const g=v.state[a];if(g==null)return;JSON.stringify(i.getState())!==JSON.stringify(g)&&f(g);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(v)});case"DISPATCH":switch(m.payload.type){case"RESET":return f(p),a===void 0?u==null?void 0:u.init(i.getState()):u==null?void 0:u.init(rd(c.name));case"COMMIT":if(a===void 0){u==null||u.init(i.getState());return}return u==null?void 0:u.init(rd(c.name));case"ROLLBACK":return mm(m.state,v=>{if(a===void 0){f(v),u==null||u.init(i.getState());return}f(v[a]),u==null||u.init(rd(c.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return mm(m.state,v=>{if(a===void 0){f(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&f(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=m.payload,g=(y=v.computedStates.slice(-1)[0])==null?void 0:y.state;if(!g)return;f(a===void 0?g:g[a]),u==null||u.send(null,v);return}case"PAUSE_RECORDING":return h=!h}return}}),p},mm=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function dZ(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=c=>c===null?null:JSON.parse(c,t==null?void 0:t.reviver),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,t==null?void 0:t.replacer)),removeItem:i=>n.removeItem(i)}}const Ba=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Ba(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Ba(r)(n)}}}},fZ=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},s=!1;const a=new Set,c=new Set;let l;try{l=o.getStorage()}catch{}if(!l)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...y)},r,i);const u=Ba(o.serialize),d=()=>{const y=o.partialize({...r()});let v;const g=u({state:y,version:o.version}).then(b=>l.setItem(o.name,b)).catch(b=>{v=b});if(v)throw v;return g},h=i.setState;i.setState=(y,v)=>{h(y,v),d()};const f=e((...y)=>{n(...y),d()},r,i);let p;const m=()=>{var y;if(!l)return;s=!1,a.forEach(g=>g(r()));const v=((y=o.onRehydrateStorage)==null?void 0:y.call(o,r()))||void 0;return Ba(l.getItem.bind(l))(o.name).then(g=>{if(g)return o.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==o.version){if(o.migrate)return o.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var b;return p=o.merge(g,(b=r())!=null?b:f),n(p,!0),d()}).then(()=>{v==null||v(p,void 0),s=!0,c.forEach(g=>g(p))}).catch(g=>{v==null||v(void 0,g)})};return i.persist={setOptions:y=>{o={...o,...y},y.getStorage&&(l=y.getStorage())},clearStorage:()=>{l==null||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(c.add(y),()=>{c.delete(y)})},m(),p||f},pZ=(e,t)=>(n,r,i)=>{let o={storage:dZ(()=>localStorage),partialize:m=>m,version:0,merge:(m,y)=>({...y,...m}),...t},s=!1;const a=new Set,c=new Set;let l=o.storage;if(!l)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...m)},r,i);const u=()=>{const m=o.partialize({...r()});return l.setItem(o.name,{state:m,version:o.version})},d=i.setState;i.setState=(m,y)=>{d(m,y),u()};const h=e((...m)=>{n(...m),u()},r,i);let f;const p=()=>{var m,y;if(!l)return;s=!1,a.forEach(g=>{var b;return g((b=r())!=null?b:h)});const v=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(m=r())!=null?m:h))||void 0;return Ba(l.getItem.bind(l))(o.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==o.version){if(o.migrate)return o.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var b;return f=o.merge(g,(b=r())!=null?b:h),n(f,!0),u()}).then(()=>{v==null||v(f,void 0),f=r(),s=!0,c.forEach(g=>g(f))}).catch(g=>{v==null||v(void 0,g)})};return i.persist={setOptions:m=>{o={...o,...m},m.storage&&(l=m.storage)},clearStorage:()=>{l==null||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(c.add(m),()=>{c.delete(m)})},o.skipHydration||p(),f||h},hZ=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?fZ(e,t):pZ(e,t),Qn=lZ()(oE(hZ((e,t)=>({messageHistory:{},addMessageToHistory:({userId:n,message:r})=>e(i=>({...i,messageHistory:{...i.messageHistory,[n]:[r,...(i.messageHistory[n]??[]).slice(0,100)]}})),clientMode:"",setClientMode:n=>{const{clearAll:r,clientMode:i}=t();i!==n&&r(),e(o=>({...o,clientMode:n}))},setUser:n=>e(r=>({...r,user:n})),setConversationId:n=>e(r=>({...r,conversationId:n})),clearAll:()=>{e(n=>({...n,messageHistory:{},user:void 0,conversationId:void 0}))}}),{name:"botpress-webchat"}))),sE=w.createContext(null),mZ=e=>{const t={theme:{},configuration:{},messages:{},connected:!0,disableComposer:!1,renderers:{},isReadOnly:!1,userData:{},closeWindow:()=>{},messageContainerRef:{current:null},isTyping:!1,lastTypingHeartbeat:null,allowFileUpload:!1,conversationId:void 0,disableRestartConversation:!1},n=e==null?void 0:e.client,r=e==null?void 0:e.conversationId,i=Qn.getState().setClientMode,o=Qn.getState().setConversationId;return n&&i(n.mode),w.useEffect(()=>{r&&o(r)},[r]),YS()(oE((s,a)=>{const c=d=>{const h=Qn.getState().conversationId;if(h)return s(f=>{const p=f.messages[h]??[];return{...f,messages:{...f.messages,[h]:[...p.filter(m=>m.id!==d.id),{id:Pl(),...d}]}}})},l=d=>{const h=Qn.getState().conversationId;if(h)return s(f=>({...f,messages:{...f.messages,[h]:d}}))},u=Qn.getState().addMessageToHistory;return{...t,...e,eventEmitter:H$,client:n,sendFile:d=>a().client.sendFile(d),sendTextMessage:async d=>{const h=a().client;c({id:Pl(),direction:"outgoing",sender:{name:"You"},timestamp:new Date,disableInput:!1,block:{type:"bubble",block:{type:"text",text:d}}}),h&&await h.sendMessage(d),h!=null&&h.userId&&u({message:d,userId:h.userId})},on:(d,h)=>{const f=a().client;return f?f.on(d,h):()=>{}},getClientId:()=>{var d;return(d=a().client)==null?void 0:d.clientId},setState:d=>s(h=>({...h,...d})),setTheme:d=>s(h=>({...h,theme:d})),setMessages:l,getMessages:()=>a().messages[Qn.getState().conversationId??""]??[],setConfiguration:d=>s(h=>({...h,configuration:d})),setIsTyping:(d,h)=>{s(f=>({...f,isTyping:d})),d&&(s(f=>({...f,lastTypingHeartbeat:new Date})),h&&setTimeout(()=>{const f=a().lastTypingHeartbeat;f&&new Date().getTime()-f.getTime()>h&&s(p=>({...p,isTyping:!1}))},h+100))},setLastTypingHeartbeat:d=>s(h=>({...h,lastTypingHeartbeat:d})),addMessage:c,setConnected:d=>s(h=>({...h,connected:d})),restartConversation:async()=>{const d=a().client,h=a().setMessages;d&&(await d.newConversation(),h([]))}}},{name:"webchatStore"}))};function $e(e){const t=w.useContext(sE);if(!t)throw new Error("Missing WebchatContext.Provider in the tree");return rE(t,e)}const yZ=({text:e,buttonValue:t,type:n,styles:r,variant:i,groupId:o,reusable:s,...a})=>{const c=$e(g=>g.eventEmitter),l=$e(g=>g.sendTextMessage),u=$e(g=>g.isReadOnly),[d,h]=w.useState(!1),[f,p]=w.useState(!1),[m,y]=w.useState(!1);w.useEffect(()=>{if(o)return c.on(`button-group-${o}-click`,()=>{p(!0),s||y(!0)})},[c,o,s]);function v(){o&&c.emit(`button-group-${o}-click`),h(!0),s||y(!0),i!=="link"&&l(t)}return U.jsx(gZ,{...a,variant:i,onClick:v,disabled:m||u,"data-activated":d?"":void 0,"data-group-activated":f?"":void 0,"data-type":i,value:t,...r==null?void 0:r[n],children:e})},gZ=e=>{if(e.variant==="link"){const{value:r,variant:i,...o}=e;return U.jsx("a",{...o,href:r,target:"_blank",rel:"noopener noreferrer"})}const{variant:t,...n}=e;return U.jsx("button",{type:"button",...n})},vZ=w.forwardRef(({block:e,styles:t,type:n,...r},i)=>U.jsx("div",{...r,...t==null?void 0:t[n],ref:i,children:U.jsx(ks,{styles:t,block:e})})),aE=w.createContext(null);function cE(){const e=w.useContext(aE);if(!e)throw new Error("useComposerContext must be used within a Message");return e}const lE=w.createContext(null);function bZ(){const e=w.useContext(lE);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const uE=w.createContext(null);function dE(){const e=w.useContext(uE);if(!e)throw new Error("useModalContext must be used within a ModalProvider");return e}w.createContext(null);const wZ=w.forwardRef(({url:e,type:t,styles:n,orientation:r="auto",...i},o)=>{var h,f;const s=w.useId(),{setIsLoading:a}=bZ(),[c,l]=w.useState(r),[u,d]=w.useState(!1);return w.useLayoutEffect(()=>{a(p=>[...p,s])},[]),w.useEffect(()=>{e&&c==="auto"&&E4(e).then(({width:p,height:m})=>{l(xZ(p,m)),a(y=>y.filter(v=>v!==s))})},[e]),U.jsxs(U.Fragment,{children:[u?null:U.jsx("div",{"data-orientation":c,...(h=n==null?void 0:n[t])==null?void 0:h.placeholder}),U.jsx("img",{"data-orientation":c,"data-loaded":u,...i,...(f=n==null?void 0:n[t])==null?void 0:f.image,src:e,alt:"",ref:o,loading:"lazy",onLoad:()=>{d(!0)}})]})});function xZ(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const _Z=w.forwardRef(({url:e,type:t,styles:n,...r},i)=>U.jsx("div",{children:U.jsx("video",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})})),SZ=w.forwardRef(({url:e,type:t,styles:n,...r},i)=>U.jsx("div",{children:U.jsx("audio",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})}));function EZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.75.75v10.638l3.96-4.158a.75.75 0 111.08 1.04l-5.25 5.5a.75.75 0 01-1.08 0l-5.25-5.5a.75.75 0 111.08-1.04l3.96 4.158V3.75A.75.75 0 0110 3z",clipRule:"evenodd"}))}const kZ=N.forwardRef(EZ);function CZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z",clipRule:"evenodd"}))}const TZ=N.forwardRef(CZ);function AZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm-.75-4.75a.75.75 0 001.5 0V8.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.1 0L6.2 9.74a.75.75 0 101.1 1.02l1.95-2.1v4.59z",clipRule:"evenodd"}))}const OZ=N.forwardRef(AZ);function IZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"}))}const RZ=N.forwardRef(IZ);function PZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M4.5 2A1.5 1.5 0 003 3.5v13A1.5 1.5 0 004.5 18h11a1.5 1.5 0 001.5-1.5V7.621a1.5 1.5 0 00-.44-1.06l-4.12-4.122A1.5 1.5 0 0011.378 2H4.5zm4.75 6.75a.75.75 0 011.5 0v2.546l.943-1.048a.75.75 0 011.114 1.004l-2.25 2.5a.75.75 0 01-1.114 0l-2.25-2.5a.75.75 0 111.114-1.004l.943 1.048V8.75z",clipRule:"evenodd"}))}const $Z=N.forwardRef(PZ);function DZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M9.69 18.933l.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 00.281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 103 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 002.273 1.765 11.842 11.842 0 00.976.544l.062.029.018.008.006.003zM10 11.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5z",clipRule:"evenodd"}))}const NZ=N.forwardRef(DZ);function jZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{d:"M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"}))}const MZ=N.forwardRef(jZ),qZ=w.forwardRef(({type:e,latitude:t,longitude:n,title:r,styles:i,...o},s)=>{var c,l,u;const a=`https://www.google.com/maps/search/?api=1&query=${t},${n}`;return U.jsxs("a",{...o,...(c=i==null?void 0:i[e])==null?void 0:c.container,href:a,type:"_blank",rel:"noopener",ref:s,children:[U.jsx("p",{...(l=i==null?void 0:i[e])==null?void 0:l.title,children:r}),U.jsx(NZ,{...(u=i==null?void 0:i[e])==null?void 0:u.icon})]})}),LZ=w.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...o},s)=>U.jsx("div",{"data-horizontal":r,"data-vertical":i,...o,...t==null?void 0:t[n],ref:s,children:e.map((a,c)=>U.jsx(ks,{styles:t,block:a},c))})),FZ=w.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...o},s)=>U.jsx("div",{"data-horizontal":r,"data-vertical":i,...o,...t==null?void 0:t[n],ref:s,children:e.map((a,c)=>U.jsx(ks,{styles:t,block:a},c))}));function UZ(e){return Object.prototype.toString.call(e)==="[object Object]"}function fE(e){return UZ(e)||Array.isArray(e)}function BZ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ym(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],c=t[s];return typeof a=="function"?`${a}`==`${c}`:!fE(a)||!fE(c)?a===c:ym(a,c)})}function pE(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function zZ(e,t){if(e.length!==t.length)return!1;const n=pE(e),r=pE(t);return n.every((i,o)=>{const s=r[o];return ym(i,s)})}function gm(e){return typeof e=="number"}function hE(e){return typeof e=="string"}function vm(e){return typeof e=="boolean"}function mE(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zt(e){return Math.abs(e)}function bm(e){return Math.sign(e)}function id(e,t){return Zt(e-t)}function ZZ(e,t){if(e===0||t===0||Zt(e)<=Zt(t))return 0;const n=id(Zt(e),Zt(t));return Zt(n/e)}function za(e){return sd(e).map(Number)}function ui(e){return e[od(e)]}function od(e){return Math.max(0,e.length-1)}function sd(e){return Object.keys(e)}function yE(e,t){return[e,t].reduce((n,r)=>(sd(r).forEach(i=>{const o=n[i],s=r[i],a=mE(o)&&mE(s);n[i]=a?yE(o,s):s}),n),{})}function gE(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function VZ(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(){return t*Number(e)}function a(l){return gm(e)?s():n[e](l)}return{measure:a}}function HZ(e,t){const n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=a(),o=c();function s(u){const{width:d,height:h}=u;return n==="x"?d:h}function a(){return n==="y"?"top":t==="rtl"?"right":"left"}function c(){return n==="y"?"bottom":t==="rtl"?"left":"right"}return{scroll:n,cross:r,startEdge:i,endEdge:o,measureSize:s}}function Ni(e,t){const n=Zt(e-t);function r(l){return l<e}function i(l){return l>t}function o(l){return r(l)||i(l)}function s(l){return o(l)?r(l)?e:t:l}function a(l){return n?l-n*Math.ceil((l-t)/n):l}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function vE(e,t,n){const{constrain:r}=Ni(0,e),i=e+1;let o=s(t);function s(h){return n?Zt((i+h)%i):r(h)}function a(){return o}function c(h){return o=s(h),d}function l(h){return u().set(a()+h)}function u(){return vE(e,a(),n)}const d={get:a,set:c,add:l,clone:u};return d}function WZ(e){const t=e==="rtl"?-1:1;function n(i){return i*t}return{apply:n}}function Za(){let e=[];function t(i,o,s,a={passive:!0}){return i.addEventListener(o,s,a),e.push(()=>i.removeEventListener(o,s,a)),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function KZ(e,t,n,r,i,o,s,a,c,l,u,d,h,f,p,m,y,v,g){const{cross:b}=e,S=["INPUT","SELECT","TEXTAREA"],E={passive:!1},_=Za(),I=Za(),P=Ni(50,225).constrain(p.measure(20)),$={mouse:300,touch:400},O={mouse:500,touch:600},q=m?43:25;let H=!1,B=0,F=0,D=!1,M=!1,Z=!1,W=!1;function Q(de,_e){if(!_e)return;function pe(et){(vm(_e)||_e(de,et))&&Te(et)}const De=n;_.add(De,"dragstart",et=>et.preventDefault(),E).add(De,"touchmove",()=>{},E).add(De,"touchend",()=>{}).add(De,"touchstart",pe).add(De,"mousedown",pe).add(De,"touchcancel",Pe).add(De,"contextmenu",Pe).add(De,"click",Fe,!0)}function C(){_.clear(),I.clear()}function te(){const de=W?r:n;I.add(de,"touchmove",Ee,E).add(de,"touchend",Pe).add(de,"mousemove",Ee,E).add(de,"mouseup",Pe)}function fe(de){const _e=de.nodeName||"";return S.includes(_e)}function A(){return(m?O:$)[W?"mouse":"touch"]}function we(de,_e){const pe=h.add(bm(de)*-1),De=d.byDistance(de,!m).distance;return m||Zt(de)<P?De:v&&_e?De*.5:d.byIndex(pe.get(),0).distance}function Te(de){const _e=gE(de,i);W=_e,!(_e&&de.button!==0)&&(fe(de.target)||(Z=m&&_e&&!de.buttons&&H,H=id(o.get(),a.get())>=2,D=!0,s.pointerDown(de),u.useFriction(0).useDuration(0),o.set(a),te(),B=s.readPoint(de),F=s.readPoint(de,b),f.emit("pointerDown")))}function Ee(de){const _e=s.readPoint(de),pe=s.readPoint(de,b),De=id(_e,B),et=id(pe,F);if(!M&&!W&&(!de.cancelable||(M=De>et,!M)))return Pe(de);const L=s.pointerMove(de);De>y&&(Z=!0),u.useFriction(.3).useDuration(1),c.start(),o.add(t.apply(L)),de.preventDefault()}function Pe(de){const pe=d.byDistance(0,!1).index!==h.get(),De=s.pointerUp(de)*A(),et=we(t.apply(De),pe),L=ZZ(De,et),oe=q-10*L,ce=g+L/50;M=!1,D=!1,I.clear(),u.useDuration(oe).useFriction(ce),l.distance(et,!m),W=!1,f.emit("pointerUp")}function Fe(de){Z&&(de.stopPropagation(),de.preventDefault())}function Re(){return D}return{init:Q,pointerDown:Re,destroy:C}}function JZ(e,t){let r,i;function o(d){return d.timeStamp}function s(d,h){const p=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(gE(d,t)?d:d.touches[0])[p]}function a(d){return r=d,i=d,s(d)}function c(d){const h=s(d)-s(i),f=o(d)-o(r)>170;return i=d,f&&(r=d),h}function l(d){if(!r||!i)return 0;const h=s(i)-s(r),f=o(d)-o(r),p=o(d)-o(i)>170,m=h/f;return f&&!p&&Zt(m)>.1?m:0}return{pointerDown:a,pointerMove:c,pointerUp:l,readPoint:s}}function YZ(e){function t(r){return e*(r/100)}return{measure:t}}function GZ(e,t,n,r,i){let o,s,a=[],c=!1;function l(f){return i.measureSize(f.getBoundingClientRect())}function u(f,p){if(!p)return;s=l(e),a=r.map(l);function m(v){for(const g of v){const b=g.target===e,S=r.indexOf(g.target),E=b?s:a[S],_=l(b?e:r[S]);if(E!==_){n.requestAnimationFrame(()=>{f.reInit(),t.emit("resize")});break}}}o=new ResizeObserver(v=>{c||(vm(p)||p(f,v))&&m(v)}),[e].concat(r).forEach(v=>o.observe(v))}function d(){o&&o.disconnect(),c=!0}return{init:u,destroy:d}}function XZ(e,t,n,r){let i=!0,o=0,s=0,a=n,c=r,l=e.get(),u=0;function d(){const E=t.get()-e.get(),_=!a;let I=0;return _?(o=0,e.set(t),I=E):(o+=E/a,o*=c,l+=o,e.add(o),I=l-u),s=bm(I),u=l,i=Zt(E)<.001,S}function h(){return i}function f(){return a}function p(){return s}function m(){return o}function y(){return g(n)}function v(){return b(r)}function g(E){return a=E,S}function b(E){return c=E,S}const S={direction:p,duration:f,velocity:m,seek:d,settled:h,useBaseFriction:v,useBaseDuration:y,useFriction:b,useDuration:g};return S}function QZ(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=Ni(.1,.99);let c=!1;function l(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(f){if(!l())return;const p=e.reachedMin(t.get())?"min":"max",m=Zt(e[p]-t.get()),y=n.get()-t.get(),v=a.constrain(m/s);n.subtract(y*v),!f&&Zt(y)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(f){c=!f}return{constrain:u,toggleActive:d}}function e7(e,t,n,r){const i=Ni(-t+e,n[0]),o=c(),s=l();function a(){const d=o[0],h=ui(o),f=o.lastIndexOf(d),p=o.indexOf(h)+1;return Ni(f,p)}function c(){return n.map(i.constrain).map(d=>parseFloat(d.toFixed(3)))}function l(){if(t<=e)return[i.max];if(r==="keepSnaps")return o;const{min:d,max:h}=a();return o.slice(d,h)}return{snapsContained:s}}function t7(e,t,n){const r=t[0],i=n?r-e:ui(t);return{limit:Ni(i,r)}}function n7(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:c}=Ni(o,s);function l(h){return h===1?c(n.get()):h===-1?a(n.get()):!1}function u(h){if(!l(h))return;const f=e*(h*-1);r.forEach(p=>p.add(f))}return{loop:u}}function r7(e){const{max:t,length:n}=e;function r(o){return(o-t)/-n}return{get:r}}function i7(e,t,n,r,i,o,s){const{startEdge:a,endEdge:c}=e,{groupSlides:l}=o,u=f().map(t.measure),d=p(),h=m();function f(){return l(r).map(v=>ui(v)[c]-v[0][a]).map(Zt)}function p(){return r.map(v=>n[a]-v[a]).map(v=>-Zt(v))}function m(){const g=ui(d)-ui(i);return l(d).map(b=>b[0]).map((b,S,E)=>{const _=!S,I=S===od(E);return s&&_?0:s&&I?g:b+u[S]})}return{snaps:d,snapsAligned:h}}function o7(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function c(p){return p.concat().sort((m,y)=>Zt(m)-Zt(y))[0]}function l(p){const m=e?s(p):a(p),y=t.map(g=>g-m).map(g=>u(g,0)).map((g,b)=>({diff:g,index:b})).sort((g,b)=>Zt(g.diff)-Zt(b.diff)),{index:v}=y[0];return{index:v,distance:m}}function u(p,m){const y=[p,p+n,p-n];if(!e)return y[0];if(!m)return c(y);const v=y.filter(g=>bm(g)===m);return c(v)}function d(p,m){const y=t[p]-i.get(),v=u(y,m);return{index:p,distance:v}}function h(p,m){const y=i.get()+p,{index:v,distance:g}=l(y),b=!e&&o(y);if(!m||b)return{index:v,distance:p};const S=t[v]-g,E=p+u(S,0);return{index:v,distance:E}}return{byDistance:h,byIndex:d,shortcut:u}}function s7(e,t,n,r,i,o,s){function a(d){const h=d.distance,f=d.index!==t.get();o.add(h),h&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),f&&(n.set(t.get()),t.set(d.index),s.emit("select"))}function c(d,h){const f=r.byDistance(d,h);a(f)}function l(d,h){const f=t.clone().set(d),p=r.byIndex(f.get(),h);a(p)}return{distance:c,index:l}}function ad(e){let t=e;function n(){return t}function r(c){t=s(c)}function i(c){t+=s(c)}function o(c){t-=s(c)}function s(c){return gm(c)?c:c.get()}return{get:n,set:r,add:i,subtract:o}}function bE(e,t,n){const r=e.scroll==="x"?s:a,i=n.style;let o=!1;function s(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function c(h){o||(i.transform=r(t.apply(h)))}function l(h){o=!h}function u(){o||(i.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:u,to:c,toggleActive:l}}function a7(e,t,n,r,i,o,s,a,c){const l=za(i),u=za(i).reverse(),d=m().concat(y());function h(E,_){return E.reduce((I,P)=>I-i[P],_)}function f(E,_){return E.reduce((I,P)=>h(I,_)>0?I.concat([P]):I,[])}function p(E,_){const I=_==="start",P=I?-r:r,$=s.findSlideBounds([P]);return E.map(O=>{const q=I?0:-r,H=I?r:0,F=$.filter(D=>D.index===O)[0][I?"end":"start"];return{index:O,slideLocation:ad(-1),translate:bE(e,t,c[O]),target:()=>a.get()>F?q:H}})}function m(){const E=o[0]-1,_=f(u,E);return p(_,"end")}function y(){const E=n-o[0]-1,_=f(l,E);return p(_,"start")}function v(){return d.every(({index:E})=>{const _=l.filter(I=>I!==E);return h(_,n)<=.1})}function g(){d.forEach(E=>{const{target:_,translate:I,slideLocation:P}=E,$=_();$!==P.get()&&(I.to($),P.set($))})}function b(){d.forEach(E=>E.translate.clear())}return{canLoop:v,clear:b,loop:g,loopPoints:d}}function c7(e,t){let n,r=!1;function i(a,c){if(!c)return;function l(u){for(const d of u)if(d.type==="childList"){a.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(u=>{r||(vm(c)||c(a,u))&&l(u)}),n.observe(e,{childList:!0})}function o(){n&&n.disconnect(),r=!0}return{init:i,destroy:o}}function l7(e,t,n,r,i,o,s){const{removeOffset:a,constrain:c}=i,l=.5,u=o?[0,t,-t]:[0],d=f(u,s);function h(y){const v=y||0;return n.map(g=>Ni(l,g-l).constrain(g*v))}function f(y,v){const g=y||u,b=h(v);return g.reduce((S,E)=>{const _=r.map((I,P)=>({start:I-n[P]+b[P]+E,end:I+e-b[P]+E,index:P}));return S.concat(_)},[])}function p(y,v){const g=o?a(y):c(y);return(v||d).reduce((S,E)=>{const{index:_,start:I,end:P}=E,$=S.includes(_),O=I<g&&P>g;return!$&&O?S.concat([_]):S},[])}return{check:p,findSlideBounds:f}}function u7(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:c}=e,l=n[0]&&i,u=p(),d=m(),h=n.map(s),f=y();function p(){if(!l)return 0;const g=n[0];return Zt(t[a]-g[a])}function m(){if(!l)return 0;const g=o.getComputedStyle(ui(r));return parseFloat(g.getPropertyValue(`margin-${c}`))}function y(){return n.map((g,b,S)=>{const E=!b,_=b===od(S);return E?h[b]+u:_?h[b]+d:S[b+1][a]-g[a]}).map(Zt)}return{slideSizes:h,slideSizesWithGaps:f}}function d7(e,t,n){const r=gm(n);function i(c,l){return za(c).filter(u=>u%l===0).map(u=>c.slice(u,u+l))}function o(c){return za(c).reduce((l,u)=>{const h=t.slice(ui(l),u+1).reduce((f,p)=>f+p,0);return!u||h>e?l.concat(u):l},[]).map((l,u,d)=>c.slice(l,d[u+1]))}function s(c){return r?i(c,n):o(c)}return{groupSlides:s}}function f7(e,t,n,r,i,o,s,a){const{align:c,axis:l,direction:u,startIndex:d,inViewThreshold:h,loop:f,duration:p,dragFree:m,dragThreshold:y,slidesToScroll:v,skipSnaps:g,containScroll:b}=o,S=t.getBoundingClientRect(),E=n.map(ce=>ce.getBoundingClientRect()),_=WZ(u),I=HZ(l,u),P=I.measureSize(S),$=YZ(P),O=VZ(c,P),q=!f&&!!b,H=f||!!b,{slideSizes:B,slideSizesWithGaps:F}=u7(I,S,E,n,H,i),D=d7(P,F,v),{snaps:M,snapsAligned:Z}=i7(I,O,S,E,F,D,q),W=-ui(M)+ui(F),{snapsContained:Q}=e7(P,W,Z,b),C=q?Q:Z,{limit:te}=t7(W,C,f),fe=vE(od(C),d,f),A=fe.clone(),we=za(n),Te=({dragHandler:ce,scrollBody:ue,scrollBounds:Ne,eventHandler:Se,animation:Be,options:{loop:pt}})=>{const Ge=ce.pointerDown();pt||Ne.constrain(Ge);const K=ue.seek().settled();K&&!Ge&&(Be.stop(),Se.emit("settle")),K||Se.emit("scroll")},Ee=({scrollBody:ce,translate:ue,location:Ne,offsetLocation:Se,scrollLooper:Be,slideLooper:pt,options:{loop:Ge}},K)=>{const ie=ce.velocity();Se.set(Ne.get()-ie+ie*K),Ge&&(Be.loop(ce.direction()),pt.loop()),ue.to(Se.get())},Pe={start:()=>a.start(oe),stop:()=>a.stop(oe),update:()=>Te(oe),render:ce=>Ee(oe,ce)},Fe=.68,Re=C[fe.get()],he=ad(Re),de=ad(Re),_e=ad(Re),pe=XZ(he,_e,p,Fe),De=o7(f,C,W,te,_e),et=s7(Pe,fe,A,De,pe,_e,s),L=l7(P,W,B,M,te,f,h),oe={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:S,slideRects:E,animation:Pe,axis:I,direction:_,dragHandler:KZ(I,_,e,r,i,_e,JZ(I,i),he,Pe,et,pe,De,fe,s,$,m,y,g,Fe),eventStore:Za(),percentOfView:$,index:fe,indexPrevious:A,limit:te,location:he,offsetLocation:de,options:o,resizeHandler:GZ(t,s,i,n,I),scrollBody:pe,scrollBounds:QZ(te,he,_e,pe,$),scrollLooper:n7(W,te,de,[he,de,_e]),scrollProgress:r7(te),scrollSnaps:C,scrollTarget:De,scrollTo:et,slideLooper:a7(I,_,P,W,F,C,L,de,n),slidesHandler:c7(t,s),slidesInView:L,slideIndexes:we,slidesToScroll:D,target:_e,translate:bE(I,_,t)};return oe}function p7(e){const t=16.666666666666668;let n=[],r=null,i=0,o=0;function s(d){r||(r=d);const h=d-r;for(r=d,i+=h;i>=t;)n.forEach(({animation:p})=>p.update()),i-=t;const f=Zt(i/t);n.forEach(({animation:p})=>p.render(f)),o&&e.requestAnimationFrame(s)}function a(d){n.includes(d)||n.push(d),!o&&(o=e.requestAnimationFrame(s))}function c(d){n=n.filter(h=>h!==d),!n.length&&(e.cancelAnimationFrame(o),r=null,i=0,o=0)}function l(){r=null,i=0}return{start:a,stop:c,reset:l,window:e}}function h7(){const e={};let t;function n(c){t=c}function r(c){return e[c]||[]}function i(c){return r(c).forEach(l=>l(t,c)),a}function o(c,l){return e[c]=r(c).concat([l]),a}function s(c,l){return e[c]=r(c).filter(u=>u!==l),a}const a={init:n,emit:i,off:s,on:o};return a}const m7={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function y7(e){function t(o,s){return yE(o,s||{})}function n(o){const s=o.breakpoints||{},a=sd(s).filter(c=>e.matchMedia(c).matches).map(c=>s[c]).reduce((c,l)=>t(c,l),{});return t(o,a)}function r(o){return o.map(s=>sd(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function g7(e){let t=[];function n(o,s){return t=o.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(s,e)),o.reduce((a,c)=>Object.assign(a,{[c.name]:c}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function vs(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=y7(i),s=g7(o),a=Za(),c=Za(),l=h7(),{animationRealms:u}=vs,{mergeOptions:d,optionsAtMedia:h,optionsMediaQueries:f}=o,{on:p,off:m,emit:y}=l,v=B;let g=!1,b,S=d(m7,vs.globalOptions),E=d(S),_=[],I,P,$;function O(){const{container:pe,slides:De}=E;P=(hE(pe)?e.querySelector(pe):pe)||e.children[0];const L=hE(De)?P.querySelectorAll(De):De;$=[].slice.call(L||P.children)}function q(pe,De){const et=f7(e,P,$,r,i,pe,l,De);if(pe.loop&&!et.slideLooper.canLoop()){const L=Object.assign({},pe,{loop:!1});return q(L,De)}return et}function H(pe,De){if(g)return;const et=u.find(oe=>oe.window===i),L=et||p7(i);et||u.push(L),S=d(S,pe),E=h(S),_=De||_,O(),b=q(E,L),f([S,..._.map(({options:oe})=>oe)]).forEach(oe=>a.add(oe,"change",B)),E.active&&(b.translate.to(b.location.get()),b.eventHandler.init(_e),b.resizeHandler.init(_e,E.watchResize),b.slidesHandler.init(_e,E.watchSlides),c.add(r,"visibilitychange",()=>{r.hidden&&L.reset()}),b.options.loop&&b.slideLooper.loop(),P.offsetParent&&$.length&&b.dragHandler.init(_e,E.watchDrag),I=s.init(_,_e))}function B(pe,De){const et=Te();F(),H(d({startIndex:et},pe),De),l.emit("reInit")}function F(){b.dragHandler.destroy(),b.animation.stop(),b.eventStore.clear(),b.translate.clear(),b.slideLooper.clear(),b.resizeHandler.destroy(),b.slidesHandler.destroy(),s.destroy(),a.clear(),c.clear()}function D(){g||(g=!0,a.clear(),F(),l.emit("destroy"))}function M(pe){const De=b[pe?"target":"location"].get(),et=E.loop?"removeOffset":"constrain";return b.slidesInView.check(b.limit[et](De))}function Z(pe){const De=M(pe);return b.slideIndexes.filter(et=>!De.includes(et))}function W(pe,De,et){!E.active||g||(b.scrollBody.useBaseFriction().useDuration(De?0:E.duration),b.scrollTo.index(pe,et||0))}function Q(pe){const De=b.index.add(1).get();W(De,pe===!0,-1)}function C(pe){const De=b.index.add(-1).get();W(De,pe===!0,1)}function te(){return b.index.add(1).get()!==Te()}function fe(){return b.index.add(-1).get()!==Te()}function A(){return b.scrollSnaps.map(b.scrollProgress.get)}function we(){return b.scrollProgress.get(b.location.get())}function Te(){return b.index.get()}function Ee(){return b.indexPrevious.get()}function Pe(){return I}function Fe(){return b}function Re(){return e}function he(){return P}function de(){return $}const _e={canScrollNext:te,canScrollPrev:fe,containerNode:he,internalEngine:Fe,destroy:D,off:m,on:p,emit:y,plugins:Pe,previousScrollSnap:Ee,reInit:v,rootNode:Re,scrollNext:Q,scrollPrev:C,scrollProgress:we,scrollSnapList:A,scrollTo:W,selectedScrollSnap:Te,slideNodes:de,slidesInView:M,slidesNotInView:Z};return H(t,n),setTimeout(()=>l.emit("init"),0),_e}vs.animationRealms=[],vs.globalOptions=void 0;function wm(e={},t=[]){const n=w.useRef(e),r=w.useRef(t),[i,o]=w.useState(),[s,a]=w.useState(),c=w.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return w.useEffect(()=>{if(BZ()&&s){vs.globalOptions=wm.globalOptions;const l=vs(s,n.current,r.current);return o(l),()=>l.destroy()}else o(void 0)},[s,o]),w.useEffect(()=>{ym(n.current,e)||(n.current=e,c())},[e,c]),w.useEffect(()=>{zZ(r.current,t)||(r.current=t,c())},[t,c]),[a,i]}wm.globalOptions=void 0;function v7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",clipRule:"evenodd"}))}const b7=N.forwardRef(v7);function w7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"}))}const x7=N.forwardRef(w7);function _7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0016.5 9h-1.875a1.875 1.875 0 01-1.875-1.875V5.25A3.75 3.75 0 009 1.5H5.625zM7.5 15a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5A.75.75 0 017.5 15zm.75 2.25a.75.75 0 000 1.5H12a.75.75 0 000-1.5H8.25z",clipRule:"evenodd"}),N.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0114.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 013.434 1.279 9.768 9.768 0 00-6.963-6.963z"}))}const S7=N.forwardRef(_7);function E7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{d:"M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z"}),N.createElement("path",{d:"M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"}))}const k7=N.forwardRef(E7);function C7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 00-.945-5.003 12.754 12.754 0 01-4.339 2.708 18.991 18.991 0 01-.214 4.772 17.165 17.165 0 005.498-2.477zM14.634 15.55a17.324 17.324 0 00.332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 00.332 4.647 17.385 17.385 0 005.268 0zM9.772 17.119a18.963 18.963 0 004.456 0A17.182 17.182 0 0112 21.724a17.18 17.18 0 01-2.228-4.605zM7.777 15.23a18.87 18.87 0 01-.214-4.774 12.753 12.753 0 01-4.34-2.708 9.711 9.711 0 00-.944 5.004 17.165 17.165 0 005.498 2.477zM21.356 14.752a9.765 9.765 0 01-7.478 6.817 18.64 18.64 0 001.988-4.718 18.627 18.627 0 005.49-2.098zM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 001.988 4.718 9.765 9.765 0 01-7.478-6.816zM13.878 2.43a9.755 9.755 0 016.116 3.986 11.267 11.267 0 01-3.746 2.504 18.63 18.63 0 00-2.37-6.49zM12 2.276a17.152 17.152 0 012.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0112 2.276zM10.122 2.43a18.629 18.629 0 00-2.37 6.49 11.266 11.266 0 01-3.746-2.504 9.754 9.754 0 016.116-3.985z"}))}const T7=N.forwardRef(C7);function A7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"}))}const O7=N.forwardRef(A7);function I7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M1.5 4.5a3 3 0 013-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 01-.694 1.955l-1.293.97c-.135.101-.164.249-.126.352a11.285 11.285 0 006.697 6.697c.103.038.25.009.352-.126l.97-1.293a1.875 1.875 0 011.955-.694l4.423 1.105c.834.209 1.42.959 1.42 1.82V19.5a3 3 0 01-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5z",clipRule:"evenodd"}))}const R7=N.forwardRef(I7),P7=w.forwardRef(({type:e,styles:t,blocks:n},r)=>{const[i,o]=wm({skipSnaps:!0}),[s,a]=w.useState(!0),[c,l]=w.useState(!0),u=w.useCallback(()=>o&&o.scrollPrev(),[o]),d=w.useCallback(()=>o&&o.scrollNext(),[o]),h=t==null?void 0:t[e],f=w.useCallback(p=>{a(!p.canScrollPrev()),l(!p.canScrollNext())},[]);return w.useEffect(()=>{o&&(f(o),o.on("reInit",f),o.on("select",f))},[o,f]),U.jsxs("div",{...h==null?void 0:h.container,"data-container":"carousel",ref:i,children:[U.jsx("div",{ref:r,...h==null?void 0:h.slidesContainer,children:n.map((p,m)=>U.jsx(ks,{styles:t,block:p},m))}),U.jsx(b7,{...h==null?void 0:h.backButton,"data-disabled":s?"":void 0,onClick:u}),U.jsx(x7,{...h==null?void 0:h.nextButton,"data-disabled":c?"":void 0,onClick:d})]})}),bs=Math.min,er=Math.max,cd=Math.round,ws=Math.floor,ji=e=>({x:e,y:e});function wE(e,t,n){return er(e,bs(t,n))}function ld(e,t){return typeof e=="function"?e(t):e}function Va(e){return e.split("-")[0]}function xm(e){return e.split("-")[1]}function xE(e){return e==="x"?"y":"x"}function $7(e){return e==="y"?"height":"width"}function Ha(e){return["top","bottom"].includes(Va(e))?"y":"x"}function D7(e){return xE(Ha(e))}function N7(e){return{top:0,right:0,bottom:0,left:0,...e}}function j7(e){return typeof e!="number"?N7(e):{top:e,right:e,bottom:e,left:e}}function ud(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Mi(e){return _E(e)?(e.nodeName||"").toLowerCase():"#document"}function tr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function di(e){var t;return(t=(_E(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _E(e){return e instanceof Node||e instanceof tr(e).Node}function Jt(e){return e instanceof Element||e instanceof tr(e).Element}function Pn(e){return e instanceof HTMLElement||e instanceof tr(e).HTMLElement}function _m(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tr(e).ShadowRoot}function Wa(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function M7(e){return["table","td","th"].includes(Mi(e))}function Sm(e){const t=Em(),n=nr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function q7(e){let t=xo(e);for(;Pn(t)&&!Ka(t);){if(Sm(t))return t;t=xo(t)}return null}function Em(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ka(e){return["html","body","#document"].includes(Mi(e))}function nr(e){return tr(e).getComputedStyle(e)}function dd(e){return Jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function xo(e){if(Mi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_m(e)&&e.host||di(e);return _m(t)?t.host:t}function SE(e){const t=xo(e);return Ka(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pn(t)&&Wa(t)?t:SE(t)}function qi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=SE(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=tr(i);return o?t.concat(s,s.visualViewport||[],Wa(i)?i:[],s.frameElement&&n?qi(s.frameElement):[]):t.concat(i,qi(i,[],n))}function Li(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Wn(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_m(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function EE(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function L7(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function kE(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(EE())||t.test(L7()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function CE(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function TE(){return/apple/i.test(navigator.vendor)}function F7(){return EE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function AE(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function U7(e){return"nativeEvent"in e}function B7(e){return e.matches("html,body")}function Tr(e){return(e==null?void 0:e.ownerDocument)||document}function km(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function OE(e){return"composedPath"in e?e.composedPath()[0]:e.target}const z7="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function IE(e){return Pn(e)&&e.matches(z7)}function xn(e){e.preventDefault(),e.stopPropagation()}function RE(e,t,n){let{reference:r,floating:i}=e;const o=Ha(t),s=D7(t),a=$7(s),c=Va(t),l=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(xm(t)){case"start":f[s]-=h*(n&&l?-1:1);break;case"end":f[s]+=h*(n&&l?-1:1);break}return f}const Z7=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=RE(l,r,c),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:y,fn:v}=a[m],{x:g,y:b,data:S,reset:E}=await v({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:l,platform:s,elements:{reference:e,floating:t}});if(u=g??u,d=b??d,f={...f,[y]:{...f[y],...S}},E&&p<=50){p++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(l=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:u,y:d}=RE(l,h,c)),m=-1;continue}}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function PE(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=ld(t,e),p=j7(f),y=a[h?d==="floating"?"reference":"floating":d],v=ud(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),g=d==="floating"?{...s.floating,x:r,y:i}:s.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),S=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},E=ud(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:b,strategy:c}):g);return{top:(v.top-E.top+p.top)/S.y,bottom:(E.bottom-v.bottom+p.bottom)/S.y,left:(v.left-E.left+p.left)/S.x,right:(E.right-v.right+p.right)/S.x}}async function V7(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Va(n),a=xm(n),c=Ha(n)==="y",l=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,d=ld(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:h*l}:{x:h*l,y:f*u}}const H7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await V7(t,e);return{x:n+i.x,y:r+i.y,data:i}}}},W7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:g}=y;return{x:v,y:g}}},...c}=ld(e,t),l={x:n,y:r},u=await PE(t,c),d=Ha(Va(i)),h=xE(d);let f=l[h],p=l[d];if(o){const y=h==="y"?"top":"left",v=h==="y"?"bottom":"right",g=f+u[y],b=f-u[v];f=wE(g,f,b)}if(s){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",g=p+u[y],b=p-u[v];p=wE(g,p,b)}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},K7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=ld(e,t),c=await PE(t,a),l=Va(n),u=xm(n),d=Ha(n)==="y",{width:h,height:f}=r.floating;let p,m;l==="top"||l==="bottom"?(p=l,m=u===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(m=l,p=u==="end"?"top":"bottom");const y=f-c[p],v=h-c[m],g=!t.middlewareData.shift;let b=y,S=v;if(d){const _=h-c.left-c.right;S=u||g?bs(v,_):_}else{const _=f-c.top-c.bottom;b=u||g?bs(y,_):_}if(g&&!u){const _=er(c.left,0),I=er(c.right,0),P=er(c.top,0),$=er(c.bottom,0);d?S=h-2*(_!==0||I!==0?_+I:er(c.left,c.right)):b=f-2*(P!==0||$!==0?P+$:er(c.top,c.bottom))}await s({...t,availableWidth:S,availableHeight:b});const E=await i.getDimensions(o.floating);return h!==E.width||f!==E.height?{reset:{rects:!0}}:{}}}};function $E(e){const t=nr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Pn(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=cd(n)!==o||cd(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Cm(e){return Jt(e)?e:e.contextElement}function xs(e){const t=Cm(e);if(!Pn(t))return ji(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=$E(t);let s=(o?cd(n.width):n.width)/r,a=(o?cd(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const J7=ji(0);function DE(e){const t=tr(e);return!Em()||!t.visualViewport?J7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Y7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tr(e)?!1:t}function _o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Cm(e);let s=ji(1);t&&(r?Jt(r)&&(s=xs(r)):s=xs(e));const a=Y7(o,n,r)?DE(o):ji(0);let c=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const h=tr(o),f=r&&Jt(r)?tr(r):r;let p=h.frameElement;for(;p&&r&&f!==h;){const m=xs(p),y=p.getBoundingClientRect(),v=nr(p),g=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*m.x,b=y.top+(p.clientTop+parseFloat(v.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=g,l+=b,p=tr(p).frameElement}}return ud({width:u,height:d,x:c,y:l})}function G7(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Pn(n),o=di(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=ji(1);const c=ji(0);if((i||!i&&r!=="fixed")&&((Mi(n)!=="body"||Wa(o))&&(s=dd(n)),Pn(n))){const l=_o(n);a=xs(n),c.x=l.x+n.clientLeft,c.y=l.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+c.x,y:t.y*a.y-s.scrollTop*a.y+c.y}}function X7(e){return Array.from(e.getClientRects())}function NE(e){return _o(di(e)).left+dd(e).scrollLeft}function Q7(e){const t=di(e),n=dd(e),r=e.ownerDocument.body,i=er(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=er(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+NE(e);const a=-n.scrollTop;return nr(r).direction==="rtl"&&(s+=er(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function e9(e,t){const n=tr(e),r=di(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const l=Em();(!l||l&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}function t9(e,t){const n=_o(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Pn(e)?xs(e):ji(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,c=i*o.x,l=r*o.y;return{width:s,height:a,x:c,y:l}}function jE(e,t,n){let r;if(t==="viewport")r=e9(e,n);else if(t==="document")r=Q7(di(e));else if(Jt(t))r=t9(t,n);else{const i=DE(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return ud(r)}function ME(e,t){const n=xo(e);return n===t||!Jt(n)||Ka(n)?!1:nr(n).position==="fixed"||ME(n,t)}function n9(e,t){const n=t.get(e);if(n)return n;let r=qi(e,[],!1).filter(a=>Jt(a)&&Mi(a)!=="body"),i=null;const o=nr(e).position==="fixed";let s=o?xo(e):e;for(;Jt(s)&&!Ka(s);){const a=nr(s),c=Sm(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Wa(s)&&!c&&ME(e,s))?r=r.filter(u=>u!==s):i=a,s=xo(s)}return t.set(e,r),r}function r9(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?n9(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const d=jE(t,u,i);return l.top=er(d.top,l.top),l.right=bs(d.right,l.right),l.bottom=bs(d.bottom,l.bottom),l.left=er(d.left,l.left),l},jE(t,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function i9(e){return $E(e)}function o9(e,t,n){const r=Pn(t),i=di(t),o=n==="fixed",s=_o(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=ji(0);if(r||!r&&!o)if((Mi(t)!=="body"||Wa(i))&&(a=dd(t)),r){const l=_o(t,!0,o,t);c.x=l.x+t.clientLeft,c.y=l.y+t.clientTop}else i&&(c.x=NE(i));return{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function qE(e,t){return!Pn(e)||nr(e).position==="fixed"?null:t?t(e):e.offsetParent}function LE(e,t){const n=tr(e);if(!Pn(e))return n;let r=qE(e,t);for(;r&&M7(r)&&nr(r).position==="static";)r=qE(r,t);return r&&(Mi(r)==="html"||Mi(r)==="body"&&nr(r).position==="static"&&!Sm(r))?n:r||q7(e)||n}const s9=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||LE,o=this.getDimensions;return{reference:o9(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function a9(e){return nr(e).direction==="rtl"}const c9={convertOffsetParentRelativeRectToViewportRelativeRect:G7,getDocumentElement:di,getClippingRect:r9,getOffsetParent:LE,getElementRects:s9,getClientRects:X7,getDimensions:i9,getScale:xs,isElement:Jt,isRTL:a9};function l9(e,t){let n=null,r;const i=di(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const{left:l,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=ws(u),p=ws(i.clientWidth-(l+d)),m=ws(i.clientHeight-(u+h)),y=ws(l),g={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:er(0,bs(1,c))||1};let b=!0;function S(E){const _=E[0].intersectionRatio;if(_!==c){if(!b)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},100)}b=!1}try{n=new IntersectionObserver(S,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,g)}n.observe(e)}return s(!0),o}function u9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Cm(e),u=i||o?[...l?qi(l):[],...qi(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=l&&a?l9(l,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(v=>{let[g]=v;g&&g.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),l&&!c&&f.observe(l),f.observe(t));let p,m=c?_o(e):null;c&&y();function y(){const v=_o(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(y)}return n(),()=>{u.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d&&d(),f&&f.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const d9=(e,t,n)=>{const r=new Map,i={platform:c9,...n},o={...i.platform,_c:r};return Z7(e,t,{...i,platform:o})};var fd=typeof document<"u"?w.useLayoutEffect:w.useEffect;function pd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!pd(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!pd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function FE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function UE(e,t){const n=FE(e);return Math.round(t*n)/n}function BE(e){const t=N.useRef(e);return fd(()=>{t.current=e}),t}function f9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=N.useState(r);pd(h,r)||f(r);const[p,m]=N.useState(null),[y,v]=N.useState(null),g=N.useCallback(M=>{M!=_.current&&(_.current=M,m(M))},[m]),b=N.useCallback(M=>{M!==I.current&&(I.current=M,v(M))},[v]),S=o||p,E=s||y,_=N.useRef(null),I=N.useRef(null),P=N.useRef(u),$=BE(c),O=BE(i),q=N.useCallback(()=>{if(!_.current||!I.current)return;const M={placement:t,strategy:n,middleware:h};O.current&&(M.platform=O.current),d9(_.current,I.current,M).then(Z=>{const W={...Z,isPositioned:!0};H.current&&!pd(P.current,W)&&(P.current=W,qC.flushSync(()=>{d(W)}))})},[h,t,n,O]);fd(()=>{l===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[l]);const H=N.useRef(!1);fd(()=>(H.current=!0,()=>{H.current=!1}),[]),fd(()=>{if(S&&(_.current=S),E&&(I.current=E),S&&E){if($.current)return $.current(S,E,q);q()}},[S,E,q,$]);const B=N.useMemo(()=>({reference:_,floating:I,setReference:g,setFloating:b}),[g,b]),F=N.useMemo(()=>({reference:S,floating:E}),[S,E]),D=N.useMemo(()=>{const M={position:n,left:0,top:0};if(!F.floating)return M;const Z=UE(F.floating,u.x),W=UE(F.floating,u.y);return a?{...M,transform:"translate("+Z+"px, "+W+"px)",...FE(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:W}},[n,a,F.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:q,refs:B,elements:F,floatingStyles:D}),[u,q,B,F,D])}/*!
|
|
359
|
+
`);const v=g.state[a];if(v==null)return;JSON.stringify(i.getState())!==JSON.stringify(v)&&f(v);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(g)});case"DISPATCH":switch(m.payload.type){case"RESET":return f(h),a===void 0?u==null?void 0:u.init(i.getState()):u==null?void 0:u.init(rd(c.name));case"COMMIT":if(a===void 0){u==null||u.init(i.getState());return}return u==null?void 0:u.init(rd(c.name));case"ROLLBACK":return mm(m.state,g=>{if(a===void 0){f(g),u==null||u.init(i.getState());return}f(g[a]),u==null||u.init(rd(c.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return mm(m.state,g=>{if(a===void 0){f(g);return}JSON.stringify(i.getState())!==JSON.stringify(g[a])&&f(g[a])});case"IMPORT_STATE":{const{nextLiftedState:g}=m.payload,v=(y=g.computedStates.slice(-1)[0])==null?void 0:y.state;if(!v)return;f(a===void 0?v:v[a]),u==null||u.send(null,g);return}case"PAUSE_RECORDING":return p=!p}return}}),h},mm=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function dZ(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=c=>c===null?null:JSON.parse(c,t==null?void 0:t.reviver),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,t==null?void 0:t.replacer)),removeItem:i=>n.removeItem(i)}}const Ba=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Ba(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Ba(r)(n)}}}},fZ=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,g)=>({...g,...y}),...t},s=!1;const a=new Set,c=new Set;let l;try{l=o.getStorage()}catch{}if(!l)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...y)},r,i);const u=Ba(o.serialize),d=()=>{const y=o.partialize({...r()});let g;const v=u({state:y,version:o.version}).then(b=>l.setItem(o.name,b)).catch(b=>{g=b});if(g)throw g;return v},p=i.setState;i.setState=(y,g)=>{p(y,g),d()};const f=e((...y)=>{n(...y),d()},r,i);let h;const m=()=>{var y;if(!l)return;s=!1,a.forEach(v=>v(r()));const g=((y=o.onRehydrateStorage)==null?void 0:y.call(o,r()))||void 0;return Ba(l.getItem.bind(l))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var b;return h=o.merge(v,(b=r())!=null?b:f),n(h,!0),d()}).then(()=>{g==null||g(h,void 0),s=!0,c.forEach(v=>v(h))}).catch(v=>{g==null||g(void 0,v)})};return i.persist={setOptions:y=>{o={...o,...y},y.getStorage&&(l=y.getStorage())},clearStorage:()=>{l==null||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(c.add(y),()=>{c.delete(y)})},m(),h||f},pZ=(e,t)=>(n,r,i)=>{let o={storage:dZ(()=>localStorage),partialize:m=>m,version:0,merge:(m,y)=>({...y,...m}),...t},s=!1;const a=new Set,c=new Set;let l=o.storage;if(!l)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...m)},r,i);const u=()=>{const m=o.partialize({...r()});return l.setItem(o.name,{state:m,version:o.version})},d=i.setState;i.setState=(m,y)=>{d(m,y),u()};const p=e((...m)=>{n(...m),u()},r,i);let f;const h=()=>{var m,y;if(!l)return;s=!1,a.forEach(v=>{var b;return v((b=r())!=null?b:p)});const g=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(m=r())!=null?m:p))||void 0;return Ba(l.getItem.bind(l))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var b;return f=o.merge(v,(b=r())!=null?b:p),n(f,!0),u()}).then(()=>{g==null||g(f,void 0),f=r(),s=!0,c.forEach(v=>v(f))}).catch(v=>{g==null||g(void 0,v)})};return i.persist={setOptions:m=>{o={...o,...m},m.storage&&(l=m.storage)},clearStorage:()=>{l==null||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>h(),hasHydrated:()=>s,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(c.add(m),()=>{c.delete(m)})},o.skipHydration||h(),f||p},hZ=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?fZ(e,t):pZ(e,t),Qn=lZ()(oE(hZ((e,t)=>({messageHistory:{},addMessageToHistory:({userId:n,message:r})=>e(i=>({...i,messageHistory:{...i.messageHistory,[n]:[r,...(i.messageHistory[n]??[]).slice(0,100)]}})),clientMode:"",setClientMode:n=>{const{clearAll:r,clientMode:i}=t();i!==n&&r(),e(o=>({...o,clientMode:n}))},setUser:n=>e(r=>({...r,user:n})),setConversationId:n=>e(r=>({...r,conversationId:n})),clearAll:()=>{e(n=>({...n,messageHistory:{},user:void 0,conversationId:void 0}))}}),{name:"botpress-webchat"}))),sE=w.createContext(null),mZ=e=>{const t={theme:{},configuration:{},messages:{},connected:!0,disableComposer:!1,renderers:{},isReadOnly:!1,userData:{},userName:void 0,userPictureUrl:void 0,closeWindow:()=>{},messageContainerRef:{current:null},isTyping:!1,lastTypingHeartbeat:null,allowFileUpload:!1,conversationId:void 0,disableRestartConversation:!1},n=e==null?void 0:e.client,r=e==null?void 0:e.conversationId,i=Qn.getState().setClientMode,o=Qn.getState().setConversationId;return n&&i(n.mode),w.useEffect(()=>{r&&o(r)},[r]),YS()(oE((s,a)=>{const c=d=>{const p=Qn.getState().conversationId;if(p)return s(f=>{const h=f.messages[p]??[];return{...f,messages:{...f.messages,[p]:[...h.filter(m=>m.id!==d.id),{id:Pl(),...d}]}}})},l=d=>{const p=Qn.getState().conversationId;if(p)return s(f=>({...f,messages:{...f.messages,[p]:d}}))},u=Qn.getState().addMessageToHistory;return{...t,...e,eventEmitter:H$,client:n,sendFile:d=>a().client.sendFile(d),sendTextMessage:async d=>{const p=a().client;c({id:Pl(),direction:"outgoing",sender:{name:"You"},timestamp:new Date,disableInput:!1,block:{type:"bubble",block:{type:"text",text:d}}}),p&&await p.sendMessage(d),p!=null&&p.userId&&u({message:d,userId:p.userId})},on:(d,p)=>{const f=a().client;return f?f.on(d,p):()=>{}},getClientId:()=>{var d;return(d=a().client)==null?void 0:d.clientId},setState:d=>s(p=>({...p,...d})),setTheme:d=>s(p=>({...p,theme:d})),setMessages:l,getMessages:()=>a().messages[Qn.getState().conversationId??""]??[],setConfiguration:d=>s(p=>({...p,configuration:d})),setIsTyping:(d,p)=>{s(f=>({...f,isTyping:d})),d&&(s(f=>({...f,lastTypingHeartbeat:new Date})),p&&setTimeout(()=>{const f=a().lastTypingHeartbeat;f&&new Date().getTime()-f.getTime()>p&&s(h=>({...h,isTyping:!1}))},p+100))},setLastTypingHeartbeat:d=>s(p=>({...p,lastTypingHeartbeat:d})),addMessage:c,setConnected:d=>s(p=>({...p,connected:d})),restartConversation:async()=>{const d=a().client,p=a().setMessages;d&&(await d.newConversation(),p([]))}}},{name:"webchatStore"}))};function Ie(e){const t=w.useContext(sE);if(!t)throw new Error("Missing WebchatContext.Provider in the tree");return rE(t,e)}const yZ=({text:e,buttonValue:t,type:n,styles:r,variant:i,groupId:o,reusable:s,...a})=>{const c=Ie(v=>v.eventEmitter),l=Ie(v=>v.sendTextMessage),u=Ie(v=>v.isReadOnly),[d,p]=w.useState(!1),[f,h]=w.useState(!1),[m,y]=w.useState(!1);w.useEffect(()=>{if(o)return c.on(`button-group-${o}-click`,()=>{h(!0),s||y(!0)})},[c,o,s]);function g(){o&&c.emit(`button-group-${o}-click`),p(!0),s||y(!0),i!=="link"&&l(t)}return U.jsx(gZ,{...a,variant:i,onClick:g,disabled:m||u,"data-activated":d?"":void 0,"data-group-activated":f?"":void 0,"data-type":i,value:t,...r==null?void 0:r[n],children:e})},gZ=e=>{if(e.variant==="link"){const{value:r,variant:i,...o}=e;return U.jsx("a",{...o,href:r,target:"_blank",rel:"noopener noreferrer"})}const{variant:t,...n}=e;return U.jsx("button",{type:"button",...n})},vZ=w.forwardRef(({block:e,styles:t,type:n,...r},i)=>U.jsx("div",{...r,...t==null?void 0:t[n],ref:i,children:U.jsx(ks,{styles:t,block:e})})),aE=w.createContext(null);function cE(){const e=w.useContext(aE);if(!e)throw new Error("useComposerContext must be used within a Message");return e}const lE=w.createContext(null);function bZ(){const e=w.useContext(lE);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const uE=w.createContext(null);function dE(){const e=w.useContext(uE);if(!e)throw new Error("useModalContext must be used within a ModalProvider");return e}w.createContext(null);const wZ=w.forwardRef(({url:e,type:t,styles:n,orientation:r="auto",...i},o)=>{var p,f;const s=w.useId(),{setIsLoading:a}=bZ(),[c,l]=w.useState(r),[u,d]=w.useState(!1);return w.useLayoutEffect(()=>{a(h=>[...h,s])},[]),w.useEffect(()=>{e&&c==="auto"&&E4(e).then(({width:h,height:m})=>{l(xZ(h,m)),a(y=>y.filter(g=>g!==s))})},[e]),U.jsxs(U.Fragment,{children:[u?null:U.jsx("div",{"data-orientation":c,...(p=n==null?void 0:n[t])==null?void 0:p.placeholder}),U.jsx("img",{"data-orientation":c,"data-loaded":u,...i,...(f=n==null?void 0:n[t])==null?void 0:f.image,src:e,alt:"",ref:o,loading:"lazy",onLoad:()=>{d(!0)}})]})});function xZ(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const _Z=w.forwardRef(({url:e,type:t,styles:n,...r},i)=>U.jsx("div",{children:U.jsx("video",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})})),SZ=w.forwardRef(({url:e,type:t,styles:n,...r},i)=>U.jsx("div",{children:U.jsx("audio",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})}));function EZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.75.75v10.638l3.96-4.158a.75.75 0 111.08 1.04l-5.25 5.5a.75.75 0 01-1.08 0l-5.25-5.5a.75.75 0 111.08-1.04l3.96 4.158V3.75A.75.75 0 0110 3z",clipRule:"evenodd"}))}const kZ=N.forwardRef(EZ);function CZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z",clipRule:"evenodd"}))}const TZ=N.forwardRef(CZ);function AZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm-.75-4.75a.75.75 0 001.5 0V8.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.1 0L6.2 9.74a.75.75 0 101.1 1.02l1.95-2.1v4.59z",clipRule:"evenodd"}))}const OZ=N.forwardRef(AZ);function IZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"}))}const RZ=N.forwardRef(IZ);function PZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M4.5 2A1.5 1.5 0 003 3.5v13A1.5 1.5 0 004.5 18h11a1.5 1.5 0 001.5-1.5V7.621a1.5 1.5 0 00-.44-1.06l-4.12-4.122A1.5 1.5 0 0011.378 2H4.5zm4.75 6.75a.75.75 0 011.5 0v2.546l.943-1.048a.75.75 0 011.114 1.004l-2.25 2.5a.75.75 0 01-1.114 0l-2.25-2.5a.75.75 0 111.114-1.004l.943 1.048V8.75z",clipRule:"evenodd"}))}const $Z=N.forwardRef(PZ);function DZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M9.69 18.933l.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 00.281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 103 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 002.273 1.765 11.842 11.842 0 00.976.544l.062.029.018.008.006.003zM10 11.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5z",clipRule:"evenodd"}))}const NZ=N.forwardRef(DZ);function jZ({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{d:"M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"}))}const MZ=N.forwardRef(jZ),qZ=w.forwardRef(({type:e,latitude:t,longitude:n,title:r,styles:i,...o},s)=>{var c,l,u;const a=`https://www.google.com/maps/search/?api=1&query=${t},${n}`;return U.jsxs("a",{...o,...(c=i==null?void 0:i[e])==null?void 0:c.container,href:a,type:"_blank",rel:"noopener",ref:s,children:[U.jsx("p",{...(l=i==null?void 0:i[e])==null?void 0:l.title,children:r}),U.jsx(NZ,{...(u=i==null?void 0:i[e])==null?void 0:u.icon})]})}),LZ=w.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...o},s)=>U.jsx("div",{"data-horizontal":r,"data-vertical":i,...o,...t==null?void 0:t[n],ref:s,children:e.map((a,c)=>U.jsx(ks,{styles:t,block:a},c))})),FZ=w.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...o},s)=>U.jsx("div",{"data-horizontal":r,"data-vertical":i,...o,...t==null?void 0:t[n],ref:s,children:e.map((a,c)=>U.jsx(ks,{styles:t,block:a},c))}));function UZ(e){return Object.prototype.toString.call(e)==="[object Object]"}function fE(e){return UZ(e)||Array.isArray(e)}function BZ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ym(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],c=t[s];return typeof a=="function"?`${a}`==`${c}`:!fE(a)||!fE(c)?a===c:ym(a,c)})}function pE(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function zZ(e,t){if(e.length!==t.length)return!1;const n=pE(e),r=pE(t);return n.every((i,o)=>{const s=r[o];return ym(i,s)})}function gm(e){return typeof e=="number"}function hE(e){return typeof e=="string"}function vm(e){return typeof e=="boolean"}function mE(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zt(e){return Math.abs(e)}function bm(e){return Math.sign(e)}function id(e,t){return Zt(e-t)}function ZZ(e,t){if(e===0||t===0||Zt(e)<=Zt(t))return 0;const n=id(Zt(e),Zt(t));return Zt(n/e)}function za(e){return sd(e).map(Number)}function ui(e){return e[od(e)]}function od(e){return Math.max(0,e.length-1)}function sd(e){return Object.keys(e)}function yE(e,t){return[e,t].reduce((n,r)=>(sd(r).forEach(i=>{const o=n[i],s=r[i],a=mE(o)&&mE(s);n[i]=a?yE(o,s):s}),n),{})}function gE(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function VZ(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(){return t*Number(e)}function a(l){return gm(e)?s():n[e](l)}return{measure:a}}function HZ(e,t){const n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=a(),o=c();function s(u){const{width:d,height:p}=u;return n==="x"?d:p}function a(){return n==="y"?"top":t==="rtl"?"right":"left"}function c(){return n==="y"?"bottom":t==="rtl"?"left":"right"}return{scroll:n,cross:r,startEdge:i,endEdge:o,measureSize:s}}function Ni(e,t){const n=Zt(e-t);function r(l){return l<e}function i(l){return l>t}function o(l){return r(l)||i(l)}function s(l){return o(l)?r(l)?e:t:l}function a(l){return n?l-n*Math.ceil((l-t)/n):l}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function vE(e,t,n){const{constrain:r}=Ni(0,e),i=e+1;let o=s(t);function s(p){return n?Zt((i+p)%i):r(p)}function a(){return o}function c(p){return o=s(p),d}function l(p){return u().set(a()+p)}function u(){return vE(e,a(),n)}const d={get:a,set:c,add:l,clone:u};return d}function WZ(e){const t=e==="rtl"?-1:1;function n(i){return i*t}return{apply:n}}function Za(){let e=[];function t(i,o,s,a={passive:!0}){return i.addEventListener(o,s,a),e.push(()=>i.removeEventListener(o,s,a)),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function KZ(e,t,n,r,i,o,s,a,c,l,u,d,p,f,h,m,y,g,v){const{cross:b}=e,S=["INPUT","SELECT","TEXTAREA"],E={passive:!1},_=Za(),I=Za(),P=Ni(50,225).constrain(h.measure(20)),$={mouse:300,touch:400},O={mouse:500,touch:600},q=m?43:25;let H=!1,B=0,F=0,D=!1,M=!1,Z=!1,W=!1;function Q(de,_e){if(!_e)return;function pe(et){(vm(_e)||_e(de,et))&&Te(et)}const De=n;_.add(De,"dragstart",et=>et.preventDefault(),E).add(De,"touchmove",()=>{},E).add(De,"touchend",()=>{}).add(De,"touchstart",pe).add(De,"mousedown",pe).add(De,"touchcancel",$e).add(De,"contextmenu",$e).add(De,"click",Fe,!0)}function C(){_.clear(),I.clear()}function te(){const de=W?r:n;I.add(de,"touchmove",Ee,E).add(de,"touchend",$e).add(de,"mousemove",Ee,E).add(de,"mouseup",$e)}function fe(de){const _e=de.nodeName||"";return S.includes(_e)}function A(){return(m?O:$)[W?"mouse":"touch"]}function we(de,_e){const pe=p.add(bm(de)*-1),De=d.byDistance(de,!m).distance;return m||Zt(de)<P?De:g&&_e?De*.5:d.byIndex(pe.get(),0).distance}function Te(de){const _e=gE(de,i);W=_e,!(_e&&de.button!==0)&&(fe(de.target)||(Z=m&&_e&&!de.buttons&&H,H=id(o.get(),a.get())>=2,D=!0,s.pointerDown(de),u.useFriction(0).useDuration(0),o.set(a),te(),B=s.readPoint(de),F=s.readPoint(de,b),f.emit("pointerDown")))}function Ee(de){const _e=s.readPoint(de),pe=s.readPoint(de,b),De=id(_e,B),et=id(pe,F);if(!M&&!W&&(!de.cancelable||(M=De>et,!M)))return $e(de);const L=s.pointerMove(de);De>y&&(Z=!0),u.useFriction(.3).useDuration(1),c.start(),o.add(t.apply(L)),de.preventDefault()}function $e(de){const pe=d.byDistance(0,!1).index!==p.get(),De=s.pointerUp(de)*A(),et=we(t.apply(De),pe),L=ZZ(De,et),oe=q-10*L,ce=v+L/50;M=!1,D=!1,I.clear(),u.useDuration(oe).useFriction(ce),l.distance(et,!m),W=!1,f.emit("pointerUp")}function Fe(de){Z&&(de.stopPropagation(),de.preventDefault())}function Pe(){return D}return{init:Q,pointerDown:Pe,destroy:C}}function JZ(e,t){let r,i;function o(d){return d.timeStamp}function s(d,p){const h=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(gE(d,t)?d:d.touches[0])[h]}function a(d){return r=d,i=d,s(d)}function c(d){const p=s(d)-s(i),f=o(d)-o(r)>170;return i=d,f&&(r=d),p}function l(d){if(!r||!i)return 0;const p=s(i)-s(r),f=o(d)-o(r),h=o(d)-o(i)>170,m=p/f;return f&&!h&&Zt(m)>.1?m:0}return{pointerDown:a,pointerMove:c,pointerUp:l,readPoint:s}}function YZ(e){function t(r){return e*(r/100)}return{measure:t}}function GZ(e,t,n,r,i){let o,s,a=[],c=!1;function l(f){return i.measureSize(f.getBoundingClientRect())}function u(f,h){if(!h)return;s=l(e),a=r.map(l);function m(g){for(const v of g){const b=v.target===e,S=r.indexOf(v.target),E=b?s:a[S],_=l(b?e:r[S]);if(E!==_){n.requestAnimationFrame(()=>{f.reInit(),t.emit("resize")});break}}}o=new ResizeObserver(g=>{c||(vm(h)||h(f,g))&&m(g)}),[e].concat(r).forEach(g=>o.observe(g))}function d(){o&&o.disconnect(),c=!0}return{init:u,destroy:d}}function XZ(e,t,n,r){let i=!0,o=0,s=0,a=n,c=r,l=e.get(),u=0;function d(){const E=t.get()-e.get(),_=!a;let I=0;return _?(o=0,e.set(t),I=E):(o+=E/a,o*=c,l+=o,e.add(o),I=l-u),s=bm(I),u=l,i=Zt(E)<.001,S}function p(){return i}function f(){return a}function h(){return s}function m(){return o}function y(){return v(n)}function g(){return b(r)}function v(E){return a=E,S}function b(E){return c=E,S}const S={direction:h,duration:f,velocity:m,seek:d,settled:p,useBaseFriction:g,useBaseDuration:y,useFriction:b,useDuration:v};return S}function QZ(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=Ni(.1,.99);let c=!1;function l(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(f){if(!l())return;const h=e.reachedMin(t.get())?"min":"max",m=Zt(e[h]-t.get()),y=n.get()-t.get(),g=a.constrain(m/s);n.subtract(y*g),!f&&Zt(y)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(f){c=!f}return{constrain:u,toggleActive:d}}function e7(e,t,n,r){const i=Ni(-t+e,n[0]),o=c(),s=l();function a(){const d=o[0],p=ui(o),f=o.lastIndexOf(d),h=o.indexOf(p)+1;return Ni(f,h)}function c(){return n.map(i.constrain).map(d=>parseFloat(d.toFixed(3)))}function l(){if(t<=e)return[i.max];if(r==="keepSnaps")return o;const{min:d,max:p}=a();return o.slice(d,p)}return{snapsContained:s}}function t7(e,t,n){const r=t[0],i=n?r-e:ui(t);return{limit:Ni(i,r)}}function n7(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:c}=Ni(o,s);function l(p){return p===1?c(n.get()):p===-1?a(n.get()):!1}function u(p){if(!l(p))return;const f=e*(p*-1);r.forEach(h=>h.add(f))}return{loop:u}}function r7(e){const{max:t,length:n}=e;function r(o){return(o-t)/-n}return{get:r}}function i7(e,t,n,r,i,o,s){const{startEdge:a,endEdge:c}=e,{groupSlides:l}=o,u=f().map(t.measure),d=h(),p=m();function f(){return l(r).map(g=>ui(g)[c]-g[0][a]).map(Zt)}function h(){return r.map(g=>n[a]-g[a]).map(g=>-Zt(g))}function m(){const v=ui(d)-ui(i);return l(d).map(b=>b[0]).map((b,S,E)=>{const _=!S,I=S===od(E);return s&&_?0:s&&I?v:b+u[S]})}return{snaps:d,snapsAligned:p}}function o7(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function c(h){return h.concat().sort((m,y)=>Zt(m)-Zt(y))[0]}function l(h){const m=e?s(h):a(h),y=t.map(v=>v-m).map(v=>u(v,0)).map((v,b)=>({diff:v,index:b})).sort((v,b)=>Zt(v.diff)-Zt(b.diff)),{index:g}=y[0];return{index:g,distance:m}}function u(h,m){const y=[h,h+n,h-n];if(!e)return y[0];if(!m)return c(y);const g=y.filter(v=>bm(v)===m);return c(g)}function d(h,m){const y=t[h]-i.get(),g=u(y,m);return{index:h,distance:g}}function p(h,m){const y=i.get()+h,{index:g,distance:v}=l(y),b=!e&&o(y);if(!m||b)return{index:g,distance:h};const S=t[g]-v,E=h+u(S,0);return{index:g,distance:E}}return{byDistance:p,byIndex:d,shortcut:u}}function s7(e,t,n,r,i,o,s){function a(d){const p=d.distance,f=d.index!==t.get();o.add(p),p&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),f&&(n.set(t.get()),t.set(d.index),s.emit("select"))}function c(d,p){const f=r.byDistance(d,p);a(f)}function l(d,p){const f=t.clone().set(d),h=r.byIndex(f.get(),p);a(h)}return{distance:c,index:l}}function ad(e){let t=e;function n(){return t}function r(c){t=s(c)}function i(c){t+=s(c)}function o(c){t-=s(c)}function s(c){return gm(c)?c:c.get()}return{get:n,set:r,add:i,subtract:o}}function bE(e,t,n){const r=e.scroll==="x"?s:a,i=n.style;let o=!1;function s(p){return`translate3d(${p}px,0px,0px)`}function a(p){return`translate3d(0px,${p}px,0px)`}function c(p){o||(i.transform=r(t.apply(p)))}function l(p){o=!p}function u(){o||(i.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:u,to:c,toggleActive:l}}function a7(e,t,n,r,i,o,s,a,c){const l=za(i),u=za(i).reverse(),d=m().concat(y());function p(E,_){return E.reduce((I,P)=>I-i[P],_)}function f(E,_){return E.reduce((I,P)=>p(I,_)>0?I.concat([P]):I,[])}function h(E,_){const I=_==="start",P=I?-r:r,$=s.findSlideBounds([P]);return E.map(O=>{const q=I?0:-r,H=I?r:0,F=$.filter(D=>D.index===O)[0][I?"end":"start"];return{index:O,slideLocation:ad(-1),translate:bE(e,t,c[O]),target:()=>a.get()>F?q:H}})}function m(){const E=o[0]-1,_=f(u,E);return h(_,"end")}function y(){const E=n-o[0]-1,_=f(l,E);return h(_,"start")}function g(){return d.every(({index:E})=>{const _=l.filter(I=>I!==E);return p(_,n)<=.1})}function v(){d.forEach(E=>{const{target:_,translate:I,slideLocation:P}=E,$=_();$!==P.get()&&(I.to($),P.set($))})}function b(){d.forEach(E=>E.translate.clear())}return{canLoop:g,clear:b,loop:v,loopPoints:d}}function c7(e,t){let n,r=!1;function i(a,c){if(!c)return;function l(u){for(const d of u)if(d.type==="childList"){a.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(u=>{r||(vm(c)||c(a,u))&&l(u)}),n.observe(e,{childList:!0})}function o(){n&&n.disconnect(),r=!0}return{init:i,destroy:o}}function l7(e,t,n,r,i,o,s){const{removeOffset:a,constrain:c}=i,l=.5,u=o?[0,t,-t]:[0],d=f(u,s);function p(y){const g=y||0;return n.map(v=>Ni(l,v-l).constrain(v*g))}function f(y,g){const v=y||u,b=p(g);return v.reduce((S,E)=>{const _=r.map((I,P)=>({start:I-n[P]+b[P]+E,end:I+e-b[P]+E,index:P}));return S.concat(_)},[])}function h(y,g){const v=o?a(y):c(y);return(g||d).reduce((S,E)=>{const{index:_,start:I,end:P}=E,$=S.includes(_),O=I<v&&P>v;return!$&&O?S.concat([_]):S},[])}return{check:h,findSlideBounds:f}}function u7(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:c}=e,l=n[0]&&i,u=h(),d=m(),p=n.map(s),f=y();function h(){if(!l)return 0;const v=n[0];return Zt(t[a]-v[a])}function m(){if(!l)return 0;const v=o.getComputedStyle(ui(r));return parseFloat(v.getPropertyValue(`margin-${c}`))}function y(){return n.map((v,b,S)=>{const E=!b,_=b===od(S);return E?p[b]+u:_?p[b]+d:S[b+1][a]-v[a]}).map(Zt)}return{slideSizes:p,slideSizesWithGaps:f}}function d7(e,t,n){const r=gm(n);function i(c,l){return za(c).filter(u=>u%l===0).map(u=>c.slice(u,u+l))}function o(c){return za(c).reduce((l,u)=>{const p=t.slice(ui(l),u+1).reduce((f,h)=>f+h,0);return!u||p>e?l.concat(u):l},[]).map((l,u,d)=>c.slice(l,d[u+1]))}function s(c){return r?i(c,n):o(c)}return{groupSlides:s}}function f7(e,t,n,r,i,o,s,a){const{align:c,axis:l,direction:u,startIndex:d,inViewThreshold:p,loop:f,duration:h,dragFree:m,dragThreshold:y,slidesToScroll:g,skipSnaps:v,containScroll:b}=o,S=t.getBoundingClientRect(),E=n.map(ce=>ce.getBoundingClientRect()),_=WZ(u),I=HZ(l,u),P=I.measureSize(S),$=YZ(P),O=VZ(c,P),q=!f&&!!b,H=f||!!b,{slideSizes:B,slideSizesWithGaps:F}=u7(I,S,E,n,H,i),D=d7(P,F,g),{snaps:M,snapsAligned:Z}=i7(I,O,S,E,F,D,q),W=-ui(M)+ui(F),{snapsContained:Q}=e7(P,W,Z,b),C=q?Q:Z,{limit:te}=t7(W,C,f),fe=vE(od(C),d,f),A=fe.clone(),we=za(n),Te=({dragHandler:ce,scrollBody:ue,scrollBounds:Ne,eventHandler:Se,animation:Be,options:{loop:pt}})=>{const Ge=ce.pointerDown();pt||Ne.constrain(Ge);const K=ue.seek().settled();K&&!Ge&&(Be.stop(),Se.emit("settle")),K||Se.emit("scroll")},Ee=({scrollBody:ce,translate:ue,location:Ne,offsetLocation:Se,scrollLooper:Be,slideLooper:pt,options:{loop:Ge}},K)=>{const ie=ce.velocity();Se.set(Ne.get()-ie+ie*K),Ge&&(Be.loop(ce.direction()),pt.loop()),ue.to(Se.get())},$e={start:()=>a.start(oe),stop:()=>a.stop(oe),update:()=>Te(oe),render:ce=>Ee(oe,ce)},Fe=.68,Pe=C[fe.get()],he=ad(Pe),de=ad(Pe),_e=ad(Pe),pe=XZ(he,_e,h,Fe),De=o7(f,C,W,te,_e),et=s7($e,fe,A,De,pe,_e,s),L=l7(P,W,B,M,te,f,p),oe={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:S,slideRects:E,animation:$e,axis:I,direction:_,dragHandler:KZ(I,_,e,r,i,_e,JZ(I,i),he,$e,et,pe,De,fe,s,$,m,y,v,Fe),eventStore:Za(),percentOfView:$,index:fe,indexPrevious:A,limit:te,location:he,offsetLocation:de,options:o,resizeHandler:GZ(t,s,i,n,I),scrollBody:pe,scrollBounds:QZ(te,he,_e,pe,$),scrollLooper:n7(W,te,de,[he,de,_e]),scrollProgress:r7(te),scrollSnaps:C,scrollTarget:De,scrollTo:et,slideLooper:a7(I,_,P,W,F,C,L,de,n),slidesHandler:c7(t,s),slidesInView:L,slideIndexes:we,slidesToScroll:D,target:_e,translate:bE(I,_,t)};return oe}function p7(e){const t=16.666666666666668;let n=[],r=null,i=0,o=0;function s(d){r||(r=d);const p=d-r;for(r=d,i+=p;i>=t;)n.forEach(({animation:h})=>h.update()),i-=t;const f=Zt(i/t);n.forEach(({animation:h})=>h.render(f)),o&&e.requestAnimationFrame(s)}function a(d){n.includes(d)||n.push(d),!o&&(o=e.requestAnimationFrame(s))}function c(d){n=n.filter(p=>p!==d),!n.length&&(e.cancelAnimationFrame(o),r=null,i=0,o=0)}function l(){r=null,i=0}return{start:a,stop:c,reset:l,window:e}}function h7(){const e={};let t;function n(c){t=c}function r(c){return e[c]||[]}function i(c){return r(c).forEach(l=>l(t,c)),a}function o(c,l){return e[c]=r(c).concat([l]),a}function s(c,l){return e[c]=r(c).filter(u=>u!==l),a}const a={init:n,emit:i,off:s,on:o};return a}const m7={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function y7(e){function t(o,s){return yE(o,s||{})}function n(o){const s=o.breakpoints||{},a=sd(s).filter(c=>e.matchMedia(c).matches).map(c=>s[c]).reduce((c,l)=>t(c,l),{});return t(o,a)}function r(o){return o.map(s=>sd(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function g7(e){let t=[];function n(o,s){return t=o.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(s,e)),o.reduce((a,c)=>Object.assign(a,{[c.name]:c}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function vs(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=y7(i),s=g7(o),a=Za(),c=Za(),l=h7(),{animationRealms:u}=vs,{mergeOptions:d,optionsAtMedia:p,optionsMediaQueries:f}=o,{on:h,off:m,emit:y}=l,g=B;let v=!1,b,S=d(m7,vs.globalOptions),E=d(S),_=[],I,P,$;function O(){const{container:pe,slides:De}=E;P=(hE(pe)?e.querySelector(pe):pe)||e.children[0];const L=hE(De)?P.querySelectorAll(De):De;$=[].slice.call(L||P.children)}function q(pe,De){const et=f7(e,P,$,r,i,pe,l,De);if(pe.loop&&!et.slideLooper.canLoop()){const L=Object.assign({},pe,{loop:!1});return q(L,De)}return et}function H(pe,De){if(v)return;const et=u.find(oe=>oe.window===i),L=et||p7(i);et||u.push(L),S=d(S,pe),E=p(S),_=De||_,O(),b=q(E,L),f([S,..._.map(({options:oe})=>oe)]).forEach(oe=>a.add(oe,"change",B)),E.active&&(b.translate.to(b.location.get()),b.eventHandler.init(_e),b.resizeHandler.init(_e,E.watchResize),b.slidesHandler.init(_e,E.watchSlides),c.add(r,"visibilitychange",()=>{r.hidden&&L.reset()}),b.options.loop&&b.slideLooper.loop(),P.offsetParent&&$.length&&b.dragHandler.init(_e,E.watchDrag),I=s.init(_,_e))}function B(pe,De){const et=Te();F(),H(d({startIndex:et},pe),De),l.emit("reInit")}function F(){b.dragHandler.destroy(),b.animation.stop(),b.eventStore.clear(),b.translate.clear(),b.slideLooper.clear(),b.resizeHandler.destroy(),b.slidesHandler.destroy(),s.destroy(),a.clear(),c.clear()}function D(){v||(v=!0,a.clear(),F(),l.emit("destroy"))}function M(pe){const De=b[pe?"target":"location"].get(),et=E.loop?"removeOffset":"constrain";return b.slidesInView.check(b.limit[et](De))}function Z(pe){const De=M(pe);return b.slideIndexes.filter(et=>!De.includes(et))}function W(pe,De,et){!E.active||v||(b.scrollBody.useBaseFriction().useDuration(De?0:E.duration),b.scrollTo.index(pe,et||0))}function Q(pe){const De=b.index.add(1).get();W(De,pe===!0,-1)}function C(pe){const De=b.index.add(-1).get();W(De,pe===!0,1)}function te(){return b.index.add(1).get()!==Te()}function fe(){return b.index.add(-1).get()!==Te()}function A(){return b.scrollSnaps.map(b.scrollProgress.get)}function we(){return b.scrollProgress.get(b.location.get())}function Te(){return b.index.get()}function Ee(){return b.indexPrevious.get()}function $e(){return I}function Fe(){return b}function Pe(){return e}function he(){return P}function de(){return $}const _e={canScrollNext:te,canScrollPrev:fe,containerNode:he,internalEngine:Fe,destroy:D,off:m,on:h,emit:y,plugins:$e,previousScrollSnap:Ee,reInit:g,rootNode:Pe,scrollNext:Q,scrollPrev:C,scrollProgress:we,scrollSnapList:A,scrollTo:W,selectedScrollSnap:Te,slideNodes:de,slidesInView:M,slidesNotInView:Z};return H(t,n),setTimeout(()=>l.emit("init"),0),_e}vs.animationRealms=[],vs.globalOptions=void 0;function wm(e={},t=[]){const n=w.useRef(e),r=w.useRef(t),[i,o]=w.useState(),[s,a]=w.useState(),c=w.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return w.useEffect(()=>{if(BZ()&&s){vs.globalOptions=wm.globalOptions;const l=vs(s,n.current,r.current);return o(l),()=>l.destroy()}else o(void 0)},[s,o]),w.useEffect(()=>{ym(n.current,e)||(n.current=e,c())},[e,c]),w.useEffect(()=>{zZ(r.current,t)||(r.current=t,c())},[t,c]),[a,i]}wm.globalOptions=void 0;function v7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",clipRule:"evenodd"}))}const b7=N.forwardRef(v7);function w7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"}))}const x7=N.forwardRef(w7);function _7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0016.5 9h-1.875a1.875 1.875 0 01-1.875-1.875V5.25A3.75 3.75 0 009 1.5H5.625zM7.5 15a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5A.75.75 0 017.5 15zm.75 2.25a.75.75 0 000 1.5H12a.75.75 0 000-1.5H8.25z",clipRule:"evenodd"}),N.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0114.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 013.434 1.279 9.768 9.768 0 00-6.963-6.963z"}))}const S7=N.forwardRef(_7);function E7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{d:"M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z"}),N.createElement("path",{d:"M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"}))}const k7=N.forwardRef(E7);function C7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 00-.945-5.003 12.754 12.754 0 01-4.339 2.708 18.991 18.991 0 01-.214 4.772 17.165 17.165 0 005.498-2.477zM14.634 15.55a17.324 17.324 0 00.332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 00.332 4.647 17.385 17.385 0 005.268 0zM9.772 17.119a18.963 18.963 0 004.456 0A17.182 17.182 0 0112 21.724a17.18 17.18 0 01-2.228-4.605zM7.777 15.23a18.87 18.87 0 01-.214-4.774 12.753 12.753 0 01-4.34-2.708 9.711 9.711 0 00-.944 5.004 17.165 17.165 0 005.498 2.477zM21.356 14.752a9.765 9.765 0 01-7.478 6.817 18.64 18.64 0 001.988-4.718 18.627 18.627 0 005.49-2.098zM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 001.988 4.718 9.765 9.765 0 01-7.478-6.816zM13.878 2.43a9.755 9.755 0 016.116 3.986 11.267 11.267 0 01-3.746 2.504 18.63 18.63 0 00-2.37-6.49zM12 2.276a17.152 17.152 0 012.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0112 2.276zM10.122 2.43a18.629 18.629 0 00-2.37 6.49 11.266 11.266 0 01-3.746-2.504 9.754 9.754 0 016.116-3.985z"}))}const T7=N.forwardRef(C7);function A7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"}))}const O7=N.forwardRef(A7);function I7({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M1.5 4.5a3 3 0 013-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 01-.694 1.955l-1.293.97c-.135.101-.164.249-.126.352a11.285 11.285 0 006.697 6.697c.103.038.25.009.352-.126l.97-1.293a1.875 1.875 0 011.955-.694l4.423 1.105c.834.209 1.42.959 1.42 1.82V19.5a3 3 0 01-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5z",clipRule:"evenodd"}))}const R7=N.forwardRef(I7),P7=w.forwardRef(({type:e,styles:t,blocks:n},r)=>{const[i,o]=wm({skipSnaps:!0}),[s,a]=w.useState(!0),[c,l]=w.useState(!0),u=w.useCallback(()=>o&&o.scrollPrev(),[o]),d=w.useCallback(()=>o&&o.scrollNext(),[o]),p=t==null?void 0:t[e],f=w.useCallback(h=>{a(!h.canScrollPrev()),l(!h.canScrollNext())},[]);return w.useEffect(()=>{o&&(f(o),o.on("reInit",f),o.on("select",f))},[o,f]),U.jsxs("div",{...p==null?void 0:p.container,"data-container":"carousel",ref:i,children:[U.jsx("div",{ref:r,...p==null?void 0:p.slidesContainer,children:n.map((h,m)=>U.jsx(ks,{styles:t,block:h},m))}),U.jsx(b7,{...p==null?void 0:p.backButton,"data-disabled":s?"":void 0,onClick:u}),U.jsx(x7,{...p==null?void 0:p.nextButton,"data-disabled":c?"":void 0,onClick:d})]})}),bs=Math.min,er=Math.max,cd=Math.round,ws=Math.floor,ji=e=>({x:e,y:e});function wE(e,t,n){return er(e,bs(t,n))}function ld(e,t){return typeof e=="function"?e(t):e}function Va(e){return e.split("-")[0]}function xm(e){return e.split("-")[1]}function xE(e){return e==="x"?"y":"x"}function $7(e){return e==="y"?"height":"width"}function Ha(e){return["top","bottom"].includes(Va(e))?"y":"x"}function D7(e){return xE(Ha(e))}function N7(e){return{top:0,right:0,bottom:0,left:0,...e}}function j7(e){return typeof e!="number"?N7(e):{top:e,right:e,bottom:e,left:e}}function ud(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Mi(e){return _E(e)?(e.nodeName||"").toLowerCase():"#document"}function tr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function di(e){var t;return(t=(_E(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _E(e){return e instanceof Node||e instanceof tr(e).Node}function Jt(e){return e instanceof Element||e instanceof tr(e).Element}function Pn(e){return e instanceof HTMLElement||e instanceof tr(e).HTMLElement}function _m(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tr(e).ShadowRoot}function Wa(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function M7(e){return["table","td","th"].includes(Mi(e))}function Sm(e){const t=Em(),n=nr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function q7(e){let t=xo(e);for(;Pn(t)&&!Ka(t);){if(Sm(t))return t;t=xo(t)}return null}function Em(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ka(e){return["html","body","#document"].includes(Mi(e))}function nr(e){return tr(e).getComputedStyle(e)}function dd(e){return Jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function xo(e){if(Mi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_m(e)&&e.host||di(e);return _m(t)?t.host:t}function SE(e){const t=xo(e);return Ka(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pn(t)&&Wa(t)?t:SE(t)}function qi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=SE(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=tr(i);return o?t.concat(s,s.visualViewport||[],Wa(i)?i:[],s.frameElement&&n?qi(s.frameElement):[]):t.concat(i,qi(i,[],n))}function Li(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Wn(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_m(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function EE(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function L7(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function kE(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(EE())||t.test(L7()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function CE(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function TE(){return/apple/i.test(navigator.vendor)}function F7(){return EE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function AE(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function U7(e){return"nativeEvent"in e}function B7(e){return e.matches("html,body")}function Tr(e){return(e==null?void 0:e.ownerDocument)||document}function km(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function OE(e){return"composedPath"in e?e.composedPath()[0]:e.target}const z7="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function IE(e){return Pn(e)&&e.matches(z7)}function xn(e){e.preventDefault(),e.stopPropagation()}function RE(e,t,n){let{reference:r,floating:i}=e;const o=Ha(t),s=D7(t),a=$7(s),c=Va(t),l=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(xm(t)){case"start":f[s]-=p*(n&&l?-1:1);break;case"end":f[s]+=p*(n&&l?-1:1);break}return f}const Z7=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=RE(l,r,c),p=r,f={},h=0;for(let m=0;m<a.length;m++){const{name:y,fn:g}=a[m],{x:v,y:b,data:S,reset:E}=await g({x:u,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:f,rects:l,platform:s,elements:{reference:e,floating:t}});if(u=v??u,d=b??d,f={...f,[y]:{...f[y],...S}},E&&h<=50){h++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(l=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:u,y:d}=RE(l,p,c)),m=-1;continue}}return{x:u,y:d,placement:p,strategy:i,middlewareData:f}};async function PE(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=ld(t,e),h=j7(f),y=a[p?d==="floating"?"reference":"floating":d],g=ud(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),v=d==="floating"?{...s.floating,x:r,y:i}:s.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),S=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},E=ud(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:b,strategy:c}):v);return{top:(g.top-E.top+h.top)/S.y,bottom:(E.bottom-g.bottom+h.bottom)/S.y,left:(g.left-E.left+h.left)/S.x,right:(E.right-g.right+h.right)/S.x}}async function V7(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Va(n),a=xm(n),c=Ha(n)==="y",l=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,d=ld(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof h=="number"&&(f=a==="end"?h*-1:h),c?{x:f*u,y:p*l}:{x:p*l,y:f*u}}const H7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await V7(t,e);return{x:n+i.x,y:r+i.y,data:i}}}},W7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:g,y:v}=y;return{x:g,y:v}}},...c}=ld(e,t),l={x:n,y:r},u=await PE(t,c),d=Ha(Va(i)),p=xE(d);let f=l[p],h=l[d];if(o){const y=p==="y"?"top":"left",g=p==="y"?"bottom":"right",v=f+u[y],b=f-u[g];f=wE(v,f,b)}if(s){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=h+u[y],b=h-u[g];h=wE(v,h,b)}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},K7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=ld(e,t),c=await PE(t,a),l=Va(n),u=xm(n),d=Ha(n)==="y",{width:p,height:f}=r.floating;let h,m;l==="top"||l==="bottom"?(h=l,m=u===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(m=l,h=u==="end"?"top":"bottom");const y=f-c[h],g=p-c[m],v=!t.middlewareData.shift;let b=y,S=g;if(d){const _=p-c.left-c.right;S=u||v?bs(g,_):_}else{const _=f-c.top-c.bottom;b=u||v?bs(y,_):_}if(v&&!u){const _=er(c.left,0),I=er(c.right,0),P=er(c.top,0),$=er(c.bottom,0);d?S=p-2*(_!==0||I!==0?_+I:er(c.left,c.right)):b=f-2*(P!==0||$!==0?P+$:er(c.top,c.bottom))}await s({...t,availableWidth:S,availableHeight:b});const E=await i.getDimensions(o.floating);return p!==E.width||f!==E.height?{reset:{rects:!0}}:{}}}};function $E(e){const t=nr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Pn(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=cd(n)!==o||cd(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Cm(e){return Jt(e)?e:e.contextElement}function xs(e){const t=Cm(e);if(!Pn(t))return ji(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=$E(t);let s=(o?cd(n.width):n.width)/r,a=(o?cd(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const J7=ji(0);function DE(e){const t=tr(e);return!Em()||!t.visualViewport?J7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Y7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tr(e)?!1:t}function _o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Cm(e);let s=ji(1);t&&(r?Jt(r)&&(s=xs(r)):s=xs(e));const a=Y7(o,n,r)?DE(o):ji(0);let c=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const p=tr(o),f=r&&Jt(r)?tr(r):r;let h=p.frameElement;for(;h&&r&&f!==p;){const m=xs(h),y=h.getBoundingClientRect(),g=nr(h),v=y.left+(h.clientLeft+parseFloat(g.paddingLeft))*m.x,b=y.top+(h.clientTop+parseFloat(g.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=v,l+=b,h=tr(h).frameElement}}return ud({width:u,height:d,x:c,y:l})}function G7(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Pn(n),o=di(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=ji(1);const c=ji(0);if((i||!i&&r!=="fixed")&&((Mi(n)!=="body"||Wa(o))&&(s=dd(n)),Pn(n))){const l=_o(n);a=xs(n),c.x=l.x+n.clientLeft,c.y=l.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+c.x,y:t.y*a.y-s.scrollTop*a.y+c.y}}function X7(e){return Array.from(e.getClientRects())}function NE(e){return _o(di(e)).left+dd(e).scrollLeft}function Q7(e){const t=di(e),n=dd(e),r=e.ownerDocument.body,i=er(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=er(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+NE(e);const a=-n.scrollTop;return nr(r).direction==="rtl"&&(s+=er(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function e9(e,t){const n=tr(e),r=di(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const l=Em();(!l||l&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}function t9(e,t){const n=_o(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Pn(e)?xs(e):ji(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,c=i*o.x,l=r*o.y;return{width:s,height:a,x:c,y:l}}function jE(e,t,n){let r;if(t==="viewport")r=e9(e,n);else if(t==="document")r=Q7(di(e));else if(Jt(t))r=t9(t,n);else{const i=DE(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return ud(r)}function ME(e,t){const n=xo(e);return n===t||!Jt(n)||Ka(n)?!1:nr(n).position==="fixed"||ME(n,t)}function n9(e,t){const n=t.get(e);if(n)return n;let r=qi(e,[],!1).filter(a=>Jt(a)&&Mi(a)!=="body"),i=null;const o=nr(e).position==="fixed";let s=o?xo(e):e;for(;Jt(s)&&!Ka(s);){const a=nr(s),c=Sm(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Wa(s)&&!c&&ME(e,s))?r=r.filter(u=>u!==s):i=a,s=xo(s)}return t.set(e,r),r}function r9(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?n9(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const d=jE(t,u,i);return l.top=er(d.top,l.top),l.right=bs(d.right,l.right),l.bottom=bs(d.bottom,l.bottom),l.left=er(d.left,l.left),l},jE(t,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function i9(e){return $E(e)}function o9(e,t,n){const r=Pn(t),i=di(t),o=n==="fixed",s=_o(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=ji(0);if(r||!r&&!o)if((Mi(t)!=="body"||Wa(i))&&(a=dd(t)),r){const l=_o(t,!0,o,t);c.x=l.x+t.clientLeft,c.y=l.y+t.clientTop}else i&&(c.x=NE(i));return{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function qE(e,t){return!Pn(e)||nr(e).position==="fixed"?null:t?t(e):e.offsetParent}function LE(e,t){const n=tr(e);if(!Pn(e))return n;let r=qE(e,t);for(;r&&M7(r)&&nr(r).position==="static";)r=qE(r,t);return r&&(Mi(r)==="html"||Mi(r)==="body"&&nr(r).position==="static"&&!Sm(r))?n:r||q7(e)||n}const s9=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||LE,o=this.getDimensions;return{reference:o9(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function a9(e){return nr(e).direction==="rtl"}const c9={convertOffsetParentRelativeRectToViewportRelativeRect:G7,getDocumentElement:di,getClippingRect:r9,getOffsetParent:LE,getElementRects:s9,getClientRects:X7,getDimensions:i9,getScale:xs,isElement:Jt,isRTL:a9};function l9(e,t){let n=null,r;const i=di(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const{left:l,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f=ws(u),h=ws(i.clientWidth-(l+d)),m=ws(i.clientHeight-(u+p)),y=ws(l),v={rootMargin:-f+"px "+-h+"px "+-m+"px "+-y+"px",threshold:er(0,bs(1,c))||1};let b=!0;function S(E){const _=E[0].intersectionRatio;if(_!==c){if(!b)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},100)}b=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(e)}return s(!0),o}function u9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Cm(e),u=i||o?[...l?qi(l):[],...qi(t)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const d=l&&a?l9(l,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(g=>{let[v]=g;v&&v.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),l&&!c&&f.observe(l),f.observe(t));let h,m=c?_o(e):null;c&&y();function y(){const g=_o(e);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,h=requestAnimationFrame(y)}return n(),()=>{u.forEach(g=>{i&&g.removeEventListener("scroll",n),o&&g.removeEventListener("resize",n)}),d&&d(),f&&f.disconnect(),f=null,c&&cancelAnimationFrame(h)}}const d9=(e,t,n)=>{const r=new Map,i={platform:c9,...n},o={...i.platform,_c:r};return Z7(e,t,{...i,platform:o})};var fd=typeof document<"u"?w.useLayoutEffect:w.useEffect;function pd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!pd(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!pd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function FE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function UE(e,t){const n=FE(e);return Math.round(t*n)/n}function BE(e){const t=N.useRef(e);return fd(()=>{t.current=e}),t}function f9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=N.useState(r);pd(p,r)||f(r);const[h,m]=N.useState(null),[y,g]=N.useState(null),v=N.useCallback(M=>{M!=_.current&&(_.current=M,m(M))},[m]),b=N.useCallback(M=>{M!==I.current&&(I.current=M,g(M))},[g]),S=o||h,E=s||y,_=N.useRef(null),I=N.useRef(null),P=N.useRef(u),$=BE(c),O=BE(i),q=N.useCallback(()=>{if(!_.current||!I.current)return;const M={placement:t,strategy:n,middleware:p};O.current&&(M.platform=O.current),d9(_.current,I.current,M).then(Z=>{const W={...Z,isPositioned:!0};H.current&&!pd(P.current,W)&&(P.current=W,qC.flushSync(()=>{d(W)}))})},[p,t,n,O]);fd(()=>{l===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[l]);const H=N.useRef(!1);fd(()=>(H.current=!0,()=>{H.current=!1}),[]),fd(()=>{if(S&&(_.current=S),E&&(I.current=E),S&&E){if($.current)return $.current(S,E,q);q()}},[S,E,q,$]);const B=N.useMemo(()=>({reference:_,floating:I,setReference:v,setFloating:b}),[v,b]),F=N.useMemo(()=>({reference:S,floating:E}),[S,E]),D=N.useMemo(()=>{const M={position:n,left:0,top:0};if(!F.floating)return M;const Z=UE(F.floating,u.x),W=UE(F.floating,u.y);return a?{...M,transform:"translate("+Z+"px, "+W+"px)",...FE(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:W}},[n,a,F.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:q,refs:B,elements:F,floatingStyles:D}),[u,q,B,F,D])}/*!
|
|
360
360
|
* tabbable 6.2.0
|
|
361
361
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
362
|
-
*/var p9=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Tm=p9.join(","),zE=typeof Element>"u",Ja=zE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,hd=!zE&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},md=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&e(t.parentNode);return s},h9=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},m9=function(t,n,r){if(md(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Tm));return n&&Ja.call(t,Tm)&&i.unshift(t),i=i.filter(r),i},y9=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!md(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),c=a.length?a:s.children,l=e(c,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:s,candidates:l})}else{var u=Ja.call(s,Tm);u&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!md(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&h){var f=e(d===!0?s.children:d.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:s,candidates:f})}else o.unshift.apply(o,s.children)}}return i},ZE=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},VE=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||h9(t))&&!ZE(t)?0:t.tabIndex},g9=function(t,n){var r=VE(t);return r<0&&n&&!ZE(t)?0:r},v9=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},HE=function(t){return t.tagName==="INPUT"},b9=function(t){return HE(t)&&t.type==="hidden"},w9=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},x9=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},_9=function(t){if(!t.name)return!0;var n=t.form||hd(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=x9(i,t.form);return!o||o===t},S9=function(t){return HE(t)&&t.type==="radio"},E9=function(t){return S9(t)&&!_9(t)},k9=function(t){var n,r=t&&hd(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,c;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!o&&i;){var l,u,d;r=hd(i),i=(l=r)===null||l===void 0?void 0:l.host,o=!!((u=i)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return o},WE=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},C9=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=Ja.call(t,"details>summary:first-of-type"),s=o?t.parentElement:t;if(Ja.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var c=t.parentElement,l=hd(t);if(c&&!c.shadowRoot&&i(c)===!0)return WE(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c}t=a}if(k9(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return WE(t);return!1},T9=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ja.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},A9=function(t,n){return!(n.disabled||md(n)||b9(n)||C9(n,t)||w9(n)||T9(n))},KE=function(t,n){return!(E9(n)||VE(n)<0||!A9(t,n))},O9=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},I9=function e(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,c=g9(a,s),l=s?e(i.candidates):a;c===0?s?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:c,item:i,isScope:s,content:l})}),r.sort(v9).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Am=function(t,n){n=n||{};var r;return n.getShadowRoot?r=y9([t],n.includeContainer,{filter:KE.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:O9}):r=m9(t,n.includeContainer,KE.bind(null,n)),I9(r)};const Om="ArrowUp",yd="ArrowDown",_s="ArrowLeft",Ya="ArrowRight";function gd(e,t,n){return Math.floor(e/t)!==n}function Ga(e,t){return t<0||t>=e.current.length}function Im(e,t){return $n(e,{disabledIndices:t})}function JE(e,t){return $n(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $n(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var c,l;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(c=s[a])!=null&&c.hasAttribute("disabled")||((l=s[a])==null?void 0:l.getAttribute("aria-disabled"))==="true"));return a}function R9(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:c,prevIndex:l,stopEvent:u=!1}=t,d=l;if(n.key===Om){if(u&&xn(n),l===-1)d=c;else if(d=$n(e,{startingIndex:d,amount:o,decrement:!0,disabledIndices:s}),i&&(l-o<a||d<0)){const h=l%o,f=c%o,p=c-(f-h);f===h?d=c:d=f>h?p:p-o}Ga(e,d)&&(d=l)}if(n.key===yd&&(u&&xn(n),l===-1?d=a:(d=$n(e,{startingIndex:l,amount:o,disabledIndices:s}),i&&l+o>c&&(d=$n(e,{startingIndex:l%o-o,amount:o,disabledIndices:s}))),Ga(e,d)&&(d=l)),r==="both"){const h=ws(l/o);n.key===Ya&&(u&&xn(n),l%o!==o-1?(d=$n(e,{startingIndex:l,disabledIndices:s}),i&&gd(d,o,h)&&(d=$n(e,{startingIndex:l-l%o-1,disabledIndices:s}))):i&&(d=$n(e,{startingIndex:l-l%o-1,disabledIndices:s})),gd(d,o,h)&&(d=l)),n.key===_s&&(u&&xn(n),l%o!==0?(d=$n(e,{startingIndex:l,disabledIndices:s,decrement:!0}),i&&gd(d,o,h)&&(d=$n(e,{startingIndex:l+(o-l%o),decrement:!0,disabledIndices:s}))):i&&(d=$n(e,{startingIndex:l+(o-l%o),decrement:!0,disabledIndices:s})),gd(d,o,h)&&(d=l));const f=ws(c/o)===h;Ga(e,d)&&(i&&f?d=n.key===_s?c:$n(e,{startingIndex:l-l%o-1,disabledIndices:s}):d=l)}return d}let YE=0;function fi(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(YE);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():YE=requestAnimationFrame(o)}var an=typeof document<"u"?w.useLayoutEffect:w.useEffect;function vd(){return vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vd.apply(this,arguments)}let Rm=!1,P9=0;const GE=()=>"floating-ui-"+P9++;function $9(){const[e,t]=N.useState(()=>Rm?GE():void 0);return an(()=>{e==null&&t(GE())},[]),N.useEffect(()=>{Rm||(Rm=!0)},[]),e}const Pm=N["useId".toString()]||$9;function D9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const N9=N.createContext(null),j9=N.createContext(null),XE=()=>{var e;return((e=N.useContext(N9))==null?void 0:e.id)||null},bd=()=>N.useContext(j9);function Xa(e){return"data-floating-ui-"+e}function Fi(e){const t=w.useRef(e);return an(()=>{t.current=e}),t}function M9(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function Ss(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function q9(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),Ss(e,o).forEach(c=>{i(c.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let Es=new WeakMap,wd=new WeakSet,xd={},$m=0;const L9=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,QE=e=>e&&(e.host||QE(e.parentNode)),F9=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=QE(n);return e.contains(r)?r:null}).filter(n=>n!=null);function U9(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=F9(t,e),a=new Set,c=new Set(s),l=[];xd[i]||(xd[i]=new WeakMap);const u=xd[i];s.forEach(d),h(t),a.clear();function d(f){!f||a.has(f)||(a.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,p=>{if(a.has(p))h(p);else{const m=o?p.getAttribute(o):null,y=m!==null&&m!=="false",v=(Es.get(p)||0)+1,g=(u.get(p)||0)+1;Es.set(p,v),u.set(p,g),l.push(p),v===1&&y&&wd.add(p),g===1&&p.setAttribute(i,""),!y&&o&&p.setAttribute(o,"true")}})}return $m++,()=>{l.forEach(f=>{const p=(Es.get(f)||0)-1,m=(u.get(f)||0)-1;Es.set(f,p),u.set(f,m),p||(!wd.has(f)&&o&&f.removeAttribute(o),wd.delete(f)),m||f.removeAttribute(i)}),$m--,$m||(Es=new WeakMap,Es=new WeakMap,wd=new WeakSet,xd={})}}function ek(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Tr(e[0]).body;return U9(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Dm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tk(e,t){const n=Am(e,Dm());t==="prev"&&n.reverse();const r=n.indexOf(Li(Tr(e)));return n.slice(r+1)[0]}function nk(){return tk(document.body,"next")}function rk(){return tk(document.body,"prev")}function Qa(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Wn(n,r)}function B9(e){Am(e,Dm()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function z9(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Nm={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let Z9;function ik(e){e.key==="Tab"&&(e.target,clearTimeout(Z9))}const _d=N.forwardRef(function(t,n){const[r,i]=N.useState();an(()=>(TE()&&i("button"),document.addEventListener("keydown",ik),()=>{document.removeEventListener("keydown",ik)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Xa("focus-guard")]:"",style:Nm};return N.createElement("span",vd({},t,o))}),ok=N.createContext(null);function V9(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=N.useState(null),o=Pm(),s=sk(),a=N.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),c=N.useRef();return an(()=>()=>{r==null||r.remove()},[r,a]),an(()=>{if(c.current===a)return;c.current=a;const{id:l,root:u,portalContext:d,uniqueId:h}=a,f=l?document.getElementById(l):null,p=Xa("portal");if(f){const m=document.createElement("div");m.id=h,m.setAttribute(p,""),f.appendChild(m),i(m)}else{let m=u||(d==null?void 0:d.portalNode);m&&!Jt(m)&&(m=m.current),m=m||document.body;let y=null;l&&(y=document.createElement("div"),y.id=l,m.appendChild(y));const v=document.createElement("div");v.id=h,v.setAttribute(p,""),m=y||m,m.appendChild(v),i(v)}},[a]),r}function H9(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=V9({id:n,root:r}),[s,a]=N.useState(null),c=N.useRef(null),l=N.useRef(null),u=N.useRef(null),d=N.useRef(null),h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return N.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function f(p){o&&Qa(p)&&(p.type==="focusin"?z9:B9)(o)}return o.addEventListener("focusin",f,!0),o.addEventListener("focusout",f,!0),()=>{o.removeEventListener("focusin",f,!0),o.removeEventListener("focusout",f,!0)}},[o,i,s==null?void 0:s.modal]),N.createElement(ok.Provider,{value:N.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&N.createElement(_d,{"data-type":"outside",ref:c,onFocus:f=>{if(Qa(f,o)){var p;(p=u.current)==null||p.focus()}else{const m=rk()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus()}}}),h&&o&&N.createElement("span",{"aria-owns":o.id,style:Nm}),o&&Ar.createPortal(t,o),h&&o&&N.createElement(_d,{"data-type":"outside",ref:l,onFocus:f=>{if(Qa(f,o)){var p;(p=d.current)==null||p.focus()}else{const m=nk()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,f.nativeEvent))}}}))}const sk=()=>N.useContext(ok),W9=N.forwardRef(function(t,n){return N.createElement("button",vd({},t,{type:"button",ref:n,tabIndex:-1,style:Nm}))});function K9(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:c=!0,visuallyHiddenDismiss:l=!1,closeOnFocusOut:u=!0}=e,{open:d,refs:h,nodeId:f,onOpenChange:p,events:m,dataRef:y,elements:{domReference:v,floating:g}}=t,b=L9()?o:!0,S=Fi(i),E=Fi(s),_=Fi(a),I=bd(),P=sk(),$=typeof s=="number"&&s<0,O=N.useRef(null),q=N.useRef(null),H=N.useRef(!1),B=N.useRef(null),F=N.useRef(!1),D=P!=null,M=v&&v.getAttribute("role")==="combobox"&&IE(v)&&$,Z=N.useCallback(function(te){return te===void 0&&(te=g),te?Am(te,Dm()):[]},[g]),W=N.useCallback(te=>{const fe=Z(te);return S.current.map(A=>v&&A==="reference"?v:g&&A==="floating"?g:fe).filter(Boolean).flat()},[v,g,S,Z]);N.useEffect(()=>{if(r||!c)return;function te(A){if(A.key==="Tab"){Wn(g,Li(Tr(g)))&&Z().length===0&&!M&&xn(A);const we=W(),Te=OE(A);S.current[0]==="reference"&&Te===v&&(xn(A),A.shiftKey?fi(we[we.length-1]):fi(we[1])),S.current[1]==="floating"&&Te===g&&A.shiftKey&&(xn(A),fi(we[0]))}}const fe=Tr(g);return fe.addEventListener("keydown",te),()=>{fe.removeEventListener("keydown",te)}},[r,v,g,c,S,h,M,Z,W]),N.useEffect(()=>{if(r||!u)return;function te(){F.current=!0,setTimeout(()=>{F.current=!1})}function fe(A){const we=A.relatedTarget;queueMicrotask(()=>{const Te=!(Wn(v,we)||Wn(g,we)||Wn(we,g)||Wn(P==null?void 0:P.portalNode,we)||we!=null&&we.hasAttribute(Xa("focus-guard"))||I&&(Ss(I.nodesRef.current,f).find(Ee=>{var Pe,Fe;return Wn((Pe=Ee.context)==null?void 0:Pe.elements.floating,we)||Wn((Fe=Ee.context)==null?void 0:Fe.elements.domReference,we)})||M9(I.nodesRef.current,f).find(Ee=>{var Pe,Fe;return((Pe=Ee.context)==null?void 0:Pe.elements.floating)===we||((Fe=Ee.context)==null?void 0:Fe.elements.domReference)===we})));we&&Te&&!F.current&&we!==B.current&&(H.current=!0,p(!1,A))})}if(g&&Pn(v))return v.addEventListener("focusout",fe),v.addEventListener("pointerdown",te),!c&&g.addEventListener("focusout",fe),()=>{v.removeEventListener("focusout",fe),v.removeEventListener("pointerdown",te),!c&&g.removeEventListener("focusout",fe)}},[r,v,g,c,f,I,P,p,u]),N.useEffect(()=>{var te;if(r)return;const fe=Array.from((P==null||(te=P.portalNode)==null?void 0:te.querySelectorAll("["+Xa("portal")+"]"))||[]);if(g){const A=[g,...fe,O.current,q.current,S.current.includes("reference")||M?v:null].filter(Te=>Te!=null),we=c?ek(A,b,!b):ek(A);return()=>{we()}}},[r,v,g,c,S,P,M,b]),an(()=>{if(r||!g)return;const te=Tr(g),fe=Li(te);queueMicrotask(()=>{const A=W(g),we=E.current,Te=(typeof we=="number"?A[we]:we.current)||g,Ee=Wn(g,fe);!$&&!Ee&&d&&fi(Te,{preventScroll:Te===g})})},[r,d,g,$,W,E]),an(()=>{if(r||!g)return;let te=!1;const fe=Tr(g),A=Li(fe),we=y.current;B.current=A;function Te(Ee){if(Ee.type==="escapeKey"&&h.domReference.current&&(B.current=h.domReference.current),["referencePress","escapeKey"].includes(Ee.type))return;const Pe=Ee.data.returnFocus;typeof Pe=="object"?(H.current=!1,te=Pe.preventScroll):H.current=!Pe}return m.on("dismiss",Te),()=>{m.off("dismiss",Te);const Ee=Li(fe);(Wn(g,Ee)||I&&Ss(I.nodesRef.current,f).some(Fe=>{var Re;return Wn((Re=Fe.context)==null?void 0:Re.elements.floating,Ee)})||we.openEvent&&["click","mousedown"].includes(we.openEvent.type))&&h.domReference.current&&(B.current=h.domReference.current),_.current&&Pn(B.current)&&!H.current&&fi(B.current,{cancelPrevious:!1,preventScroll:te})}},[r,g,_,y,h,m,I,f]),an(()=>{if(!(r||!P))return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:d,onOpenChange:p,refs:h}),()=>{P.setFocusManagerState(null)}},[r,P,c,d,p,h,u]),an(()=>{if(!r&&g&&typeof MutationObserver=="function"&&!$){const te=()=>{const A=g.getAttribute("tabindex");S.current.includes("floating")||Li(Tr(g))!==h.domReference.current&&Z().length===0?A!=="0"&&g.setAttribute("tabindex","0"):A!=="-1"&&g.setAttribute("tabindex","-1")};te();const fe=new MutationObserver(te);return fe.observe(g,{childList:!0,subtree:!0,attributes:!0}),()=>{fe.disconnect()}}},[r,g,h,S,Z,$]);function Q(te){return r||!l||!c?null:N.createElement(W9,{ref:te==="start"?O:q,onClick:fe=>p(!1,fe.nativeEvent)},typeof l=="string"?l:"Dismiss")}const C=!r&&b&&!M&&(D||c);return N.createElement(N.Fragment,null,C&&N.createElement(_d,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:te=>{if(c){const A=W();fi(i[0]==="reference"?A[0]:A[A.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(H.current=!1,Qa(te,P.portalNode)){const A=nk()||v;A==null||A.focus()}else{var fe;(fe=P.beforeOutsideRef.current)==null||fe.focus()}}}),!M&&Q("start"),n,Q("end"),C&&N.createElement(_d,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:te=>{if(c)fi(W()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(u&&(H.current=!0),Qa(te,P.portalNode)){const A=rk()||v;A==null||A.focus()}else{var fe;(fe=P.afterOutsideRef.current)==null||fe.focus()}}}))}function ak(e){return Pn(e.target)&&e.target.tagName==="BUTTON"}function ck(e){return IE(e)}function J9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0}=t,d=N.useRef(),h=N.useRef(!1);return N.useMemo(()=>s?{reference:{onPointerDown(f){d.current=f.pointerType},onMouseDown(f){f.button===0&&(AE(d.current,!0)&&l||a!=="click"&&(n&&c&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,f.nativeEvent):(f.preventDefault(),r(!0,f.nativeEvent))))},onClick(f){if(a==="mousedown"&&d.current){d.current=void 0;return}AE(d.current,!0)&&l||(n&&c&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,f.nativeEvent):r(!0,f.nativeEvent))},onKeyDown(f){d.current=void 0,!(f.defaultPrevented||!u||ak(f))&&(f.key===" "&&!ck(o)&&(f.preventDefault(),h.current=!0),f.key==="Enter"&&r(!(n&&c),f.nativeEvent))},onKeyUp(f){f.defaultPrevented||!u||ak(f)||ck(o)||f.key===" "&&h.current&&(h.current=!1,r(!(n&&c),f.nativeEvent))}}}:{},[s,i,a,l,u,o,c,n,r])}const Y9=N["useInsertionEffect".toString()]||(e=>e());function Ui(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Y9(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const G9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},X9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Q9=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function e8(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:c},dataRef:l}=e,{enabled:u=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:f="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:y=!1,bubbles:v}=t,g=bd(),b=XE()!=null,S=Ui(typeof h=="function"?h:()=>!1),E=typeof h=="function"?S:h,_=N.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:P}=Q9(v),$=Ui(q=>{if(!n||!u||!d||q.key!=="Escape")return;const H=g?Ss(g.nodesRef.current,o):[];if(!I&&(q.stopPropagation(),H.length>0)){let B=!0;if(H.forEach(F=>{var D;if((D=F.context)!=null&&D.open&&!F.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,U7(q)?q.nativeEvent:q)}),O=Ui(q=>{const H=_.current;if(_.current=!1,H||typeof E=="function"&&!E(q))return;const B=OE(q),F="["+Xa("inert")+"]",D=Tr(c).querySelectorAll(F);let M=Jt(B)?B:null;for(;M&&!Ka(M);){const Q=xo(M);if(Q===Tr(c).body||!Jt(Q))break;M=Q}if(D.length&&Jt(B)&&!B7(B)&&!Wn(B,c)&&Array.from(D).every(Q=>!Wn(M,Q)))return;if(Pn(B)&&c){const Q=B.clientWidth>0&&B.scrollWidth>B.clientWidth,C=B.clientHeight>0&&B.scrollHeight>B.clientHeight;let te=C&&q.offsetX>B.clientWidth;if(C&&nr(B).direction==="rtl"&&(te=q.offsetX<=B.offsetWidth-B.clientWidth),te||Q&&q.offsetY>B.clientHeight)return}const Z=g&&Ss(g.nodesRef.current,o).some(Q=>{var C;return km(q,(C=Q.context)==null?void 0:C.elements.floating)});if(km(q,c)||km(q,a)||Z)return;const W=g?Ss(g.nodesRef.current,o):[];if(W.length>0){let Q=!0;if(W.forEach(C=>{var te;if((te=C.context)!=null&&te.open&&!C.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:b?{preventScroll:!0}:kE(q)||CE(q)}}),r(!1,q)});return N.useEffect(()=>{if(!n||!u)return;l.current.__escapeKeyBubbles=I,l.current.__outsidePressBubbles=P;function q(F){r(!1,F)}const H=Tr(c);d&&H.addEventListener("keydown",$),E&&H.addEventListener(f,O);let B=[];return y&&(Jt(a)&&(B=qi(a)),Jt(c)&&(B=B.concat(qi(c))),!Jt(s)&&s&&s.contextElement&&(B=B.concat(qi(s.contextElement)))),B=B.filter(F=>{var D;return F!==((D=H.defaultView)==null?void 0:D.visualViewport)}),B.forEach(F=>{F.addEventListener("scroll",q,{passive:!0})}),()=>{d&&H.removeEventListener("keydown",$),E&&H.removeEventListener(f,O),B.forEach(F=>{F.removeEventListener("scroll",q)})}},[l,c,a,s,d,E,f,n,r,y,u,I,P,$,O]),N.useEffect(()=>{_.current=!1},[E,f]),N.useMemo(()=>u?{reference:{onKeyDown:$,[G9[m]]:q=>{p&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,q.nativeEvent))}},floating:{onKeyDown:$,[X9[f]]:()=>{_.current=!0}}}:{},[u,i,p,f,m,r,$])}let jm;process.env.NODE_ENV!=="production"&&(jm=new Set);function t8(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!Jt(e.elements.reference)){var s;if(!((s=jm)!=null&&s.has(I))){var a;(a=jm)==null||a.add(I),console.error(I)}}}const[c,l]=N.useState(null),u=((t=e.elements)==null?void 0:t.reference)||c,d=f9(e),h=bd(),f=Ui((I,P)=>{I&&(m.current.openEvent=P),r==null||r(I,P)}),p=N.useRef(null),m=N.useRef({}),y=N.useState(()=>D9())[0],v=Pm(),g=N.useCallback(I=>{const P=Jt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;d.refs.setReference(P)},[d.refs]),b=N.useCallback(I=>{(Jt(I)||I===null)&&(p.current=I,l(I)),(Jt(d.refs.reference.current)||d.refs.reference.current===null||I!==null&&!Jt(I))&&d.refs.setReference(I)},[d.refs]),S=N.useMemo(()=>({...d.refs,setReference:b,setPositionReference:g,domReference:p}),[d.refs,b,g]),E=N.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),_=N.useMemo(()=>({...d,refs:S,elements:E,dataRef:m,nodeId:i,floatingId:v,events:y,open:n,onOpenChange:f}),[d,i,v,y,n,f,S,E]);return an(()=>{const I=h==null?void 0:h.nodesRef.current.find(P=>P.id===i);I&&(I.context=_)}),N.useMemo(()=>({...d,context:_,refs:S,elements:E}),[d,S,E,_])}function Mm(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,c]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var l;(l=r.get(a))==null||l.push(c),i[a]=function(){for(var u,d=arguments.length,h=new Array(d),f=0;f<d;f++)h[f]=arguments[f];return(u=r.get(a))==null?void 0:u.map(p=>p(...h)).find(p=>p!==void 0)}}}else i[a]=c}),i),{})}}function n8(e){e===void 0&&(e=[]);const t=e,n=N.useCallback(o=>Mm(o,e,"reference"),t),r=N.useCallback(o=>Mm(o,e,"floating"),t),i=N.useCallback(o=>Mm(o,e,"item"),e.map(o=>o==null?void 0:o.item));return N.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let lk=!1;function Sd(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function uk(e,t){return Sd(t,e===Om||e===yd,e===_s||e===Ya)}function qm(e,t,n){return Sd(t,e===yd,n?e===_s:e===Ya)||e==="Enter"||e==" "||e===""}function r8(e,t,n){return Sd(t,n?e===_s:e===Ya,e===yd)}function dk(e,t,n){return Sd(t,n?e===Ya:e===_s,e===Om)}function i8(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:h=!1,loop:f=!1,nested:p=!1,rtl:m=!1,virtual:y=!1,focusItemOnOpen:v="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:b=!0,disabledIndices:S=void 0,orientation:E="vertical",cols:_=1,scrollItemIntoView:I=!0,virtualItemRef:P}=t;process.env.NODE_ENV!=="production"&&(h&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),y||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),E==="vertical"&&_>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const $=XE(),O=bd(),q=Ui(l),H=N.useRef(v),B=N.useRef(d??-1),F=N.useRef(null),D=N.useRef(!0),M=N.useRef(q),Z=N.useRef(!!s),W=N.useRef(!1),Q=N.useRef(!1),C=Fi(S),te=Fi(n),fe=Fi(I),[A,we]=N.useState(),[Te,Ee]=N.useState(),Pe=Ui(function(he,de,_e){_e===void 0&&(_e=!1);const pe=he.current[de.current];pe&&(y?(we(pe.id),O==null||O.events.emit("virtualfocus",pe),P&&(P.current=pe)):fi(pe,{preventScroll:!0,sync:F7()&&TE()?lk||W.current:!1}),requestAnimationFrame(()=>{const De=fe.current;De&&pe&&(_e||!D.current)&&(pe.scrollIntoView==null||pe.scrollIntoView(typeof De=="boolean"?{block:"nearest",inline:"nearest"}:De))}))});an(()=>{document.createElement("div").focus({get preventScroll(){return lk=!0,!1}})},[]),an(()=>{u&&(n&&s?H.current&&d!=null&&(Q.current=!0,q(d)):Z.current&&(B.current=-1,M.current(null)))},[u,n,s,d,q]),an(()=>{if(u&&n&&s)if(c==null){if(W.current=!1,d!=null)return;if(Z.current&&(B.current=-1,Pe(a,B)),!Z.current&&H.current&&(F.current!=null||H.current===!0&&F.current==null)){let he=0;const de=()=>{a.current[0]==null?(he<2&&(he?requestAnimationFrame:queueMicrotask)(de),he++):(B.current=F.current==null||qm(F.current,E,m)||p?Im(a,C.current):JE(a,C.current),F.current=null,q(B.current))};de()}}else Ga(a,c)||(B.current=c,Pe(a,B,Q.current),Q.current=!1)},[u,n,s,c,d,p,a,E,m,q,Pe,C]),an(()=>{var he,de;if(!u||s||!O||y||!Z.current)return;const _e=O.nodesRef.current,pe=(he=_e.find(L=>L.id===$))==null||(de=he.context)==null?void 0:de.elements.floating,De=Li(Tr(s)),et=_e.some(L=>L.context&&Wn(L.context.elements.floating,De));pe&&!et&&D.current&&pe.focus({preventScroll:!0})},[u,s,O,$,y]),an(()=>{if(!u||!O||!y||$)return;function he(de){Ee(de.id),P&&(P.current=de)}return O.events.on("virtualfocus",he),()=>{O.events.off("virtualfocus",he)}},[u,O,y,$,P]),an(()=>{M.current=q,Z.current=!!s}),an(()=>{n||(F.current=null)},[n]);const Fe=c!=null,Re=N.useMemo(()=>{function he(_e){if(!n)return;const pe=a.current.indexOf(_e);pe!==-1&&q(pe)}return{onFocus(_e){let{currentTarget:pe}=_e;he(pe)},onClick:_e=>{let{currentTarget:pe}=_e;return pe.focus({preventScroll:!0})},...g&&{onMouseMove(_e){let{currentTarget:pe}=_e;he(pe)},onPointerLeave(_e){let{pointerType:pe}=_e;!D.current||pe==="touch"||(B.current=-1,Pe(a,B),q(null),y||fi(i.floating.current,{preventScroll:!0}))}}}},[n,i,Pe,g,a,q,y]);return N.useMemo(()=>{if(!u)return{};const he=C.current;function de(L){if(D.current=!1,W.current=!0,!te.current&&L.currentTarget===i.floating.current)return;if(p&&dk(L.key,E,m)){xn(L),r(!1,L.nativeEvent),Pn(o)&&!y&&o.focus();return}const oe=B.current,ce=Im(a,he),ue=JE(a,he);if(L.key==="Home"&&(xn(L),B.current=ce,q(B.current)),L.key==="End"&&(xn(L),B.current=ue,q(B.current)),!(_>1&&(B.current=R9(a,{event:L,orientation:E,loop:f,cols:_,disabledIndices:he,minIndex:ce,maxIndex:ue,prevIndex:B.current,stopEvent:!0}),q(B.current),E==="both"))&&uk(L.key,E)){if(xn(L),n&&!y&&Li(L.currentTarget.ownerDocument)===L.currentTarget){B.current=qm(L.key,E,m)?ce:ue,q(B.current);return}qm(L.key,E,m)?f?B.current=oe>=ue?h&&oe!==a.current.length?-1:ce:$n(a,{startingIndex:oe,disabledIndices:he}):B.current=Math.min(ue,$n(a,{startingIndex:oe,disabledIndices:he})):f?B.current=oe<=ce?h&&oe!==-1?a.current.length:ue:$n(a,{startingIndex:oe,decrement:!0,disabledIndices:he}):B.current=Math.max(ce,$n(a,{startingIndex:oe,decrement:!0,disabledIndices:he})),Ga(a,B.current)?q(null):q(B.current)}}function _e(L){v==="auto"&&kE(L.nativeEvent)&&(H.current=!0)}function pe(L){H.current=v,v==="auto"&&CE(L.nativeEvent)&&(H.current=!0)}const De=y&&n&&Fe&&{"aria-activedescendant":Te||A},et=a.current.find(L=>(L==null?void 0:L.id)===A);return{reference:{...De,onKeyDown(L){D.current=!1;const oe=L.key.indexOf("Arrow")===0,ce=r8(L.key,E,m),ue=dk(L.key,E,m),Ne=uk(L.key,E),Se=(p?ce:Ne)||L.key==="Enter"||L.key.trim()==="";if(y&&n){const K=O==null?void 0:O.nodesRef.current.find(ae=>ae.parentId==null),ie=O&&K?q9(O.nodesRef.current,K.id):null;if(oe&&ie&&P){const ae=new KeyboardEvent("keydown",{key:L.key,bubbles:!0});if(ce||ue){var Be,pt;const Ae=((Be=ie.context)==null?void 0:Be.elements.domReference)===L.currentTarget,Je=ue&&!Ae?(pt=ie.context)==null?void 0:pt.elements.domReference:ce?et:null;Je&&(xn(L),Je.dispatchEvent(ae),Ee(void 0))}if(Ne&&ie.context&&ie.context.open&&ie.parentId&&L.currentTarget!==ie.context.elements.domReference){var Ge;xn(L),(Ge=ie.context.elements.domReference)==null||Ge.dispatchEvent(ae);return}}return de(L)}if(!(!n&&!b&&oe)){if(Se&&(F.current=p&&Ne?null:L.key),p){ce&&(xn(L),n?(B.current=Im(a,he),q(B.current)):r(!0,L.nativeEvent));return}Ne&&(d!=null&&(B.current=d),xn(L),!n&&b?r(!0,L.nativeEvent):de(L),n&&q(B.current))}},onFocus(){n&&q(null)},onPointerDown:pe,onMouseDown:_e,onClick:_e},floating:{"aria-orientation":E==="both"?void 0:E,...De,onKeyDown:de,onPointerMove(){D.current=!0}},item:Re}},[o,i,A,Te,C,te,a,u,E,m,y,n,Fe,p,d,b,h,_,f,v,q,r,Re,O,P])}function o8(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=Pm();return N.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function s8(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:h=[],selectedIndex:f=null}=t,p=N.useRef(),m=N.useRef(""),y=N.useRef((n=f??s)!=null?n:-1),v=N.useRef(null),g=Ui(a),b=Ui(c),S=Fi(u),E=Fi(h);return an(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),an(()=>{if(r&&m.current===""){var _;y.current=(_=f??s)!=null?_:-1}},[r,f,s]),N.useMemo(()=>{if(!l)return{};function _($){$?i.current.typing||(i.current.typing=$,b($)):i.current.typing&&(i.current.typing=$,b($))}function I($,O,q){const H=S.current?S.current(O,q):O.find(B=>(B==null?void 0:B.toLocaleLowerCase().indexOf(q.toLocaleLowerCase()))===0);return H?$.indexOf(H):-1}function P($){const O=o.current;if(m.current.length>0&&m.current[0]!==" "&&(I(O,O,m.current)===-1?_(!1):$.key===" "&&xn($)),O==null||E.current.includes($.key)||$.key.length!==1||$.ctrlKey||$.metaKey||$.altKey)return;r&&$.key!==" "&&(xn($),_(!0)),O.every(F=>{var D,M;return F?((D=F[0])==null?void 0:D.toLocaleLowerCase())!==((M=F[1])==null?void 0:M.toLocaleLowerCase()):!0})&&m.current===$.key&&(m.current="",y.current=v.current),m.current+=$.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",y.current=v.current,_(!1)},d);const H=y.current,B=I(O,[...O.slice((H||0)+1),...O.slice(0,(H||0)+1)],m.current);B!==-1?(g(B),v.current=B):$.key!==" "&&(m.current="",_(!1))}return{reference:{onKeyDown:P},floating:{onKeyDown:P,onKeyUp($){$.key===" "&&_(!1)}}}},[l,r,i,o,d,E,S,g,b])}const a8=({styles:e,type:t,options:n,label:r,reusable:i})=>{var Z,W,Q,C,te,fe,A,we,Te,Ee,Pe,Fe;const o=$e(Re=>Re.sendTextMessage),s=$e(Re=>Re.messageContainerRef),a=$e(Re=>Re.isReadOnly),[c,l]=N.useState(!1),[u,d]=N.useState(null),[h,f]=N.useState(null),p=n.reduce((Re,he)=>(Re[he.label]=he.value,Re),{}),m=p?Object.keys(p):[],y=Re=>{l(h!==null&&!i?!1:Re)},{refs:v,floatingStyles:g,context:b}=t8({placement:"bottom-start",open:c,onOpenChange:y,whileElementsMounted:u9,middleware:[H7(5),W7({padding:10,boundary:(s==null?void 0:s.current)??void 0,crossAxis:!0}),K7({apply({rects:Re,elements:he,availableHeight:de}){Object.assign(he.floating.style,{maxHeight:`${de}px`,minWidth:`${Re.reference.width}px`})},padding:10})]}),S=N.useRef([]),E=N.useRef(m),_=N.useRef(!1),I=J9(b,{event:"mousedown"}),P=e8(b),$=o8(b,{role:"listbox"}),O=i8(b,{listRef:S,activeIndex:u,selectedIndex:h,onNavigate:d,loop:!0}),q=s8(b,{listRef:E,activeIndex:u,selectedIndex:h,onMatch:c?d:f,onTypingChange(Re){_.current=Re}}),{getReferenceProps:H,getFloatingProps:B,getItemProps:F}=n8([P,$,O,q,I]),D=Re=>{f(Re),o(p[m[Re]]),l(!1)},M=h!==null?m[h]:void 0;return U.jsxs(U.Fragment,{children:[U.jsxs("div",{tabIndex:0,ref:v.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":h!==null&&!i?"":void 0,...(W=(Z=e==null?void 0:e[t])==null?void 0:Z.button)==null?void 0:W.container,...H(),children:[U.jsx("span",{...(C=(Q=e==null?void 0:e[t])==null?void 0:Q.button)==null?void 0:C.text,children:M||r||"Select..."}),U.jsx(RZ,{...(fe=(te=e==null?void 0:e[t])==null?void 0:te.button)==null?void 0:fe.icon})]}),c&&U.jsx(H9,{children:U.jsx(K9,{context:b,modal:!1,children:U.jsx("div",{ref:v.setFloating,className:(Te=(we=(A=e==null?void 0:e[t])==null?void 0:A.content)==null?void 0:we.container)==null?void 0:Te.className,style:{...g,...(Fe=(Pe=(Ee=e==null?void 0:e[t])==null?void 0:Ee.content)==null?void 0:Pe.container)==null?void 0:Fe.style},...B(),children:m.map((Re,he)=>{var de,_e;return U.jsx("div",{ref:pe=>{S.current[he]=pe},role:"option",tabIndex:he===u?0:-1,"aria-selected":he===h&&he===u,"data-active":he===u?"":void 0,...(_e=(de=e==null?void 0:e[t])==null?void 0:de.content)==null?void 0:_e.item,...F({onClick(){a||D(he)},onKeyDown(pe){a||(pe.key==="Enter"&&(pe.preventDefault(),D(he)),pe.key===" "&&!_.current&&(pe.preventDefault(),D(he)))}}),children:Re},Re)})})})})]})},c8=w.forwardRef(({type:e,title:t,styles:n,url:r,...i},o)=>{var s,a,c;return U.jsxs("a",{...i,...(s=n==null?void 0:n[e])==null?void 0:s.container,href:r,download:!0,ref:o,target:"_blank",children:[U.jsx("p",{...(a=n==null?void 0:n[e])==null?void 0:a.title,children:t||r}),U.jsx($Z,{...(c=n==null?void 0:n[e])==null?void 0:c.icon})]})}),fk={audio:SZ,bubble:vZ,button:yZ,carousel:P7,column:LZ,dropdown:a8,file:c8,image:wZ,location:qZ,row:FZ,text:vL,video:_Z},ks=({block:e,styles:t,...n})=>{const i=$e(s=>s.renderers)[e.type]??fk[e.type],o={...n,styles:t,...e};return U.jsx(i,{...o})},pk=w.memo(w.forwardRef((e,t)=>{const{composer:n}=$e(d=>d.theme),r=$e(d=>d.sendTextMessage),i=$e(d=>d.disableComposer),o=$e(d=>d.isReadOnly),[s,a]=w.useState(""),[c,l]=w.useState(-1);if(o)return null;const u=()=>{s&&(r(s),a(""),l(-1))};return U.jsx(aE.Provider,{value:{value:s,setValue:a,historyIndex:c,setHistoryIndex:l,sendMessage:u},children:U.jsx("div",{"data-disabled":i,...e,...n==null?void 0:n.container,ref:t})})})),hk=w.memo(e=>{const{composer:t}=$e(v=>v.theme),n=$e(v=>v.configuration),r=$e(v=>v.disableComposer),i=$e(v=>v.setIsTyping),{value:o,setValue:s,historyIndex:a,setHistoryIndex:c,sendMessage:l}=cE(),u=w.useRef(null),d=Qn(v=>v.user),h=Qn(v=>v.messageHistory),[f,p]=w.useState(!1);bL(u.current,o);function m({key:v}){v==="Shift"&&p(!0)}function y({key:v}){v==="Shift"&&p(!1)}return w.useEffect(()=>(window.addEventListener("keydown",m),window.addEventListener("keyup",y),()=>{window.removeEventListener("keydown",m),window.removeEventListener("keyup",y)}),[]),U.jsx("textarea",{...t==null?void 0:t.input,placeholder:(n==null?void 0:n.composerPlaceholder)??"Type your message...",disabled:r,ref:u,value:o,"data-has-value":!!o,onChange:v=>s(v.target.value),onKeyDown:v=>{if(!r){if(v.key==="Enter"&&(v.preventDefault(),f?(s(`${o}
|
|
363
|
-
`),setTimeout(()=>{var g;return(g=u.current)==null?void 0:g.scroll({behavior:"instant",top:u.current.scrollHeight})},0)):(l(),setTimeout(()=>i(!0,9e3),500))),v.key==="ArrowUp"){v.preventDefault();const g=h[(d==null?void 0:d.userId)??""]??[];a<g.length-1&&s(g[a+1]),c(()=>Math.min(a+1,g.length-1))}if(v.key==="ArrowDown"){v.preventDefault();const g=h[(d==null?void 0:d.userId)??""]??[];s(a===0?"":g[a-1]),c(()=>Math.max(a-1,-1))}}},...e})}),mk=w.memo(w.forwardRef(({icon:e=MZ,...t},n)=>{var u,d;const{composer:r}=$e(h=>h.theme),i=$e(h=>h.sendFile),o=$e(h=>h.addMessage),s=w.useRef(null);if(!$e(h=>h.allowFileUpload))return null;const c=()=>{var h;s.current&&((h=s.current)==null||h.click())},l=async h=>{var p;const f=(p=h.target.files)==null?void 0:p[0];if(f)try{const{fileUrl:m,type:y}=await i(f)??"";o({direction:"outgoing",sender:{name:"You"},timestamp:new Date,disableInput:!1,block:{type:y,url:m}})}catch(m){console.error("Error sending file:",m)}};return U.jsxs(U.Fragment,{children:[U.jsx("button",{type:"button",ref:n,...t,...(u=r==null?void 0:r.uploadButton)==null?void 0:u.container,onClick:c,children:U.jsx(e,{...(d=r==null?void 0:r.uploadButton)==null?void 0:d.icon})}),U.jsx("input",{type:"file",ref:s,style:{display:"none"},onChange:l})]})})),yk=w.memo(w.forwardRef(({icon:e=OZ,...t},n)=>{var s,a;const{value:r,sendMessage:i}=cE(),{composer:o}=$e(c=>c.theme);return U.jsx("button",{type:"button",ref:n,...t,...(s=o==null?void 0:o.button)==null?void 0:s.container,disabled:!r,onClick:i,children:U.jsx(e,{...(a=o==null?void 0:o.button)==null?void 0:a.icon})})})),gk=({children:e})=>{const[t,n]=w.useState(!1),[r,i]=w.useState(""),[o,s]=w.useState(null),a=({title:l,content:u})=>{i(l),s(u),n(!0)},c=()=>{n(!1)};return U.jsxs(uE.Provider,{value:{hideModal:c,showModal:a,title:r,content:o,open:t},children:[U.jsx(Zi,{open:t,onOpenChange:n,children:U.jsx(Zi.Content,{title:r,children:o})}),e]})},l8=({children:e,...t})=>{const n=w.useRef(),r=w.useRef(null),i=mZ({...t,messageContainerRef:r});return n.current||(n.current=i),U.jsx(sE.Provider,{value:n.current,children:U.jsx(u8,{children:e})})},u8=({children:e})=>{const t=$e(p=>p.client),n=$e(p=>p.addMessage),r=$e(p=>p.setMessages),i=$e(p=>p.configuration),o=$e(p=>p.setConnected),s=$e(p=>p.userData),a=$e(p=>p.setIsTyping),c=Qn(p=>p.setConversationId),l=Qn(p=>p.user),u=Qn(p=>p.conversationId),d=Qn(p=>p.setUser),[h,f]=w.useState(0);return w.useEffect(()=>{if(t)return t.on("message",p=>{try{const{payload:m,disableInput:y,id:v,conversationId:g}=p;if(u!==g)return;a(!1,0),n({id:v,direction:"incoming",sender:{name:i.botName??"Bot",avatar:i.botAvatar},timestamp:new Date(p.sentOn),block:m,disableInput:y})}catch{console.error("Invalid message payload")}})},[u]),w.useEffect(()=>{if(t)return t.on("conversation",p=>{c(p)})},[]),WS(async()=>{if(t)return t.on("error",()=>{f(p=>p+1)})}),WS(async()=>{if(!t||u&&t.conversationId===u)return;let p;try{p=await t.connect(l,s),o(!0)}catch(y){console.error(y),o(!1);return}d(p),u&&await t.conversationExists(u)?await t.switchConversation(u):await t.newConversation();const m=[];for(const y of await t.listMessages())try{const{payload:v,authorId:g,sentOn:b,disableInput:S,id:E}=y,_=g===t.userId?"outgoing":"incoming";m.push({id:E,direction:_,sender:_==="outgoing"?{name:"You"}:{name:i.botName??"Bot",avatar:i.botAvatar},timestamp:new Date(b),block:v,disableInput:S})}catch{console.error("Invalid message payload")}return r(m.reverse()),()=>{t.disconnect()}},[h,u]),U.jsx(U.Fragment,{children:e})};function Dn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}const d8=N["useId".toString()]||(()=>{});let f8=0;function Ed(e){const[t,n]=N.useState(d8());return zo(()=>{e||n(r=>r??String(f8++))},[e]),e||(t?`radix-${t}`:"")}function vk({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=p8({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=Mn(n),c=w.useCallback(l=>{if(o){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else i(l)},[o,e,i,a]);return[s,c]}function p8({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=Mn(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}function h8(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Lm="dismissableLayer.update",m8="dismissableLayer.pointerDownOutside",y8="dismissableLayer.focusOutside";let bk;const g8=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),v8=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...l}=e,u=w.useContext(g8),[d,h]=w.useState(null),f=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=w.useState({}),m=Jn(t,P=>h(P)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(v),b=d?y.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,E=b>=g,_=b8(P=>{const $=P.target,O=[...u.branches].some(q=>q.contains($));!E||O||(o==null||o(P),a==null||a(P),P.defaultPrevented||c==null||c())},f),I=w8(P=>{const $=P.target;[...u.branches].some(q=>q.contains($))||(s==null||s(P),a==null||a(P),P.defaultPrevented||c==null||c())},f);return h8(P=>{b===u.layers.size-1&&(i==null||i(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},f),w.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(bk=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),wk(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=bk)}},[d,f,r,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),wk())},[d,u]),w.useEffect(()=>{const P=()=>p({});return document.addEventListener(Lm,P),()=>document.removeEventListener(Lm,P)},[]),w.createElement(bn.div,Xi({},l,{ref:m,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Dn(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Dn(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Dn(e.onPointerDownCapture,_.onPointerDownCapture)}))});function b8(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){xk(m8,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function w8(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&xk(y8,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wk(){const e=new CustomEvent(Lm);document.dispatchEvent(e)}function xk(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?F$(i,o):i.dispatchEvent(o)}const Fm="focusScope.autoFocusOnMount",Um="focusScope.autoFocusOnUnmount",_k={bubbles:!1,cancelable:!0},x8=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,c]=w.useState(null),l=Mn(i),u=Mn(o),d=w.useRef(null),h=Jn(t,m=>c(m)),f=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let m=function(b){if(f.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:Bi(d.current,{select:!0})},y=function(b){if(f.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||Bi(d.current,{select:!0}))},v=function(b){const S=document.activeElement;for(const E of b)E.removedNodes.length>0&&(a!=null&&a.contains(S)||Bi(a))};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const g=new MutationObserver(v);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),g.disconnect()}}},[r,a,f.paused]),w.useEffect(()=>{if(a){kk.add(f);const m=document.activeElement;if(!a.contains(m)){const v=new CustomEvent(Fm,_k);a.addEventListener(Fm,l),a.dispatchEvent(v),v.defaultPrevented||(_8(T8(Sk(a)),{select:!0}),document.activeElement===m&&Bi(a))}return()=>{a.removeEventListener(Fm,l),setTimeout(()=>{const v=new CustomEvent(Um,_k);a.addEventListener(Um,u),a.dispatchEvent(v),v.defaultPrevented||Bi(m??document.body,{select:!0}),a.removeEventListener(Um,u),kk.remove(f)},0)}}},[a,l,u,f]);const p=w.useCallback(m=>{if(!n&&!r||f.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(y&&v){const g=m.currentTarget,[b,S]=S8(g);b&&S?!m.shiftKey&&v===S?(m.preventDefault(),n&&Bi(b,{select:!0})):m.shiftKey&&v===b&&(m.preventDefault(),n&&Bi(S,{select:!0})):v===g&&m.preventDefault()}},[n,r,f.paused]);return w.createElement(bn.div,Xi({tabIndex:-1},s,{ref:h,onKeyDown:p}))});function _8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bi(r,{select:t}),document.activeElement!==n)return}function S8(e){const t=Sk(e),n=Ek(t,e),r=Ek(t.reverse(),e);return[n,r]}function Sk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ek(e,t){for(const n of e)if(!E8(n,{upTo:t}))return n}function E8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function k8(e){return e instanceof HTMLInputElement&&"select"in e}function Bi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&k8(e)&&t&&e.select()}}const kk=C8();function C8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ck(e,t),e.unshift(t)},remove(t){var n;e=Ck(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Ck(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function T8(e){return e.filter(t=>t.tagName!=="A")}function A8(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const zi=e=>{const{present:t,children:n}=e,r=O8(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=Jn(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};zi.displayName="Presence";function O8(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),s=e?"mounted":"unmounted",[a,c]=A8(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const l=kd(r.current);o.current=a==="mounted"?l:"none"},[a]),zo(()=>{const l=r.current,u=i.current;if(u!==e){const h=o.current,f=kd(l);e?c("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),zo(()=>{if(t){const l=d=>{const f=kd(r.current).includes(d.animationName);d.target===t&&f&&Ar.flushSync(()=>c("ANIMATION_END"))},u=d=>{d.target===t&&(o.current=kd(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function kd(e){return(e==null?void 0:e.animationName)||"none"}let Bm=0;function I8(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:Tk()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:Tk()),Bm++,()=>{Bm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Bm--}},[])}function Tk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Vr=function(){return Vr=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vr.apply(this,arguments)};function Ak(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function R8(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Cd="right-scroll-bar-position",Td="width-before-scroll-bar",P8="with-scroll-bars-hidden",$8="--removed-body-scroll-bar-size";function D8(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function N8(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function j8(e,t){return N8(t||null,function(n){return e.forEach(function(r){return D8(r,n)})})}function M8(e){return e}function q8(e,t){t===void 0&&(t=M8);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var c=function(){var u=s;s=[],u.forEach(o)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){s.push(u),l()},filter:function(u){return s=s.filter(u),n}}}};return i}function L8(e){e===void 0&&(e={});var t=q8(null);return t.options=Vr({async:!0,ssr:!1},e),t}var Ok=function(e){var t=e.sideCar,n=Ak(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return N.createElement(r,Vr({},n))};Ok.isSideCarExport=!0;function F8(e,t){return e.useMedium(t),Ok}var Ik=L8(),zm=function(){},Ad=N.forwardRef(function(e,t){var n=N.useRef(null),r=N.useState({onScrollCapture:zm,onWheelCapture:zm,onTouchMoveCapture:zm}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,p=e.inert,m=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,g=Ak(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=h,S=j8([n,t]),E=Vr(Vr({},g),i);return N.createElement(N.Fragment,null,u&&N.createElement(b,{sideCar:Ik,removeScrollBar:l,shards:d,noIsolation:f,inert:p,setCallbacks:o,allowPinchZoom:!!m,lockRef:n}),s?N.cloneElement(N.Children.only(a),Vr(Vr({},E),{ref:S})):N.createElement(v,Vr({},E,{className:c,ref:S}),a))});Ad.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ad.classNames={fullWidth:Td,zeroRight:Cd};var Rk,U8=function(){if(Rk)return Rk;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function B8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=U8();return t&&e.setAttribute("nonce",t),e}function z8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Z8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=B8())&&(z8(t,n),Z8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},H8=function(){var e=V8();return function(t,n){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pk=function(){var e=H8(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},W8={left:0,top:0,right:0,gap:0},Zm=function(e){return parseInt(e||"",10)||0},K8=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Zm(n),Zm(r),Zm(i)]},J8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return W8;var t=K8(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Y8=Pk(),G8=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
362
|
+
*/var p9=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Tm=p9.join(","),zE=typeof Element>"u",Ja=zE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,hd=!zE&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},md=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&e(t.parentNode);return s},h9=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},m9=function(t,n,r){if(md(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Tm));return n&&Ja.call(t,Tm)&&i.unshift(t),i=i.filter(r),i},y9=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!md(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),c=a.length?a:s.children,l=e(c,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:s,candidates:l})}else{var u=Ja.call(s,Tm);u&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!md(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&p){var f=e(d===!0?s.children:d.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:s,candidates:f})}else o.unshift.apply(o,s.children)}}return i},ZE=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},VE=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||h9(t))&&!ZE(t)?0:t.tabIndex},g9=function(t,n){var r=VE(t);return r<0&&n&&!ZE(t)?0:r},v9=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},HE=function(t){return t.tagName==="INPUT"},b9=function(t){return HE(t)&&t.type==="hidden"},w9=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},x9=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},_9=function(t){if(!t.name)return!0;var n=t.form||hd(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=x9(i,t.form);return!o||o===t},S9=function(t){return HE(t)&&t.type==="radio"},E9=function(t){return S9(t)&&!_9(t)},k9=function(t){var n,r=t&&hd(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,c;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!o&&i;){var l,u,d;r=hd(i),i=(l=r)===null||l===void 0?void 0:l.host,o=!!((u=i)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return o},WE=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},C9=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=Ja.call(t,"details>summary:first-of-type"),s=o?t.parentElement:t;if(Ja.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var c=t.parentElement,l=hd(t);if(c&&!c.shadowRoot&&i(c)===!0)return WE(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c}t=a}if(k9(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return WE(t);return!1},T9=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ja.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},A9=function(t,n){return!(n.disabled||md(n)||b9(n)||C9(n,t)||w9(n)||T9(n))},KE=function(t,n){return!(E9(n)||VE(n)<0||!A9(t,n))},O9=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},I9=function e(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,c=g9(a,s),l=s?e(i.candidates):a;c===0?s?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:c,item:i,isScope:s,content:l})}),r.sort(v9).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Am=function(t,n){n=n||{};var r;return n.getShadowRoot?r=y9([t],n.includeContainer,{filter:KE.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:O9}):r=m9(t,n.includeContainer,KE.bind(null,n)),I9(r)};const Om="ArrowUp",yd="ArrowDown",_s="ArrowLeft",Ya="ArrowRight";function gd(e,t,n){return Math.floor(e/t)!==n}function Ga(e,t){return t<0||t>=e.current.length}function Im(e,t){return $n(e,{disabledIndices:t})}function JE(e,t){return $n(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $n(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var c,l;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(c=s[a])!=null&&c.hasAttribute("disabled")||((l=s[a])==null?void 0:l.getAttribute("aria-disabled"))==="true"));return a}function R9(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:c,prevIndex:l,stopEvent:u=!1}=t,d=l;if(n.key===Om){if(u&&xn(n),l===-1)d=c;else if(d=$n(e,{startingIndex:d,amount:o,decrement:!0,disabledIndices:s}),i&&(l-o<a||d<0)){const p=l%o,f=c%o,h=c-(f-p);f===p?d=c:d=f>p?h:h-o}Ga(e,d)&&(d=l)}if(n.key===yd&&(u&&xn(n),l===-1?d=a:(d=$n(e,{startingIndex:l,amount:o,disabledIndices:s}),i&&l+o>c&&(d=$n(e,{startingIndex:l%o-o,amount:o,disabledIndices:s}))),Ga(e,d)&&(d=l)),r==="both"){const p=ws(l/o);n.key===Ya&&(u&&xn(n),l%o!==o-1?(d=$n(e,{startingIndex:l,disabledIndices:s}),i&&gd(d,o,p)&&(d=$n(e,{startingIndex:l-l%o-1,disabledIndices:s}))):i&&(d=$n(e,{startingIndex:l-l%o-1,disabledIndices:s})),gd(d,o,p)&&(d=l)),n.key===_s&&(u&&xn(n),l%o!==0?(d=$n(e,{startingIndex:l,disabledIndices:s,decrement:!0}),i&&gd(d,o,p)&&(d=$n(e,{startingIndex:l+(o-l%o),decrement:!0,disabledIndices:s}))):i&&(d=$n(e,{startingIndex:l+(o-l%o),decrement:!0,disabledIndices:s})),gd(d,o,p)&&(d=l));const f=ws(c/o)===p;Ga(e,d)&&(i&&f?d=n.key===_s?c:$n(e,{startingIndex:l-l%o-1,disabledIndices:s}):d=l)}return d}let YE=0;function fi(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(YE);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():YE=requestAnimationFrame(o)}var an=typeof document<"u"?w.useLayoutEffect:w.useEffect;function vd(){return vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vd.apply(this,arguments)}let Rm=!1,P9=0;const GE=()=>"floating-ui-"+P9++;function $9(){const[e,t]=N.useState(()=>Rm?GE():void 0);return an(()=>{e==null&&t(GE())},[]),N.useEffect(()=>{Rm||(Rm=!0)},[]),e}const Pm=N["useId".toString()]||$9;function D9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const N9=N.createContext(null),j9=N.createContext(null),XE=()=>{var e;return((e=N.useContext(N9))==null?void 0:e.id)||null},bd=()=>N.useContext(j9);function Xa(e){return"data-floating-ui-"+e}function Fi(e){const t=w.useRef(e);return an(()=>{t.current=e}),t}function M9(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function Ss(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function q9(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),Ss(e,o).forEach(c=>{i(c.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let Es=new WeakMap,wd=new WeakSet,xd={},$m=0;const L9=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,QE=e=>e&&(e.host||QE(e.parentNode)),F9=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=QE(n);return e.contains(r)?r:null}).filter(n=>n!=null);function U9(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=F9(t,e),a=new Set,c=new Set(s),l=[];xd[i]||(xd[i]=new WeakMap);const u=xd[i];s.forEach(d),p(t),a.clear();function d(f){!f||a.has(f)||(a.add(f),f.parentNode&&d(f.parentNode))}function p(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,h=>{if(a.has(h))p(h);else{const m=o?h.getAttribute(o):null,y=m!==null&&m!=="false",g=(Es.get(h)||0)+1,v=(u.get(h)||0)+1;Es.set(h,g),u.set(h,v),l.push(h),g===1&&y&&wd.add(h),v===1&&h.setAttribute(i,""),!y&&o&&h.setAttribute(o,"true")}})}return $m++,()=>{l.forEach(f=>{const h=(Es.get(f)||0)-1,m=(u.get(f)||0)-1;Es.set(f,h),u.set(f,m),h||(!wd.has(f)&&o&&f.removeAttribute(o),wd.delete(f)),m||f.removeAttribute(i)}),$m--,$m||(Es=new WeakMap,Es=new WeakMap,wd=new WeakSet,xd={})}}function ek(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Tr(e[0]).body;return U9(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Dm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tk(e,t){const n=Am(e,Dm());t==="prev"&&n.reverse();const r=n.indexOf(Li(Tr(e)));return n.slice(r+1)[0]}function nk(){return tk(document.body,"next")}function rk(){return tk(document.body,"prev")}function Qa(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Wn(n,r)}function B9(e){Am(e,Dm()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function z9(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Nm={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let Z9;function ik(e){e.key==="Tab"&&(e.target,clearTimeout(Z9))}const _d=N.forwardRef(function(t,n){const[r,i]=N.useState();an(()=>(TE()&&i("button"),document.addEventListener("keydown",ik),()=>{document.removeEventListener("keydown",ik)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Xa("focus-guard")]:"",style:Nm};return N.createElement("span",vd({},t,o))}),ok=N.createContext(null);function V9(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=N.useState(null),o=Pm(),s=sk(),a=N.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),c=N.useRef();return an(()=>()=>{r==null||r.remove()},[r,a]),an(()=>{if(c.current===a)return;c.current=a;const{id:l,root:u,portalContext:d,uniqueId:p}=a,f=l?document.getElementById(l):null,h=Xa("portal");if(f){const m=document.createElement("div");m.id=p,m.setAttribute(h,""),f.appendChild(m),i(m)}else{let m=u||(d==null?void 0:d.portalNode);m&&!Jt(m)&&(m=m.current),m=m||document.body;let y=null;l&&(y=document.createElement("div"),y.id=l,m.appendChild(y));const g=document.createElement("div");g.id=p,g.setAttribute(h,""),m=y||m,m.appendChild(g),i(g)}},[a]),r}function H9(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=V9({id:n,root:r}),[s,a]=N.useState(null),c=N.useRef(null),l=N.useRef(null),u=N.useRef(null),d=N.useRef(null),p=!!s&&!s.modal&&s.open&&i&&!!(r||o);return N.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function f(h){o&&Qa(h)&&(h.type==="focusin"?z9:B9)(o)}return o.addEventListener("focusin",f,!0),o.addEventListener("focusout",f,!0),()=>{o.removeEventListener("focusin",f,!0),o.removeEventListener("focusout",f,!0)}},[o,i,s==null?void 0:s.modal]),N.createElement(ok.Provider,{value:N.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:o,setFocusManagerState:a}),[i,o])},p&&o&&N.createElement(_d,{"data-type":"outside",ref:c,onFocus:f=>{if(Qa(f,o)){var h;(h=u.current)==null||h.focus()}else{const m=rk()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus()}}}),p&&o&&N.createElement("span",{"aria-owns":o.id,style:Nm}),o&&Ar.createPortal(t,o),p&&o&&N.createElement(_d,{"data-type":"outside",ref:l,onFocus:f=>{if(Qa(f,o)){var h;(h=d.current)==null||h.focus()}else{const m=nk()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,f.nativeEvent))}}}))}const sk=()=>N.useContext(ok),W9=N.forwardRef(function(t,n){return N.createElement("button",vd({},t,{type:"button",ref:n,tabIndex:-1,style:Nm}))});function K9(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:c=!0,visuallyHiddenDismiss:l=!1,closeOnFocusOut:u=!0}=e,{open:d,refs:p,nodeId:f,onOpenChange:h,events:m,dataRef:y,elements:{domReference:g,floating:v}}=t,b=L9()?o:!0,S=Fi(i),E=Fi(s),_=Fi(a),I=bd(),P=sk(),$=typeof s=="number"&&s<0,O=N.useRef(null),q=N.useRef(null),H=N.useRef(!1),B=N.useRef(null),F=N.useRef(!1),D=P!=null,M=g&&g.getAttribute("role")==="combobox"&&IE(g)&&$,Z=N.useCallback(function(te){return te===void 0&&(te=v),te?Am(te,Dm()):[]},[v]),W=N.useCallback(te=>{const fe=Z(te);return S.current.map(A=>g&&A==="reference"?g:v&&A==="floating"?v:fe).filter(Boolean).flat()},[g,v,S,Z]);N.useEffect(()=>{if(r||!c)return;function te(A){if(A.key==="Tab"){Wn(v,Li(Tr(v)))&&Z().length===0&&!M&&xn(A);const we=W(),Te=OE(A);S.current[0]==="reference"&&Te===g&&(xn(A),A.shiftKey?fi(we[we.length-1]):fi(we[1])),S.current[1]==="floating"&&Te===v&&A.shiftKey&&(xn(A),fi(we[0]))}}const fe=Tr(v);return fe.addEventListener("keydown",te),()=>{fe.removeEventListener("keydown",te)}},[r,g,v,c,S,p,M,Z,W]),N.useEffect(()=>{if(r||!u)return;function te(){F.current=!0,setTimeout(()=>{F.current=!1})}function fe(A){const we=A.relatedTarget;queueMicrotask(()=>{const Te=!(Wn(g,we)||Wn(v,we)||Wn(we,v)||Wn(P==null?void 0:P.portalNode,we)||we!=null&&we.hasAttribute(Xa("focus-guard"))||I&&(Ss(I.nodesRef.current,f).find(Ee=>{var $e,Fe;return Wn(($e=Ee.context)==null?void 0:$e.elements.floating,we)||Wn((Fe=Ee.context)==null?void 0:Fe.elements.domReference,we)})||M9(I.nodesRef.current,f).find(Ee=>{var $e,Fe;return(($e=Ee.context)==null?void 0:$e.elements.floating)===we||((Fe=Ee.context)==null?void 0:Fe.elements.domReference)===we})));we&&Te&&!F.current&&we!==B.current&&(H.current=!0,h(!1,A))})}if(v&&Pn(g))return g.addEventListener("focusout",fe),g.addEventListener("pointerdown",te),!c&&v.addEventListener("focusout",fe),()=>{g.removeEventListener("focusout",fe),g.removeEventListener("pointerdown",te),!c&&v.removeEventListener("focusout",fe)}},[r,g,v,c,f,I,P,h,u]),N.useEffect(()=>{var te;if(r)return;const fe=Array.from((P==null||(te=P.portalNode)==null?void 0:te.querySelectorAll("["+Xa("portal")+"]"))||[]);if(v){const A=[v,...fe,O.current,q.current,S.current.includes("reference")||M?g:null].filter(Te=>Te!=null),we=c?ek(A,b,!b):ek(A);return()=>{we()}}},[r,g,v,c,S,P,M,b]),an(()=>{if(r||!v)return;const te=Tr(v),fe=Li(te);queueMicrotask(()=>{const A=W(v),we=E.current,Te=(typeof we=="number"?A[we]:we.current)||v,Ee=Wn(v,fe);!$&&!Ee&&d&&fi(Te,{preventScroll:Te===v})})},[r,d,v,$,W,E]),an(()=>{if(r||!v)return;let te=!1;const fe=Tr(v),A=Li(fe),we=y.current;B.current=A;function Te(Ee){if(Ee.type==="escapeKey"&&p.domReference.current&&(B.current=p.domReference.current),["referencePress","escapeKey"].includes(Ee.type))return;const $e=Ee.data.returnFocus;typeof $e=="object"?(H.current=!1,te=$e.preventScroll):H.current=!$e}return m.on("dismiss",Te),()=>{m.off("dismiss",Te);const Ee=Li(fe);(Wn(v,Ee)||I&&Ss(I.nodesRef.current,f).some(Fe=>{var Pe;return Wn((Pe=Fe.context)==null?void 0:Pe.elements.floating,Ee)})||we.openEvent&&["click","mousedown"].includes(we.openEvent.type))&&p.domReference.current&&(B.current=p.domReference.current),_.current&&Pn(B.current)&&!H.current&&fi(B.current,{cancelPrevious:!1,preventScroll:te})}},[r,v,_,y,p,m,I,f]),an(()=>{if(!(r||!P))return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:d,onOpenChange:h,refs:p}),()=>{P.setFocusManagerState(null)}},[r,P,c,d,h,p,u]),an(()=>{if(!r&&v&&typeof MutationObserver=="function"&&!$){const te=()=>{const A=v.getAttribute("tabindex");S.current.includes("floating")||Li(Tr(v))!==p.domReference.current&&Z().length===0?A!=="0"&&v.setAttribute("tabindex","0"):A!=="-1"&&v.setAttribute("tabindex","-1")};te();const fe=new MutationObserver(te);return fe.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{fe.disconnect()}}},[r,v,p,S,Z,$]);function Q(te){return r||!l||!c?null:N.createElement(W9,{ref:te==="start"?O:q,onClick:fe=>h(!1,fe.nativeEvent)},typeof l=="string"?l:"Dismiss")}const C=!r&&b&&!M&&(D||c);return N.createElement(N.Fragment,null,C&&N.createElement(_d,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:te=>{if(c){const A=W();fi(i[0]==="reference"?A[0]:A[A.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(H.current=!1,Qa(te,P.portalNode)){const A=nk()||g;A==null||A.focus()}else{var fe;(fe=P.beforeOutsideRef.current)==null||fe.focus()}}}),!M&&Q("start"),n,Q("end"),C&&N.createElement(_d,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:te=>{if(c)fi(W()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(u&&(H.current=!0),Qa(te,P.portalNode)){const A=rk()||g;A==null||A.focus()}else{var fe;(fe=P.afterOutsideRef.current)==null||fe.focus()}}}))}function ak(e){return Pn(e.target)&&e.target.tagName==="BUTTON"}function ck(e){return IE(e)}function J9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0}=t,d=N.useRef(),p=N.useRef(!1);return N.useMemo(()=>s?{reference:{onPointerDown(f){d.current=f.pointerType},onMouseDown(f){f.button===0&&(AE(d.current,!0)&&l||a!=="click"&&(n&&c&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,f.nativeEvent):(f.preventDefault(),r(!0,f.nativeEvent))))},onClick(f){if(a==="mousedown"&&d.current){d.current=void 0;return}AE(d.current,!0)&&l||(n&&c&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,f.nativeEvent):r(!0,f.nativeEvent))},onKeyDown(f){d.current=void 0,!(f.defaultPrevented||!u||ak(f))&&(f.key===" "&&!ck(o)&&(f.preventDefault(),p.current=!0),f.key==="Enter"&&r(!(n&&c),f.nativeEvent))},onKeyUp(f){f.defaultPrevented||!u||ak(f)||ck(o)||f.key===" "&&p.current&&(p.current=!1,r(!(n&&c),f.nativeEvent))}}}:{},[s,i,a,l,u,o,c,n,r])}const Y9=N["useInsertionEffect".toString()]||(e=>e());function Ui(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Y9(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const G9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},X9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Q9=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function e8(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:c},dataRef:l}=e,{enabled:u=!0,escapeKey:d=!0,outsidePress:p=!0,outsidePressEvent:f="pointerdown",referencePress:h=!1,referencePressEvent:m="pointerdown",ancestorScroll:y=!1,bubbles:g}=t,v=bd(),b=XE()!=null,S=Ui(typeof p=="function"?p:()=>!1),E=typeof p=="function"?S:p,_=N.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:P}=Q9(g),$=Ui(q=>{if(!n||!u||!d||q.key!=="Escape")return;const H=v?Ss(v.nodesRef.current,o):[];if(!I&&(q.stopPropagation(),H.length>0)){let B=!0;if(H.forEach(F=>{var D;if((D=F.context)!=null&&D.open&&!F.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,U7(q)?q.nativeEvent:q)}),O=Ui(q=>{const H=_.current;if(_.current=!1,H||typeof E=="function"&&!E(q))return;const B=OE(q),F="["+Xa("inert")+"]",D=Tr(c).querySelectorAll(F);let M=Jt(B)?B:null;for(;M&&!Ka(M);){const Q=xo(M);if(Q===Tr(c).body||!Jt(Q))break;M=Q}if(D.length&&Jt(B)&&!B7(B)&&!Wn(B,c)&&Array.from(D).every(Q=>!Wn(M,Q)))return;if(Pn(B)&&c){const Q=B.clientWidth>0&&B.scrollWidth>B.clientWidth,C=B.clientHeight>0&&B.scrollHeight>B.clientHeight;let te=C&&q.offsetX>B.clientWidth;if(C&&nr(B).direction==="rtl"&&(te=q.offsetX<=B.offsetWidth-B.clientWidth),te||Q&&q.offsetY>B.clientHeight)return}const Z=v&&Ss(v.nodesRef.current,o).some(Q=>{var C;return km(q,(C=Q.context)==null?void 0:C.elements.floating)});if(km(q,c)||km(q,a)||Z)return;const W=v?Ss(v.nodesRef.current,o):[];if(W.length>0){let Q=!0;if(W.forEach(C=>{var te;if((te=C.context)!=null&&te.open&&!C.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:b?{preventScroll:!0}:kE(q)||CE(q)}}),r(!1,q)});return N.useEffect(()=>{if(!n||!u)return;l.current.__escapeKeyBubbles=I,l.current.__outsidePressBubbles=P;function q(F){r(!1,F)}const H=Tr(c);d&&H.addEventListener("keydown",$),E&&H.addEventListener(f,O);let B=[];return y&&(Jt(a)&&(B=qi(a)),Jt(c)&&(B=B.concat(qi(c))),!Jt(s)&&s&&s.contextElement&&(B=B.concat(qi(s.contextElement)))),B=B.filter(F=>{var D;return F!==((D=H.defaultView)==null?void 0:D.visualViewport)}),B.forEach(F=>{F.addEventListener("scroll",q,{passive:!0})}),()=>{d&&H.removeEventListener("keydown",$),E&&H.removeEventListener(f,O),B.forEach(F=>{F.removeEventListener("scroll",q)})}},[l,c,a,s,d,E,f,n,r,y,u,I,P,$,O]),N.useEffect(()=>{_.current=!1},[E,f]),N.useMemo(()=>u?{reference:{onKeyDown:$,[G9[m]]:q=>{h&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,q.nativeEvent))}},floating:{onKeyDown:$,[X9[f]]:()=>{_.current=!0}}}:{},[u,i,h,f,m,r,$])}let jm;process.env.NODE_ENV!=="production"&&(jm=new Set);function t8(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!Jt(e.elements.reference)){var s;if(!((s=jm)!=null&&s.has(I))){var a;(a=jm)==null||a.add(I),console.error(I)}}}const[c,l]=N.useState(null),u=((t=e.elements)==null?void 0:t.reference)||c,d=f9(e),p=bd(),f=Ui((I,P)=>{I&&(m.current.openEvent=P),r==null||r(I,P)}),h=N.useRef(null),m=N.useRef({}),y=N.useState(()=>D9())[0],g=Pm(),v=N.useCallback(I=>{const P=Jt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;d.refs.setReference(P)},[d.refs]),b=N.useCallback(I=>{(Jt(I)||I===null)&&(h.current=I,l(I)),(Jt(d.refs.reference.current)||d.refs.reference.current===null||I!==null&&!Jt(I))&&d.refs.setReference(I)},[d.refs]),S=N.useMemo(()=>({...d.refs,setReference:b,setPositionReference:v,domReference:h}),[d.refs,b,v]),E=N.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),_=N.useMemo(()=>({...d,refs:S,elements:E,dataRef:m,nodeId:i,floatingId:g,events:y,open:n,onOpenChange:f}),[d,i,g,y,n,f,S,E]);return an(()=>{const I=p==null?void 0:p.nodesRef.current.find(P=>P.id===i);I&&(I.context=_)}),N.useMemo(()=>({...d,context:_,refs:S,elements:E}),[d,S,E,_])}function Mm(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,c]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var l;(l=r.get(a))==null||l.push(c),i[a]=function(){for(var u,d=arguments.length,p=new Array(d),f=0;f<d;f++)p[f]=arguments[f];return(u=r.get(a))==null?void 0:u.map(h=>h(...p)).find(h=>h!==void 0)}}}else i[a]=c}),i),{})}}function n8(e){e===void 0&&(e=[]);const t=e,n=N.useCallback(o=>Mm(o,e,"reference"),t),r=N.useCallback(o=>Mm(o,e,"floating"),t),i=N.useCallback(o=>Mm(o,e,"item"),e.map(o=>o==null?void 0:o.item));return N.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let lk=!1;function Sd(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function uk(e,t){return Sd(t,e===Om||e===yd,e===_s||e===Ya)}function qm(e,t,n){return Sd(t,e===yd,n?e===_s:e===Ya)||e==="Enter"||e==" "||e===""}function r8(e,t,n){return Sd(t,n?e===_s:e===Ya,e===yd)}function dk(e,t,n){return Sd(t,n?e===Ya:e===_s,e===Om)}function i8(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:p=!1,loop:f=!1,nested:h=!1,rtl:m=!1,virtual:y=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:S=void 0,orientation:E="vertical",cols:_=1,scrollItemIntoView:I=!0,virtualItemRef:P}=t;process.env.NODE_ENV!=="production"&&(p&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),y||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),E==="vertical"&&_>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const $=XE(),O=bd(),q=Ui(l),H=N.useRef(g),B=N.useRef(d??-1),F=N.useRef(null),D=N.useRef(!0),M=N.useRef(q),Z=N.useRef(!!s),W=N.useRef(!1),Q=N.useRef(!1),C=Fi(S),te=Fi(n),fe=Fi(I),[A,we]=N.useState(),[Te,Ee]=N.useState(),$e=Ui(function(he,de,_e){_e===void 0&&(_e=!1);const pe=he.current[de.current];pe&&(y?(we(pe.id),O==null||O.events.emit("virtualfocus",pe),P&&(P.current=pe)):fi(pe,{preventScroll:!0,sync:F7()&&TE()?lk||W.current:!1}),requestAnimationFrame(()=>{const De=fe.current;De&&pe&&(_e||!D.current)&&(pe.scrollIntoView==null||pe.scrollIntoView(typeof De=="boolean"?{block:"nearest",inline:"nearest"}:De))}))});an(()=>{document.createElement("div").focus({get preventScroll(){return lk=!0,!1}})},[]),an(()=>{u&&(n&&s?H.current&&d!=null&&(Q.current=!0,q(d)):Z.current&&(B.current=-1,M.current(null)))},[u,n,s,d,q]),an(()=>{if(u&&n&&s)if(c==null){if(W.current=!1,d!=null)return;if(Z.current&&(B.current=-1,$e(a,B)),!Z.current&&H.current&&(F.current!=null||H.current===!0&&F.current==null)){let he=0;const de=()=>{a.current[0]==null?(he<2&&(he?requestAnimationFrame:queueMicrotask)(de),he++):(B.current=F.current==null||qm(F.current,E,m)||h?Im(a,C.current):JE(a,C.current),F.current=null,q(B.current))};de()}}else Ga(a,c)||(B.current=c,$e(a,B,Q.current),Q.current=!1)},[u,n,s,c,d,h,a,E,m,q,$e,C]),an(()=>{var he,de;if(!u||s||!O||y||!Z.current)return;const _e=O.nodesRef.current,pe=(he=_e.find(L=>L.id===$))==null||(de=he.context)==null?void 0:de.elements.floating,De=Li(Tr(s)),et=_e.some(L=>L.context&&Wn(L.context.elements.floating,De));pe&&!et&&D.current&&pe.focus({preventScroll:!0})},[u,s,O,$,y]),an(()=>{if(!u||!O||!y||$)return;function he(de){Ee(de.id),P&&(P.current=de)}return O.events.on("virtualfocus",he),()=>{O.events.off("virtualfocus",he)}},[u,O,y,$,P]),an(()=>{M.current=q,Z.current=!!s}),an(()=>{n||(F.current=null)},[n]);const Fe=c!=null,Pe=N.useMemo(()=>{function he(_e){if(!n)return;const pe=a.current.indexOf(_e);pe!==-1&&q(pe)}return{onFocus(_e){let{currentTarget:pe}=_e;he(pe)},onClick:_e=>{let{currentTarget:pe}=_e;return pe.focus({preventScroll:!0})},...v&&{onMouseMove(_e){let{currentTarget:pe}=_e;he(pe)},onPointerLeave(_e){let{pointerType:pe}=_e;!D.current||pe==="touch"||(B.current=-1,$e(a,B),q(null),y||fi(i.floating.current,{preventScroll:!0}))}}}},[n,i,$e,v,a,q,y]);return N.useMemo(()=>{if(!u)return{};const he=C.current;function de(L){if(D.current=!1,W.current=!0,!te.current&&L.currentTarget===i.floating.current)return;if(h&&dk(L.key,E,m)){xn(L),r(!1,L.nativeEvent),Pn(o)&&!y&&o.focus();return}const oe=B.current,ce=Im(a,he),ue=JE(a,he);if(L.key==="Home"&&(xn(L),B.current=ce,q(B.current)),L.key==="End"&&(xn(L),B.current=ue,q(B.current)),!(_>1&&(B.current=R9(a,{event:L,orientation:E,loop:f,cols:_,disabledIndices:he,minIndex:ce,maxIndex:ue,prevIndex:B.current,stopEvent:!0}),q(B.current),E==="both"))&&uk(L.key,E)){if(xn(L),n&&!y&&Li(L.currentTarget.ownerDocument)===L.currentTarget){B.current=qm(L.key,E,m)?ce:ue,q(B.current);return}qm(L.key,E,m)?f?B.current=oe>=ue?p&&oe!==a.current.length?-1:ce:$n(a,{startingIndex:oe,disabledIndices:he}):B.current=Math.min(ue,$n(a,{startingIndex:oe,disabledIndices:he})):f?B.current=oe<=ce?p&&oe!==-1?a.current.length:ue:$n(a,{startingIndex:oe,decrement:!0,disabledIndices:he}):B.current=Math.max(ce,$n(a,{startingIndex:oe,decrement:!0,disabledIndices:he})),Ga(a,B.current)?q(null):q(B.current)}}function _e(L){g==="auto"&&kE(L.nativeEvent)&&(H.current=!0)}function pe(L){H.current=g,g==="auto"&&CE(L.nativeEvent)&&(H.current=!0)}const De=y&&n&&Fe&&{"aria-activedescendant":Te||A},et=a.current.find(L=>(L==null?void 0:L.id)===A);return{reference:{...De,onKeyDown(L){D.current=!1;const oe=L.key.indexOf("Arrow")===0,ce=r8(L.key,E,m),ue=dk(L.key,E,m),Ne=uk(L.key,E),Se=(h?ce:Ne)||L.key==="Enter"||L.key.trim()==="";if(y&&n){const K=O==null?void 0:O.nodesRef.current.find(ae=>ae.parentId==null),ie=O&&K?q9(O.nodesRef.current,K.id):null;if(oe&&ie&&P){const ae=new KeyboardEvent("keydown",{key:L.key,bubbles:!0});if(ce||ue){var Be,pt;const Ae=((Be=ie.context)==null?void 0:Be.elements.domReference)===L.currentTarget,Je=ue&&!Ae?(pt=ie.context)==null?void 0:pt.elements.domReference:ce?et:null;Je&&(xn(L),Je.dispatchEvent(ae),Ee(void 0))}if(Ne&&ie.context&&ie.context.open&&ie.parentId&&L.currentTarget!==ie.context.elements.domReference){var Ge;xn(L),(Ge=ie.context.elements.domReference)==null||Ge.dispatchEvent(ae);return}}return de(L)}if(!(!n&&!b&&oe)){if(Se&&(F.current=h&&Ne?null:L.key),h){ce&&(xn(L),n?(B.current=Im(a,he),q(B.current)):r(!0,L.nativeEvent));return}Ne&&(d!=null&&(B.current=d),xn(L),!n&&b?r(!0,L.nativeEvent):de(L),n&&q(B.current))}},onFocus(){n&&q(null)},onPointerDown:pe,onMouseDown:_e,onClick:_e},floating:{"aria-orientation":E==="both"?void 0:E,...De,onKeyDown:de,onPointerMove(){D.current=!0}},item:Pe}},[o,i,A,Te,C,te,a,u,E,m,y,n,Fe,h,d,b,p,_,f,g,q,r,Pe,O,P])}function o8(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=Pm();return N.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function s8(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:p=[],selectedIndex:f=null}=t,h=N.useRef(),m=N.useRef(""),y=N.useRef((n=f??s)!=null?n:-1),g=N.useRef(null),v=Ui(a),b=Ui(c),S=Fi(u),E=Fi(p);return an(()=>{r&&(clearTimeout(h.current),g.current=null,m.current="")},[r]),an(()=>{if(r&&m.current===""){var _;y.current=(_=f??s)!=null?_:-1}},[r,f,s]),N.useMemo(()=>{if(!l)return{};function _($){$?i.current.typing||(i.current.typing=$,b($)):i.current.typing&&(i.current.typing=$,b($))}function I($,O,q){const H=S.current?S.current(O,q):O.find(B=>(B==null?void 0:B.toLocaleLowerCase().indexOf(q.toLocaleLowerCase()))===0);return H?$.indexOf(H):-1}function P($){const O=o.current;if(m.current.length>0&&m.current[0]!==" "&&(I(O,O,m.current)===-1?_(!1):$.key===" "&&xn($)),O==null||E.current.includes($.key)||$.key.length!==1||$.ctrlKey||$.metaKey||$.altKey)return;r&&$.key!==" "&&(xn($),_(!0)),O.every(F=>{var D,M;return F?((D=F[0])==null?void 0:D.toLocaleLowerCase())!==((M=F[1])==null?void 0:M.toLocaleLowerCase()):!0})&&m.current===$.key&&(m.current="",y.current=g.current),m.current+=$.key,clearTimeout(h.current),h.current=setTimeout(()=>{m.current="",y.current=g.current,_(!1)},d);const H=y.current,B=I(O,[...O.slice((H||0)+1),...O.slice(0,(H||0)+1)],m.current);B!==-1?(v(B),g.current=B):$.key!==" "&&(m.current="",_(!1))}return{reference:{onKeyDown:P},floating:{onKeyDown:P,onKeyUp($){$.key===" "&&_(!1)}}}},[l,r,i,o,d,E,S,v,b])}const a8=({styles:e,type:t,options:n,label:r,reusable:i})=>{var Z,W,Q,C,te,fe,A,we,Te,Ee,$e,Fe;const o=Ie(Pe=>Pe.sendTextMessage),s=Ie(Pe=>Pe.messageContainerRef),a=Ie(Pe=>Pe.isReadOnly),[c,l]=N.useState(!1),[u,d]=N.useState(null),[p,f]=N.useState(null),h=n.reduce((Pe,he)=>(Pe[he.label]=he.value,Pe),{}),m=h?Object.keys(h):[],y=Pe=>{l(p!==null&&!i?!1:Pe)},{refs:g,floatingStyles:v,context:b}=t8({placement:"bottom-start",open:c,onOpenChange:y,whileElementsMounted:u9,middleware:[H7(5),W7({padding:10,boundary:(s==null?void 0:s.current)??void 0,crossAxis:!0}),K7({apply({rects:Pe,elements:he,availableHeight:de}){Object.assign(he.floating.style,{maxHeight:`${de}px`,minWidth:`${Pe.reference.width}px`})},padding:10})]}),S=N.useRef([]),E=N.useRef(m),_=N.useRef(!1),I=J9(b,{event:"mousedown"}),P=e8(b),$=o8(b,{role:"listbox"}),O=i8(b,{listRef:S,activeIndex:u,selectedIndex:p,onNavigate:d,loop:!0}),q=s8(b,{listRef:E,activeIndex:u,selectedIndex:p,onMatch:c?d:f,onTypingChange(Pe){_.current=Pe}}),{getReferenceProps:H,getFloatingProps:B,getItemProps:F}=n8([P,$,O,q,I]),D=Pe=>{f(Pe),o(h[m[Pe]]),l(!1)},M=p!==null?m[p]:void 0;return U.jsxs(U.Fragment,{children:[U.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":p!==null&&!i?"":void 0,...(W=(Z=e==null?void 0:e[t])==null?void 0:Z.button)==null?void 0:W.container,...H(),children:[U.jsx("span",{...(C=(Q=e==null?void 0:e[t])==null?void 0:Q.button)==null?void 0:C.text,children:M||r||"Select..."}),U.jsx(RZ,{...(fe=(te=e==null?void 0:e[t])==null?void 0:te.button)==null?void 0:fe.icon})]}),c&&U.jsx(H9,{children:U.jsx(K9,{context:b,modal:!1,children:U.jsx("div",{ref:g.setFloating,className:(Te=(we=(A=e==null?void 0:e[t])==null?void 0:A.content)==null?void 0:we.container)==null?void 0:Te.className,style:{...v,...(Fe=($e=(Ee=e==null?void 0:e[t])==null?void 0:Ee.content)==null?void 0:$e.container)==null?void 0:Fe.style},...B(),children:m.map((Pe,he)=>{var de,_e;return U.jsx("div",{ref:pe=>{S.current[he]=pe},role:"option",tabIndex:he===u?0:-1,"aria-selected":he===p&&he===u,"data-active":he===u?"":void 0,...(_e=(de=e==null?void 0:e[t])==null?void 0:de.content)==null?void 0:_e.item,...F({onClick(){a||D(he)},onKeyDown(pe){a||(pe.key==="Enter"&&(pe.preventDefault(),D(he)),pe.key===" "&&!_.current&&(pe.preventDefault(),D(he)))}}),children:Pe},Pe)})})})})]})},c8=w.forwardRef(({type:e,title:t,styles:n,url:r,...i},o)=>{var s,a,c;return U.jsxs("a",{...i,...(s=n==null?void 0:n[e])==null?void 0:s.container,href:r,download:!0,ref:o,target:"_blank",children:[U.jsx("p",{...(a=n==null?void 0:n[e])==null?void 0:a.title,children:t||r}),U.jsx($Z,{...(c=n==null?void 0:n[e])==null?void 0:c.icon})]})}),fk={audio:SZ,bubble:vZ,button:yZ,carousel:P7,column:LZ,dropdown:a8,file:c8,image:wZ,location:qZ,row:FZ,text:vL,video:_Z},ks=({block:e,styles:t,...n})=>{const i=Ie(s=>s.renderers)[e.type]??fk[e.type],o={...n,styles:t,...e};return U.jsx(i,{...o})},pk=w.memo(w.forwardRef((e,t)=>{const{composer:n}=Ie(d=>d.theme),r=Ie(d=>d.sendTextMessage),i=Ie(d=>d.disableComposer),o=Ie(d=>d.isReadOnly),[s,a]=w.useState(""),[c,l]=w.useState(-1);if(o)return null;const u=()=>{s&&(r(s),a(""),l(-1))};return U.jsx(aE.Provider,{value:{value:s,setValue:a,historyIndex:c,setHistoryIndex:l,sendMessage:u},children:U.jsx("div",{"data-disabled":i,...e,...n==null?void 0:n.container,ref:t})})})),hk=w.memo(e=>{const{composer:t}=Ie(g=>g.theme),n=Ie(g=>g.configuration),r=Ie(g=>g.disableComposer),i=Ie(g=>g.setIsTyping),{value:o,setValue:s,historyIndex:a,setHistoryIndex:c,sendMessage:l}=cE(),u=w.useRef(null),d=Qn(g=>g.user),p=Qn(g=>g.messageHistory),[f,h]=w.useState(!1);bL(u.current,o);function m({key:g}){g==="Shift"&&h(!0)}function y({key:g}){g==="Shift"&&h(!1)}return w.useEffect(()=>(window.addEventListener("keydown",m),window.addEventListener("keyup",y),()=>{window.removeEventListener("keydown",m),window.removeEventListener("keyup",y)}),[]),U.jsx("textarea",{...t==null?void 0:t.input,placeholder:(n==null?void 0:n.composerPlaceholder)??"Type your message...",disabled:r,ref:u,value:o,"data-has-value":!!o,onChange:g=>s(g.target.value),onKeyDown:g=>{if(!r){if(g.key==="Enter"&&(g.preventDefault(),f?(s(`${o}
|
|
363
|
+
`),setTimeout(()=>{var v;return(v=u.current)==null?void 0:v.scroll({behavior:"instant",top:u.current.scrollHeight})},0)):(l(),setTimeout(()=>i(!0,9e3),500))),g.key==="ArrowUp"){g.preventDefault();const v=p[(d==null?void 0:d.userId)??""]??[];a<v.length-1&&s(v[a+1]),c(()=>Math.min(a+1,v.length-1))}if(g.key==="ArrowDown"){g.preventDefault();const v=p[(d==null?void 0:d.userId)??""]??[];s(a===0?"":v[a-1]),c(()=>Math.max(a-1,-1))}}},...e})}),mk=w.memo(w.forwardRef(({icon:e=MZ,...t},n)=>{var u,d;const{composer:r}=Ie(p=>p.theme),i=Ie(p=>p.sendFile),o=Ie(p=>p.addMessage),s=w.useRef(null);if(!Ie(p=>p.allowFileUpload))return null;const c=()=>{var p;s.current&&((p=s.current)==null||p.click())},l=async p=>{var h;const f=(h=p.target.files)==null?void 0:h[0];if(f)try{const{fileUrl:m,type:y}=await i(f)??"";o({direction:"outgoing",sender:{name:"You"},timestamp:new Date,disableInput:!1,block:{type:y,url:m}})}catch(m){console.error("Error sending file:",m)}};return U.jsxs(U.Fragment,{children:[U.jsx("button",{type:"button",ref:n,...t,...(u=r==null?void 0:r.uploadButton)==null?void 0:u.container,onClick:c,children:U.jsx(e,{...(d=r==null?void 0:r.uploadButton)==null?void 0:d.icon})}),U.jsx("input",{type:"file",ref:s,style:{display:"none"},onChange:l})]})})),yk=w.memo(w.forwardRef(({icon:e=OZ,...t},n)=>{var s,a;const{value:r,sendMessage:i}=cE(),{composer:o}=Ie(c=>c.theme);return U.jsx("button",{type:"button",ref:n,...t,...(s=o==null?void 0:o.button)==null?void 0:s.container,disabled:!r,onClick:i,children:U.jsx(e,{...(a=o==null?void 0:o.button)==null?void 0:a.icon})})})),gk=({children:e})=>{const[t,n]=w.useState(!1),[r,i]=w.useState(""),[o,s]=w.useState(null),a=({title:l,content:u})=>{i(l),s(u),n(!0)},c=()=>{n(!1)};return U.jsxs(uE.Provider,{value:{hideModal:c,showModal:a,title:r,content:o,open:t},children:[U.jsx(Zi,{open:t,onOpenChange:n,children:U.jsx(Zi.Content,{title:r,children:o})}),e]})},l8=({children:e,...t})=>{const n=w.useRef(),r=w.useRef(null),i=mZ({...t,messageContainerRef:r});return n.current||(n.current=i),U.jsx(sE.Provider,{value:n.current,children:U.jsx(u8,{children:e})})},u8=({children:e})=>{const t=Ie(g=>g.client),n=Ie(g=>g.addMessage),r=Ie(g=>g.setMessages),i=Ie(g=>g.configuration),o=Ie(g=>g.setConnected),s=Ie(g=>g.userData),a=Ie(g=>g.userName),c=Ie(g=>g.userPictureUrl),l=Ie(g=>g.setIsTyping),u=Ie(g=>g.getMessages),d=Qn(g=>g.setConversationId),p=Qn(g=>g.user),f=Qn(g=>g.conversationId),h=Qn(g=>g.setUser),[m,y]=w.useState(0);return w.useEffect(()=>{if(t)return t.on("messageSent",g=>{const v=u(),b=v[v.length-1];b.block.type!=="bubble"||b.block.block.type!=="text"||b.block.block.text===g||n({direction:"outgoing",sender:{name:"You"},timestamp:new Date,block:{type:"bubble",block:{type:"text",text:g}},disableInput:!1})})},[f]),w.useEffect(()=>{if(t)return t.on("message",g=>{try{const{payload:v,disableInput:b,id:S,conversationId:E}=g;if(f!==E)return;l(!1,0),n({id:S,direction:"incoming",sender:{name:i.botName??"Bot",avatar:i.botAvatar},timestamp:new Date(g.sentOn),block:v,disableInput:b})}catch{console.error("Invalid message payload")}})},[f]),w.useEffect(()=>{if(t)return t.on("conversation",g=>{d(g)})},[]),WS(async()=>{if(t)return t.on("error",()=>{y(g=>g+1)})}),WS(async()=>{if(!t||f&&t.conversationId===f)return;let g;try{g=await t.connect(p,s,{name:a,pictureUrl:c}),o(!0)}catch(b){console.error(b),o(!1);return}h(g),f&&await t.conversationExists(f)?await t.switchConversation(f):await t.newConversation();const v=[];for(const b of await t.listMessages())try{const{payload:S,authorId:E,sentOn:_,disableInput:I,id:P}=b,$=E===t.userId?"outgoing":"incoming";v.push({id:P,direction:$,sender:$==="outgoing"?{name:"You"}:{name:i.botName??"Bot",avatar:i.botAvatar},timestamp:new Date(_),block:S,disableInput:I})}catch{console.error("Invalid message payload")}return r(v.reverse()),()=>{t.disconnect()}},[m,f]),U.jsx(U.Fragment,{children:e})};function Dn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}const d8=N["useId".toString()]||(()=>{});let f8=0;function Ed(e){const[t,n]=N.useState(d8());return zo(()=>{e||n(r=>r??String(f8++))},[e]),e||(t?`radix-${t}`:"")}function vk({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=p8({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=Mn(n),c=w.useCallback(l=>{if(o){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else i(l)},[o,e,i,a]);return[s,c]}function p8({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=Mn(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}function h8(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Lm="dismissableLayer.update",m8="dismissableLayer.pointerDownOutside",y8="dismissableLayer.focusOutside";let bk;const g8=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),v8=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...l}=e,u=w.useContext(g8),[d,p]=w.useState(null),f=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=w.useState({}),m=Jn(t,P=>p(P)),y=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(g),b=d?y.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,E=b>=v,_=b8(P=>{const $=P.target,O=[...u.branches].some(q=>q.contains($));!E||O||(o==null||o(P),a==null||a(P),P.defaultPrevented||c==null||c())},f),I=w8(P=>{const $=P.target;[...u.branches].some(q=>q.contains($))||(s==null||s(P),a==null||a(P),P.defaultPrevented||c==null||c())},f);return h8(P=>{b===u.layers.size-1&&(i==null||i(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},f),w.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(bk=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),wk(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=bk)}},[d,f,r,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),wk())},[d,u]),w.useEffect(()=>{const P=()=>h({});return document.addEventListener(Lm,P),()=>document.removeEventListener(Lm,P)},[]),w.createElement(bn.div,Xi({},l,{ref:m,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Dn(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Dn(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Dn(e.onPointerDownCapture,_.onPointerDownCapture)}))});function b8(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){xk(m8,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function w8(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&xk(y8,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wk(){const e=new CustomEvent(Lm);document.dispatchEvent(e)}function xk(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?F$(i,o):i.dispatchEvent(o)}const Fm="focusScope.autoFocusOnMount",Um="focusScope.autoFocusOnUnmount",_k={bubbles:!1,cancelable:!0},x8=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,c]=w.useState(null),l=Mn(i),u=Mn(o),d=w.useRef(null),p=Jn(t,m=>c(m)),f=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let m=function(b){if(f.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:Bi(d.current,{select:!0})},y=function(b){if(f.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||Bi(d.current,{select:!0}))},g=function(b){const S=document.activeElement;for(const E of b)E.removedNodes.length>0&&(a!=null&&a.contains(S)||Bi(a))};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),v.disconnect()}}},[r,a,f.paused]),w.useEffect(()=>{if(a){kk.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Fm,_k);a.addEventListener(Fm,l),a.dispatchEvent(g),g.defaultPrevented||(_8(T8(Sk(a)),{select:!0}),document.activeElement===m&&Bi(a))}return()=>{a.removeEventListener(Fm,l),setTimeout(()=>{const g=new CustomEvent(Um,_k);a.addEventListener(Um,u),a.dispatchEvent(g),g.defaultPrevented||Bi(m??document.body,{select:!0}),a.removeEventListener(Um,u),kk.remove(f)},0)}}},[a,l,u,f]);const h=w.useCallback(m=>{if(!n&&!r||f.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[b,S]=S8(v);b&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Bi(b,{select:!0})):m.shiftKey&&g===b&&(m.preventDefault(),n&&Bi(S,{select:!0})):g===v&&m.preventDefault()}},[n,r,f.paused]);return w.createElement(bn.div,Xi({tabIndex:-1},s,{ref:p,onKeyDown:h}))});function _8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bi(r,{select:t}),document.activeElement!==n)return}function S8(e){const t=Sk(e),n=Ek(t,e),r=Ek(t.reverse(),e);return[n,r]}function Sk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ek(e,t){for(const n of e)if(!E8(n,{upTo:t}))return n}function E8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function k8(e){return e instanceof HTMLInputElement&&"select"in e}function Bi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&k8(e)&&t&&e.select()}}const kk=C8();function C8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ck(e,t),e.unshift(t)},remove(t){var n;e=Ck(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Ck(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function T8(e){return e.filter(t=>t.tagName!=="A")}function A8(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const zi=e=>{const{present:t,children:n}=e,r=O8(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=Jn(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};zi.displayName="Presence";function O8(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),s=e?"mounted":"unmounted",[a,c]=A8(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const l=kd(r.current);o.current=a==="mounted"?l:"none"},[a]),zo(()=>{const l=r.current,u=i.current;if(u!==e){const p=o.current,f=kd(l);e?c("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&p!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),zo(()=>{if(t){const l=d=>{const f=kd(r.current).includes(d.animationName);d.target===t&&f&&Ar.flushSync(()=>c("ANIMATION_END"))},u=d=>{d.target===t&&(o.current=kd(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function kd(e){return(e==null?void 0:e.animationName)||"none"}let Bm=0;function I8(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:Tk()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:Tk()),Bm++,()=>{Bm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Bm--}},[])}function Tk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Vr=function(){return Vr=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vr.apply(this,arguments)};function Ak(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function R8(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Cd="right-scroll-bar-position",Td="width-before-scroll-bar",P8="with-scroll-bars-hidden",$8="--removed-body-scroll-bar-size";function D8(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function N8(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function j8(e,t){return N8(t||null,function(n){return e.forEach(function(r){return D8(r,n)})})}function M8(e){return e}function q8(e,t){t===void 0&&(t=M8);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var c=function(){var u=s;s=[],u.forEach(o)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){s.push(u),l()},filter:function(u){return s=s.filter(u),n}}}};return i}function L8(e){e===void 0&&(e={});var t=q8(null);return t.options=Vr({async:!0,ssr:!1},e),t}var Ok=function(e){var t=e.sideCar,n=Ak(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return N.createElement(r,Vr({},n))};Ok.isSideCarExport=!0;function F8(e,t){return e.useMedium(t),Ok}var Ik=L8(),zm=function(){},Ad=N.forwardRef(function(e,t){var n=N.useRef(null),r=N.useState({onScrollCapture:zm,onWheelCapture:zm,onTouchMoveCapture:zm}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,f=e.noIsolation,h=e.inert,m=e.allowPinchZoom,y=e.as,g=y===void 0?"div":y,v=Ak(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=p,S=j8([n,t]),E=Vr(Vr({},v),i);return N.createElement(N.Fragment,null,u&&N.createElement(b,{sideCar:Ik,removeScrollBar:l,shards:d,noIsolation:f,inert:h,setCallbacks:o,allowPinchZoom:!!m,lockRef:n}),s?N.cloneElement(N.Children.only(a),Vr(Vr({},E),{ref:S})):N.createElement(g,Vr({},E,{className:c,ref:S}),a))});Ad.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ad.classNames={fullWidth:Td,zeroRight:Cd};var Rk,U8=function(){if(Rk)return Rk;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function B8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=U8();return t&&e.setAttribute("nonce",t),e}function z8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Z8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=B8())&&(z8(t,n),Z8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},H8=function(){var e=V8();return function(t,n){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pk=function(){var e=H8(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},W8={left:0,top:0,right:0,gap:0},Zm=function(e){return parseInt(e||"",10)||0},K8=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Zm(n),Zm(r),Zm(i)]},J8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return W8;var t=K8(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Y8=Pk(),G8=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
364
364
|
.`.concat(P8,` {
|
|
365
365
|
overflow: hidden `).concat(r,`;
|
|
366
366
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -397,7 +397,7 @@ to {
|
|
|
397
397
|
body {
|
|
398
398
|
`).concat($8,": ").concat(a,`px;
|
|
399
399
|
}
|
|
400
|
-
`)},X8=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=N.useMemo(function(){return J8(i)},[i]);return N.createElement(Y8,{styles:G8(o,!t,i,n?"":"!important")})},Vm=!1;if(typeof window<"u")try{var Od=Object.defineProperty({},"passive",{get:function(){return Vm=!0,!0}});window.addEventListener("test",Od,Od),window.removeEventListener("test",Od,Od)}catch{Vm=!1}var Cs=Vm?{passive:!1}:!1,Q8=function(e){return e.tagName==="TEXTAREA"},$k=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q8(e)&&n[t]==="visible")},eV=function(e){return $k(e,"overflowY")},tV=function(e){return $k(e,"overflowX")},Dk=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Nk(e,n);if(r){var i=jk(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},nV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Nk=function(e,t){return e==="v"?eV(t):tV(t)},jk=function(e,t){return e==="v"?nV(t):rV(t)},iV=function(e,t){return e==="h"&&t==="rtl"?-1:1},oV=function(e,t,n,r,i){var o=iV(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,c=t.contains(a),l=!1,u=s>0,d=0,
|
|
400
|
+
`)},X8=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=N.useMemo(function(){return J8(i)},[i]);return N.createElement(Y8,{styles:G8(o,!t,i,n?"":"!important")})},Vm=!1;if(typeof window<"u")try{var Od=Object.defineProperty({},"passive",{get:function(){return Vm=!0,!0}});window.addEventListener("test",Od,Od),window.removeEventListener("test",Od,Od)}catch{Vm=!1}var Cs=Vm?{passive:!1}:!1,Q8=function(e){return e.tagName==="TEXTAREA"},$k=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q8(e)&&n[t]==="visible")},eV=function(e){return $k(e,"overflowY")},tV=function(e){return $k(e,"overflowX")},Dk=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Nk(e,n);if(r){var i=jk(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},nV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Nk=function(e,t){return e==="v"?eV(t):tV(t)},jk=function(e,t){return e==="v"?nV(t):rV(t)},iV=function(e,t){return e==="h"&&t==="rtl"?-1:1},oV=function(e,t,n,r,i){var o=iV(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,c=t.contains(a),l=!1,u=s>0,d=0,p=0;do{var f=jk(e,a),h=f[0],m=f[1],y=f[2],g=m-y-o*h;(h||g)&&Nk(e,a)&&(d+=g,p+=h),a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&(i&&d===0||!i&&s>d)||!u&&(i&&p===0||!i&&-s>p))&&(l=!0),l},Id=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mk=function(e){return[e.deltaX,e.deltaY]},qk=function(e){return e&&"current"in e?e.current:e},sV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aV=function(e){return`
|
|
401
401
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
402
402
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
403
|
-
`)},cV=0,Ts=[];function lV(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),i=N.useState(cV++)[0],o=N.useState(function(){return Pk()})[0],s=N.useRef(e);N.useEffect(function(){s.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=R8([e.lockRef.current],(e.shards||[]).map(qk),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=N.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!s.current.allowPinchZoom;var v=Id(m),g=n.current,b="deltaX"in m?m.deltaX:g[0]-v[0],S="deltaY"in m?m.deltaY:g[1]-v[1],E,_=m.target,I=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in m&&I==="h"&&_.type==="range")return!1;var P=Dk(I,_);if(!P)return!0;if(P?E=I:(E=I==="v"?"h":"v",P=Dk(I,_)),!P)return!1;if(!r.current&&"changedTouches"in m&&(b||S)&&(r.current=E),!E)return!0;var $=r.current||E;return oV($,y,m,$==="h"?b:S,!0)},[]),c=N.useCallback(function(m){var y=m;if(!(!Ts.length||Ts[Ts.length-1]!==o)){var v="deltaY"in y?Mk(y):Id(y),g=t.current.filter(function(E){return E.name===y.type&&E.target===y.target&&sV(E.delta,v)})[0];if(g&&g.should){y.cancelable&&y.preventDefault();return}if(!g){var b=(s.current.shards||[]).map(qk).filter(Boolean).filter(function(E){return E.contains(y.target)}),S=b.length>0?a(y,b[0]):!s.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),l=N.useCallback(function(m,y,v,g){var b={name:m,delta:y,target:v,should:g};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),u=N.useCallback(function(m){n.current=Id(m),r.current=void 0},[]),d=N.useCallback(function(m){l(m.type,Mk(m),m.target,a(m,e.lockRef.current))},[]),h=N.useCallback(function(m){l(m.type,Id(m),m.target,a(m,e.lockRef.current))},[]);N.useEffect(function(){return Ts.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Cs),document.addEventListener("touchmove",c,Cs),document.addEventListener("touchstart",u,Cs),function(){Ts=Ts.filter(function(m){return m!==o}),document.removeEventListener("wheel",c,Cs),document.removeEventListener("touchmove",c,Cs),document.removeEventListener("touchstart",u,Cs)}},[]);var f=e.removeScrollBar,p=e.inert;return N.createElement(N.Fragment,null,p?N.createElement(o,{styles:aV(i)}):null,f?N.createElement(X8,{gapMode:"margin"}):null)}const uV=F8(Ik,lV);var Lk=N.forwardRef(function(e,t){return N.createElement(Ad,Vr({},e,{ref:t,sideCar:uV}))});Lk.classNames=Ad.classNames;const dV=Lk;var fV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},As=new WeakMap,Rd=new WeakMap,Pd={},Hm=0,Fk=function(e){return e&&(e.host||Fk(e.parentNode))},pV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Fk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},hV=function(e,t,n,r){var i=pV(t,Array.isArray(e)?e:[e]);Pd[n]||(Pd[n]=new WeakMap);var o=Pd[n],s=[],a=new Set,c=new Set(i),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};i.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else{var f=h.getAttribute(r),p=f!==null&&f!=="false",m=(As.get(h)||0)+1,y=(o.get(h)||0)+1;As.set(h,m),o.set(h,y),s.push(h),m===1&&p&&Rd.set(h,!0),y===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}})};return u(t),a.clear(),Hm++,function(){s.forEach(function(d){var h=As.get(d)-1,f=o.get(d)-1;As.set(d,h),o.set(d,f),h||(Rd.has(d)||d.removeAttribute(r),Rd.delete(d)),f||d.removeAttribute(n)}),Hm--,Hm||(As=new WeakMap,As=new WeakMap,Rd=new WeakMap,Pd={})}},mV=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||fV(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),hV(r,i,n,"aria-hidden")):function(){return null}};const Uk="Dialog",[Bk,hK]=Nl(Uk),[yV,pi]=Bk(Uk),gV=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=w.useRef(null),c=w.useRef(null),[l=!1,u]=vk({prop:r,defaultProp:i,onChange:o});return w.createElement(yV,{scope:t,triggerRef:a,contentRef:c,contentId:Ed(),titleId:Ed(),descriptionId:Ed(),open:l,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(d=>!d),[u]),modal:s},n)},vV="DialogTrigger",bV=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pi(vV,n),o=Jn(t,i.triggerRef);return w.createElement(bn.button,mt({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Km(i.open)},r,{ref:o,onClick:Dn(e.onClick,i.onOpenToggle)}))}),wV="DialogPortal",[mK,zk]=Bk(wV,{forceMount:void 0}),Wm="DialogOverlay",xV=w.forwardRef((e,t)=>{const n=zk(Wm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=pi(Wm,e.__scopeDialog);return o.modal?w.createElement(zi,{present:r||o.open},w.createElement(_V,mt({},i,{ref:t}))):null}),_V=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pi(Wm,n);return w.createElement(dV,{as:ip,allowPinchZoom:!0,shards:[i.contentRef]},w.createElement(bn.div,mt({"data-state":Km(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ec="DialogContent",SV=w.forwardRef((e,t)=>{const n=zk(ec,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=pi(ec,e.__scopeDialog);return w.createElement(zi,{present:r||o.open},o.modal?w.createElement(EV,mt({},i,{ref:t})):w.createElement(kV,mt({},i,{ref:t})))}),EV=w.forwardRef((e,t)=>{const n=pi(ec,e.__scopeDialog),r=w.useRef(null),i=Jn(t,n.contentRef,r);return w.useEffect(()=>{const o=r.current;if(o)return mV(o)},[]),w.createElement(Zk,mt({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Dn(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Dn(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Dn(e.onFocusOutside,o=>o.preventDefault())}))}),kV=w.forwardRef((e,t)=>{const n=pi(ec,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return w.createElement(Zk,mt({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),Zk=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=pi(ec,n),c=w.useRef(null),l=Jn(t,c);return I8(),w.createElement(w.Fragment,null,w.createElement(x8,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},w.createElement(v8,mt({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Km(a.open)},s,{ref:l,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),CV="DialogTitle",TV=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pi(CV,n);return w.createElement(bn.h2,mt({id:i.titleId},r,{ref:t}))}),AV="DialogClose",OV=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pi(AV,n);return w.createElement(bn.button,mt({type:"button"},r,{ref:t,onClick:Dn(e.onClick,()=>i.onOpenChange(!1))}))});function Km(e){return e?"open":"closed"}const IV=gV,RV=bV,PV=xV,$V=SV,DV=TV,Vk=OV;function NV({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const Hk=N.forwardRef(NV);function Zi({open:e,onOpenChange:t,children:n}){return U.jsx(IV,{open:e,onOpenChange:t,children:n})}function jV({title:e,children:t}){var r,i,o,s,a,c,l,u;const{modal:n}=$e(d=>d.theme);return U.jsxs(U.Fragment,{children:[U.jsx(PV,{...n==null?void 0:n.overlay}),U.jsx("div",{...n==null?void 0:n.container,children:U.jsxs($V,{...(r=n==null?void 0:n.dialog)==null?void 0:r.container,children:[U.jsxs("div",{...(o=(i=n==null?void 0:n.dialog)==null?void 0:i.title)==null?void 0:o.container,children:[U.jsx(DV,{...(a=(s=n==null?void 0:n.dialog)==null?void 0:s.title)==null?void 0:a.text,children:e}),U.jsx(Vk,{children:U.jsx(Hk,{role:"button",tabIndex:0,...(l=(c=n==null?void 0:n.dialog)==null?void 0:c.title)==null?void 0:l.closeIcon})})]}),U.jsx("div",{...(u=n==null?void 0:n.dialog)==null?void 0:u.content,children:t})]})})]})}Zi.Button=RV,Zi.Close=Vk,Zi.Content=jV;const Wk=w.forwardRef(({children:e,...t},n)=>{const{container:r}=$e(i=>i.theme);return U.jsxs("div",{...t,...r,ref:n,children:[U.jsx(h6,{}),U.jsxs(gk,{children:[U.jsx(MV,{}),e]})]})}),MV=()=>{const{modal:e}=$e(r=>r.theme),t=$e(r=>r.connected),{showModal:n}=dE();return w.useEffect(()=>{var r,i,o,s;t||n({title:"Connection Error",content:U.jsxs(U.Fragment,{children:[U.jsx("p",{...(i=(r=e==null?void 0:e.dialog)==null?void 0:r.newConversation)==null?void 0:i.text,children:"There was an error connecting to the server. Please check your internet connection and try again."}),U.jsx(Zi.Close,{asChild:!0,children:U.jsx("button",{type:"button",...(s=(o=e==null?void 0:e.dialog)==null?void 0:o.newConversation)==null?void 0:s.button,onClick:()=>window.location.reload(),children:"Restart"})})]})})},[t]),U.jsx(U.Fragment,{})},qV=w.forwardRef(({children:e,onClick:t,...n},r)=>{const{fab:i}=$e(a=>a.theme),{container:o,icon:s}=i??{};return U.jsx("div",{...n,...o,ref:r,onClick:t,children:U.jsx("div",{...s})})}),Kk="Collapsible",[LV,gK]=Nl(Kk),[FV,Jm]=LV(Kk),UV=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[c=!1,l]=vk({prop:r,defaultProp:i,onChange:s});return w.createElement(FV,{scope:n,disabled:o,contentId:Ed(),open:c,onOpenToggle:w.useCallback(()=>l(u=>!u),[l])},w.createElement(bn.div,mt({"data-state":Ym(c),"data-disabled":o?"":void 0},a,{ref:t})))}),BV="CollapsibleTrigger",zV=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Jm(BV,n);return w.createElement(bn.button,mt({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ym(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Dn(e.onClick,i.onOpenToggle)}))}),Jk="CollapsibleContent",ZV=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Jm(Jk,e.__scopeCollapsible);return w.createElement(zi,{present:n||i.open},({present:o})=>w.createElement(VV,mt({},r,{ref:t,present:o})))}),VV=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Jm(Jk,n),[a,c]=w.useState(r),l=w.useRef(null),u=Jn(t,l),d=w.useRef(0),h=d.current,f=w.useRef(0),p=f.current,m=s.open||a,y=w.useRef(m),v=w.useRef();return w.useEffect(()=>{const g=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(g)},[]),zo(()=>{const g=l.current;if(g){v.current=v.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const b=g.getBoundingClientRect();d.current=b.height,f.current=b.width,y.current||(g.style.transitionDuration=v.current.transitionDuration,g.style.animationName=v.current.animationName),c(r)}},[s.open,r]),w.createElement(bn.div,mt({"data-state":Ym(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m},o,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)});function Ym(e){return e?"open":"closed"}const HV=UV,WV=zV,KV=ZV,JV=e=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e},N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667"})),Yk=({...e})=>{var s,a;const{header:t,modal:n}=$e(c=>c.theme),r=$e(c=>c.restartConversation),{showModal:i}=dE(),o=c=>{var l,u,d,h;c.stopPropagation(),i({title:"Restart Conversation",content:U.jsxs(U.Fragment,{children:[U.jsx("p",{...(u=(l=n==null?void 0:n.dialog)==null?void 0:l.newConversation)==null?void 0:u.text,children:"Are you sure you want to restart a new conversation?"}),U.jsx(Zi.Close,{asChild:!0,children:U.jsx("button",{type:"button",...(h=(d=n==null?void 0:n.dialog)==null?void 0:d.newConversation)==null?void 0:h.button,onClick:r,children:"Restart"})})]})})};return U.jsx(TZ,{...e,...(a=(s=t==null?void 0:t.content)==null?void 0:s.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:o,onKeyDown:c=>{c.key==="Enter"&&o(c)}})},YV=({...e})=>{var i,o;const{header:t}=$e(s=>s.theme),n=$e(s=>s.closeWindow),r=s=>{s.stopPropagation(),n==null||n()};return U.jsx(Hk,{...e,...(o=(i=t==null?void 0:t.content)==null?void 0:i.actions)==null?void 0:o.icons,role:"button",tabIndex:0,onClick:r,onKeyDown:s=>{s.key==="Enter"&&r(s)}})},GV=w.memo(w.forwardRef(({defaultOpen:e,...t},n)=>{const{header:r}=$e(s=>s.theme),[i,o]=w.useState(!!e);return U.jsx(HV,{open:i,onOpenChange:o,...t,...r==null?void 0:r.container,ref:n})})),XV=w.forwardRef((e,t)=>{var r;const{header:n}=$e(i=>i.theme);return U.jsx(WV,{...e,...(r=n==null?void 0:n.content)==null?void 0:r.container,ref:t})}),QV=w.forwardRef((e,t)=>{var r;const{header:n}=$e(i=>i.theme);return U.jsx(KV,{...e,...(r=n==null?void 0:n.expandedContent)==null?void 0:r.container,ref:t})}),eH=w.forwardRef(({src:e,...t},n)=>{var o;const{header:r}=$e(s=>s.theme),i=$e(s=>s.getClientId)();return U.jsx(ap,{...t,ref:n,userId:i,src:e,...(o=r==null?void 0:r.content)==null?void 0:o.avatar})}),tH=w.forwardRef((e,t)=>{var r;const{header:n}=$e(i=>i.theme);return U.jsx("h2",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.title,ref:t})}),nH=w.forwardRef((e,t)=>{var r;const{header:n}=$e(i=>i.theme);return U.jsx("p",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.description,ref:t})}),rH=w.forwardRef((e,t)=>{var r,i;const{header:n}=$e(o=>o.theme);return U.jsx("div",{...e,...(i=(r=n==null?void 0:n.content)==null?void 0:r.actions)==null?void 0:i.container,ref:t})}),rr=Object.assign(GV,{Content:XV,ExpandedContent:QV,Avatar:eH,Description:nH,Title:tH,Actions:rH,DescriptionItem:({icon:e,title:t,link:n,...r})=>{var a,c,l,u,d,h,f,p,m,y,v,g;const{header:i}=$e(b=>b.theme),o=e??JV,s=b=>{b&&S4(b)};return!n&&!t?null:n?U.jsxs("a",{...r,...(c=(a=i==null?void 0:i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:c.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[U.jsx(o,{...(u=(l=i==null?void 0:i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),U.jsx("p",{...(h=(d=i==null?void 0:i.expandedContent)==null?void 0:d.descriptionItems)==null?void 0:h.link,children:t})]}):U.jsxs("div",{...r,...(p=(f=i==null?void 0:i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:p.container,onClick:b=>{s(b.currentTarget.textContent)},children:[U.jsx(o,{...(y=(m=i==null?void 0:i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:y.icon}),U.jsx("p",{...(g=(v=i==null?void 0:i.expandedContent)==null?void 0:v.descriptionItems)==null?void 0:g.text,children:t})]})}}),Gk=()=>{var o,s,a,c,l,u,d,h,f,p,m,y,v,g,b,S,E,_,I;const{header:e}=$e(P=>P.theme),t=$e(P=>P.configuration),n=$e(P=>P.closeWindow),r=$e(P=>!P.disableRestartConversation),i=!!((o=t.email)!=null&&o.title)||!!((s=t.phone)!=null&&s.title)||!!((a=t.website)!=null&&a.title)||!!((c=t.termsOfService)!=null&&c.link)||!!((l=t.privacyPolicy)!=null&&l.link);return U.jsxs(rr,{open:i?void 0:!1,"data-disabled":i?void 0:"",children:[U.jsxs(rr.Content,{children:[U.jsx(rr.Avatar,{src:t.botAvatar,children:t.botName||"Bot"}),U.jsx(rr.Title,{children:t.botName||"Bot"}),t.botDescription&&U.jsx(rr.Description,{children:t.botDescription}),U.jsxs(rr.Actions,{children:[r&&U.jsx(Yk,{}),n&&U.jsx(YV,{})]})]}),U.jsxs(rr.ExpandedContent,{children:[U.jsxs("div",{"data-links":"",...(u=e==null?void 0:e.expandedContent)==null?void 0:u.group,children:[U.jsx(rr.DescriptionItem,{"data-email":"",icon:k7,title:(d=t.email)==null?void 0:d.title,link:(h=t.email)==null?void 0:h.link}),U.jsx(rr.DescriptionItem,{"data-phone":"",icon:R7,title:(f=t.phone)==null?void 0:f.title,link:(p=t.phone)==null?void 0:p.link}),U.jsx(rr.DescriptionItem,{"data-website":"",link:(m=t.website)==null?void 0:m.link,icon:T7,title:(y=t.website)==null?void 0:y.title})]}),U.jsxs("div",{"data-legal":"",...(v=e==null?void 0:e.expandedContent)==null?void 0:v.group,children:[U.jsx(rr.DescriptionItem,{"data-terms":"",link:(g=t.termsOfService)==null?void 0:g.link,icon:S7,title:(b=t.termsOfService)==null?void 0:b.title}),U.jsx(rr.DescriptionItem,{"data-privacy":"",link:(S=t.privacyPolicy)==null?void 0:S.link,icon:O7,title:(E=t.privacyPolicy)==null?void 0:E.title})]}),U.jsx("div",{...(I=(_=e==null?void 0:e.expandedContent)==null?void 0:_.descriptionItems)==null?void 0:I.poweredBy,children:"⚡ by Botpress"})]})]})},iH=rr,Xk=w.memo(({...e})=>{const{loadingIndicator:t}=$e(n=>n.theme);return U.jsx("div",{...e,...t==null?void 0:t.container,children:U.jsx("div",{...t==null?void 0:t.loader})})}),Gm=w.forwardRef(({direction:e,block:t,scroll:n,disableInput:r,children:i,sender:o,...s},a)=>{var m,y,v,g;const[c,l]=w.useState([]),{message:u}=$e(b=>b.theme),{botAvatar:d,botName:h}=$e(b=>b.configuration),f=$e(b=>b.getClientId)();J6(()=>{n()}),w.useEffect(()=>{c.length===0&&n()},[c.length]);const p=hx(f??"",15);return U.jsx(lE.Provider,{value:{isLoading:c,setIsLoading:l},children:U.jsxs("div",{...s,...u==null?void 0:u.container,"data-loaded":c.length===0,"data-disable-input":!!r,"data-direction":e,ref:a,children:[U.jsxs(dx,{"data-color":p,...(m=u==null?void 0:u.avatar)==null?void 0:m.container,children:[U.jsx(fx,{...(y=u==null?void 0:u.avatar)==null?void 0:y.image,src:(o==null?void 0:o.avatar)??d}),U.jsx(px,{...(v=u==null?void 0:u.avatar)==null?void 0:v.fallback,children:(o==null?void 0:o.name[0])??((g=h??"Bot")==null?void 0:g[0])})]}),t&&U.jsx(ks,{block:t,styles:u==null?void 0:u.blocks}),i]})})}),oH=w.createContext(void 0);function sH(e){const t=w.useContext(oH);return e||t||"ltr"}function aH(e,[t,n]){return Math.min(n,Math.max(t,e))}function cH(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Qk="ScrollArea",[eC,bK]=Nl(Qk),[lH,fr]=eC(Qk),uH=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,c]=w.useState(null),[l,u]=w.useState(null),[d,h]=w.useState(null),[f,p]=w.useState(null),[m,y]=w.useState(null),[v,g]=w.useState(0),[b,S]=w.useState(0),[E,_]=w.useState(!1),[I,P]=w.useState(!1),$=Jn(t,q=>c(q)),O=sH(i);return w.createElement(lH,{scope:n,type:r,dir:O,scrollHideDelay:o,scrollArea:a,viewport:l,onViewportChange:u,content:d,onContentChange:h,scrollbarX:f,onScrollbarXChange:p,scrollbarXEnabled:E,onScrollbarXEnabledChange:_,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:I,onScrollbarYEnabledChange:P,onCornerWidthChange:g,onCornerHeightChange:S},w.createElement(bn.div,mt({dir:O},s,{ref:$,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})))}),dH="ScrollAreaViewport",fH=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,o=fr(dH,n),s=w.useRef(null),a=Jn(t,s,o.onViewportChange);return w.createElement(w.Fragment,null,w.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),w.createElement(bn.div,mt({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style}}),w.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),hi="ScrollAreaScrollbar",pH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fr(hi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return w.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?w.createElement(hH,mt({},r,{ref:t,forceMount:n})):i.type==="scroll"?w.createElement(mH,mt({},r,{ref:t,forceMount:n})):i.type==="auto"?w.createElement(tC,mt({},r,{ref:t,forceMount:n})):i.type==="always"?w.createElement(Xm,mt({},r,{ref:t})):null}),hH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fr(hi,e.__scopeScrollArea),[o,s]=w.useState(!1);return w.useEffect(()=>{const a=i.scrollArea;let c=0;if(a){const l=()=>{window.clearTimeout(c),s(!0)},u=()=>{c=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",l),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",l),a.removeEventListener("pointerleave",u)}}},[i.scrollArea,i.scrollHideDelay]),w.createElement(zi,{present:n||o},w.createElement(tC,mt({"data-state":o?"visible":"hidden"},r,{ref:t})))}),mH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fr(hi,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Nd(()=>c("SCROLL_END"),100),[a,c]=cH("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,i.scrollHideDelay,c]),w.useEffect(()=>{const l=i.viewport,u=o?"scrollLeft":"scrollTop";if(l){let d=l[u];const h=()=>{const f=l[u];d!==f&&(c("SCROLL"),s()),d=f};return l.addEventListener("scroll",h),()=>l.removeEventListener("scroll",h)}},[i.viewport,o,c,s]),w.createElement(zi,{present:n||a!=="hidden"},w.createElement(Xm,mt({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Dn(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Dn(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),tC=w.forwardRef((e,t)=>{const n=fr(hi,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=w.useState(!1),a=e.orientation==="horizontal",c=Nd(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?l:u)}},10);return Os(n.viewport,c),Os(n.content,c),w.createElement(zi,{present:r||o},w.createElement(Xm,mt({"data-state":o?"visible":"hidden"},i,{ref:t})))}),Xm=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=fr(hi,e.__scopeScrollArea),o=w.useRef(null),s=w.useRef(0),[a,c]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=oC(a.viewport,a.content),u={...r,sizes:a,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:h=>s.current=h};function d(h,f){return SH(h,s.current,a,f)}return n==="horizontal"?w.createElement(yH,mt({},u,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollLeft,f=sC(h,a,i.dir);o.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=d(h,i.dir))}})):n==="vertical"?w.createElement(gH,mt({},u,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollTop,f=sC(h,a);o.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=d(h))}})):null}),yH=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=fr(hi,e.__scopeScrollArea),[s,a]=w.useState(),c=w.useRef(null),l=Jn(t,c,o.onScrollbarXChange);return w.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.createElement(rC,mt({"data-orientation":"horizontal"},i,{ref:l,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Dd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(o.viewport){const h=o.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),cC(h,d)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:$d(s.paddingLeft),paddingEnd:$d(s.paddingRight)}})}}))}),gH=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=fr(hi,e.__scopeScrollArea),[s,a]=w.useState(),c=w.useRef(null),l=Jn(t,c,o.onScrollbarYChange);return w.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.createElement(rC,mt({"data-orientation":"vertical"},i,{ref:l,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Dd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(o.viewport){const h=o.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),cC(h,d)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:$d(s.paddingTop),paddingEnd:$d(s.paddingBottom)}})}}))}),[vH,nC]=eC(hi),rC=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...h}=e,f=fr(hi,n),[p,m]=w.useState(null),y=Jn(t,$=>m($)),v=w.useRef(null),g=w.useRef(""),b=f.viewport,S=r.content-r.viewport,E=Mn(u),_=Mn(c),I=Nd(d,10);function P($){if(v.current){const O=$.clientX-v.current.left,q=$.clientY-v.current.top;l({x:O,y:q})}}return w.useEffect(()=>{const $=O=>{const q=O.target;(p==null?void 0:p.contains(q))&&E(O,S)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[b,p,S,E]),w.useEffect(_,[r,_]),Os(p,I),Os(f.content,I),w.createElement(vH,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:Mn(o),onThumbPointerUp:Mn(s),onThumbPositionChange:_,onThumbPointerDown:Mn(a)},w.createElement(bn.div,mt({},h,{ref:y,style:{position:"absolute",...h.style},onPointerDown:Dn(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),v.current=p.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),P($))}),onPointerMove:Dn(e.onPointerMove,P),onPointerUp:Dn(e.onPointerUp,$=>{const O=$.target;O.hasPointerCapture($.pointerId)&&O.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=g.current,f.viewport&&(f.viewport.style.scrollBehavior=""),v.current=null})})))}),Qm="ScrollAreaThumb",bH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=nC(Qm,e.__scopeScrollArea);return w.createElement(zi,{present:n||i.hasThumb},w.createElement(wH,mt({ref:t},r)))}),wH=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=fr(Qm,n),s=nC(Qm,n),{onThumbPositionChange:a}=s,c=Jn(t,d=>s.onThumbChange(d)),l=w.useRef(),u=Nd(()=>{l.current&&(l.current(),l.current=void 0)},100);return w.useEffect(()=>{const d=o.viewport;if(d){const h=()=>{if(u(),!l.current){const f=EH(d,a);l.current=f,a()}};return a(),d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[o.viewport,u,a]),w.createElement(bn.div,mt({"data-state":s.hasThumb?"visible":"hidden"},i,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Dn(e.onPointerDownCapture,d=>{const f=d.target.getBoundingClientRect(),p=d.clientX-f.left,m=d.clientY-f.top;s.onThumbPointerDown({x:p,y:m})}),onPointerUp:Dn(e.onPointerUp,s.onThumbPointerUp)}))}),iC="ScrollAreaCorner",xH=w.forwardRef((e,t)=>{const n=fr(iC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?w.createElement(_H,mt({},e,{ref:t})):null}),_H=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=fr(iC,n),[o,s]=w.useState(0),[a,c]=w.useState(0),l=!!(o&&a);return Os(i.scrollbarX,()=>{var u;const d=((u=i.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;i.onCornerHeightChange(d),c(d)}),Os(i.scrollbarY,()=>{var u;const d=((u=i.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;i.onCornerWidthChange(d),s(d)}),l?w.createElement(bn.div,mt({},r,{ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function $d(e){return e?parseInt(e,10):0}function oC(e,t){const n=e/t;return isNaN(n)?0:n}function Dd(e){const t=oC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function SH(e,t,n,r="ltr"){const i=Dd(n),o=i/2,s=t||o,a=i-s,c=n.scrollbar.paddingStart+s,l=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return aC([c,l],d)(e)}function sC(e,t,n="ltr"){const r=Dd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,c=n==="ltr"?[0,s]:[s*-1,0],l=aH(e,c);return aC([0,s],[0,a])(l)}function aC(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function cC(e,t){return e>0&&e<t}const EH=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Nd(e,t){const n=Mn(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Os(e,t){const n=Mn(t);zo(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const kH=uH,CH=fH,TH=pH,AH=bH,OH=xH;var lC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(tt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",c="hour",l="day",u="week",d="month",h="quarter",f="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var D=["th","st","nd","rd"],M=F%100;return"["+F+(D[(M-20)%10]||D[M]||D[0])+"]"}},b=function(F,D,M){var Z=String(F);return!Z||Z.length>=D?F:""+Array(D+1-Z.length).join(M)+F},S={s:b,z:function(F){var D=-F.utcOffset(),M=Math.abs(D),Z=Math.floor(M/60),W=M%60;return(D<=0?"+":"-")+b(Z,2,"0")+":"+b(W,2,"0")},m:function F(D,M){if(D.date()<M.date())return-F(M,D);var Z=12*(M.year()-D.year())+(M.month()-D.month()),W=D.clone().add(Z,d),Q=M-W<0,C=D.clone().add(Z+(Q?-1:1),d);return+(-(Z+(M-W)/(Q?W-C:C-W))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:d,y:f,w:u,d:l,D:p,h:c,m:a,s,ms:o,Q:h}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},E="en",_={};_[E]=g;var I="$isDayjsObject",P=function(F){return F instanceof H||!(!F||!F[I])},$=function F(D,M,Z){var W;if(!D)return E;if(typeof D=="string"){var Q=D.toLowerCase();_[Q]&&(W=Q),M&&(_[Q]=M,W=Q);var C=D.split("-");if(!W&&C.length>1)return F(C[0])}else{var te=D.name;_[te]=D,W=te}return!Z&&W&&(E=W),W||!Z&&E},O=function(F,D){if(P(F))return F.clone();var M=typeof D=="object"?D:{};return M.date=F,M.args=arguments,new H(M)},q=S;q.l=$,q.i=P,q.w=function(F,D){return O(F,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var H=function(){function F(M){this.$L=$(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[I]=!0}var D=F.prototype;return D.parse=function(M){this.$d=function(Z){var W=Z.date,Q=Z.utc;if(W===null)return new Date(NaN);if(q.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var C=W.match(y);if(C){var te=C[2]-1||0,fe=(C[7]||"0").substring(0,3);return Q?new Date(Date.UTC(C[1],te,C[3]||1,C[4]||0,C[5]||0,C[6]||0,fe)):new Date(C[1],te,C[3]||1,C[4]||0,C[5]||0,C[6]||0,fe)}}return new Date(W)}(M),this.init()},D.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},D.$utils=function(){return q},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(M,Z){var W=O(M);return this.startOf(Z)<=W&&W<=this.endOf(Z)},D.isAfter=function(M,Z){return O(M)<this.startOf(Z)},D.isBefore=function(M,Z){return this.endOf(Z)<O(M)},D.$g=function(M,Z,W){return q.u(M)?this[Z]:this.set(W,M)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(M,Z){var W=this,Q=!!q.u(Z)||Z,C=q.p(M),te=function(Re,he){var de=q.w(W.$u?Date.UTC(W.$y,he,Re):new Date(W.$y,he,Re),W);return Q?de:de.endOf(l)},fe=function(Re,he){return q.w(W.toDate()[Re].apply(W.toDate("s"),(Q?[0,0,0,0]:[23,59,59,999]).slice(he)),W)},A=this.$W,we=this.$M,Te=this.$D,Ee="set"+(this.$u?"UTC":"");switch(C){case f:return Q?te(1,0):te(31,11);case d:return Q?te(1,we):te(0,we+1);case u:var Pe=this.$locale().weekStart||0,Fe=(A<Pe?A+7:A)-Pe;return te(Q?Te-Fe:Te+(6-Fe),we);case l:case p:return fe(Ee+"Hours",0);case c:return fe(Ee+"Minutes",1);case a:return fe(Ee+"Seconds",2);case s:return fe(Ee+"Milliseconds",3);default:return this.clone()}},D.endOf=function(M){return this.startOf(M,!1)},D.$set=function(M,Z){var W,Q=q.p(M),C="set"+(this.$u?"UTC":""),te=(W={},W[l]=C+"Date",W[p]=C+"Date",W[d]=C+"Month",W[f]=C+"FullYear",W[c]=C+"Hours",W[a]=C+"Minutes",W[s]=C+"Seconds",W[o]=C+"Milliseconds",W)[Q],fe=Q===l?this.$D+(Z-this.$W):Z;if(Q===d||Q===f){var A=this.clone().set(p,1);A.$d[te](fe),A.init(),this.$d=A.set(p,Math.min(this.$D,A.daysInMonth())).$d}else te&&this.$d[te](fe);return this.init(),this},D.set=function(M,Z){return this.clone().$set(M,Z)},D.get=function(M){return this[q.p(M)]()},D.add=function(M,Z){var W,Q=this;M=Number(M);var C=q.p(Z),te=function(we){var Te=O(Q);return q.w(Te.date(Te.date()+Math.round(we*M)),Q)};if(C===d)return this.set(d,this.$M+M);if(C===f)return this.set(f,this.$y+M);if(C===l)return te(1);if(C===u)return te(7);var fe=(W={},W[a]=r,W[c]=i,W[s]=n,W)[C]||1,A=this.$d.getTime()+M*fe;return q.w(A,this)},D.subtract=function(M,Z){return this.add(-1*M,Z)},D.format=function(M){var Z=this,W=this.$locale();if(!this.isValid())return W.invalidDate||m;var Q=M||"YYYY-MM-DDTHH:mm:ssZ",C=q.z(this),te=this.$H,fe=this.$m,A=this.$M,we=W.weekdays,Te=W.months,Ee=W.meridiem,Pe=function(he,de,_e,pe){return he&&(he[de]||he(Z,Q))||_e[de].slice(0,pe)},Fe=function(he){return q.s(te%12||12,he,"0")},Re=Ee||function(he,de,_e){var pe=he<12?"AM":"PM";return _e?pe.toLowerCase():pe};return Q.replace(v,function(he,de){return de||function(_e){switch(_e){case"YY":return String(Z.$y).slice(-2);case"YYYY":return q.s(Z.$y,4,"0");case"M":return A+1;case"MM":return q.s(A+1,2,"0");case"MMM":return Pe(W.monthsShort,A,Te,3);case"MMMM":return Pe(Te,A);case"D":return Z.$D;case"DD":return q.s(Z.$D,2,"0");case"d":return String(Z.$W);case"dd":return Pe(W.weekdaysMin,Z.$W,we,2);case"ddd":return Pe(W.weekdaysShort,Z.$W,we,3);case"dddd":return we[Z.$W];case"H":return String(te);case"HH":return q.s(te,2,"0");case"h":return Fe(1);case"hh":return Fe(2);case"a":return Re(te,fe,!0);case"A":return Re(te,fe,!1);case"m":return String(fe);case"mm":return q.s(fe,2,"0");case"s":return String(Z.$s);case"ss":return q.s(Z.$s,2,"0");case"SSS":return q.s(Z.$ms,3,"0");case"Z":return C}return null}(he)||C.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(M,Z,W){var Q,C=this,te=q.p(Z),fe=O(M),A=(fe.utcOffset()-this.utcOffset())*r,we=this-fe,Te=function(){return q.m(C,fe)};switch(te){case f:Q=Te()/12;break;case d:Q=Te();break;case h:Q=Te()/3;break;case u:Q=(we-A)/6048e5;break;case l:Q=(we-A)/864e5;break;case c:Q=we/i;break;case a:Q=we/r;break;case s:Q=we/n;break;default:Q=we}return W?Q:q.a(Q)},D.daysInMonth=function(){return this.endOf(d).$D},D.$locale=function(){return _[this.$L]},D.locale=function(M,Z){if(!M)return this.$L;var W=this.clone(),Q=$(M,Z,!0);return Q&&(W.$L=Q),W},D.clone=function(){return q.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},F}(),B=H.prototype;return O.prototype=B,[["$ms",o],["$s",s],["$m",a],["$H",c],["$W",l],["$M",d],["$y",f],["$D",p]].forEach(function(F){B[F[1]]=function(D){return this.$g(D,F[0],F[1])}}),O.extend=function(F,D){return F.$i||(F(D,H,O),F.$i=!0),O},O.locale=$,O.isDayjs=P,O.unix=function(F){return O(1e3*F)},O.en=_[E],O.Ls=_,O.p={},O})})(lC);var IH=lC.exports;const jd=mi(IH);var uC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(tt,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(uC);var RH=uC.exports;const PH=mi(RH);var dC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(tt,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(dC);var $H=dC.exports;const DH=mi($H);jd.extend(PH),jd.extend(DH);function NH(e,t="day"){if(!e||e.length===0)return[];const n=[];n.push(fC(e[0].timestamp));for(let r=0;r<e.length;r++)if(n.push(e[r]),r+1<e.length){const i=e[r].timestamp,o=e[r+1].timestamp;jd(i).isSame(o,t)||n.push(fC(o))}return n}function fC(e){return{id:Pl(),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:jH(e)}}}function jH(e,t=!1){const n=jd(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}const pC=w.memo(({scrollDownButton:e,...t})=>{var g,b,S,E,_,I,P,$,O,q,H,B,F;const{messageList:n}=$e(D=>D.theme),r=Qn(D=>D.conversationId),i=$e(D=>D.messages)[r??""]??[],o=$e(D=>D.setState),s=$e(D=>D.client),a=$e(D=>D.getClientId)(),c=$e(D=>D.configuration),l=$e(D=>D.messageContainerRef),u=$e(D=>D.isTyping),d=$e(D=>D.setIsTyping),h=w.useMemo(()=>NH(i),[i]),[f,p]=w.useState(!0),{y:m}=tZ(l),y=()=>{if(!l.current)return;const{scrollHeight:D}=l.current;f&&l.current.scrollTo({top:D})};w.useEffect(()=>s==null?void 0:s.on("isTyping",({isTyping:D,timeout:M})=>{d(D,M)}),[]),w.useEffect(()=>{const D=i[i.length-1];o({disableComposer:!!(D!=null&&D.disableInput)})},[i.length]),w.useEffect(()=>{if(!l.current)return;const{offsetHeight:D,scrollHeight:M,scrollTop:Z}=l.current;p(M<=Z+D+100)},[m]);const v=e!=null&&e.icon?e==null?void 0:e.icon:kZ;return U.jsxs(kH,{...(g=n==null?void 0:n.scrollbar)==null?void 0:g.container,scrollHideDelay:300,type:"hover",children:[U.jsx(CH,{...(b=n==null?void 0:n.scrollbar)==null?void 0:b.viewport,ref:l,children:U.jsxs("ul",{...t,...n==null?void 0:n.container,children:[U.jsxs("li",{...(S=n==null?void 0:n.marquee)==null?void 0:S.container,children:[U.jsx(ap,{userId:a,src:c.botAvatar,...(E=n==null?void 0:n.marquee)==null?void 0:E.avatar,children:(c.botName||"Bot").slice(0,1)}),U.jsxs("div",{...(_=n==null?void 0:n.marquee)==null?void 0:_.content,children:[U.jsx("h1",{...(I=n==null?void 0:n.marquee)==null?void 0:I.title,children:c.botName||"Bot"}),U.jsx("p",{...(P=n==null?void 0:n.marquee)==null?void 0:P.description,children:c.botDescription})]})]}),h.map((D,M)=>U.jsx(Gm,{scroll:y,...D},M)),u&&U.jsx(Gm,{scroll:y,direction:"incoming",children:U.jsx(Xk,{})}),U.jsx("li",{"data-is-at-bottom":f,...($=n==null?void 0:n.scrollDownButton)==null?void 0:$.container,children:!!i.length&&U.jsxs("button",{type:"button","data-is-at-bottom":f,...(O=n==null?void 0:n.scrollDownButton)==null?void 0:O.button,onClick:()=>{var D,M;return(M=l.current)==null?void 0:M.scrollBy({top:(D=l.current)==null?void 0:D.scrollHeight})},children:[(e==null?void 0:e.text)??"Back"," ",U.jsx(v,{...(q=n==null?void 0:n.scrollDownButton)==null?void 0:q.icon})]})})]})}),U.jsx(TH,{orientation:"vertical",...(H=n==null?void 0:n.scrollbar)==null?void 0:H.background,children:U.jsx(AH,{...(B=n==null?void 0:n.scrollbar)==null?void 0:B.thumb})}),U.jsx(OH,{...(F=n==null?void 0:n.scrollbar)==null?void 0:F.corner})]})}),MH=()=>U.jsxs(Wk,{children:[U.jsx(Gk,{}),U.jsx(pC,{}),U.jsxs(pk,{children:[U.jsx(mk,{}),U.jsx(hk,{}),U.jsx(yk,{})]})]}),Is=V.object({title:V.string(),link:V.string().optional()}),hC=V.object({composerPlaceholder:V.string().optional(),botName:V.string().optional(),botAvatar:V.string().optional(),botDescription:V.string().optional(),website:Is.optional(),email:Is.optional(),phone:Is.optional(),privacyPolicy:Is.optional(),termsOfService:Is.optional()}),mC=V.enum(["heading1","heading2","heading3","text","horizontalRule","link","italic","bold","orderedList","unorderedList","listItem","lineBreak","pre"]),yC=V.object({}).passthrough().transform(e=>e),xe=V.object({className:V.string().optional(),style:yC.optional()}),Md=V.object({container:xe.optional(),image:xe.optional(),fallback:xe.optional()}),gC=V.object({button:xe.optional(),text:V.record(mC,xe.optional()),image:V.object({image:xe.optional(),placeholder:xe.optional()}).optional(),audio:xe.optional(),video:xe.optional(),file:V.object({container:xe.optional(),title:xe.optional(),icon:xe.optional()}).optional(),location:V.object({container:xe.optional(),title:xe.optional(),icon:xe.optional()}).optional(),column:xe.optional(),row:xe.optional(),bubble:xe.optional(),carousel:V.object({container:xe.optional(),slidesContainer:xe.optional(),backButton:xe.optional(),nextButton:xe.optional()}).optional(),dropdown:V.object({button:V.object({container:xe.optional(),icon:xe.optional(),text:xe.optional()}).optional(),content:V.object({container:xe.optional(),item:xe.optional()}).optional()}).optional()}),vC=V.object({container:xe.optional(),modal:V.object({overlay:xe.optional(),container:xe.optional(),dialog:V.object({container:xe.optional(),title:V.object({container:xe.optional(),text:xe.optional(),closeIcon:xe.optional()}).optional(),content:xe.optional(),newConversation:V.object({text:xe.optional(),button:xe.optional()}).optional()}).optional()}).optional(),notification:V.object({container:xe.optional(),title:xe.optional(),description:xe.optional(),icon:xe.optional(),closeIcon:xe.optional()}).optional(),header:V.object({container:xe.optional(),content:V.object({container:xe.optional(),title:xe.optional(),description:xe.optional(),avatar:Md.optional(),actions:V.object({container:xe.optional(),icons:xe.optional()}).optional()}),expandedContent:V.object({container:xe.optional(),group:xe.optional(),descriptionItems:V.object({container:xe.optional(),icon:xe.optional(),text:xe.optional(),link:xe.optional(),poweredBy:xe.optional()}).optional()}).optional(),description:V.object({container:xe.optional(),title:xe.optional(),subtitle:xe.optional()}).optional(),newConversationIcon:xe.optional()}).optional(),composer:V.object({container:xe.optional(),input:xe.optional(),uploadButton:V.object({container:xe.optional(),icon:xe.optional()}).optional(),button:V.object({container:xe.optional(),icon:xe.optional()}).optional()}).optional(),fab:V.object({icon:xe.optional(),container:xe.optional()}).optional(),messageList:V.object({scrollbar:V.object({container:xe.optional(),viewport:xe.optional(),thumb:xe.optional(),corner:xe.optional(),background:xe.optional()}).optional(),container:xe.optional(),marquee:V.object({content:xe.optional(),title:xe.optional(),description:xe.optional(),avatar:Md.optional(),container:xe.optional()}).optional(),scrollDownButton:V.object({container:xe.optional(),button:xe.optional(),icon:xe.optional()}).optional()}).optional(),message:V.object({container:xe.optional(),avatar:Md.optional(),blocks:gC.optional()}).optional(),loadingIndicator:V.object({container:xe.optional(),loader:xe.optional()}).optional()}),bC=V.enum(["opened","closed","initial"]),wC=V.object({data:V.record(V.unknown()).optional()}),xC=V.enum(["messaging","pushpin"]),_C=V.object({configuration:hC.optional().catch(void 0),theme:vC.optional().catch(void 0),style:V.string().optional().catch(void 0),user:wC.optional().catch(void 0)}),qH=_C.extend({clientId:V.string(),botId:V.string(),selector:V.string().optional().catch(void 0),webchatScriptUrl:V.string().optional().catch(void 0),fabScriptUrl:V.string().optional().catch(void 0),messagingUrl:V.string().optional().catch(void 0),pushpinUrl:V.string().optional().catch(void 0),clientMode:xC.optional().catch(void 0),defaultState:bC.optional().catch(void 0)});Ke.Avatar=ap,Ke.Block=ks,Ke.Composer=pk,Ke.ComposerButton=yk,Ke.ComposerInput=hk,Ke.Container=Wk,Ke.Fab=qV,Ke.Header=Gk,Ke.HeaderRoot=iH,Ke.LoadingIndicator=Xk,Ke.Message=Gm,Ke.MessageList=pC,Ke.Modal=Zi,Ke.ModalProvider=gk,Ke.RestartConversation=Yk,Ke.UploadButton=mk,Ke.Webchat=MH,Ke.WebchatProvider=l8,Ke.__adapters=P$,Ke.avatarThemeSchema=Md,Ke.blockThemeSchema=gC,Ke.clientModePropsSchema=xC,Ke.configPropsSchema=_C,Ke.configurationSchema=hC,Ke.cssStyleSchema=yC,Ke.descriptionItemSchema=Is,Ke.fileTypes=kS,Ke.getClient=TS,Ke.initPropsSchema=qH,Ke.isFileType=CS,Ke.markdownTypeSchema=mC,Ke.renderers=fk,Ke.statePropsSchema=bC,Ke.styleOptionSchema=xe,Ke.themeSchema=vC,Ke.useClient=_4,Ke.useWebchatStore=$e,Ke.userPropsSchema=wC,Object.defineProperty(Ke,Symbol.toStringTag,{value:"Module"})});
|
|
403
|
+
`)},cV=0,Ts=[];function lV(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),i=N.useState(cV++)[0],o=N.useState(function(){return Pk()})[0],s=N.useRef(e);N.useEffect(function(){s.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=R8([e.lockRef.current],(e.shards||[]).map(qk),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=N.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!s.current.allowPinchZoom;var g=Id(m),v=n.current,b="deltaX"in m?m.deltaX:v[0]-g[0],S="deltaY"in m?m.deltaY:v[1]-g[1],E,_=m.target,I=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in m&&I==="h"&&_.type==="range")return!1;var P=Dk(I,_);if(!P)return!0;if(P?E=I:(E=I==="v"?"h":"v",P=Dk(I,_)),!P)return!1;if(!r.current&&"changedTouches"in m&&(b||S)&&(r.current=E),!E)return!0;var $=r.current||E;return oV($,y,m,$==="h"?b:S,!0)},[]),c=N.useCallback(function(m){var y=m;if(!(!Ts.length||Ts[Ts.length-1]!==o)){var g="deltaY"in y?Mk(y):Id(y),v=t.current.filter(function(E){return E.name===y.type&&E.target===y.target&&sV(E.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var b=(s.current.shards||[]).map(qk).filter(Boolean).filter(function(E){return E.contains(y.target)}),S=b.length>0?a(y,b[0]):!s.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),l=N.useCallback(function(m,y,g,v){var b={name:m,delta:y,target:g,should:v};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),u=N.useCallback(function(m){n.current=Id(m),r.current=void 0},[]),d=N.useCallback(function(m){l(m.type,Mk(m),m.target,a(m,e.lockRef.current))},[]),p=N.useCallback(function(m){l(m.type,Id(m),m.target,a(m,e.lockRef.current))},[]);N.useEffect(function(){return Ts.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Cs),document.addEventListener("touchmove",c,Cs),document.addEventListener("touchstart",u,Cs),function(){Ts=Ts.filter(function(m){return m!==o}),document.removeEventListener("wheel",c,Cs),document.removeEventListener("touchmove",c,Cs),document.removeEventListener("touchstart",u,Cs)}},[]);var f=e.removeScrollBar,h=e.inert;return N.createElement(N.Fragment,null,h?N.createElement(o,{styles:aV(i)}):null,f?N.createElement(X8,{gapMode:"margin"}):null)}const uV=F8(Ik,lV);var Lk=N.forwardRef(function(e,t){return N.createElement(Ad,Vr({},e,{ref:t,sideCar:uV}))});Lk.classNames=Ad.classNames;const dV=Lk;var fV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},As=new WeakMap,Rd=new WeakMap,Pd={},Hm=0,Fk=function(e){return e&&(e.host||Fk(e.parentNode))},pV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Fk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},hV=function(e,t,n,r){var i=pV(t,Array.isArray(e)?e:[e]);Pd[n]||(Pd[n]=new WeakMap);var o=Pd[n],s=[],a=new Set,c=new Set(i),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};i.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))u(p);else{var f=p.getAttribute(r),h=f!==null&&f!=="false",m=(As.get(p)||0)+1,y=(o.get(p)||0)+1;As.set(p,m),o.set(p,y),s.push(p),m===1&&h&&Rd.set(p,!0),y===1&&p.setAttribute(n,"true"),h||p.setAttribute(r,"true")}})};return u(t),a.clear(),Hm++,function(){s.forEach(function(d){var p=As.get(d)-1,f=o.get(d)-1;As.set(d,p),o.set(d,f),p||(Rd.has(d)||d.removeAttribute(r),Rd.delete(d)),f||d.removeAttribute(n)}),Hm--,Hm||(As=new WeakMap,As=new WeakMap,Rd=new WeakMap,Pd={})}},mV=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||fV(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),hV(r,i,n,"aria-hidden")):function(){return null}};const Uk="Dialog",[Bk,hK]=Nl(Uk),[yV,pi]=Bk(Uk),gV=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=w.useRef(null),c=w.useRef(null),[l=!1,u]=vk({prop:r,defaultProp:i,onChange:o});return w.createElement(yV,{scope:t,triggerRef:a,contentRef:c,contentId:Ed(),titleId:Ed(),descriptionId:Ed(),open:l,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(d=>!d),[u]),modal:s},n)},vV="DialogTrigger",bV=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pi(vV,n),o=Jn(t,i.triggerRef);return w.createElement(bn.button,mt({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Km(i.open)},r,{ref:o,onClick:Dn(e.onClick,i.onOpenToggle)}))}),wV="DialogPortal",[mK,zk]=Bk(wV,{forceMount:void 0}),Wm="DialogOverlay",xV=w.forwardRef((e,t)=>{const n=zk(Wm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=pi(Wm,e.__scopeDialog);return o.modal?w.createElement(zi,{present:r||o.open},w.createElement(_V,mt({},i,{ref:t}))):null}),_V=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pi(Wm,n);return w.createElement(dV,{as:ip,allowPinchZoom:!0,shards:[i.contentRef]},w.createElement(bn.div,mt({"data-state":Km(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ec="DialogContent",SV=w.forwardRef((e,t)=>{const n=zk(ec,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=pi(ec,e.__scopeDialog);return w.createElement(zi,{present:r||o.open},o.modal?w.createElement(EV,mt({},i,{ref:t})):w.createElement(kV,mt({},i,{ref:t})))}),EV=w.forwardRef((e,t)=>{const n=pi(ec,e.__scopeDialog),r=w.useRef(null),i=Jn(t,n.contentRef,r);return w.useEffect(()=>{const o=r.current;if(o)return mV(o)},[]),w.createElement(Zk,mt({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Dn(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Dn(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Dn(e.onFocusOutside,o=>o.preventDefault())}))}),kV=w.forwardRef((e,t)=>{const n=pi(ec,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return w.createElement(Zk,mt({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),Zk=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=pi(ec,n),c=w.useRef(null),l=Jn(t,c);return I8(),w.createElement(w.Fragment,null,w.createElement(x8,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},w.createElement(v8,mt({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Km(a.open)},s,{ref:l,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),CV="DialogTitle",TV=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pi(CV,n);return w.createElement(bn.h2,mt({id:i.titleId},r,{ref:t}))}),AV="DialogClose",OV=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pi(AV,n);return w.createElement(bn.button,mt({type:"button"},r,{ref:t,onClick:Dn(e.onClick,()=>i.onOpenChange(!1))}))});function Km(e){return e?"open":"closed"}const IV=gV,RV=bV,PV=xV,$V=SV,DV=TV,Vk=OV;function NV({title:e,titleId:t,...n},r){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,N.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const Hk=N.forwardRef(NV);function Zi({open:e,onOpenChange:t,children:n}){return U.jsx(IV,{open:e,onOpenChange:t,children:n})}function jV({title:e,children:t}){var r,i,o,s,a,c,l,u;const{modal:n}=Ie(d=>d.theme);return U.jsxs(U.Fragment,{children:[U.jsx(PV,{...n==null?void 0:n.overlay}),U.jsx("div",{...n==null?void 0:n.container,children:U.jsxs($V,{...(r=n==null?void 0:n.dialog)==null?void 0:r.container,children:[U.jsxs("div",{...(o=(i=n==null?void 0:n.dialog)==null?void 0:i.title)==null?void 0:o.container,children:[U.jsx(DV,{...(a=(s=n==null?void 0:n.dialog)==null?void 0:s.title)==null?void 0:a.text,children:e}),U.jsx(Vk,{children:U.jsx(Hk,{role:"button",tabIndex:0,...(l=(c=n==null?void 0:n.dialog)==null?void 0:c.title)==null?void 0:l.closeIcon})})]}),U.jsx("div",{...(u=n==null?void 0:n.dialog)==null?void 0:u.content,children:t})]})})]})}Zi.Button=RV,Zi.Close=Vk,Zi.Content=jV;const Wk=w.forwardRef(({children:e,...t},n)=>{const{container:r}=Ie(i=>i.theme);return U.jsxs("div",{...t,...r,ref:n,children:[U.jsx(h6,{}),U.jsxs(gk,{children:[U.jsx(MV,{}),e]})]})}),MV=()=>{const{modal:e}=Ie(r=>r.theme),t=Ie(r=>r.connected),{showModal:n}=dE();return w.useEffect(()=>{var r,i,o,s;t||n({title:"Connection Error",content:U.jsxs(U.Fragment,{children:[U.jsx("p",{...(i=(r=e==null?void 0:e.dialog)==null?void 0:r.newConversation)==null?void 0:i.text,children:"There was an error connecting to the server. Please check your internet connection and try again."}),U.jsx(Zi.Close,{asChild:!0,children:U.jsx("button",{type:"button",...(s=(o=e==null?void 0:e.dialog)==null?void 0:o.newConversation)==null?void 0:s.button,onClick:()=>window.location.reload(),children:"Restart"})})]})})},[t]),U.jsx(U.Fragment,{})},qV=w.forwardRef(({children:e,onClick:t,...n},r)=>{const{fab:i}=Ie(a=>a.theme),{container:o,icon:s}=i??{};return U.jsx("div",{...n,...o,ref:r,onClick:t,children:U.jsx("div",{...s})})}),Kk="Collapsible",[LV,gK]=Nl(Kk),[FV,Jm]=LV(Kk),UV=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[c=!1,l]=vk({prop:r,defaultProp:i,onChange:s});return w.createElement(FV,{scope:n,disabled:o,contentId:Ed(),open:c,onOpenToggle:w.useCallback(()=>l(u=>!u),[l])},w.createElement(bn.div,mt({"data-state":Ym(c),"data-disabled":o?"":void 0},a,{ref:t})))}),BV="CollapsibleTrigger",zV=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Jm(BV,n);return w.createElement(bn.button,mt({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ym(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Dn(e.onClick,i.onOpenToggle)}))}),Jk="CollapsibleContent",ZV=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Jm(Jk,e.__scopeCollapsible);return w.createElement(zi,{present:n||i.open},({present:o})=>w.createElement(VV,mt({},r,{ref:t,present:o})))}),VV=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Jm(Jk,n),[a,c]=w.useState(r),l=w.useRef(null),u=Jn(t,l),d=w.useRef(0),p=d.current,f=w.useRef(0),h=f.current,m=s.open||a,y=w.useRef(m),g=w.useRef();return w.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),zo(()=>{const v=l.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const b=v.getBoundingClientRect();d.current=b.height,f.current=b.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[s.open,r]),w.createElement(bn.div,mt({"data-state":Ym(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m},o,{ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style}}),m&&i)});function Ym(e){return e?"open":"closed"}const HV=UV,WV=zV,KV=ZV,JV=e=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e},N.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667"})),Yk=({...e})=>{var s,a;const{header:t,modal:n}=Ie(c=>c.theme),r=Ie(c=>c.restartConversation),{showModal:i}=dE(),o=c=>{var l,u,d,p;c.stopPropagation(),i({title:"Restart Conversation",content:U.jsxs(U.Fragment,{children:[U.jsx("p",{...(u=(l=n==null?void 0:n.dialog)==null?void 0:l.newConversation)==null?void 0:u.text,children:"Are you sure you want to restart a new conversation?"}),U.jsx(Zi.Close,{asChild:!0,children:U.jsx("button",{type:"button",...(p=(d=n==null?void 0:n.dialog)==null?void 0:d.newConversation)==null?void 0:p.button,onClick:r,children:"Restart"})})]})})};return U.jsx(TZ,{...e,...(a=(s=t==null?void 0:t.content)==null?void 0:s.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:o,onKeyDown:c=>{c.key==="Enter"&&o(c)}})},YV=({...e})=>{var i,o;const{header:t}=Ie(s=>s.theme),n=Ie(s=>s.closeWindow),r=s=>{s.stopPropagation(),n==null||n()};return U.jsx(Hk,{...e,...(o=(i=t==null?void 0:t.content)==null?void 0:i.actions)==null?void 0:o.icons,role:"button",tabIndex:0,onClick:r,onKeyDown:s=>{s.key==="Enter"&&r(s)}})},GV=w.memo(w.forwardRef(({defaultOpen:e,...t},n)=>{const{header:r}=Ie(s=>s.theme),[i,o]=w.useState(!!e);return U.jsx(HV,{open:i,onOpenChange:o,...t,...r==null?void 0:r.container,ref:n})})),XV=w.forwardRef((e,t)=>{var r;const{header:n}=Ie(i=>i.theme);return U.jsx(WV,{...e,...(r=n==null?void 0:n.content)==null?void 0:r.container,ref:t})}),QV=w.forwardRef((e,t)=>{var r;const{header:n}=Ie(i=>i.theme);return U.jsx(KV,{...e,...(r=n==null?void 0:n.expandedContent)==null?void 0:r.container,ref:t})}),eH=w.forwardRef(({src:e,...t},n)=>{var o;const{header:r}=Ie(s=>s.theme),i=Ie(s=>s.getClientId)();return U.jsx(ap,{...t,ref:n,userId:i,src:e,...(o=r==null?void 0:r.content)==null?void 0:o.avatar})}),tH=w.forwardRef((e,t)=>{var r;const{header:n}=Ie(i=>i.theme);return U.jsx("h2",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.title,ref:t})}),nH=w.forwardRef((e,t)=>{var r;const{header:n}=Ie(i=>i.theme);return U.jsx("p",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.description,ref:t})}),rH=w.forwardRef((e,t)=>{var r,i;const{header:n}=Ie(o=>o.theme);return U.jsx("div",{...e,...(i=(r=n==null?void 0:n.content)==null?void 0:r.actions)==null?void 0:i.container,ref:t})}),rr=Object.assign(GV,{Content:XV,ExpandedContent:QV,Avatar:eH,Description:nH,Title:tH,Actions:rH,DescriptionItem:({icon:e,title:t,link:n,...r})=>{var a,c,l,u,d,p,f,h,m,y,g,v;const{header:i}=Ie(b=>b.theme),o=e??JV,s=b=>{b&&S4(b)};return!n&&!t?null:n?U.jsxs("a",{...r,...(c=(a=i==null?void 0:i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:c.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[U.jsx(o,{...(u=(l=i==null?void 0:i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),U.jsx("p",{...(p=(d=i==null?void 0:i.expandedContent)==null?void 0:d.descriptionItems)==null?void 0:p.link,children:t})]}):U.jsxs("div",{...r,...(h=(f=i==null?void 0:i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:h.container,onClick:b=>{s(b.currentTarget.textContent)},children:[U.jsx(o,{...(y=(m=i==null?void 0:i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:y.icon}),U.jsx("p",{...(v=(g=i==null?void 0:i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:v.text,children:t})]})}}),Gk=()=>{var o,s,a,c,l,u,d,p,f,h,m,y,g,v,b,S,E,_,I;const{header:e}=Ie(P=>P.theme),t=Ie(P=>P.configuration),n=Ie(P=>P.closeWindow),r=Ie(P=>!P.disableRestartConversation),i=!!((o=t.email)!=null&&o.title)||!!((s=t.phone)!=null&&s.title)||!!((a=t.website)!=null&&a.title)||!!((c=t.termsOfService)!=null&&c.link)||!!((l=t.privacyPolicy)!=null&&l.link);return U.jsxs(rr,{open:i?void 0:!1,"data-disabled":i?void 0:"",children:[U.jsxs(rr.Content,{children:[U.jsx(rr.Avatar,{src:t.botAvatar,children:t.botName||"Bot"}),U.jsx(rr.Title,{children:t.botName||"Bot"}),t.botDescription&&U.jsx(rr.Description,{children:t.botDescription}),U.jsxs(rr.Actions,{children:[r&&U.jsx(Yk,{}),n&&U.jsx(YV,{})]})]}),U.jsxs(rr.ExpandedContent,{children:[U.jsxs("div",{"data-links":"",...(u=e==null?void 0:e.expandedContent)==null?void 0:u.group,children:[U.jsx(rr.DescriptionItem,{"data-email":"",icon:k7,title:(d=t.email)==null?void 0:d.title,link:(p=t.email)==null?void 0:p.link}),U.jsx(rr.DescriptionItem,{"data-phone":"",icon:R7,title:(f=t.phone)==null?void 0:f.title,link:(h=t.phone)==null?void 0:h.link}),U.jsx(rr.DescriptionItem,{"data-website":"",link:(m=t.website)==null?void 0:m.link,icon:T7,title:(y=t.website)==null?void 0:y.title})]}),U.jsxs("div",{"data-legal":"",...(g=e==null?void 0:e.expandedContent)==null?void 0:g.group,children:[U.jsx(rr.DescriptionItem,{"data-terms":"",link:(v=t.termsOfService)==null?void 0:v.link,icon:S7,title:(b=t.termsOfService)==null?void 0:b.title}),U.jsx(rr.DescriptionItem,{"data-privacy":"",link:(S=t.privacyPolicy)==null?void 0:S.link,icon:O7,title:(E=t.privacyPolicy)==null?void 0:E.title})]}),U.jsx("div",{...(I=(_=e==null?void 0:e.expandedContent)==null?void 0:_.descriptionItems)==null?void 0:I.poweredBy,children:"⚡ by Botpress"})]})]})},iH=rr,Xk=w.memo(({...e})=>{const{loadingIndicator:t}=Ie(n=>n.theme);return U.jsx("div",{...e,...t==null?void 0:t.container,children:U.jsx("div",{...t==null?void 0:t.loader})})}),Gm=w.forwardRef(({direction:e,block:t,scroll:n,disableInput:r,children:i,sender:o,...s},a)=>{var m,y,g,v;const[c,l]=w.useState([]),{message:u}=Ie(b=>b.theme),{botAvatar:d,botName:p}=Ie(b=>b.configuration),f=Ie(b=>b.getClientId)();J6(()=>{n()}),w.useEffect(()=>{c.length===0&&n()},[c.length]);const h=hx(f??"",15);return U.jsx(lE.Provider,{value:{isLoading:c,setIsLoading:l},children:U.jsxs("div",{...s,...u==null?void 0:u.container,"data-loaded":c.length===0,"data-disable-input":!!r,"data-direction":e,ref:a,children:[U.jsxs(dx,{"data-color":h,...(m=u==null?void 0:u.avatar)==null?void 0:m.container,children:[U.jsx(fx,{...(y=u==null?void 0:u.avatar)==null?void 0:y.image,src:(o==null?void 0:o.avatar)??d}),U.jsx(px,{...(g=u==null?void 0:u.avatar)==null?void 0:g.fallback,children:(o==null?void 0:o.name[0])??((v=p??"Bot")==null?void 0:v[0])})]}),t&&U.jsx(ks,{block:t,styles:u==null?void 0:u.blocks}),i]})})}),oH=w.createContext(void 0);function sH(e){const t=w.useContext(oH);return e||t||"ltr"}function aH(e,[t,n]){return Math.min(n,Math.max(t,e))}function cH(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Qk="ScrollArea",[eC,bK]=Nl(Qk),[lH,fr]=eC(Qk),uH=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,c]=w.useState(null),[l,u]=w.useState(null),[d,p]=w.useState(null),[f,h]=w.useState(null),[m,y]=w.useState(null),[g,v]=w.useState(0),[b,S]=w.useState(0),[E,_]=w.useState(!1),[I,P]=w.useState(!1),$=Jn(t,q=>c(q)),O=sH(i);return w.createElement(lH,{scope:n,type:r,dir:O,scrollHideDelay:o,scrollArea:a,viewport:l,onViewportChange:u,content:d,onContentChange:p,scrollbarX:f,onScrollbarXChange:h,scrollbarXEnabled:E,onScrollbarXEnabledChange:_,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:I,onScrollbarYEnabledChange:P,onCornerWidthChange:v,onCornerHeightChange:S},w.createElement(bn.div,mt({dir:O},s,{ref:$,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})))}),dH="ScrollAreaViewport",fH=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,o=fr(dH,n),s=w.useRef(null),a=Jn(t,s,o.onViewportChange);return w.createElement(w.Fragment,null,w.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),w.createElement(bn.div,mt({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style}}),w.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),hi="ScrollAreaScrollbar",pH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fr(hi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return w.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?w.createElement(hH,mt({},r,{ref:t,forceMount:n})):i.type==="scroll"?w.createElement(mH,mt({},r,{ref:t,forceMount:n})):i.type==="auto"?w.createElement(tC,mt({},r,{ref:t,forceMount:n})):i.type==="always"?w.createElement(Xm,mt({},r,{ref:t})):null}),hH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fr(hi,e.__scopeScrollArea),[o,s]=w.useState(!1);return w.useEffect(()=>{const a=i.scrollArea;let c=0;if(a){const l=()=>{window.clearTimeout(c),s(!0)},u=()=>{c=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",l),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",l),a.removeEventListener("pointerleave",u)}}},[i.scrollArea,i.scrollHideDelay]),w.createElement(zi,{present:n||o},w.createElement(tC,mt({"data-state":o?"visible":"hidden"},r,{ref:t})))}),mH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fr(hi,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Nd(()=>c("SCROLL_END"),100),[a,c]=cH("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,i.scrollHideDelay,c]),w.useEffect(()=>{const l=i.viewport,u=o?"scrollLeft":"scrollTop";if(l){let d=l[u];const p=()=>{const f=l[u];d!==f&&(c("SCROLL"),s()),d=f};return l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[i.viewport,o,c,s]),w.createElement(zi,{present:n||a!=="hidden"},w.createElement(Xm,mt({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Dn(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Dn(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),tC=w.forwardRef((e,t)=>{const n=fr(hi,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=w.useState(!1),a=e.orientation==="horizontal",c=Nd(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?l:u)}},10);return Os(n.viewport,c),Os(n.content,c),w.createElement(zi,{present:r||o},w.createElement(Xm,mt({"data-state":o?"visible":"hidden"},i,{ref:t})))}),Xm=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=fr(hi,e.__scopeScrollArea),o=w.useRef(null),s=w.useRef(0),[a,c]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=oC(a.viewport,a.content),u={...r,sizes:a,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,f){return SH(p,s.current,a,f)}return n==="horizontal"?w.createElement(yH,mt({},u,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,f=sC(p,a,i.dir);o.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=d(p,i.dir))}})):n==="vertical"?w.createElement(gH,mt({},u,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,f=sC(p,a);o.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=d(p))}})):null}),yH=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=fr(hi,e.__scopeScrollArea),[s,a]=w.useState(),c=w.useRef(null),l=Jn(t,c,o.onScrollbarXChange);return w.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.createElement(rC,mt({"data-orientation":"horizontal"},i,{ref:l,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Dd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),cC(p,d)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:$d(s.paddingLeft),paddingEnd:$d(s.paddingRight)}})}}))}),gH=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=fr(hi,e.__scopeScrollArea),[s,a]=w.useState(),c=w.useRef(null),l=Jn(t,c,o.onScrollbarYChange);return w.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.createElement(rC,mt({"data-orientation":"vertical"},i,{ref:l,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Dd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),cC(p,d)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:$d(s.paddingTop),paddingEnd:$d(s.paddingBottom)}})}}))}),[vH,nC]=eC(hi),rC=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...p}=e,f=fr(hi,n),[h,m]=w.useState(null),y=Jn(t,$=>m($)),g=w.useRef(null),v=w.useRef(""),b=f.viewport,S=r.content-r.viewport,E=Mn(u),_=Mn(c),I=Nd(d,10);function P($){if(g.current){const O=$.clientX-g.current.left,q=$.clientY-g.current.top;l({x:O,y:q})}}return w.useEffect(()=>{const $=O=>{const q=O.target;(h==null?void 0:h.contains(q))&&E(O,S)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[b,h,S,E]),w.useEffect(_,[r,_]),Os(h,I),Os(f.content,I),w.createElement(vH,{scope:n,scrollbar:h,hasThumb:i,onThumbChange:Mn(o),onThumbPointerUp:Mn(s),onThumbPositionChange:_,onThumbPointerDown:Mn(a)},w.createElement(bn.div,mt({},p,{ref:y,style:{position:"absolute",...p.style},onPointerDown:Dn(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),g.current=h.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),P($))}),onPointerMove:Dn(e.onPointerMove,P),onPointerUp:Dn(e.onPointerUp,$=>{const O=$.target;O.hasPointerCapture($.pointerId)&&O.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=v.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})))}),Qm="ScrollAreaThumb",bH=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=nC(Qm,e.__scopeScrollArea);return w.createElement(zi,{present:n||i.hasThumb},w.createElement(wH,mt({ref:t},r)))}),wH=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=fr(Qm,n),s=nC(Qm,n),{onThumbPositionChange:a}=s,c=Jn(t,d=>s.onThumbChange(d)),l=w.useRef(),u=Nd(()=>{l.current&&(l.current(),l.current=void 0)},100);return w.useEffect(()=>{const d=o.viewport;if(d){const p=()=>{if(u(),!l.current){const f=EH(d,a);l.current=f,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[o.viewport,u,a]),w.createElement(bn.div,mt({"data-state":s.hasThumb?"visible":"hidden"},i,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Dn(e.onPointerDownCapture,d=>{const f=d.target.getBoundingClientRect(),h=d.clientX-f.left,m=d.clientY-f.top;s.onThumbPointerDown({x:h,y:m})}),onPointerUp:Dn(e.onPointerUp,s.onThumbPointerUp)}))}),iC="ScrollAreaCorner",xH=w.forwardRef((e,t)=>{const n=fr(iC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?w.createElement(_H,mt({},e,{ref:t})):null}),_H=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=fr(iC,n),[o,s]=w.useState(0),[a,c]=w.useState(0),l=!!(o&&a);return Os(i.scrollbarX,()=>{var u;const d=((u=i.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;i.onCornerHeightChange(d),c(d)}),Os(i.scrollbarY,()=>{var u;const d=((u=i.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;i.onCornerWidthChange(d),s(d)}),l?w.createElement(bn.div,mt({},r,{ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function $d(e){return e?parseInt(e,10):0}function oC(e,t){const n=e/t;return isNaN(n)?0:n}function Dd(e){const t=oC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function SH(e,t,n,r="ltr"){const i=Dd(n),o=i/2,s=t||o,a=i-s,c=n.scrollbar.paddingStart+s,l=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return aC([c,l],d)(e)}function sC(e,t,n="ltr"){const r=Dd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,c=n==="ltr"?[0,s]:[s*-1,0],l=aH(e,c);return aC([0,s],[0,a])(l)}function aC(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function cC(e,t){return e>0&&e<t}const EH=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Nd(e,t){const n=Mn(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Os(e,t){const n=Mn(t);zo(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const kH=uH,CH=fH,TH=pH,AH=bH,OH=xH;var lC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(tt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",c="hour",l="day",u="week",d="month",p="quarter",f="year",h="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var D=["th","st","nd","rd"],M=F%100;return"["+F+(D[(M-20)%10]||D[M]||D[0])+"]"}},b=function(F,D,M){var Z=String(F);return!Z||Z.length>=D?F:""+Array(D+1-Z.length).join(M)+F},S={s:b,z:function(F){var D=-F.utcOffset(),M=Math.abs(D),Z=Math.floor(M/60),W=M%60;return(D<=0?"+":"-")+b(Z,2,"0")+":"+b(W,2,"0")},m:function F(D,M){if(D.date()<M.date())return-F(M,D);var Z=12*(M.year()-D.year())+(M.month()-D.month()),W=D.clone().add(Z,d),Q=M-W<0,C=D.clone().add(Z+(Q?-1:1),d);return+(-(Z+(M-W)/(Q?W-C:C-W))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:d,y:f,w:u,d:l,D:h,h:c,m:a,s,ms:o,Q:p}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},E="en",_={};_[E]=v;var I="$isDayjsObject",P=function(F){return F instanceof H||!(!F||!F[I])},$=function F(D,M,Z){var W;if(!D)return E;if(typeof D=="string"){var Q=D.toLowerCase();_[Q]&&(W=Q),M&&(_[Q]=M,W=Q);var C=D.split("-");if(!W&&C.length>1)return F(C[0])}else{var te=D.name;_[te]=D,W=te}return!Z&&W&&(E=W),W||!Z&&E},O=function(F,D){if(P(F))return F.clone();var M=typeof D=="object"?D:{};return M.date=F,M.args=arguments,new H(M)},q=S;q.l=$,q.i=P,q.w=function(F,D){return O(F,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var H=function(){function F(M){this.$L=$(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[I]=!0}var D=F.prototype;return D.parse=function(M){this.$d=function(Z){var W=Z.date,Q=Z.utc;if(W===null)return new Date(NaN);if(q.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var C=W.match(y);if(C){var te=C[2]-1||0,fe=(C[7]||"0").substring(0,3);return Q?new Date(Date.UTC(C[1],te,C[3]||1,C[4]||0,C[5]||0,C[6]||0,fe)):new Date(C[1],te,C[3]||1,C[4]||0,C[5]||0,C[6]||0,fe)}}return new Date(W)}(M),this.init()},D.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},D.$utils=function(){return q},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(M,Z){var W=O(M);return this.startOf(Z)<=W&&W<=this.endOf(Z)},D.isAfter=function(M,Z){return O(M)<this.startOf(Z)},D.isBefore=function(M,Z){return this.endOf(Z)<O(M)},D.$g=function(M,Z,W){return q.u(M)?this[Z]:this.set(W,M)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(M,Z){var W=this,Q=!!q.u(Z)||Z,C=q.p(M),te=function(Pe,he){var de=q.w(W.$u?Date.UTC(W.$y,he,Pe):new Date(W.$y,he,Pe),W);return Q?de:de.endOf(l)},fe=function(Pe,he){return q.w(W.toDate()[Pe].apply(W.toDate("s"),(Q?[0,0,0,0]:[23,59,59,999]).slice(he)),W)},A=this.$W,we=this.$M,Te=this.$D,Ee="set"+(this.$u?"UTC":"");switch(C){case f:return Q?te(1,0):te(31,11);case d:return Q?te(1,we):te(0,we+1);case u:var $e=this.$locale().weekStart||0,Fe=(A<$e?A+7:A)-$e;return te(Q?Te-Fe:Te+(6-Fe),we);case l:case h:return fe(Ee+"Hours",0);case c:return fe(Ee+"Minutes",1);case a:return fe(Ee+"Seconds",2);case s:return fe(Ee+"Milliseconds",3);default:return this.clone()}},D.endOf=function(M){return this.startOf(M,!1)},D.$set=function(M,Z){var W,Q=q.p(M),C="set"+(this.$u?"UTC":""),te=(W={},W[l]=C+"Date",W[h]=C+"Date",W[d]=C+"Month",W[f]=C+"FullYear",W[c]=C+"Hours",W[a]=C+"Minutes",W[s]=C+"Seconds",W[o]=C+"Milliseconds",W)[Q],fe=Q===l?this.$D+(Z-this.$W):Z;if(Q===d||Q===f){var A=this.clone().set(h,1);A.$d[te](fe),A.init(),this.$d=A.set(h,Math.min(this.$D,A.daysInMonth())).$d}else te&&this.$d[te](fe);return this.init(),this},D.set=function(M,Z){return this.clone().$set(M,Z)},D.get=function(M){return this[q.p(M)]()},D.add=function(M,Z){var W,Q=this;M=Number(M);var C=q.p(Z),te=function(we){var Te=O(Q);return q.w(Te.date(Te.date()+Math.round(we*M)),Q)};if(C===d)return this.set(d,this.$M+M);if(C===f)return this.set(f,this.$y+M);if(C===l)return te(1);if(C===u)return te(7);var fe=(W={},W[a]=r,W[c]=i,W[s]=n,W)[C]||1,A=this.$d.getTime()+M*fe;return q.w(A,this)},D.subtract=function(M,Z){return this.add(-1*M,Z)},D.format=function(M){var Z=this,W=this.$locale();if(!this.isValid())return W.invalidDate||m;var Q=M||"YYYY-MM-DDTHH:mm:ssZ",C=q.z(this),te=this.$H,fe=this.$m,A=this.$M,we=W.weekdays,Te=W.months,Ee=W.meridiem,$e=function(he,de,_e,pe){return he&&(he[de]||he(Z,Q))||_e[de].slice(0,pe)},Fe=function(he){return q.s(te%12||12,he,"0")},Pe=Ee||function(he,de,_e){var pe=he<12?"AM":"PM";return _e?pe.toLowerCase():pe};return Q.replace(g,function(he,de){return de||function(_e){switch(_e){case"YY":return String(Z.$y).slice(-2);case"YYYY":return q.s(Z.$y,4,"0");case"M":return A+1;case"MM":return q.s(A+1,2,"0");case"MMM":return $e(W.monthsShort,A,Te,3);case"MMMM":return $e(Te,A);case"D":return Z.$D;case"DD":return q.s(Z.$D,2,"0");case"d":return String(Z.$W);case"dd":return $e(W.weekdaysMin,Z.$W,we,2);case"ddd":return $e(W.weekdaysShort,Z.$W,we,3);case"dddd":return we[Z.$W];case"H":return String(te);case"HH":return q.s(te,2,"0");case"h":return Fe(1);case"hh":return Fe(2);case"a":return Pe(te,fe,!0);case"A":return Pe(te,fe,!1);case"m":return String(fe);case"mm":return q.s(fe,2,"0");case"s":return String(Z.$s);case"ss":return q.s(Z.$s,2,"0");case"SSS":return q.s(Z.$ms,3,"0");case"Z":return C}return null}(he)||C.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(M,Z,W){var Q,C=this,te=q.p(Z),fe=O(M),A=(fe.utcOffset()-this.utcOffset())*r,we=this-fe,Te=function(){return q.m(C,fe)};switch(te){case f:Q=Te()/12;break;case d:Q=Te();break;case p:Q=Te()/3;break;case u:Q=(we-A)/6048e5;break;case l:Q=(we-A)/864e5;break;case c:Q=we/i;break;case a:Q=we/r;break;case s:Q=we/n;break;default:Q=we}return W?Q:q.a(Q)},D.daysInMonth=function(){return this.endOf(d).$D},D.$locale=function(){return _[this.$L]},D.locale=function(M,Z){if(!M)return this.$L;var W=this.clone(),Q=$(M,Z,!0);return Q&&(W.$L=Q),W},D.clone=function(){return q.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},F}(),B=H.prototype;return O.prototype=B,[["$ms",o],["$s",s],["$m",a],["$H",c],["$W",l],["$M",d],["$y",f],["$D",h]].forEach(function(F){B[F[1]]=function(D){return this.$g(D,F[0],F[1])}}),O.extend=function(F,D){return F.$i||(F(D,H,O),F.$i=!0),O},O.locale=$,O.isDayjs=P,O.unix=function(F){return O(1e3*F)},O.en=_[E],O.Ls=_,O.p={},O})})(lC);var IH=lC.exports;const jd=mi(IH);var uC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(tt,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(uC);var RH=uC.exports;const PH=mi(RH);var dC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(tt,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(dC);var $H=dC.exports;const DH=mi($H);jd.extend(PH),jd.extend(DH);function NH(e,t="day"){if(!e||e.length===0)return[];const n=[];n.push(fC(e[0].timestamp));for(let r=0;r<e.length;r++)if(n.push(e[r]),r+1<e.length){const i=e[r].timestamp,o=e[r+1].timestamp;jd(i).isSame(o,t)||n.push(fC(o))}return n}function fC(e){return{id:Pl(),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:jH(e)}}}function jH(e,t=!1){const n=jd(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}const pC=w.memo(({scrollDownButton:e,...t})=>{var v,b,S,E,_,I,P,$,O,q,H,B,F;const{messageList:n}=Ie(D=>D.theme),r=Qn(D=>D.conversationId),i=Ie(D=>D.messages)[r??""]??[],o=Ie(D=>D.setState),s=Ie(D=>D.client),a=Ie(D=>D.getClientId)(),c=Ie(D=>D.configuration),l=Ie(D=>D.messageContainerRef),u=Ie(D=>D.isTyping),d=Ie(D=>D.setIsTyping),p=w.useMemo(()=>NH(i),[i]),[f,h]=w.useState(!0),{y:m}=tZ(l),y=()=>{if(!l.current)return;const{scrollHeight:D}=l.current;f&&l.current.scrollTo({top:D})};w.useEffect(()=>s==null?void 0:s.on("isTyping",({isTyping:D,timeout:M})=>{d(D,M)}),[]),w.useEffect(()=>{const D=i[i.length-1];o({disableComposer:!!(D!=null&&D.disableInput)})},[i.length]),w.useEffect(()=>{if(!l.current)return;const{offsetHeight:D,scrollHeight:M,scrollTop:Z}=l.current;h(M<=Z+D+100)},[m]);const g=e!=null&&e.icon?e==null?void 0:e.icon:kZ;return U.jsxs(kH,{...(v=n==null?void 0:n.scrollbar)==null?void 0:v.container,scrollHideDelay:300,type:"hover",children:[U.jsx(CH,{...(b=n==null?void 0:n.scrollbar)==null?void 0:b.viewport,ref:l,children:U.jsxs("ul",{...t,...n==null?void 0:n.container,children:[U.jsxs("li",{...(S=n==null?void 0:n.marquee)==null?void 0:S.container,children:[U.jsx(ap,{userId:a,src:c.botAvatar,...(E=n==null?void 0:n.marquee)==null?void 0:E.avatar,children:(c.botName||"Bot").slice(0,1)}),U.jsxs("div",{...(_=n==null?void 0:n.marquee)==null?void 0:_.content,children:[U.jsx("h1",{...(I=n==null?void 0:n.marquee)==null?void 0:I.title,children:c.botName||"Bot"}),U.jsx("p",{...(P=n==null?void 0:n.marquee)==null?void 0:P.description,children:c.botDescription})]})]}),p.map((D,M)=>U.jsx(Gm,{scroll:y,...D},M)),u&&U.jsx(Gm,{scroll:y,direction:"incoming",children:U.jsx(Xk,{})}),U.jsx("li",{"data-is-at-bottom":f,...($=n==null?void 0:n.scrollDownButton)==null?void 0:$.container,children:!!i.length&&U.jsxs("button",{type:"button","data-is-at-bottom":f,...(O=n==null?void 0:n.scrollDownButton)==null?void 0:O.button,onClick:()=>{var D,M;return(M=l.current)==null?void 0:M.scrollBy({top:(D=l.current)==null?void 0:D.scrollHeight})},children:[(e==null?void 0:e.text)??"Back"," ",U.jsx(g,{...(q=n==null?void 0:n.scrollDownButton)==null?void 0:q.icon})]})})]})}),U.jsx(TH,{orientation:"vertical",...(H=n==null?void 0:n.scrollbar)==null?void 0:H.background,children:U.jsx(AH,{...(B=n==null?void 0:n.scrollbar)==null?void 0:B.thumb})}),U.jsx(OH,{...(F=n==null?void 0:n.scrollbar)==null?void 0:F.corner})]})}),MH=()=>U.jsxs(Wk,{children:[U.jsx(Gk,{}),U.jsx(pC,{}),U.jsxs(pk,{children:[U.jsx(mk,{}),U.jsx(hk,{}),U.jsx(yk,{})]})]}),Is=V.object({title:V.string(),link:V.string().optional()}),hC=V.object({composerPlaceholder:V.string().optional(),botName:V.string().optional(),botAvatar:V.string().optional(),botDescription:V.string().optional(),website:Is.optional(),email:Is.optional(),phone:Is.optional(),privacyPolicy:Is.optional(),termsOfService:Is.optional()}),mC=V.enum(["heading1","heading2","heading3","text","horizontalRule","link","italic","bold","orderedList","unorderedList","listItem","lineBreak","pre"]),yC=V.object({}).passthrough().transform(e=>e),xe=V.object({className:V.string().optional(),style:yC.optional()}),Md=V.object({container:xe.optional(),image:xe.optional(),fallback:xe.optional()}),gC=V.object({button:xe.optional(),text:V.record(mC,xe.optional()),image:V.object({image:xe.optional(),placeholder:xe.optional()}).optional(),audio:xe.optional(),video:xe.optional(),file:V.object({container:xe.optional(),title:xe.optional(),icon:xe.optional()}).optional(),location:V.object({container:xe.optional(),title:xe.optional(),icon:xe.optional()}).optional(),column:xe.optional(),row:xe.optional(),bubble:xe.optional(),carousel:V.object({container:xe.optional(),slidesContainer:xe.optional(),backButton:xe.optional(),nextButton:xe.optional()}).optional(),dropdown:V.object({button:V.object({container:xe.optional(),icon:xe.optional(),text:xe.optional()}).optional(),content:V.object({container:xe.optional(),item:xe.optional()}).optional()}).optional()}),vC=V.object({container:xe.optional(),modal:V.object({overlay:xe.optional(),container:xe.optional(),dialog:V.object({container:xe.optional(),title:V.object({container:xe.optional(),text:xe.optional(),closeIcon:xe.optional()}).optional(),content:xe.optional(),newConversation:V.object({text:xe.optional(),button:xe.optional()}).optional()}).optional()}).optional(),notification:V.object({container:xe.optional(),title:xe.optional(),description:xe.optional(),icon:xe.optional(),closeIcon:xe.optional()}).optional(),header:V.object({container:xe.optional(),content:V.object({container:xe.optional(),title:xe.optional(),description:xe.optional(),avatar:Md.optional(),actions:V.object({container:xe.optional(),icons:xe.optional()}).optional()}),expandedContent:V.object({container:xe.optional(),group:xe.optional(),descriptionItems:V.object({container:xe.optional(),icon:xe.optional(),text:xe.optional(),link:xe.optional(),poweredBy:xe.optional()}).optional()}).optional(),description:V.object({container:xe.optional(),title:xe.optional(),subtitle:xe.optional()}).optional(),newConversationIcon:xe.optional()}).optional(),composer:V.object({container:xe.optional(),input:xe.optional(),uploadButton:V.object({container:xe.optional(),icon:xe.optional()}).optional(),button:V.object({container:xe.optional(),icon:xe.optional()}).optional()}).optional(),fab:V.object({icon:xe.optional(),container:xe.optional()}).optional(),messageList:V.object({scrollbar:V.object({container:xe.optional(),viewport:xe.optional(),thumb:xe.optional(),corner:xe.optional(),background:xe.optional()}).optional(),container:xe.optional(),marquee:V.object({content:xe.optional(),title:xe.optional(),description:xe.optional(),avatar:Md.optional(),container:xe.optional()}).optional(),scrollDownButton:V.object({container:xe.optional(),button:xe.optional(),icon:xe.optional()}).optional()}).optional(),message:V.object({container:xe.optional(),avatar:Md.optional(),blocks:gC.optional()}).optional(),loadingIndicator:V.object({container:xe.optional(),loader:xe.optional()}).optional()}),bC=V.enum(["opened","closed","initial"]),wC=V.object({name:V.string().optional(),pictureUrl:V.string().optional(),data:V.record(V.unknown()).optional()}),xC=V.enum(["messaging","pushpin"]),_C=V.object({configuration:hC.optional().catch(void 0),theme:vC.optional().catch(void 0),style:V.string().optional().catch(void 0),user:wC.optional().catch(void 0)}),qH=_C.extend({clientId:V.string(),botId:V.string(),selector:V.string().optional().catch(void 0),webchatScriptUrl:V.string().optional().catch(void 0),fabScriptUrl:V.string().optional().catch(void 0),messagingUrl:V.string().optional().catch(void 0),pushpinUrl:V.string().optional().catch(void 0),clientMode:xC.optional().catch(void 0),defaultState:bC.optional().catch(void 0)});Ke.Avatar=ap,Ke.Block=ks,Ke.Composer=pk,Ke.ComposerButton=yk,Ke.ComposerInput=hk,Ke.Container=Wk,Ke.Fab=qV,Ke.Header=Gk,Ke.HeaderRoot=iH,Ke.LoadingIndicator=Xk,Ke.Message=Gm,Ke.MessageList=pC,Ke.Modal=Zi,Ke.ModalProvider=gk,Ke.RestartConversation=Yk,Ke.UploadButton=mk,Ke.Webchat=MH,Ke.WebchatProvider=l8,Ke.__adapters=P$,Ke.avatarThemeSchema=Md,Ke.blockThemeSchema=gC,Ke.clientModePropsSchema=xC,Ke.configPropsSchema=_C,Ke.configurationSchema=hC,Ke.cssStyleSchema=yC,Ke.descriptionItemSchema=Is,Ke.fileTypes=kS,Ke.getClient=TS,Ke.initPropsSchema=qH,Ke.isFileType=CS,Ke.markdownTypeSchema=mC,Ke.renderers=fk,Ke.statePropsSchema=bC,Ke.styleOptionSchema=xe,Ke.themeSchema=vC,Ke.useClient=_4,Ke.useWebchatStore=Ie,Ke.userPropsSchema=wC,Object.defineProperty(Ke,Symbol.toStringTag,{value:"Module"})});
|