@tonyclaw/llm-inspector 1.8.0 → 1.9.0
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/.output/nitro.json +1 -1
- package/.output/public/assets/{index-BLVa7n9b.css → index-DdJSLfxK.css} +1 -1
- package/.output/public/assets/{index-DH3FOgcK.js → index-DyKLPMPn.js} +18 -18
- package/.output/public/assets/{main-Beo3LJDa.js → main-Cu0oTDfX.js} +1 -1
- package/.output/server/_ssr/{index-HkueJ4Un.mjs → index-COIATcfa.mjs} +74 -28
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-DTswxb7l.mjs → router-CwmgKXBJ.mjs} +236 -65
- package/.output/server/{_tanstack-start-manifest_v-DhUuivt-.mjs → _tanstack-start-manifest_v-C7hQOzvX.mjs} +1 -1
- package/.output/server/index.mjs +23 -23
- package/README.md +8 -209
- package/package.json +1 -1
- package/src/components/ProxyViewerContainer.tsx +10 -1
- package/src/components/providers/ProviderCard.tsx +19 -15
- package/src/components/providers/ProviderForm.tsx +21 -0
- package/src/components/proxy-viewer/LogEntry.tsx +7 -0
- package/src/components/proxy-viewer/ResponseView.tsx +32 -6
- package/src/proxy/chunkStorage.ts +4 -6
- package/src/proxy/formats/anthropic/schemas.ts +9 -0
- package/src/proxy/formats/anthropic/stream.ts +11 -0
- package/src/proxy/formats/openai/stream.ts +15 -0
- package/src/proxy/handler.ts +34 -27
- package/src/proxy/logIndex.ts +52 -7
- package/src/proxy/logger.ts +60 -10
- package/src/proxy/providers.ts +5 -0
- package/src/proxy/schemas.ts +2 -0
- package/src/proxy/socketTracker.ts +90 -36
- package/src/proxy/store.ts +24 -14
- package/src/routes/api/providers.$providerId.ts +1 -0
- package/src/routes/api/providers.ts +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as _,a as cr,c as yr,g as Di,j as h,R as tt,b as Hl,d as fh,u as hh}from"./main-Beo3LJDa.js";function G(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=s.prototype,u=Object.keys(c);for(let f=0;f<u.length;f++){const p=u[f];p in a||(a[p]=c[p].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const c=n?.Parent?new i:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class kn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ql extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Kl={};function Zt(e){return Kl}function Gl(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ii(e,t){return typeof t=="bigint"?t.toString():t}function ro(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Mi(e){return e==null}function Li(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ph(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(o=Number.parseInt(l[1]))}const i=n>o?n:o,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}const Ls=Symbol("evaluating");function Ne(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ls)return r===void 0&&(r=Ls,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function ln(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Kt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Fs(e){return JSON.stringify(e)}function mh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Jl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const gh=ro(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Nn(e){if(rr(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(rr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Yl(e){return Nn(e)?{...e}:Array.isArray(e)?[...e]:e}const xh=new Set(["string","number","symbol"]);function An(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gt(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ge(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function yh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const vh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function bh(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Kt(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return ln(this,"shape",s),s},checks:[]});return Gt(e,i)}function wh(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Kt(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return ln(this,"shape",s),s},checks:[]});return Gt(e,i)}function _h(e,t){if(!Nn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Kt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return ln(this,"shape",i),i}});return Gt(e,o)}function kh(e,t){if(!Nn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return ln(this,"shape",r),r}});return Gt(e,n)}function Sh(e,t){const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return ln(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Gt(e,n)}function Ch(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Kt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return ln(this,"shape",l),l},checks:[]});return Gt(t,s)}function Eh(e,t,n){const r=Kt(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return ln(this,"shape",i),i}});return Gt(t,r)}function vn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function bn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function vr(e){return typeof e=="string"?e:e?.message}function Vt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=vr(e.inst?._zod.def?.error?.(e))??vr(t?.error?.(e))??vr(n.customError?.(e))??vr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Fi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function or(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Xl=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ii,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ql=G("$ZodError",Xl),ec=G("$ZodError",Xl,{Parent:Error});function Th(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Nh(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>r({issues:s}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let s=n,a=0;for(;a<i.path.length;){const l=i.path[a];a===i.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(i))):s[l]=s[l]||{_errors:[]},s=s[l],a++}}};return r(e),n}const $i=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new kn;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Vt(l,i,Zt())));throw Jl(a,o?.callee),a}return s.value},Bi=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Vt(l,i,Zt())));throw Jl(a,o?.callee),a}return s.value},oo=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new kn;return i.issues.length?{success:!1,error:new(e??Ql)(i.issues.map(s=>Vt(s,o,Zt())))}:{success:!0,data:i.value}},Ah=oo(ec),io=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Vt(s,o,Zt())))}:{success:!0,data:i.value}},zh=io(ec),jh=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return $i(e)(t,n,o)},Ih=e=>(t,n,r)=>$i(e)(t,n,r),Oh=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bi(e)(t,n,o)},Ph=e=>async(t,n,r)=>Bi(e)(t,n,r),Rh=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return oo(e)(t,n,o)},Dh=e=>(t,n,r)=>oo(e)(t,n,r),Mh=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return io(e)(t,n,o)},Lh=e=>async(t,n,r)=>io(e)(t,n,r),Fh=/^[cC][^\s-]{8,}$/,$h=/^[0-9a-z]+$/,Bh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Uh=/^[0-9a-vA-V]{20}$/,Zh=/^[A-Za-z0-9]{27}$/,Vh=/^[a-zA-Z0-9_-]{21}$/,Wh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hh=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,$s=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,qh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Gh(){return new RegExp(Kh,"u")}const Jh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Yh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Xh=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Qh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ep=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tc=/^[A-Za-z0-9_-]*$/,tp=/^\+[1-9]\d{6,14}$/,nc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",np=new RegExp(`^${nc}$`);function rc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rp(e){return new RegExp(`^${rc(e)}$`)}function op(e){const t=rc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${nc}T(?:${r})$`)}const ip=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},sp=/^-?\d+$/,oc=/^-?\d+(?:\.\d+)?$/,ap=/^(?:true|false)$/i,lp=/^null$/i,cp=/^[^A-Z]*$/,up=/^[^a-z]*$/,rt=G("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ic={number:"number",bigint:"bigint",object:"date"},sc=G("$ZodCheckLessThan",(e,t)=>{rt.init(e,t);const n=ic[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ac=G("$ZodCheckGreaterThan",(e,t)=>{rt.init(e,t);const n=ic[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),dp=G("$ZodCheckMultipleOf",(e,t)=>{rt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):ph(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),fp=G("$ZodCheckNumberFormat",(e,t)=>{rt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=vh[t.format];e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,n&&(a.pattern=sp)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),hp=G("$ZodCheckMaxLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=Fi(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),pp=G("$ZodCheckMinLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=Fi(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),mp=G("$ZodCheckLengthEquals",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=Fi(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),so=G("$ZodCheckStringFormat",(e,t)=>{var n,r;rt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),gp=G("$ZodCheckRegex",(e,t)=>{so.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),xp=G("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=cp),so.init(e,t)}),yp=G("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=up),so.init(e,t)}),vp=G("$ZodCheckIncludes",(e,t)=>{rt.init(e,t);const n=An(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),bp=G("$ZodCheckStartsWith",(e,t)=>{rt.init(e,t);const n=new RegExp(`^${An(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),wp=G("$ZodCheckEndsWith",(e,t)=>{rt.init(e,t);const n=new RegExp(`.*${An(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),_p=G("$ZodCheckOverwrite",(e,t)=>{rt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class kp{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
1
|
+
import{r as _,a as ur,c as vr,g as Di,j as h,R as tt,b as ql,d as hh,u as ph}from"./main-Cu0oTDfX.js";function G(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=s.prototype,u=Object.keys(c);for(let f=0;f<u.length;f++){const p=u[f];p in a||(a[p]=c[p].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const c=n?.Parent?new i:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class kn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Kl extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Gl={};function Zt(e){return Gl}function Jl(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ii(e,t){return typeof t=="bigint"?t.toString():t}function ro(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Mi(e){return e==null}function Li(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function mh(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(o=Number.parseInt(l[1]))}const i=n>o?n:o,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}const Ls=Symbol("evaluating");function Ne(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ls)return r===void 0&&(r=Ls,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function ln(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Kt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Fs(e){return JSON.stringify(e)}function gh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Yl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function or(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const xh=ro(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Nn(e){if(or(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(or(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Xl(e){return Nn(e)?{...e}:Array.isArray(e)?[...e]:e}const yh=new Set(["string","number","symbol"]);function An(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gt(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ge(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function vh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const bh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function wh(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Kt(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return ln(this,"shape",s),s},checks:[]});return Gt(e,i)}function _h(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Kt(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return ln(this,"shape",s),s},checks:[]});return Gt(e,i)}function kh(e,t){if(!Nn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Kt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return ln(this,"shape",i),i}});return Gt(e,o)}function Sh(e,t){if(!Nn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return ln(this,"shape",r),r}});return Gt(e,n)}function Ch(e,t){const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return ln(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Gt(e,n)}function Eh(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Kt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return ln(this,"shape",l),l},checks:[]});return Gt(t,s)}function Th(e,t,n){const r=Kt(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return ln(this,"shape",i),i}});return Gt(t,r)}function vn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function bn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function br(e){return typeof e=="string"?e:e?.message}function Vt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=br(e.inst?._zod.def?.error?.(e))??br(t?.error?.(e))??br(n.customError?.(e))??br(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Fi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ir(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Ql=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ii,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ec=G("$ZodError",Ql),tc=G("$ZodError",Ql,{Parent:Error});function Nh(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Ah(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>r({issues:s}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let s=n,a=0;for(;a<i.path.length;){const l=i.path[a];a===i.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(i))):s[l]=s[l]||{_errors:[]},s=s[l],a++}}};return r(e),n}const $i=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new kn;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Vt(l,i,Zt())));throw Yl(a,o?.callee),a}return s.value},Bi=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Vt(l,i,Zt())));throw Yl(a,o?.callee),a}return s.value},oo=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new kn;return i.issues.length?{success:!1,error:new(e??ec)(i.issues.map(s=>Vt(s,o,Zt())))}:{success:!0,data:i.value}},jh=oo(tc),io=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Vt(s,o,Zt())))}:{success:!0,data:i.value}},zh=io(tc),Ih=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return $i(e)(t,n,o)},Oh=e=>(t,n,r)=>$i(e)(t,n,r),Ph=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bi(e)(t,n,o)},Rh=e=>async(t,n,r)=>Bi(e)(t,n,r),Dh=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return oo(e)(t,n,o)},Mh=e=>(t,n,r)=>oo(e)(t,n,r),Lh=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return io(e)(t,n,o)},Fh=e=>async(t,n,r)=>io(e)(t,n,r),$h=/^[cC][^\s-]{8,}$/,Bh=/^[0-9a-z]+$/,Uh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zh=/^[0-9a-vA-V]{20}$/,Vh=/^[A-Za-z0-9]{27}$/,Wh=/^[a-zA-Z0-9_-]{21}$/,Hh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qh=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,$s=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Kh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Gh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Jh(){return new RegExp(Gh,"u")}const Yh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Xh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qh=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ep=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nc=/^[A-Za-z0-9_-]*$/,np=/^\+[1-9]\d{6,14}$/,rc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",rp=new RegExp(`^${rc}$`);function oc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function op(e){return new RegExp(`^${oc(e)}$`)}function ip(e){const t=oc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${rc}T(?:${r})$`)}const sp=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ap=/^-?\d+$/,ic=/^-?\d+(?:\.\d+)?$/,lp=/^(?:true|false)$/i,cp=/^null$/i,up=/^[^A-Z]*$/,dp=/^[^a-z]*$/,rt=G("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sc={number:"number",bigint:"bigint",object:"date"},ac=G("$ZodCheckLessThan",(e,t)=>{rt.init(e,t);const n=sc[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),lc=G("$ZodCheckGreaterThan",(e,t)=>{rt.init(e,t);const n=sc[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fp=G("$ZodCheckMultipleOf",(e,t)=>{rt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):mh(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),hp=G("$ZodCheckNumberFormat",(e,t)=>{rt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=bh[t.format];e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,n&&(a.pattern=ap)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),pp=G("$ZodCheckMaxLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=Fi(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),mp=G("$ZodCheckMinLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=Fi(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),gp=G("$ZodCheckLengthEquals",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=Fi(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),so=G("$ZodCheckStringFormat",(e,t)=>{var n,r;rt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),xp=G("$ZodCheckRegex",(e,t)=>{so.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),yp=G("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=up),so.init(e,t)}),vp=G("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=dp),so.init(e,t)}),bp=G("$ZodCheckIncludes",(e,t)=>{rt.init(e,t);const n=An(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),wp=G("$ZodCheckStartsWith",(e,t)=>{rt.init(e,t);const n=new RegExp(`^${An(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),_p=G("$ZodCheckEndsWith",(e,t)=>{rt.init(e,t);const n=new RegExp(`.*${An(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),kp=G("$ZodCheckOverwrite",(e,t)=>{rt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Sp{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
2
2
|
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
|
|
3
|
-
`))}}const
|
|
3
|
+
`))}}const Cp={major:4,minor:3,patch:6},Me=G("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cp;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,l)=>{let c=vn(s),u;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(c)continue;const p=s.issues.length,d=f._zod.check(s);if(d instanceof Promise&&l?.async===!1)throw new kn;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await d,s.issues.length!==p&&(c||(c=vn(s,p)))});else{if(s.issues.length===p)continue;c||(c=vn(s,p))}}return u?u.then(()=>s):s},i=(s,a,l)=>{if(vn(s))return s.aborted=!0,s;const c=o(a,r,l);if(c instanceof Promise){if(l.async===!1)throw new kn;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const c=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,a)):i(c,s,a)}const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new kn;return l.then(c=>o(c,r,a))}return o(l,r,a)}}Ne(e,"~standard",()=>({validate:o=>{try{const i=jh(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return zh(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Ui=G("$ZodString",(e,t)=>{Me.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??sp(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Fe=G("$ZodStringFormat",(e,t)=>{so.init(e,t),Ui.init(e,t)}),Ep=G("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=qh),Fe.init(e,t)}),Tp=G("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=$s(r))}else t.pattern??(t.pattern=$s());Fe.init(e,t)}),Np=G("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Kh),Fe.init(e,t)}),Ap=G("$ZodURL",(e,t)=>{Fe.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),jp=G("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Jh()),Fe.init(e,t)}),zp=G("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Wh),Fe.init(e,t)}),Ip=G("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$h),Fe.init(e,t)}),Op=G("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Bh),Fe.init(e,t)}),Pp=G("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Uh),Fe.init(e,t)}),Rp=G("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zh),Fe.init(e,t)}),Dp=G("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Vh),Fe.init(e,t)}),Mp=G("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ip(t)),Fe.init(e,t)}),Lp=G("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=rp),Fe.init(e,t)}),Fp=G("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=op(t)),Fe.init(e,t)}),$p=G("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hh),Fe.init(e,t)}),Bp=G("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Yh),Fe.init(e,t),e._zod.bag.format="ipv4"}),Up=G("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Xh),Fe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Zp=G("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Qh),Fe.init(e,t)}),Vp=G("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ep),Fe.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function cc(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Wp=G("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tp),Fe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{cc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Hp(e){if(!nc.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return cc(n)}const qp=G("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nc),Fe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Hp(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Kp=G("$ZodE164",(e,t)=>{t.pattern??(t.pattern=np),Fe.init(e,t)});function Gp(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Jp=G("$ZodJWT",(e,t)=>{Fe.init(e,t),e._zod.check=n=>{Gp(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),uc=G("$ZodNumber",(e,t)=>{Me.init(e,t),e._zod.pattern=e._zod.bag.pattern??ic,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Yp=G("$ZodNumberFormat",(e,t)=>{hp.init(e,t),uc.init(e,t)}),Xp=G("$ZodBoolean",(e,t)=>{Me.init(e,t),e._zod.pattern=lp,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Qp=G("$ZodNull",(e,t)=>{Me.init(e,t),e._zod.pattern=cp,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),em=G("$ZodUnknown",(e,t)=>{Me.init(e,t),e._zod.parse=n=>n}),tm=G("$ZodNever",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Bs(e,t,n){e.issues.length&&t.issues.push(...bn(n,e.issues)),t.value[n]=e.value}const nm=G("$ZodArray",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(c=>Bs(c,n,s))):Bs(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Br(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...bn(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function dc(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=vh(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function fc(e,t,n,r,o,i){const s=[],a=o.keySet,l=o.catchall._zod,c=l.def.type,u=l.optout==="optional";for(const f in t){if(a.has(f))continue;if(c==="never"){s.push(f);continue}const p=l.run({value:t[f],issues:[]},r);p instanceof Promise?e.push(p.then(d=>Br(d,n,f,t,u))):Br(p,n,f,t,u)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const rm=G("$ZodObject",(e,t)=>{if(Me.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=ro(()=>dc(t));Ne(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const f of u.values)l[c].add(f)}}return l});const o=or,i=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=r.value);const c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const u=[],f=s.shape;for(const p of s.keys){const d=f[p],x=d._zod.optout==="optional",m=d._zod.run({value:c[p],issues:[]},l);m instanceof Promise?u.push(m.then(y=>Br(y,a,p,c,x))):Br(m,a,p,c,x)}return i?fc(u,c,a,l,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),om=G("$ZodObjectJIT",(e,t)=>{rm.init(e,t);const n=e._zod.parse,r=ro(()=>dc(t)),o=p=>{const d=new Sp(["shape","payload","ctx"]),x=r.value,m=k=>{const S=Fs(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};d.write("const input = payload.value;");const y=Object.create(null);let g=0;for(const k of x.keys)y[k]=`key_${g++}`;d.write("const newResult = {};");for(const k of x.keys){const S=y[k],C=Fs(k),z=p[k]?._zod?.optout==="optional";d.write(`const ${S} = ${m(k)};`),z?d.write(`
|
|
4
4
|
if (${S}.issues.length) {
|
|
5
5
|
if (${C} in input) {
|
|
6
6
|
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
@@ -34,24 +34,24 @@ import{r as _,a as cr,c as yr,g as Di,j as h,R as tt,b as Hl,d as fh,u as hh}fro
|
|
|
34
34
|
newResult[${C}] = ${S}.value;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
`)}d.write("payload.value = newResult;"),d.write("return payload;");const v=d.compile();return(k,S)=>v(p,k,S)};let i;const s=rr,a=!Kl.jitless,c=a&&gh.value,u=t.catchall;let f;e._zod.parse=(p,d)=>{f??(f=r.value);const x=p.value;return s(x)?a&&c&&d?.async===!1&&d.jitless!==!0?(i||(i=o(t.shape)),p=i(p,d),u?dc([],x,p,d,f,e):p):n(p,d):(p.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),p)}});function Us(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!vn(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Vt(s,r,Zt())))}),t)}const fc=G("$ZodUnion",(e,t)=>{Me.init(e,t),Ne(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ne(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ne(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ne(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Li(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},i);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(l=>Us(l,o,e,i)):Us(a,o,e,i)}}),om=G("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,fc.init(e,t);const n=e._zod.parse;Ne(e._zod,"propValues",()=>{const o={};for(const i of t.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,l]of Object.entries(s)){o[a]||(o[a]=new Set);for(const c of l)o[a].add(c)}}return o});const r=ro(()=>{const o=t.options,i=new Map;for(const s of o){const a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const l of a){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(o,i)=>{const s=o.value;if(!rr(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}}),im=G("$ZodIntersection",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>Zs(n,l,c)):Zs(n,i,s)}});function si(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nn(e)&&Nn(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=si(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=si(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Zs(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&o&&e.issues.push({...o,keys:i}),vn(e))return e;const s=si(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const sm=G("$ZodRecord",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Nn(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const u=t.valueType._zod.run({value:o[c],issues:[]},r);u instanceof Promise?i.push(u.then(f=>{f.issues.length&&n.issues.push(...bn(c,f.issues)),n.value[c]=f.value})):(u.issues.length&&n.issues.push(...bn(c,u.issues)),n.value[c]=u.value)}let l;for(const c in o)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&oc.test(a)&&l.issues.length){const f=t.keyType._zod.run({value:Number(a),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(l=f)}if(l.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Vt(f,r,Zt())),input:a,path:[a],inst:e});continue}const u=t.valueType._zod.run({value:o[a],issues:[]},r);u instanceof Promise?i.push(u.then(f=>{f.issues.length&&n.issues.push(...bn(a,f.issues)),n.value[l.value]=f.value})):(u.issues.length&&n.issues.push(...bn(a,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),am=G("$ZodEnum",(e,t)=>{Me.init(e,t);const n=Gl(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>xh.has(typeof o)).map(o=>typeof o=="string"?An(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),lm=G("$ZodLiteral",(e,t)=>{if(Me.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?An(r):r?An(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),cm=G("$ZodTransform",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ql(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new kn;return n.value=o,n}});function Vs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const hc=G("$ZodOptional",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ne(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Li(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Vs(i,n.value)):Vs(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),um=G("$ZodExactOptional",(e,t)=>{hc.init(e,t),Ne(e._zod,"values",()=>t.innerType._zod.values),Ne(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),dm=G("$ZodNullable",(e,t)=>{Me.init(e,t),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Li(n.source)}|null)$`):void 0}),Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),fm=G("$ZodDefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Ws(i,t)):Ws(o,t)}});function Ws(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const hm=G("$ZodPrefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),pm=G("$ZodNonOptional",(e,t)=>{Me.init(e,t),Ne(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Hs(i,e)):Hs(o,e)}});function Hs(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const mm=G("$ZodCatch",(e,t)=>{Me.init(e,t),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Vt(s,r,Zt()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Vt(i,r,Zt()))},input:n.value}),n.issues=[]),n)}}),gm=G("$ZodPipe",(e,t)=>{Me.init(e,t),Ne(e._zod,"values",()=>t.in._zod.values),Ne(e._zod,"optin",()=>t.in._zod.optin),Ne(e._zod,"optout",()=>t.out._zod.optout),Ne(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>br(s,t.in,r)):br(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>br(i,t.out,r)):br(o,t.out,r)}});function br(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const xm=G("$ZodReadonly",(e,t)=>{Me.init(e,t),Ne(e._zod,"propValues",()=>t.innerType._zod.propValues),Ne(e._zod,"values",()=>t.innerType._zod.values),Ne(e._zod,"optin",()=>t.innerType?._zod?.optin),Ne(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(qs):qs(o)}});function qs(e){return e.value=Object.freeze(e.value),e}const ym=G("$ZodLazy",(e,t)=>{Me.init(e,t),Ne(e._zod,"innerType",()=>t.getter()),Ne(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ne(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ne(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ne(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),vm=G("$ZodCustom",(e,t)=>{rt.init(e,t),Me.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>Ks(i,n,r,e));Ks(o,n,r,e)}});function Ks(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(or(o))}}var Gs;class bm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function wm(){return new bm}(Gs=globalThis).__zod_globalRegistry??(Gs.__zod_globalRegistry=wm());const Xn=globalThis.__zod_globalRegistry;function _m(e,t){return new e({type:"string",...ge(t)})}function km(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ge(t)})}function Js(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ge(t)})}function Sm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ge(t)})}function Cm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ge(t)})}function Em(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ge(t)})}function Tm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ge(t)})}function Nm(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ge(t)})}function Am(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ge(t)})}function zm(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ge(t)})}function jm(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ge(t)})}function Im(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ge(t)})}function Om(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ge(t)})}function Pm(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ge(t)})}function Rm(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ge(t)})}function Dm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ge(t)})}function Mm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ge(t)})}function Lm(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ge(t)})}function Fm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ge(t)})}function $m(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ge(t)})}function Bm(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ge(t)})}function Um(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ge(t)})}function Zm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ge(t)})}function Vm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ge(t)})}function Wm(e,t){return new e({type:"string",format:"date",check:"string_format",...ge(t)})}function Hm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ge(t)})}function qm(e,t){return new e({type:"string",format:"duration",check:"string_format",...ge(t)})}function Km(e,t){return new e({type:"number",checks:[],...ge(t)})}function Gm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ge(t)})}function Jm(e,t){return new e({type:"boolean",...ge(t)})}function Ym(e,t){return new e({type:"null",...ge(t)})}function Xm(e){return new e({type:"unknown"})}function Qm(e,t){return new e({type:"never",...ge(t)})}function Ys(e,t){return new sc({check:"less_than",...ge(t),value:e,inclusive:!1})}function jo(e,t){return new sc({check:"less_than",...ge(t),value:e,inclusive:!0})}function Xs(e,t){return new ac({check:"greater_than",...ge(t),value:e,inclusive:!1})}function Io(e,t){return new ac({check:"greater_than",...ge(t),value:e,inclusive:!0})}function Qs(e,t){return new dp({check:"multiple_of",...ge(t),value:e})}function pc(e,t){return new hp({check:"max_length",...ge(t),maximum:e})}function Ur(e,t){return new pp({check:"min_length",...ge(t),minimum:e})}function mc(e,t){return new mp({check:"length_equals",...ge(t),length:e})}function eg(e,t){return new gp({check:"string_format",format:"regex",...ge(t),pattern:e})}function tg(e){return new xp({check:"string_format",format:"lowercase",...ge(e)})}function ng(e){return new yp({check:"string_format",format:"uppercase",...ge(e)})}function rg(e,t){return new vp({check:"string_format",format:"includes",...ge(t),includes:e})}function og(e,t){return new bp({check:"string_format",format:"starts_with",...ge(t),prefix:e})}function ig(e,t){return new wp({check:"string_format",format:"ends_with",...ge(t),suffix:e})}function Dn(e){return new _p({check:"overwrite",tx:e})}function sg(e){return Dn(t=>t.normalize(e))}function ag(){return Dn(e=>e.trim())}function lg(){return Dn(e=>e.toLowerCase())}function cg(){return Dn(e=>e.toUpperCase())}function ug(){return Dn(e=>mh(e))}function dg(e,t,n){return new e({type:"array",element:t,...ge(n)})}function fg(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ge(n)})}function hg(e){const t=pg(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(or(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(or(o))}},e(n.value,n)));return t}function pg(e,t){const n=new rt({check:"custom",...ge(t)});return n._zod.check=e,n}function gc(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Xn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ve(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{const p=s.schema,d=t.processors[o.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);d(e,t,p,u)}const f=e._zod.parent;f&&(s.ref||(s.ref=f),Ve(f,t,u),t.seen.get(f).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Je(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function xc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const l=r.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(s[0])?.id,p=e.external.uri??(x=>x);if(f)return{ref:p(f)};const d=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=d,{defId:d,ref:`${p("__shared")}#/${a}/${d}`}}if(s[1]===n)return{ref:"#"};const c=`#/${a}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:c}=o(s);a.def={...a.schema},c&&(a.defId=c);const u=a.schema;for(const f in u)delete u[f];u.$ref=l};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
37
|
+
`)}d.write("payload.value = newResult;"),d.write("return payload;");const b=d.compile();return(k,S)=>b(p,k,S)};let i;const s=or,a=!Gl.jitless,c=a&&xh.value,u=t.catchall;let f;e._zod.parse=(p,d)=>{f??(f=r.value);const x=p.value;return s(x)?a&&c&&d?.async===!1&&d.jitless!==!0?(i||(i=o(t.shape)),p=i(p,d),u?fc([],x,p,d,f,e):p):n(p,d):(p.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),p)}});function Us(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!vn(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Vt(s,r,Zt())))}),t)}const hc=G("$ZodUnion",(e,t)=>{Me.init(e,t),Ne(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ne(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ne(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ne(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Li(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},i);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(l=>Us(l,o,e,i)):Us(a,o,e,i)}}),im=G("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hc.init(e,t);const n=e._zod.parse;Ne(e._zod,"propValues",()=>{const o={};for(const i of t.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,l]of Object.entries(s)){o[a]||(o[a]=new Set);for(const c of l)o[a].add(c)}}return o});const r=ro(()=>{const o=t.options,i=new Map;for(const s of o){const a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const l of a){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(o,i)=>{const s=o.value;if(!or(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}}),sm=G("$ZodIntersection",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>Zs(n,l,c)):Zs(n,i,s)}});function si(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nn(e)&&Nn(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=si(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=si(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Zs(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&o&&e.issues.push({...o,keys:i}),vn(e))return e;const s=si(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const am=G("$ZodRecord",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Nn(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const u=t.valueType._zod.run({value:o[c],issues:[]},r);u instanceof Promise?i.push(u.then(f=>{f.issues.length&&n.issues.push(...bn(c,f.issues)),n.value[c]=f.value})):(u.issues.length&&n.issues.push(...bn(c,u.issues)),n.value[c]=u.value)}let l;for(const c in o)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ic.test(a)&&l.issues.length){const f=t.keyType._zod.run({value:Number(a),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(l=f)}if(l.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Vt(f,r,Zt())),input:a,path:[a],inst:e});continue}const u=t.valueType._zod.run({value:o[a],issues:[]},r);u instanceof Promise?i.push(u.then(f=>{f.issues.length&&n.issues.push(...bn(a,f.issues)),n.value[l.value]=f.value})):(u.issues.length&&n.issues.push(...bn(a,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),lm=G("$ZodEnum",(e,t)=>{Me.init(e,t);const n=Jl(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>yh.has(typeof o)).map(o=>typeof o=="string"?An(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),cm=G("$ZodLiteral",(e,t)=>{if(Me.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?An(r):r?An(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),um=G("$ZodTransform",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Kl(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new kn;return n.value=o,n}});function Vs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const pc=G("$ZodOptional",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ne(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Li(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Vs(i,n.value)):Vs(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),dm=G("$ZodExactOptional",(e,t)=>{pc.init(e,t),Ne(e._zod,"values",()=>t.innerType._zod.values),Ne(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),fm=G("$ZodNullable",(e,t)=>{Me.init(e,t),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Li(n.source)}|null)$`):void 0}),Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),hm=G("$ZodDefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Ws(i,t)):Ws(o,t)}});function Ws(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const pm=G("$ZodPrefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),mm=G("$ZodNonOptional",(e,t)=>{Me.init(e,t),Ne(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Hs(i,e)):Hs(o,e)}});function Hs(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const gm=G("$ZodCatch",(e,t)=>{Me.init(e,t),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Vt(s,r,Zt()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Vt(i,r,Zt()))},input:n.value}),n.issues=[]),n)}}),xm=G("$ZodPipe",(e,t)=>{Me.init(e,t),Ne(e._zod,"values",()=>t.in._zod.values),Ne(e._zod,"optin",()=>t.in._zod.optin),Ne(e._zod,"optout",()=>t.out._zod.optout),Ne(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>wr(s,t.in,r)):wr(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>wr(i,t.out,r)):wr(o,t.out,r)}});function wr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ym=G("$ZodReadonly",(e,t)=>{Me.init(e,t),Ne(e._zod,"propValues",()=>t.innerType._zod.propValues),Ne(e._zod,"values",()=>t.innerType._zod.values),Ne(e._zod,"optin",()=>t.innerType?._zod?.optin),Ne(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(qs):qs(o)}});function qs(e){return e.value=Object.freeze(e.value),e}const vm=G("$ZodLazy",(e,t)=>{Me.init(e,t),Ne(e._zod,"innerType",()=>t.getter()),Ne(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ne(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ne(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ne(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),bm=G("$ZodCustom",(e,t)=>{rt.init(e,t),Me.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>Ks(i,n,r,e));Ks(o,n,r,e)}});function Ks(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(ir(o))}}var Gs;class wm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function _m(){return new wm}(Gs=globalThis).__zod_globalRegistry??(Gs.__zod_globalRegistry=_m());const Qn=globalThis.__zod_globalRegistry;function km(e,t){return new e({type:"string",...ge(t)})}function Sm(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ge(t)})}function Js(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ge(t)})}function Cm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ge(t)})}function Em(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ge(t)})}function Tm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ge(t)})}function Nm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ge(t)})}function Am(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ge(t)})}function jm(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ge(t)})}function zm(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ge(t)})}function Im(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ge(t)})}function Om(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ge(t)})}function Pm(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ge(t)})}function Rm(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ge(t)})}function Dm(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ge(t)})}function Mm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ge(t)})}function Lm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ge(t)})}function Fm(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ge(t)})}function $m(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ge(t)})}function Bm(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ge(t)})}function Um(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ge(t)})}function Zm(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ge(t)})}function Vm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ge(t)})}function Wm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ge(t)})}function Hm(e,t){return new e({type:"string",format:"date",check:"string_format",...ge(t)})}function qm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ge(t)})}function Km(e,t){return new e({type:"string",format:"duration",check:"string_format",...ge(t)})}function Gm(e,t){return new e({type:"number",checks:[],...ge(t)})}function Jm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ge(t)})}function Ym(e,t){return new e({type:"boolean",...ge(t)})}function Xm(e,t){return new e({type:"null",...ge(t)})}function Qm(e){return new e({type:"unknown"})}function eg(e,t){return new e({type:"never",...ge(t)})}function Ys(e,t){return new ac({check:"less_than",...ge(t),value:e,inclusive:!1})}function zo(e,t){return new ac({check:"less_than",...ge(t),value:e,inclusive:!0})}function Xs(e,t){return new lc({check:"greater_than",...ge(t),value:e,inclusive:!1})}function Io(e,t){return new lc({check:"greater_than",...ge(t),value:e,inclusive:!0})}function Qs(e,t){return new fp({check:"multiple_of",...ge(t),value:e})}function mc(e,t){return new pp({check:"max_length",...ge(t),maximum:e})}function Ur(e,t){return new mp({check:"min_length",...ge(t),minimum:e})}function gc(e,t){return new gp({check:"length_equals",...ge(t),length:e})}function tg(e,t){return new xp({check:"string_format",format:"regex",...ge(t),pattern:e})}function ng(e){return new yp({check:"string_format",format:"lowercase",...ge(e)})}function rg(e){return new vp({check:"string_format",format:"uppercase",...ge(e)})}function og(e,t){return new bp({check:"string_format",format:"includes",...ge(t),includes:e})}function ig(e,t){return new wp({check:"string_format",format:"starts_with",...ge(t),prefix:e})}function sg(e,t){return new _p({check:"string_format",format:"ends_with",...ge(t),suffix:e})}function Dn(e){return new kp({check:"overwrite",tx:e})}function ag(e){return Dn(t=>t.normalize(e))}function lg(){return Dn(e=>e.trim())}function cg(){return Dn(e=>e.toLowerCase())}function ug(){return Dn(e=>e.toUpperCase())}function dg(){return Dn(e=>gh(e))}function fg(e,t,n){return new e({type:"array",element:t,...ge(n)})}function hg(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ge(n)})}function pg(e){const t=mg(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ir(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(ir(o))}},e(n.value,n)));return t}function mg(e,t){const n=new rt({check:"custom",...ge(t)});return n._zod.check=e,n}function xc(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Qn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ve(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{const p=s.schema,d=t.processors[o.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);d(e,t,p,u)}const f=e._zod.parent;f&&(s.ref||(s.ref=f),Ve(f,t,u),t.seen.get(f).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Je(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function yc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const l=r.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(s[0])?.id,p=e.external.uri??(x=>x);if(f)return{ref:p(f)};const d=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=d,{defId:d,ref:`${p("__shared")}#/${a}/${d}`}}if(s[1]===n)return{ref:"#"};const c=`#/${a}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:c}=o(s);a.def={...a.schema},c&&(a.defId=c);const u=a.schema;for(const f in u)delete u[f];u.$ref=l};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
38
38
|
|
|
39
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function yc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=s=>{const a=e.seen.get(s);if(a.ref===null)return;const l=a.def??a.schema,c={...l},u=a.ref;if(a.ref=null,u){r(u);const p=e.seen.get(u),d=p.schema;if(d.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(d)):Object.assign(l,d),Object.assign(l,c),s._zod.parent===u)for(const m in l)m==="$ref"||m==="allOf"||m in c||delete l[m];if(d.$ref&&p.def)for(const m in l)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(l[m])===JSON.stringify(p.def[m])&&delete l[m]}const f=s._zod.parent;if(f&&f!==u){r(f);const p=e.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(const d in l)d==="$ref"||d==="allOf"||d in p.def&&JSON.stringify(l[d])===JSON.stringify(p.def[d])&&delete l[d]}e.override({zodSchema:s,jsonSchema:l,path:a.path??[]})};for(const s of[...e.seen.entries()].reverse())r(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Zr(t,"input",e.processors),output:Zr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Je(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Je(r.element,n);if(r.type==="set")return Je(r.valueType,n);if(r.type==="lazy")return Je(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Je(r.innerType,n);if(r.type==="intersection")return Je(r.left,n)||Je(r.right,n);if(r.type==="record"||r.type==="map")return Je(r.keyType,n)||Je(r.valueType,n);if(r.type==="pipe")return Je(r.in,n)||Je(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Je(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Je(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Je(o,n))return!0;return!!(r.rest&&Je(r.rest,n))}return!1}const mg=(e,t={})=>n=>{const r=gc({...n,processors:t});return Ve(e,r),xc(r,e),yc(r,e)},Zr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=gc({...o??{},target:i,io:t,processors:n});return Ve(e,s),xc(s,e),yc(s,e)},gg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},xg=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=gg[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},yg=(e,t,n,r)=>{const o=n,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof i=="number"&&(o.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof s=="number"&&(o.maximum=s,typeof c=="number"&&t.target!=="draft-04"&&(c<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},vg=(e,t,n,r)=>{n.type="boolean"},bg=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},wg=(e,t,n,r)=>{n.not={}},_g=(e,t,n,r)=>{},kg=(e,t,n,r)=>{const o=e._zod.def,i=Gl(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},Sg=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},Cg=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Eg=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Tg=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Ve(i.element,t,{...r,path:[...r.path,"items"]})},Ng=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const c in s)o.properties[c]=Ve(s[c],t,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Ve(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Ag=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,l)=>Ve(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=s:n.anyOf=s},zg=(e,t,n,r)=>{const o=e._zod.def,i=Ve(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Ve(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l},jg=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const u=Ve(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const f of l)o.patternProperties[f.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Ve(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Ve(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const u=[...c].filter(f=>typeof f=="string"||typeof f=="number");u.length>0&&(o.required=u)}},Ig=(e,t,n,r)=>{const o=e._zod.def,i=Ve(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Og=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Pg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Rg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Dg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Mg=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ve(i,t,r);const s=t.seen.get(e);s.ref=i},Lg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},vc=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Fg=(e,t,n,r)=>{const o=e._zod.innerType;Ve(o,t,r);const i=t.seen.get(e);i.ref=o},$g=G("ZodISODateTime",(e,t)=>{Dp.init(e,t),Ue.init(e,t)});function Bg(e){return Vm($g,e)}const Ug=G("ZodISODate",(e,t)=>{Mp.init(e,t),Ue.init(e,t)});function Zg(e){return Wm(Ug,e)}const Vg=G("ZodISOTime",(e,t)=>{Lp.init(e,t),Ue.init(e,t)});function Wg(e){return Hm(Vg,e)}const Hg=G("ZodISODuration",(e,t)=>{Fp.init(e,t),Ue.init(e,t)});function qg(e){return qm(Hg,e)}const Kg=(e,t)=>{Ql.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Nh(e,n)},flatten:{value:n=>Th(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ii,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ii,2)}},isEmpty:{get(){return e.issues.length===0}}})},ht=G("ZodError",Kg,{Parent:Error}),Gg=$i(ht),Jg=Bi(ht),Yg=oo(ht),Xg=io(ht),Qg=jh(ht),e0=Ih(ht),t0=Oh(ht),n0=Ph(ht),r0=Rh(ht),o0=Dh(ht),i0=Mh(ht),s0=Lh(ht),Le=G("ZodType",(e,t)=>(Me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Zr(e,"input"),output:Zr(e,"output")}}),e.toJSONSchema=mg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Kt(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Gt(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Gg(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Yg(e,n,r),e.parseAsync=async(n,r)=>Jg(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Xg(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Qg(e,n,r),e.decode=(n,r)=>e0(e,n,r),e.encodeAsync=async(n,r)=>t0(e,n,r),e.decodeAsync=async(n,r)=>n0(e,n,r),e.safeEncode=(n,r)=>r0(e,n,r),e.safeDecode=(n,r)=>o0(e,n,r),e.safeEncodeAsync=async(n,r)=>i0(e,n,r),e.safeDecodeAsync=async(n,r)=>s0(e,n,r),e.refine=(n,r)=>e.check(nx(n,r)),e.superRefine=n=>e.check(rx(n)),e.overwrite=n=>e.check(Dn(n)),e.optional=()=>ra(e),e.exactOptional=()=>B0(e),e.nullable=()=>oa(e),e.nullish=()=>ra(oa(e)),e.nonoptional=n=>q0(e,n),e.array=()=>Be(e),e.or=n=>Jt([e,n]),e.and=n=>R0(e,n),e.transform=n=>ia(e,F0(n)),e.default=n=>V0(e,n),e.prefault=n=>H0(e,n),e.catch=n=>G0(e,n),e.pipe=n=>ia(e,n),e.readonly=()=>X0(e),e.describe=n=>{const r=e.clone();return Xn.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Xn.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Xn.get(e);const r=e.clone();return Xn.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),bc=G("_ZodString",(e,t)=>{Ui.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>xg(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(eg(...r)),e.includes=(...r)=>e.check(rg(...r)),e.startsWith=(...r)=>e.check(og(...r)),e.endsWith=(...r)=>e.check(ig(...r)),e.min=(...r)=>e.check(Ur(...r)),e.max=(...r)=>e.check(pc(...r)),e.length=(...r)=>e.check(mc(...r)),e.nonempty=(...r)=>e.check(Ur(1,...r)),e.lowercase=r=>e.check(tg(r)),e.uppercase=r=>e.check(ng(r)),e.trim=()=>e.check(ag()),e.normalize=(...r)=>e.check(sg(...r)),e.toLowerCase=()=>e.check(lg()),e.toUpperCase=()=>e.check(cg()),e.slugify=()=>e.check(ug())}),a0=G("ZodString",(e,t)=>{Ui.init(e,t),bc.init(e,t),e.email=n=>e.check(km(l0,n)),e.url=n=>e.check(Nm(c0,n)),e.jwt=n=>e.check(Zm(S0,n)),e.emoji=n=>e.check(Am(u0,n)),e.guid=n=>e.check(Js(ea,n)),e.uuid=n=>e.check(Sm(wr,n)),e.uuidv4=n=>e.check(Cm(wr,n)),e.uuidv6=n=>e.check(Em(wr,n)),e.uuidv7=n=>e.check(Tm(wr,n)),e.nanoid=n=>e.check(zm(d0,n)),e.guid=n=>e.check(Js(ea,n)),e.cuid=n=>e.check(jm(f0,n)),e.cuid2=n=>e.check(Im(h0,n)),e.ulid=n=>e.check(Om(p0,n)),e.base64=n=>e.check($m(w0,n)),e.base64url=n=>e.check(Bm(_0,n)),e.xid=n=>e.check(Pm(m0,n)),e.ksuid=n=>e.check(Rm(g0,n)),e.ipv4=n=>e.check(Dm(x0,n)),e.ipv6=n=>e.check(Mm(y0,n)),e.cidrv4=n=>e.check(Lm(v0,n)),e.cidrv6=n=>e.check(Fm(b0,n)),e.e164=n=>e.check(Um(k0,n)),e.datetime=n=>e.check(Bg(n)),e.date=n=>e.check(Zg(n)),e.time=n=>e.check(Wg(n)),e.duration=n=>e.check(qg(n))});function re(e){return _m(a0,e)}const Ue=G("ZodStringFormat",(e,t)=>{Fe.init(e,t),bc.init(e,t)}),l0=G("ZodEmail",(e,t)=>{Tp.init(e,t),Ue.init(e,t)}),ea=G("ZodGUID",(e,t)=>{Cp.init(e,t),Ue.init(e,t)}),wr=G("ZodUUID",(e,t)=>{Ep.init(e,t),Ue.init(e,t)}),c0=G("ZodURL",(e,t)=>{Np.init(e,t),Ue.init(e,t)}),u0=G("ZodEmoji",(e,t)=>{Ap.init(e,t),Ue.init(e,t)}),d0=G("ZodNanoID",(e,t)=>{zp.init(e,t),Ue.init(e,t)}),f0=G("ZodCUID",(e,t)=>{jp.init(e,t),Ue.init(e,t)}),h0=G("ZodCUID2",(e,t)=>{Ip.init(e,t),Ue.init(e,t)}),p0=G("ZodULID",(e,t)=>{Op.init(e,t),Ue.init(e,t)}),m0=G("ZodXID",(e,t)=>{Pp.init(e,t),Ue.init(e,t)}),g0=G("ZodKSUID",(e,t)=>{Rp.init(e,t),Ue.init(e,t)}),x0=G("ZodIPv4",(e,t)=>{$p.init(e,t),Ue.init(e,t)}),y0=G("ZodIPv6",(e,t)=>{Bp.init(e,t),Ue.init(e,t)}),v0=G("ZodCIDRv4",(e,t)=>{Up.init(e,t),Ue.init(e,t)}),b0=G("ZodCIDRv6",(e,t)=>{Zp.init(e,t),Ue.init(e,t)}),w0=G("ZodBase64",(e,t)=>{Vp.init(e,t),Ue.init(e,t)}),_0=G("ZodBase64URL",(e,t)=>{Hp.init(e,t),Ue.init(e,t)}),k0=G("ZodE164",(e,t)=>{qp.init(e,t),Ue.init(e,t)}),S0=G("ZodJWT",(e,t)=>{Gp.init(e,t),Ue.init(e,t)}),wc=G("ZodNumber",(e,t)=>{cc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>yg(e,r,o),e.gt=(r,o)=>e.check(Xs(r,o)),e.gte=(r,o)=>e.check(Io(r,o)),e.min=(r,o)=>e.check(Io(r,o)),e.lt=(r,o)=>e.check(Ys(r,o)),e.lte=(r,o)=>e.check(jo(r,o)),e.max=(r,o)=>e.check(jo(r,o)),e.int=r=>e.check(ta(r)),e.safe=r=>e.check(ta(r)),e.positive=r=>e.check(Xs(0,r)),e.nonnegative=r=>e.check(Io(0,r)),e.negative=r=>e.check(Ys(0,r)),e.nonpositive=r=>e.check(jo(0,r)),e.multipleOf=(r,o)=>e.check(Qs(r,o)),e.step=(r,o)=>e.check(Qs(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ye(e){return Km(wc,e)}const C0=G("ZodNumberFormat",(e,t)=>{Jp.init(e,t),wc.init(e,t)});function ta(e){return Gm(C0,e)}const E0=G("ZodBoolean",(e,t)=>{Yp.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vg(e,n,r)});function yt(e){return Jm(E0,e)}const T0=G("ZodNull",(e,t)=>{Xp.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bg(e,n,r)});function ai(e){return Ym(T0,e)}const N0=G("ZodUnknown",(e,t)=>{Qp.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_g()});function na(){return Xm(N0)}const A0=G("ZodNever",(e,t)=>{em.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wg(e,n,r)});function z0(e){return Qm(A0,e)}const j0=G("ZodArray",(e,t)=>{tm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tg(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Ur(n,r)),e.nonempty=n=>e.check(Ur(1,n)),e.max=(n,r)=>e.check(pc(n,r)),e.length=(n,r)=>e.check(mc(n,r)),e.unwrap=()=>e.element});function Be(e,t){return dg(j0,e,t)}const I0=G("ZodObject",(e,t)=>{rm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ng(e,n,r,o),Ne(e,"shape",()=>t.shape),e.keyof=()=>Mn(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:na()}),e.loose=()=>e.clone({...e._zod.def,catchall:na()}),e.strict=()=>e.clone({...e._zod.def,catchall:z0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>_h(e,n),e.safeExtend=n=>kh(e,n),e.merge=n=>Sh(e,n),e.pick=n=>bh(e,n),e.omit=n=>wh(e,n),e.partial=(...n)=>Ch(kc,e,n[0]),e.required=(...n)=>Eh(Sc,e,n[0])});function ue(e,t){const n={type:"object",shape:e??{},...ge(t)};return new I0(n)}const _c=G("ZodUnion",(e,t)=>{fc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ag(e,n,r,o),e.options=t.options});function Jt(e,t){return new _c({type:"union",options:e,...ge(t)})}const O0=G("ZodDiscriminatedUnion",(e,t)=>{_c.init(e,t),om.init(e,t)});function cn(e,t,n){return new O0({type:"union",options:t,discriminator:e,...ge(n)})}const P0=G("ZodIntersection",(e,t)=>{im.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zg(e,n,r,o)});function R0(e,t){return new P0({type:"intersection",left:e,right:t})}const D0=G("ZodRecord",(e,t)=>{sm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jg(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function tn(e,t,n){return new D0({type:"record",keyType:e,valueType:t,...ge(n)})}const li=G("ZodEnum",(e,t)=>{am.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>kg(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new li({...t,checks:[],...ge(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new li({...t,checks:[],...ge(o),entries:i})}});function Mn(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new li({type:"enum",entries:n,...ge(t)})}const M0=G("ZodLiteral",(e,t)=>{lm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sg(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Te(e,t){return new M0({type:"literal",values:Array.isArray(e)?e:[e],...ge(t)})}const L0=G("ZodTransform",(e,t)=>{cm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Eg(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ql(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(or(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(or(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function F0(e){return new L0({type:"transform",transform:e})}const kc=G("ZodOptional",(e,t)=>{hc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ra(e){return new kc({type:"optional",innerType:e})}const $0=G("ZodExactOptional",(e,t)=>{um.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function B0(e){return new $0({type:"optional",innerType:e})}const U0=G("ZodNullable",(e,t)=>{dm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ig(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function oa(e){return new U0({type:"nullable",innerType:e})}const Z0=G("ZodDefault",(e,t)=>{fm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Pg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function V0(e,t){return new Z0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Yl(t)}})}const W0=G("ZodPrefault",(e,t)=>{hm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function H0(e,t){return new W0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Yl(t)}})}const Sc=G("ZodNonOptional",(e,t)=>{pm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Og(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function q0(e,t){return new Sc({type:"nonoptional",innerType:e,...ge(t)})}const K0=G("ZodCatch",(e,t)=>{mm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function G0(e,t){return new K0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const J0=G("ZodPipe",(e,t)=>{gm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mg(e,n,r,o),e.in=t.in,e.out=t.out});function ia(e,t){return new J0({type:"pipe",in:e,out:t})}const Y0=G("ZodReadonly",(e,t)=>{xm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function X0(e){return new Y0({type:"readonly",innerType:e})}const Q0=G("ZodLazy",(e,t)=>{ym.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fg(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function ex(e){return new Q0({type:"lazy",getter:e})}const tx=G("ZodCustom",(e,t)=>{vm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cg(e,n)});function nx(e,t={}){return fg(tx,e,t)}function rx(e){return hg(e)}const zn=ex(()=>Jt([re(),ye(),yt(),ai(),Be(zn),tn(re(),zn)])),Zi=ue({type:re(),ttl:re().optional(),scope:re().optional()}),Vi=ue({type:Te("text"),text:re(),cache_control:Zi.optional()}),Cc=ue({type:Te("thinking"),thinking:re(),signature:re().optional()}),ox=ue({type:Te("base64"),media_type:re(),data:re()}),Ec=ue({type:Te("image"),source:ox}),Tc=ue({type:Te("tool_use"),id:re(),name:re(),input:tn(re(),zn)}),ix=cn("type",[Vi,Ec]),sx=ue({type:Te("tool_result"),tool_use_id:re().optional(),content:Jt([re(),Be(ix)]),is_error:yt().optional()}),ax=cn("type",[Vi,Cc,Ec,Tc,sx]),lx=Jt([re(),Be(ax)]),cx=ue({role:Mn(["user","assistant"]),content:lx}),ux=ue({type:Te("text"),text:re(),cache_control:Zi.optional()}),dx=ue({type:re(),properties:tn(re(),tn(re(),zn)).optional(),required:Be(re()).optional(),additionalProperties:yt().optional(),$schema:re().optional()}),fx=ue({name:re(),description:re().optional(),input_schema:dx.optional(),cache_control:Zi.optional()}),hx=cn("type",[ue({type:Te("enabled"),budget_tokens:ye()}),ue({type:Te("disabled")}),ue({type:Te("adaptive")})]),px=ue({model:re(),messages:Be(cx),system:Be(ux).optional(),tools:Be(fx).optional(),max_tokens:ye().optional(),temperature:ye().optional(),stream:yt().optional(),thinking:hx.optional(),metadata:ue({user_id:re().optional()}).optional()}),Wi=cn("type",[Vi,Cc,Tc]),mx=ue({input_tokens:ye(),output_tokens:ye(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}),gx=ue({id:re(),type:Te("message"),model:re(),role:Te("assistant"),content:Be(Wi),stop_reason:re().nullable(),stop_sequence:re().nullable(),usage:mx}),xx=ue({type:Te("message_start"),message:ue({id:re(),type:Te("message"),model:re(),role:Te("assistant"),content:Be(Wi),stop_reason:ai(),stop_sequence:ai(),usage:ue({input_tokens:ye(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()})}),yx=ue({type:Te("content_block_start"),index:ye(),content_block:Wi}),vx=cn("type",[ue({type:Te("text_delta"),text:re()}),ue({type:Te("input_json_delta"),partial_json:re()}),ue({type:Te("thinking_delta"),thinking:re()}),ue({type:Te("signature_delta"),signature:re()})]),bx=ue({type:Te("content_block_delta"),index:ye(),delta:vx}),wx=ue({type:Te("content_block_stop"),index:ye()}),_x=ue({type:Te("message_delta"),delta:ue({stop_reason:re().nullable(),stop_sequence:re().nullable().optional()}),usage:ue({output_tokens:ye(),input_tokens:ye().optional(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()}),kx=ue({type:Te("message_stop")}),Sx=ue({type:Te("ping")});cn("type",[xx,yx,bx,wx,_x,kx,Sx]);const Cx=px,Ex=gx,Tx=Jt([re(),Be(cn("type",[ue({type:Te("text"),text:re()}),ue({type:Te("image_url"),image_url:ue({url:re(),detail:re().optional()})})]))]),Nc=ue({role:Mn(["system","user","assistant","tool"]),content:Tx,name:re().optional(),reasoning_content:re().optional()}),Nx=ue({name:re(),arguments:re()});Nc.extend({content:Jt([re(),Be(ue({type:Te("text"),text:re()}))]).optional(),function_call:Nx.optional()});const Ax=ue({type:Te("function"),function:ue({name:re(),description:re().optional(),parameters:tn(re(),zn)})});ue({model:re(),messages:Be(Nc),temperature:ye().optional(),max_tokens:ye().optional(),stream:yt().optional(),tools:Be(Ax).optional(),tool_choice:Jt([ue({type:Te("auto")}),ue({type:Te("none")}),ue({type:Te("function"),function:ue({name:re()})})]).optional(),user:re().optional()});const Ac=ue({role:Mn(["assistant"]).optional(),content:re().nullable().optional(),reasoning_content:re().nullable().optional(),function_call:ue({name:re().optional(),arguments:re().optional()}).optional(),tool_calls:Be(ue({index:ye(),id:re().optional(),type:Te("function").optional(),function:ue({name:re().optional(),arguments:re().optional()})})).optional()}),zx=ue({index:ye(),message:ue({role:Mn(["assistant"]),content:re().nullable(),reasoning_content:re().optional(),function_call:ue({name:re(),arguments:re()}).optional()}).optional(),delta:Ac.optional(),finish_reason:re().nullable()}),jx=ue({id:re(),object:Te("chat.completion"),created:ye(),model:re(),choices:Be(zx),usage:ue({prompt_tokens:ye(),completion_tokens:ye(),total_tokens:ye()})});ue({id:re(),object:Te("chat.completion.chunk"),created:ye(),model:re(),choices:Be(ue({index:ye(),delta:Ac,finish_reason:re().nullable().optional()})),usage:ue({prompt_tokens:ye(),completion_tokens:ye(),total_tokens:ye()}).nullable().optional()});function Ix(e){try{const t=JSON.parse(e),n=jx.safeParse(t);return n.success?n.data:null}catch{return null}}const Ox=ue({index:ye(),timestamp:ye(),type:re(),data:zn}),Px=ue({chunks:Be(Ox),truncated:yt().optional().default(!1)}),ci=ue({id:ye(),timestamp:re(),method:re(),path:re(),model:re().nullable(),sessionId:re().nullable(),rawRequestBody:re().nullable(),responseStatus:ye().nullable(),responseText:re().nullable(),inputTokens:ye().nullable(),outputTokens:ye().nullable(),cacheCreationInputTokens:ye().nullable(),cacheReadInputTokens:ye().nullable(),elapsedMs:ye().nullable(),streaming:yt(),userAgent:re().nullable(),origin:re().nullable(),rawHeaders:tn(re(),re()).optional(),headers:tn(re(),re()).optional(),apiFormat:Mn(["anthropic","openai","unknown"]).default("unknown"),isTest:yt().optional().default(!1),providerName:re().nullable().optional(),clientPort:ye().nullable().optional(),clientPid:ye().nullable().optional(),clientCwd:re().nullable().optional(),clientProjectFolder:re().nullable().optional(),streamingChunks:Px.optional(),streamingChunksPath:re().nullable().optional()});ue({model:re()});function Rx(e){if(e===null)return null;try{const t=JSON.parse(e),n=Cx.safeParse(t);return n.success?n.data:null}catch{return null}}function Dx(e,t,n){const r=new Array(e);return new Proxy(r,{get(o,i,s){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let c=o[l];if(!c){const u=t[l*2];c=o[l]={index:l,key:n(l),start:u,size:t[l*2+1],end:u+t[l*2+1],lane:0}}return c}}if(i==="length")return e}return Reflect.get(o,i,s)}})}function fn(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){const a=e();return(a.length!==r.length||a.some((c,u)=>r[u]!==c))&&(r=a,o=t(...a),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1),o}return s.updateDeps=a=>{r=a},s}function sa(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const aa=(e,t)=>Math.abs(e-t)<1.01,Mx=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let Hn;const la=()=>{if(Hn!==void 0)return Hn;if(typeof navigator>"u")return Hn=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Hn=!0;const e=navigator.maxTouchPoints;return Hn=navigator.platform==="MacIntel"&&e!==void 0&&e>0},ca=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Lx=e=>e,Fx=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(r);for(let i=0;i<r;i++)o[i]=t+i;return o},$x=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(ca(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(ca(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Vr={passive:!0},Bx=typeof window>"u"?!0:"onscrollend"in window,Ux=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&Bx;let s=0;const a=i?null:Mx(o,()=>t(s,!1),e.options.isScrollingResetDelay),l=f=>()=>{s=n(r),a?.(),t(s,f)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,Vr),i&&r.addEventListener("scrollend",u,Vr),()=>{r.removeEventListener("scroll",c),i&&r.removeEventListener("scrollend",u)}},Zx=(e,t)=>Ux(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),Vx=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Wx=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},Hx=Wx;class qx{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{const a=i.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[c,u]of this.elementsCache)if(u===a){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r,o;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Lx,rangeExtractor:Fx,onChange:()=>{},measureElement:Vx,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate"};for(const c in n){const u=n[c];u!==void 0&&(i[c]=u)}const s=this.options;let a=null,l=null;if(s!==void 0&&s.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const c=s.count,u=i.count,f=this.getMeasurements(),p=c>0?((r=f[0])==null?void 0:r.key)??s.getItemKey(0):null,d=c>0?((o=f[c-1])==null?void 0:o.key)??s.getItemKey(c-1):null;if(u!==c||c>0&&u>0&&(i.getItemKey(0)!==p||i.getItemKey(u-1)!==d)){const y=c>0?this.getVirtualItemForOffset(this.getScrollOffset())??f[0]:null;y&&(a=[y.key,this.getScrollOffset()-y.start]);const g=i.followOnAppend===!0?"auto":i.followOnAppend||null;g&&u>c&&this.isAtEnd(s.scrollEndThreshold)&&(c===0||i.getItemKey(u-1)!==d)&&(l=g)}}this.options=i,(a||l)&&(this.pendingScrollAnchor=[a?.[0]??null,a?.[1]??0,l])},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=fn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,s=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!la()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",s,Vr),i.addEventListener("touchend",a,Vr),this.unsubs.push(()=>{i.removeEventListener("touchstart",s),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,s,a]=o;if(i!==null){const{count:l,getItemKey:c}=this.options;let u=0;for(;u<l&&c(u)!==i;)u++;const f=u<l?this.getMeasurements()[u]:void 0;if(f){const p=f.start+s-this.getScrollOffset();aa(p,0)||this.applyScrollAdjustment(p)}}a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=fn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,o,i,s,a,l)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=fn(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l},c)=>{const u=this.itemSizeCache;if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const f=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),a===1){const x=this.options.gap,m=n*2;let y=this._flatMeasurements;if(!y||y.length<m){const k=new Float64Array(m);y&&f>0&&k.set(y.subarray(0,f*2)),y=k,this._flatMeasurements=y}let g;if(f===0)g=r+o;else{const k=f-1;g=y[k*2]+y[k*2+1]+x}for(let k=f;k<n;k++){const S=i(k),C=u.get(S),E=typeof C=="number"?C:this.options.estimateSize(k);y[k*2]=g,y[k*2+1]=E,g+=E+x}const v=Dx(n,y,i);return this.measurementsCache=v,v}const p=this.measurementsCache.slice(0,f),d=new Array(a).fill(void 0);for(let x=0;x<f;x++){const m=p[x];m&&(d[m.lane]=x)}for(let x=f;x<n;x++){const m=i(x),y=this.laneAssignments.get(x);let g,v;const k=l==="estimate"||u.has(m);if(y!==void 0&&this.options.lanes>1){g=y;const I=d[g],z=I!==void 0?p[I]:void 0;v=z?z.end+this.options.gap:r+o}else{const I=this.options.lanes===1?p[x-1]:this.getFurthestMeasurement(p,x);v=I?I.end+this.options.gap:r+o,g=I?I.lane:x%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(x,g)}const S=u.get(m),C=typeof S=="number"?S:this.options.estimateSize(x),E=v+C;p[x]={index:x,start:v,size:C,end:E,key:m,lane:g},d[g]=x}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=fn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?Kx({measurements:n,outerSize:r,scrollOffset:o,lanes:i,flat:i===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=fn(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),s=Math.max(0,o-i),a=Math.min(this.options.count-1,o+i);return n>=s&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,a)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),i=this.elementsCache.get(o);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o,i;if(n<0||n>=this.options.count)return;let s,a,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),a=c[n*2],s=c[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;l=p.key,a=p.start,s=p.size}const u=this.itemSizeCache.get(l)??s,f=r-u;if(f!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,d=p?this.getTotalSize():0,x=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:a,size:s,end:a+s,lane:0},f,this):a<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!=="backward");(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,p?this.applyScrollAdjustment(this.getTotalSize()-d):x&&this.applyScrollAdjustment(f),this.notify(!1)}},this.getVirtualItems=fn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const o=this._flatMeasurements,i=this.options.lanes===1&&o!=null,s=zc(0,r.length-1,i?a=>o[a*2]:a=>sa(r[a]).start,n);return sa(r[s])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),i=this.getScrollOffset(),s=this.measurementsCache[n];if(!s)return;if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const i=this.getOffsetForAlignment(n,r),s=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i,l=this.now();this.scrollState={index:n,align:a,behavior:o,startedAt:l,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,s=this._flatMeasurements;s!=null?o=s[i*2]+s[i*2+1]:o=((n=r[i])==null?void 0:n.end)??0}else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const o of r)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){t!==0&&(la()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,i=1,s=o!==this.scrollState.lastTargetOffset;if(!s&&aa(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const a=this.getSize()||600,l=Math.abs(o-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>a;this.scrollState.lastTargetOffset=o,c||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const zc=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function Kx({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const i=e.length-1,s=o?u=>o[u*2]:u=>e[u].start,a=o?u=>o[u*2]+o[u*2+1]:u=>e[u].end;if(e.length<=r)return{startIndex:0,endIndex:i};let l=zc(0,i,s,n),c=l;if(r===1)for(;c<i&&a(c)<n+t;)c++;else if(r>1){const u=Array(r).fill(0);for(;c<i&&u.some(p=>p<n+t);){const p=e[c];u[p.lane]=p.end,c++}const f=Array(r).fill(n+t);for(;l>=0&&f.some(p=>p>=n);){const p=e[l];f[p.lane]=p.start,l--}l=Math.max(0,l-l%r),c=Math.min(i,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const ua=typeof document<"u"?_.useLayoutEffect:_.useEffect;function Gx({useFlushSync:e=!0,...t}){const n=_.useReducer(i=>i+1,0)[1],r={...t,onChange:(i,s)=>{var a;e&&s?cr.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,s)}},[o]=_.useState(()=>new qx(r));return o.setOptions(r),ua(()=>o._didMount(),[]),ua(()=>o._willUpdate()),o}function Jx(e){return Gx({observeElementRect:$x,observeElementOffset:Zx,scrollToFn:Hx,...e})}const jc=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Yx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Xx=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const da=e=>{const t=Xx(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Qx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ey=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const ty=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>_.createElement("svg",{ref:l,...Qx,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:jc("lucide",o),...!i&&!ey(a)&&{"aria-hidden":"true"},...a},[...s.map(([c,u])=>_.createElement(c,u)),...Array.isArray(i)?i:[i]]));const _e=(e,t)=>{const n=_.forwardRef(({className:r,...o},i)=>_.createElement(ty,{ref:i,iconNode:t,className:jc(`lucide-${Yx(da(e))}`,`lucide-${e}`,r),...o}));return n.displayName=da(e),n};const ny=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ry=_e("brain",ny);const oy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ur=_e("check",oy);const iy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],At=_e("chevron-down",iy);const sy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Wt=_e("chevron-right",sy);const ay=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ly=_e("chevron-up",ay);const cy=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],uy=_e("chevrons-down",cy);const dy=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],fy=_e("chevrons-up",dy);const hy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ui=_e("circle-alert",hy);const py=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],my=_e("circle-check-big",py);const gy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],xy=_e("circle-question-mark",gy);const yy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Ic=_e("circle-stop",yy);const vy=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Hi=_e("clock",vy);const by=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ao=_e("copy",by);const wy=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Oc=_e("download",wy);const _y=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ky=_e("external-link",_y);const Sy=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Cy=_e("eye-off",Sy);const Ey=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ty=_e("eye",Ey);const Ny=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]],Ay=_e("file-terminal",Ny);const zy=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],jy=_e("gauge",zy);const Iy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Oy=_e("globe",Iy);const Py=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Ry=_e("layout-grid",Py);const Dy=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],My=_e("list",Dy);const Ly=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pc=_e("loader-circle",Ly);const Fy=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],$y=_e("lock",Fy);const By=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Rc=_e("message-square",By);const Uy=[["path",{d:"M5 12h14",key:"1ays0h"}]],Zy=_e("minus",Uy);const Vy=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Wy=_e("pencil",Vy);const Hy=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],fa=_e("plus",Hy);const qy=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Ky=_e("radio",qy);const Gy=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Dc=_e("rotate-ccw",Gy);const Jy=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Mc=_e("rotate-cw",Jy);const Yy=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Xy=_e("server",Yy);const Qy=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ev=_e("settings",Qy);const tv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],nv=_e("terminal",tv);const rv=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ov=_e("trash-2",rv);const iv=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],sv=_e("triangle-alert",iv);const av=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],lv=_e("upload",av);const cv=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],uv=_e("user",cv);const dv=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],fv=_e("wifi-off",dv);const hv=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],pv=_e("wifi",hv);const mv=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],gv=_e("wrench",mv);const xv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yv=_e("x",xv);const vv=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],dr=_e("zap",vv);function _r(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Oo={exports:{}};var ha;function bv(){return ha||(ha=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,i){function s(c,u){if(!o[c]){if(!r[c]){var f=typeof _r=="function"&&_r;if(!u&&f)return f(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var d=o[c]={exports:{}};r[c][0].call(d.exports,function(x){var m=r[c][1][x];return s(m||x)},d,d.exports,n,r,o,i)}return o[c].exports}for(var a=typeof _r=="function"&&_r,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(n,r,o){var i=n("./utils"),s=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,u,f,p,d,x,m,y=[],g=0,v=l.length,k=v,S=i.getTypeOf(l)!=="string";g<l.length;)k=v-g,f=S?(c=l[g++],u=g<v?l[g++]:0,g<v?l[g++]:0):(c=l.charCodeAt(g++),u=g<v?l.charCodeAt(g++):0,g<v?l.charCodeAt(g++):0),p=c>>2,d=(3&c)<<4|u>>4,x=1<k?(15&u)<<2|f>>6:64,m=2<k?63&f:64,y.push(a.charAt(p)+a.charAt(d)+a.charAt(x)+a.charAt(m));return y.join("")},o.decode=function(l){var c,u,f,p,d,x,m=0,y=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var v,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=s.uint8array?new Uint8Array(0|k):new Array(0|k);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(p=a.indexOf(l.charAt(m++)))>>4,u=(15&p)<<4|(d=a.indexOf(l.charAt(m++)))>>2,f=(3&d)<<6|(x=a.indexOf(l.charAt(m++))),v[y++]=c,d!==64&&(v[y++]=u),x!==64&&(v[y++]=f);return v}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,f,p,d,x){this.compressedSize=u,this.uncompressedSize=f,this.crc32=p,this.compression=d,this.compressedContent=x}c.prototype={getContentWorker:function(){var u=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,p){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var i=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var i=n("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,u,f,p){var d=s,x=p+f;c^=-1;for(var m=p;m<x;m++)c=c>>>8^d[255&(c^u[m])];return-1^c})(0|l,a,a.length,0):(function(c,u,f,p){var d=s,x=p+f;c^=-1;for(var m=p;m<x;m++)c=c>>>8^d[255&(c^u.charCodeAt(m))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var i=null;i=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:i}},{lie:37}],7:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=i?"uint8array":"array";function u(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},o.compressWorker=function(f){return new u("Deflate",f)},o.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(d,x){var m,y="";for(m=0;m<x;m++)y+=String.fromCharCode(255&d),d>>>=8;return y}function s(d,x,m,y,g,v){var k,S,C=d.file,E=d.compression,I=v!==c.utf8encode,z=a.transformTo("string",v(C.name)),P=a.transformTo("string",c.utf8encode(C.name)),L=C.comment,V=a.transformTo("string",v(L)),T=a.transformTo("string",c.utf8encode(L)),M=P.length!==C.name.length,b=T.length!==L.length,D="",K="",U="",W=C.dir,q=C.date,A={crc32:0,compressedSize:0,uncompressedSize:0};x&&!m||(A.crc32=d.crc32,A.compressedSize=d.compressedSize,A.uncompressedSize=d.uncompressedSize);var B=0;x&&(B|=8),I||!M&&!b||(B|=2048);var R=0,N=0;W&&(R|=16),g==="UNIX"?(N=798,R|=(function(Q,pe){var X=Q;return Q||(X=pe?16893:33204),(65535&X)<<16})(C.unixPermissions,W)):(N=20,R|=(function(Q){return 63&(Q||0)})(C.dosPermissions)),k=q.getUTCHours(),k<<=6,k|=q.getUTCMinutes(),k<<=5,k|=q.getUTCSeconds()/2,S=q.getUTCFullYear()-1980,S<<=4,S|=q.getUTCMonth()+1,S<<=5,S|=q.getUTCDate(),M&&(K=i(1,1)+i(u(z),4)+P,D+="up"+i(K.length,2)+K),b&&(U=i(1,1)+i(u(V),4)+T,D+="uc"+i(U.length,2)+U);var J="";return J+=`
|
|
40
|
-
\0`,J+=i(B,2),J+=E.magic,J+=i(k,2),J+=i(S,2),J+=i(A.crc32,4),J+=i(A.compressedSize,4),J+=i(A.uncompressedSize,4),J+=i(z.length,2),J+=i(D.length,2),{fileRecord:f.LOCAL_FILE_HEADER+J+z+D,dirRecord:f.CENTRAL_FILE_HEADER+i(N,2)+J+i(V.length,2)+"\0\0\0\0"+i(R,4)+i(y,4)+z+D+V}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function p(d,x,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(d){var x=d.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,l.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:m?(x+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var x=this.streamFiles&&!d.file.dir;if(x){var m=s(d,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(d){this.accumulate=!1;var x=this.streamFiles&&!d.file.dir,m=s(d,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),x)this.push({data:(function(y){return f.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)})(d),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var d=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var m=this.bytesWritten-d,y=(function(g,v,k,S,C){var E=a.transformTo("string",C(S));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(v,4)+i(k,4)+i(E.length,2)+E})(this.dirRecords.length,m,d,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(d){this._sources.push(d);var x=this;return d.on("data",function(m){x.processChunk(m)}),d.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),d.on("error",function(m){x.error(m)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(d){var x=this._sources;if(!l.prototype.error.call(this,d))return!1;for(var m=0;m<x.length;m++)try{x[m].error(d)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var d=this._sources,x=0;x<d.length;x++)d[x].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var i=n("../compressions"),s=n("./ZipFileWorker");o.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{a.forEach(function(p,d){f++;var x=(function(v,k){var S=v||k,C=i[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(d.options.compression,l.compression),m=d.options.compressionOptions||l.compressionOptions||{},y=d.dir,g=d.date;d._compressWorker(x,m).withStreamInfo("file",{name:p,dir:y,date:g,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(u)}),u.entriesCount=f}catch(p){u.error(p)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=n("./object")).loadAsync=n("./load"),i.support=n("./support"),i.defaults=n("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=n("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var i=n("./utils"),s=n("./external"),a=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function f(p){return new s.Promise(function(d,x){var m=p.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){x(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}r.exports=function(p,d){var x=this;return d=i.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",p,!0,d.optimizedBinaryString,d.base64).then(function(m){var y=new l(d);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],g=m.files;if(d.checkCRC32)for(var v=0;v<g.length;v++)y.push(f(g[v]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,v=0;v<g.length;v++){var k=g[v],S=k.fileNameStr,C=i.resolve(k.fileNameStr);x.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:d.createFolders}),k.dir||(x.file(C).unsafeOriginalName=S)}return y.zipComment.length&&(x.comment=y.zipComment),x})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var i=n("../utils"),s=n("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var i=n("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var u=this;a.on("data",function(f,p){u.push(f)||u._helper.pause(),c&&c(p)}).on("error",function(f){u.emit("error",f)}).on("end",function(){u.push(null)})}n("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(n,r,o){function i(C,E,I){var z,P=a.getTypeOf(E),L=a.extend(I||{},u);L.date=L.date||new Date,L.compression!==null&&(L.compression=L.compression.toUpperCase()),typeof L.unixPermissions=="string"&&(L.unixPermissions=parseInt(L.unixPermissions,8)),L.unixPermissions&&16384&L.unixPermissions&&(L.dir=!0),L.dosPermissions&&16&L.dosPermissions&&(L.dir=!0),L.dir&&(C=g(C)),L.createFolders&&(z=y(C))&&v.call(this,z,!0);var V=P==="string"&&L.binary===!1&&L.base64===!1;I&&I.binary!==void 0||(L.binary=!V),(E instanceof f&&E.uncompressedSize===0||L.dir||!E||E.length===0)&&(L.base64=!1,L.binary=!0,E="",L.compression="STORE",P="string");var T=null;T=E instanceof f||E instanceof l?E:x.isNode&&x.isStream(E)?new m(C,E):a.prepareContent(C,E,L.binary,L.optimizedBinaryString,L.base64);var M=new p(C,T,L);this.files[C]=M}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),f=n("./compressedObject"),p=n("./zipObject"),d=n("./generate"),x=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var E=C.lastIndexOf("/");return 0<E?C.substring(0,E):""},g=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},v=function(C,E){return E=E!==void 0?E:u.createFolders,C=g(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:E}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var E,I,z;for(E in this.files)z=this.files[E],(I=E.slice(this.root.length,E.length))&&E.slice(0,this.root.length)===this.root&&C(I,z)},filter:function(C){var E=[];return this.forEach(function(I,z){C(I,z)&&E.push(z)}),E},file:function(C,E,I){if(arguments.length!==1)return C=this.root+C,i.call(this,C,E,I),this;if(k(C)){var z=C;return this.filter(function(L,V){return!V.dir&&z.test(L)})}var P=this.files[this.root+C];return P&&!P.dir?P:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(P,L){return L.dir&&C.test(P)});var E=this.root+C,I=v.call(this,E),z=this.clone();return z.root=I.name,z},remove:function(C){C=this.root+C;var E=this.files[C];if(E||(C.slice(-1)!=="/"&&(C+="/"),E=this.files[C]),E&&!E.dir)delete this.files[C];else for(var I=this.filter(function(P,L){return L.name.slice(0,C.length)===C}),z=0;z<I.length;z++)delete this.files[I[z].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var E,I={};try{if((I=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=I.type.toLowerCase(),I.compression=I.compression.toUpperCase(),I.type==="binarystring"&&(I.type="string"),!I.type)throw new Error("No output type specified.");a.checkSupport(I.type),I.platform!=="darwin"&&I.platform!=="freebsd"&&I.platform!=="linux"&&I.platform!=="sunos"||(I.platform="UNIX"),I.platform==="win32"&&(I.platform="DOS");var z=I.comment||this.comment||"";E=d.generateWorker(this,I,z)}catch(P){(E=new l("error")).error(P)}return new c(E,I.type||"string",I.mimeType)},generateAsync:function(C,E){return this.generateInternalStream(C).accumulate(E)},generateNodeStream:function(C,E){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(E)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),f=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===u&&this.data[p+3]===f)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),f=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&u===p[2]&&f===p[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var i=n("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,o){var i=n("./Uint8ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var i=n("./ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var i=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var p=i.getTypeOf(f);return i.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(f):s.uint8array?new u(i.transformTo("uint8array",f)):new a(i.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var i=n("./GenericWorker"),s=n("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var i=n("./GenericWorker"),s=n("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=i},{}],29:[function(n,r,o){var i=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,m){return new u.Promise(function(y,g){var v=[],k=x._internalType,S=x._outputType,C=x._mimeType;x.on("data",function(E,I){v.push(E),m&&m(I)}).on("error",function(E){v=[],g(E)}).on("end",function(){try{var E=(function(I,z,P){switch(I){case"blob":return i.newBlob(i.transformTo("arraybuffer",z),P);case"base64":return l.encode(z);default:return i.transformTo(I,z)}})(S,(function(I,z){var P,L=0,V=null,T=0;for(P=0;P<z.length;P++)T+=z[P].length;switch(I){case"string":return z.join("");case"array":return Array.prototype.concat.apply([],z);case"uint8array":for(V=new Uint8Array(T),P=0;P<z.length;P++)V.set(z[P],L),L+=z[P].length;return V;case"nodebuffer":return Buffer.concat(z);default:throw new Error("concat : unsupported type '"+I+"'")}})(k,v),C);y(E)}catch(I){g(I)}v=[]}).resume()})}function d(x,m,y){var g=m;switch(m){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=m,this._mimeType=y,i.checkSupport(g),this._worker=x.pipe(new s(g)),x.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}d.prototype={accumulate:function(x){return p(this,x)},on:function(x,m){var y=this;return x==="data"?this._worker.on(x,function(g){m.call(y,g.data,g.meta)}):this._worker.on(x,function(){i.delay(m,arguments,y)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},x)}},r.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var i=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}o.utf8encode=function(d){return s.nodebuffer?a.newBufferFrom(d,"utf-8"):(function(x){var m,y,g,v,k,S=x.length,C=0;for(v=0;v<S;v++)(64512&(y=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=x.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),v++),C+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(C):new Array(C),v=k=0;k<C;v++)(64512&(y=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=x.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),v++),y<128?m[k++]=y:(y<2048?m[k++]=192|y>>>6:(y<65536?m[k++]=224|y>>>12:(m[k++]=240|y>>>18,m[k++]=128|y>>>12&63),m[k++]=128|y>>>6&63),m[k++]=128|63&y);return m})(d)},o.utf8decode=function(d){return s.nodebuffer?i.transformTo("nodebuffer",d).toString("utf-8"):(function(x){var m,y,g,v,k=x.length,S=new Array(2*k);for(m=y=0;m<k;)if((g=x[m++])<128)S[y++]=g;else if(4<(v=c[g]))S[y++]=65533,m+=v-1;else{for(g&=v===2?31:v===3?15:7;1<v&&m<k;)g=g<<6|63&x[m++],v--;1<v?S[y++]=65533:g<65536?S[y++]=g:(g-=65536,S[y++]=55296|g>>10&1023,S[y++]=56320|1023&g)}return S.length!==y&&(S.subarray?S=S.subarray(0,y):S.length=y),i.applyFromCharCode(S)})(d=i.transformTo(s.uint8array?"uint8array":"array",d))},i.inherits(f,l),f.prototype.processChunk=function(d){var x=i.transformTo(s.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=x;(x=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),x.set(m,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var y=(function(v,k){var S;for((k=k||v.length)>v.length&&(k=v.length),S=k-1;0<=S&&(192&v[S])==128;)S--;return S<0||S===0?k:S+c[v[S]]>k?S:k})(x),g=x;y!==x.length&&(s.uint8array?(g=x.subarray(0,y),this.leftOver=x.subarray(y,x.length)):(g=x.slice(0,y),this.leftOver=x.slice(y,x.length))),this.push({data:o.utf8decode(g),meta:d.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=f,i.inherits(p,l),p.prototype.processChunk=function(d){this.push({data:o.utf8encode(d.data),meta:d.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var i=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(m){return m}function u(m,y){for(var g=0;g<m.length;++g)y[g]=255&m.charCodeAt(g);return y}n("setimmediate"),o.newBlob=function(m,y){o.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(m,y,g){var v=[],k=0,S=m.length;if(S<=g)return String.fromCharCode.apply(null,m);for(;k<S;)y==="array"||y==="nodebuffer"?v.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,S)))):v.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,S)))),k+=g;return v.join("")},stringifyByChar:function(m){for(var y="",g=0;g<m.length;g++)y+=String.fromCharCode(m[g]);return y},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var y=65536,g=o.getTypeOf(m),v=!0;if(g==="uint8array"?v=f.applyCanBeUsed.uint8array:g==="nodebuffer"&&(v=f.applyCanBeUsed.nodebuffer),v)for(;1<y;)try{return f.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return f.stringifyByChar(m)}function d(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}o.applyFromCharCode=p;var x={};x.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return x.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},x.array={string:p,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},x.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return d(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},x.uint8array={string:p,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},x.nodebuffer={string:p,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return x.nodebuffer.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:c},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var g=o.getTypeOf(y);return x[g][m](y)},o.resolve=function(m){for(var y=m.split("/"),g=[],v=0;v<y.length;v++){var k=y[v];k==="."||k===""&&v!==0&&v!==y.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,g,v="";for(g=0;g<(m||"").length;g++)v+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return v},o.delay=function(m,y,g){setImmediate(function(){m.apply(g||null,y||[])})},o.inherits=function(m,y){function g(){}g.prototype=y.prototype,m.prototype=new g},o.extend=function(){var m,y,g={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&g[y]===void 0&&(g[y]=arguments[m][y]);return g},o.prepareContent=function(m,y,g,v,k){return l.Promise.resolve(y).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,E){var I=new FileReader;I.onload=function(z){C(z.target.result)},I.onerror=function(z){E(z.target.error)},I.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(k?S=s.decode(S):g&&v!==!0&&(S=(function(E){return u(E,i.uint8array?new Uint8Array(E.length):new Array(E.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(f){this.files=[],this.loadOptions=f}u.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(p)+", expected "+s.pretty(f)+")")}},isSignature:function(f,p){var d=this.reader.index;this.reader.setIndex(f);var x=this.reader.readString(4)===p;return this.reader.setIndex(d),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",d=s.transformTo(p,f);this.zipComment=this.loadOptions.decodeFileName(d)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,p,d,x=this.zip64EndOfCentralSize-44;0<x;)f=this.reader.readInt(2),p=this.reader.readInt(4),d=this.reader.readData(p),this.zip64ExtensibleData[f]={id:f,length:p,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,p;for(f=0;f<this.files.length;f++)p=this.files[f],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var p=f;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var x=p-d;if(0<x)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=x);else if(x<0)throw new Error("Corrupted zip: missing "+Math.abs(x)+" bytes.")},prepareReader:function(f){this.reader=i(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),f=n("./support");function p(d,x){this.options=d,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var x,m;if(d.skip(22),this.fileNameLength=d.readInt(2),m=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(y){for(var g in u)if(Object.prototype.hasOwnProperty.call(u,g)&&u[g].magic===y)return u[g];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,x,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var x=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(x),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var x,m,y,g=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<g;)x=d.readInt(2),m=d.readInt(2),y=d.readData(m),this.extraFields[x]={id:x,length:m,value:y};d.setIndex(g)},handleUTF8:function(){var d=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var m=s.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=s.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var x=i(d.value);return x.readInt(1)!==1||l(this.fileName)!==x.readInt(4)?null:c.utf8decode(x.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var x=i(d.value);return x.readInt(1)!==1||l(this.fileComment)!==x.readInt(4)?null:c.utf8decode(x.readData(d.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function i(x,m,y){this.name=x,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");i.prototype={internalStream:function(x){var m=null,y="string";try{if(!x)throw new Error("No output type specified.");var g=(y=x.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var v=!this._dataBinary;v&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!v&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(k){(m=new u("error")).error(k)}return new s(m,y,"")},async:function(x,m){return this.internalStream(x).accumulate(m)},nodeStream:function(x,m){return this.internalStream(x||"nodebuffer").toNodejsStream(m)},_compressWorker:function(x,m){if(this._data instanceof c&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,x,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<f.length;d++)i.prototype[f[d]]=p;r.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,u=new l(x),f=i.document.createTextNode("");u.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var m=i.document.createElement("script");m.onreadystatechange=function(){x(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(x,0)};else{var p=new i.MessageChannel;p.port1.onmessage=x,s=function(){p.port2.postMessage(0)}}var d=[];function x(){var m,y;a=!0;for(var g=d.length;g;){for(y=d,d=[],m=-1;++m<g;)y[m]();g=d.length}a=!1}r.exports=function(m){d.push(m)!==1||a||s()}}).call(this,typeof yr<"u"?yr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function f(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,g!==s&&m(this,g)}function p(g,v,k){this.promise=g,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function d(g,v,k){i(function(){var S;try{S=v(k)}catch(C){return a.reject(g,C)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function x(g){var v=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof v=="function")return function(){v.apply(g,arguments)}}function m(g,v){var k=!1;function S(I){k||(k=!0,a.reject(g,I))}function C(I){k||(k=!0,a.resolve(g,I))}var E=y(function(){v(C,S)});E.status==="error"&&S(E.value)}function y(g,v){var k={};try{k.value=g(v),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=f).prototype.finally=function(g){if(typeof g!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(g()).then(function(){return k})},function(k){return v.resolve(g()).then(function(){throw k})})},f.prototype.catch=function(g){return this.then(null,g)},f.prototype.then=function(g,v){if(typeof g!="function"&&this.state===c||typeof v!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==u?d(k,this.state===c?g:v,this.outcome):this.queue.push(new p(k,g,v)),k},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){d(this.promise,this.onFulfilled,g)},p.prototype.callRejected=function(g){a.reject(this.promise,g)},p.prototype.otherCallRejected=function(g){d(this.promise,this.onRejected,g)},a.resolve=function(g,v){var k=y(x,v);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)m(g,S);else{g.state=c,g.outcome=v;for(var C=-1,E=g.queue.length;++C<E;)g.queue[C].callFulfilled(v)}return g},a.reject=function(g,v){g.state=l,g.outcome=v;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(v);return g},f.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},f.reject=function(g){var v=new this(s);return a.reject(v,g)},f.all=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=new Array(k),E=0,I=-1,z=new this(s);++I<k;)P(g[I],I);return z;function P(L,V){v.resolve(L).then(function(T){C[V]=T,++E!==k||S||(S=!0,a.resolve(z,C))},function(T){S||(S=!0,a.reject(z,T))})}},f.race=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=-1,E=new this(s);++C<k;)I=g[C],v.resolve(I).then(function(z){S||(S=!0,a.resolve(E,z))},function(z){S||(S=!0,a.reject(E,z))});var I;return E}},{immediate:36}],38:[function(n,r,o){var i={};(0,n("./lib/utils/common").assign)(i,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var i=n("./zlib/deflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,f=0,p=-1,d=0,x=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:p,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},g||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==f)throw new Error(l[k]);if(v.header&&i.deflateSetHeader(this.strm,v.header),v.dictionary){var S;if(S=typeof v.dictionary=="string"?a.string2buf(v.dictionary):u.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==f)throw new Error(l[k]);this._dict_set=!0}}function y(g,v){var k=new m(v);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}m.prototype.push=function(g,v){var k,S,C=this.strm,E=this.options.chunkSize;if(this.ended)return!1;S=v===~~v?v:v===!0?4:0,typeof g=="string"?C.input=a.string2buf(g):u.call(g)==="[object ArrayBuffer]"?C.input=new Uint8Array(g):C.input=g,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(E),C.next_out=0,C.avail_out=E),(k=i.deflate(C,S))!==1&&k!==f)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===f):S!==2||(this.onEnd(f),!(C.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=m,o.deflate=y,o.deflateRaw=function(g,v){return(v=v||{}).raw=!0,y(g,v)},o.gzip=function(g,v){return(v=v||{}).gzip=!0,y(g,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),f=n("./zlib/gzheader"),p=Object.prototype.toString;function d(m){if(!(this instanceof d))return new d(m);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,y.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new f,i.inflateGetHeader(this.strm,this.header)}function x(m,y){var g=new d(y);if(g.push(m,!0),g.err)throw g.msg||c[g.err];return g.result}d.prototype.push=function(m,y){var g,v,k,S,C,E,I=this.strm,z=this.options.chunkSize,P=this.options.dictionary,L=!1;if(this.ended)return!1;v=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?I.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?I.input=new Uint8Array(m):I.input=m,I.next_in=0,I.avail_in=I.input.length;do{if(I.avail_out===0&&(I.output=new s.Buf8(z),I.next_out=0,I.avail_out=z),(g=i.inflate(I,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&P&&(E=typeof P=="string"?a.string2buf(P):p.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,g=i.inflateSetDictionary(this.strm,E)),g===l.Z_BUF_ERROR&&L===!0&&(g=l.Z_OK,L=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);I.next_out&&(I.avail_out!==0&&g!==l.Z_STREAM_END&&(I.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(I.output,I.next_out),S=I.next_out-k,C=a.buf2string(I.output,k),I.next_out=S,I.avail_out=z-S,S&&s.arraySet(I.output,I.output,k,S,0),this.onData(C)):this.onData(s.shrinkBuf(I.output,I.next_out)))),I.avail_in===0&&I.avail_out===0&&(L=!0)}while((0<I.avail_in||I.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(I.avail_out=0))},d.prototype.onData=function(m){this.chunks.push(m)},d.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=d,o.inflate=x,o.inflateRaw=function(m,y){return(y=y||{}).raw=!0,x(m,y)},o.ungzip=x},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var f in u)u.hasOwnProperty(f)&&(l[f]=u[f])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,u,f,p){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+f),p);else for(var d=0;d<f;d++)l[p+d]=c[u+d]},flattenChunks:function(l){var c,u,f,p,d,x;for(c=f=0,u=l.length;c<u;c++)f+=l[c].length;for(x=new Uint8Array(f),c=p=0,u=l.length;c<u;c++)d=l[c],x.set(d,p),p+=d.length;return x}},a={arraySet:function(l,c,u,f,p){for(var d=0;d<f;d++)l[p+d]=c[u+d]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(n,r,o){var i=n("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(f,p){if(p<65537&&(f.subarray&&a||!f.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(f,p));for(var d="",x=0;x<p;x++)d+=String.fromCharCode(f[x]);return d}l[254]=l[254]=1,o.string2buf=function(f){var p,d,x,m,y,g=f.length,v=0;for(m=0;m<g;m++)(64512&(d=f.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=f.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(x-56320),m++),v+=d<128?1:d<2048?2:d<65536?3:4;for(p=new i.Buf8(v),m=y=0;y<v;m++)(64512&(d=f.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=f.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(x-56320),m++),d<128?p[y++]=d:(d<2048?p[y++]=192|d>>>6:(d<65536?p[y++]=224|d>>>12:(p[y++]=240|d>>>18,p[y++]=128|d>>>12&63),p[y++]=128|d>>>6&63),p[y++]=128|63&d);return p},o.buf2binstring=function(f){return u(f,f.length)},o.binstring2buf=function(f){for(var p=new i.Buf8(f.length),d=0,x=p.length;d<x;d++)p[d]=f.charCodeAt(d);return p},o.buf2string=function(f,p){var d,x,m,y,g=p||f.length,v=new Array(2*g);for(d=x=0;d<g;)if((m=f[d++])<128)v[x++]=m;else if(4<(y=l[m]))v[x++]=65533,d+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&d<g;)m=m<<6|63&f[d++],y--;1<y?v[x++]=65533:m<65536?v[x++]=m:(m-=65536,v[x++]=55296|m>>10&1023,v[x++]=56320|1023&m)}return u(v,x)},o.utf8border=function(f,p){var d;for((p=p||f.length)>f.length&&(p=f.length),d=p-1;0<=d&&(192&f[d])==128;)d--;return d<0||d===0?p:d+l[f[d]]>p?d:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(i,s,a,l){for(var c=65535&i|0,u=i>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--f;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,c){var u=i,f=c+l;s^=-1;for(var p=c;p<f;p++)s=s>>>8^u[255&(s^a[p])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,p=4,d=0,x=-2,m=-1,y=4,g=2,v=8,k=9,S=286,C=30,E=19,I=2*S+1,z=15,P=3,L=258,V=L+P+1,T=42,M=113,b=1,D=2,K=3,U=4;function W(w,Y){return w.msg=u[Y],Y}function q(w){return(w<<1)-(4<w?9:0)}function A(w){for(var Y=w.length;0<=--Y;)w[Y]=0}function B(w){var Y=w.state,H=Y.pending;H>w.avail_out&&(H=w.avail_out),H!==0&&(s.arraySet(w.output,Y.pending_buf,Y.pending_out,H,w.next_out),w.next_out+=H,Y.pending_out+=H,w.total_out+=H,w.avail_out-=H,Y.pending-=H,Y.pending===0&&(Y.pending_out=0))}function R(w,Y){a._tr_flush_block(w,0<=w.block_start?w.block_start:-1,w.strstart-w.block_start,Y),w.block_start=w.strstart,B(w.strm)}function N(w,Y){w.pending_buf[w.pending++]=Y}function J(w,Y){w.pending_buf[w.pending++]=Y>>>8&255,w.pending_buf[w.pending++]=255&Y}function Q(w,Y){var H,O,j=w.max_chain_length,F=w.strstart,ee=w.prev_length,ne=w.nice_match,Z=w.strstart>w.w_size-V?w.strstart-(w.w_size-V):0,ie=w.window,ce=w.w_mask,se=w.prev,$=w.strstart+L,te=ie[F+ee-1],le=ie[F+ee];w.prev_length>=w.good_match&&(j>>=2),ne>w.lookahead&&(ne=w.lookahead);do if(ie[(H=Y)+ee]===le&&ie[H+ee-1]===te&&ie[H]===ie[F]&&ie[++H]===ie[F+1]){F+=2,H++;do;while(ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&F<$);if(O=L-($-F),F=$-L,ee<O){if(w.match_start=Y,ne<=(ee=O))break;te=ie[F+ee-1],le=ie[F+ee]}}while((Y=se[Y&ce])>Z&&--j!=0);return ee<=w.lookahead?ee:w.lookahead}function pe(w){var Y,H,O,j,F,ee,ne,Z,ie,ce,se=w.w_size;do{if(j=w.window_size-w.lookahead-w.strstart,w.strstart>=se+(se-V)){for(s.arraySet(w.window,w.window,se,se,0),w.match_start-=se,w.strstart-=se,w.block_start-=se,Y=H=w.hash_size;O=w.head[--Y],w.head[Y]=se<=O?O-se:0,--H;);for(Y=H=se;O=w.prev[--Y],w.prev[Y]=se<=O?O-se:0,--H;);j+=se}if(w.strm.avail_in===0)break;if(ee=w.strm,ne=w.window,Z=w.strstart+w.lookahead,ie=j,ce=void 0,ce=ee.avail_in,ie<ce&&(ce=ie),H=ce===0?0:(ee.avail_in-=ce,s.arraySet(ne,ee.input,ee.next_in,ce,Z),ee.state.wrap===1?ee.adler=l(ee.adler,ne,ce,Z):ee.state.wrap===2&&(ee.adler=c(ee.adler,ne,ce,Z)),ee.next_in+=ce,ee.total_in+=ce,ce),w.lookahead+=H,w.lookahead+w.insert>=P)for(F=w.strstart-w.insert,w.ins_h=w.window[F],w.ins_h=(w.ins_h<<w.hash_shift^w.window[F+1])&w.hash_mask;w.insert&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[F+P-1])&w.hash_mask,w.prev[F&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=F,F++,w.insert--,!(w.lookahead+w.insert<P)););}while(w.lookahead<V&&w.strm.avail_in!==0)}function X(w,Y){for(var H,O;;){if(w.lookahead<V){if(pe(w),w.lookahead<V&&Y===f)return b;if(w.lookahead===0)break}if(H=0,w.lookahead>=P&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+P-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),H!==0&&w.strstart-H<=w.w_size-V&&(w.match_length=Q(w,H)),w.match_length>=P)if(O=a._tr_tally(w,w.strstart-w.match_start,w.match_length-P),w.lookahead-=w.match_length,w.match_length<=w.max_lazy_match&&w.lookahead>=P){for(w.match_length--;w.strstart++,w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+P-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart,--w.match_length!=0;);w.strstart++}else w.strstart+=w.match_length,w.match_length=0,w.ins_h=w.window[w.strstart],w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+1])&w.hash_mask;else O=a._tr_tally(w,0,w.window[w.strstart]),w.lookahead--,w.strstart++;if(O&&(R(w,!1),w.strm.avail_out===0))return b}return w.insert=w.strstart<P-1?w.strstart:P-1,Y===p?(R(w,!0),w.strm.avail_out===0?K:U):w.last_lit&&(R(w,!1),w.strm.avail_out===0)?b:D}function ae(w,Y){for(var H,O,j;;){if(w.lookahead<V){if(pe(w),w.lookahead<V&&Y===f)return b;if(w.lookahead===0)break}if(H=0,w.lookahead>=P&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+P-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),w.prev_length=w.match_length,w.prev_match=w.match_start,w.match_length=P-1,H!==0&&w.prev_length<w.max_lazy_match&&w.strstart-H<=w.w_size-V&&(w.match_length=Q(w,H),w.match_length<=5&&(w.strategy===1||w.match_length===P&&4096<w.strstart-w.match_start)&&(w.match_length=P-1)),w.prev_length>=P&&w.match_length<=w.prev_length){for(j=w.strstart+w.lookahead-P,O=a._tr_tally(w,w.strstart-1-w.prev_match,w.prev_length-P),w.lookahead-=w.prev_length-1,w.prev_length-=2;++w.strstart<=j&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+P-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),--w.prev_length!=0;);if(w.match_available=0,w.match_length=P-1,w.strstart++,O&&(R(w,!1),w.strm.avail_out===0))return b}else if(w.match_available){if((O=a._tr_tally(w,0,w.window[w.strstart-1]))&&R(w,!1),w.strstart++,w.lookahead--,w.strm.avail_out===0)return b}else w.match_available=1,w.strstart++,w.lookahead--}return w.match_available&&(O=a._tr_tally(w,0,w.window[w.strstart-1]),w.match_available=0),w.insert=w.strstart<P-1?w.strstart:P-1,Y===p?(R(w,!0),w.strm.avail_out===0?K:U):w.last_lit&&(R(w,!1),w.strm.avail_out===0)?b:D}function de(w,Y,H,O,j){this.good_length=w,this.max_lazy=Y,this.nice_length=H,this.max_chain=O,this.func=j}function me(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*I),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*E+1)),A(this.dyn_ltree),A(this.dyn_dtree),A(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(z+1),this.heap=new s.Buf16(2*S+1),A(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),A(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xe(w){var Y;return w&&w.state?(w.total_in=w.total_out=0,w.data_type=g,(Y=w.state).pending=0,Y.pending_out=0,Y.wrap<0&&(Y.wrap=-Y.wrap),Y.status=Y.wrap?T:M,w.adler=Y.wrap===2?0:1,Y.last_flush=f,a._tr_init(Y),d):W(w,x)}function Ee(w){var Y=xe(w);return Y===d&&(function(H){H.window_size=2*H.w_size,A(H.head),H.max_lazy_match=i[H.level].max_lazy,H.good_match=i[H.level].good_length,H.nice_match=i[H.level].nice_length,H.max_chain_length=i[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=P-1,H.match_available=0,H.ins_h=0})(w.state),Y}function Pe(w,Y,H,O,j,F){if(!w)return x;var ee=1;if(Y===m&&(Y=6),O<0?(ee=0,O=-O):15<O&&(ee=2,O-=16),j<1||k<j||H!==v||O<8||15<O||Y<0||9<Y||F<0||y<F)return W(w,x);O===8&&(O=9);var ne=new me;return(w.state=ne).strm=w,ne.wrap=ee,ne.gzhead=null,ne.w_bits=O,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=j+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+P-1)/P),ne.window=new s.Buf8(2*ne.w_size),ne.head=new s.Buf16(ne.hash_size),ne.prev=new s.Buf16(ne.w_size),ne.lit_bufsize=1<<j+6,ne.pending_buf_size=4*ne.lit_bufsize,ne.pending_buf=new s.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=Y,ne.strategy=F,ne.method=H,Ee(w)}i=[new de(0,0,0,0,function(w,Y){var H=65535;for(H>w.pending_buf_size-5&&(H=w.pending_buf_size-5);;){if(w.lookahead<=1){if(pe(w),w.lookahead===0&&Y===f)return b;if(w.lookahead===0)break}w.strstart+=w.lookahead,w.lookahead=0;var O=w.block_start+H;if((w.strstart===0||w.strstart>=O)&&(w.lookahead=w.strstart-O,w.strstart=O,R(w,!1),w.strm.avail_out===0)||w.strstart-w.block_start>=w.w_size-V&&(R(w,!1),w.strm.avail_out===0))return b}return w.insert=0,Y===p?(R(w,!0),w.strm.avail_out===0?K:U):(w.strstart>w.block_start&&(R(w,!1),w.strm.avail_out),b)}),new de(4,4,8,4,X),new de(4,5,16,8,X),new de(4,6,32,32,X),new de(4,4,16,16,ae),new de(8,16,32,32,ae),new de(8,16,128,128,ae),new de(8,32,128,256,ae),new de(32,128,258,1024,ae),new de(32,258,258,4096,ae)],o.deflateInit=function(w,Y){return Pe(w,Y,v,15,8,0)},o.deflateInit2=Pe,o.deflateReset=Ee,o.deflateResetKeep=xe,o.deflateSetHeader=function(w,Y){return w&&w.state?w.state.wrap!==2?x:(w.state.gzhead=Y,d):x},o.deflate=function(w,Y){var H,O,j,F;if(!w||!w.state||5<Y||Y<0)return w?W(w,x):x;if(O=w.state,!w.output||!w.input&&w.avail_in!==0||O.status===666&&Y!==p)return W(w,w.avail_out===0?-5:x);if(O.strm=w,H=O.last_flush,O.last_flush=Y,O.status===T)if(O.wrap===2)w.adler=0,N(O,31),N(O,139),N(O,8),O.gzhead?(N(O,(O.gzhead.text?1:0)+(O.gzhead.hcrc?2:0)+(O.gzhead.extra?4:0)+(O.gzhead.name?8:0)+(O.gzhead.comment?16:0)),N(O,255&O.gzhead.time),N(O,O.gzhead.time>>8&255),N(O,O.gzhead.time>>16&255),N(O,O.gzhead.time>>24&255),N(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),N(O,255&O.gzhead.os),O.gzhead.extra&&O.gzhead.extra.length&&(N(O,255&O.gzhead.extra.length),N(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(w.adler=c(w.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=69):(N(O,0),N(O,0),N(O,0),N(O,0),N(O,0),N(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),N(O,3),O.status=M);else{var ee=v+(O.w_bits-8<<4)<<8;ee|=(2<=O.strategy||O.level<2?0:O.level<6?1:O.level===6?2:3)<<6,O.strstart!==0&&(ee|=32),ee+=31-ee%31,O.status=M,J(O,ee),O.strstart!==0&&(J(O,w.adler>>>16),J(O,65535&w.adler)),w.adler=1}if(O.status===69)if(O.gzhead.extra){for(j=O.pending;O.gzindex<(65535&O.gzhead.extra.length)&&(O.pending!==O.pending_buf_size||(O.gzhead.hcrc&&O.pending>j&&(w.adler=c(w.adler,O.pending_buf,O.pending-j,j)),B(w),j=O.pending,O.pending!==O.pending_buf_size));)N(O,255&O.gzhead.extra[O.gzindex]),O.gzindex++;O.gzhead.hcrc&&O.pending>j&&(w.adler=c(w.adler,O.pending_buf,O.pending-j,j)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=73)}else O.status=73;if(O.status===73)if(O.gzhead.name){j=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>j&&(w.adler=c(w.adler,O.pending_buf,O.pending-j,j)),B(w),j=O.pending,O.pending===O.pending_buf_size)){F=1;break}F=O.gzindex<O.gzhead.name.length?255&O.gzhead.name.charCodeAt(O.gzindex++):0,N(O,F)}while(F!==0);O.gzhead.hcrc&&O.pending>j&&(w.adler=c(w.adler,O.pending_buf,O.pending-j,j)),F===0&&(O.gzindex=0,O.status=91)}else O.status=91;if(O.status===91)if(O.gzhead.comment){j=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>j&&(w.adler=c(w.adler,O.pending_buf,O.pending-j,j)),B(w),j=O.pending,O.pending===O.pending_buf_size)){F=1;break}F=O.gzindex<O.gzhead.comment.length?255&O.gzhead.comment.charCodeAt(O.gzindex++):0,N(O,F)}while(F!==0);O.gzhead.hcrc&&O.pending>j&&(w.adler=c(w.adler,O.pending_buf,O.pending-j,j)),F===0&&(O.status=103)}else O.status=103;if(O.status===103&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&B(w),O.pending+2<=O.pending_buf_size&&(N(O,255&w.adler),N(O,w.adler>>8&255),w.adler=0,O.status=M)):O.status=M),O.pending!==0){if(B(w),w.avail_out===0)return O.last_flush=-1,d}else if(w.avail_in===0&&q(Y)<=q(H)&&Y!==p)return W(w,-5);if(O.status===666&&w.avail_in!==0)return W(w,-5);if(w.avail_in!==0||O.lookahead!==0||Y!==f&&O.status!==666){var ne=O.strategy===2?(function(Z,ie){for(var ce;;){if(Z.lookahead===0&&(pe(Z),Z.lookahead===0)){if(ie===f)return b;break}if(Z.match_length=0,ce=a._tr_tally(Z,0,Z.window[Z.strstart]),Z.lookahead--,Z.strstart++,ce&&(R(Z,!1),Z.strm.avail_out===0))return b}return Z.insert=0,ie===p?(R(Z,!0),Z.strm.avail_out===0?K:U):Z.last_lit&&(R(Z,!1),Z.strm.avail_out===0)?b:D})(O,Y):O.strategy===3?(function(Z,ie){for(var ce,se,$,te,le=Z.window;;){if(Z.lookahead<=L){if(pe(Z),Z.lookahead<=L&&ie===f)return b;if(Z.lookahead===0)break}if(Z.match_length=0,Z.lookahead>=P&&0<Z.strstart&&(se=le[$=Z.strstart-1])===le[++$]&&se===le[++$]&&se===le[++$]){te=Z.strstart+L;do;while(se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&$<te);Z.match_length=L-(te-$),Z.match_length>Z.lookahead&&(Z.match_length=Z.lookahead)}if(Z.match_length>=P?(ce=a._tr_tally(Z,1,Z.match_length-P),Z.lookahead-=Z.match_length,Z.strstart+=Z.match_length,Z.match_length=0):(ce=a._tr_tally(Z,0,Z.window[Z.strstart]),Z.lookahead--,Z.strstart++),ce&&(R(Z,!1),Z.strm.avail_out===0))return b}return Z.insert=0,ie===p?(R(Z,!0),Z.strm.avail_out===0?K:U):Z.last_lit&&(R(Z,!1),Z.strm.avail_out===0)?b:D})(O,Y):i[O.level].func(O,Y);if(ne!==K&&ne!==U||(O.status=666),ne===b||ne===K)return w.avail_out===0&&(O.last_flush=-1),d;if(ne===D&&(Y===1?a._tr_align(O):Y!==5&&(a._tr_stored_block(O,0,0,!1),Y===3&&(A(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),B(w),w.avail_out===0))return O.last_flush=-1,d}return Y!==p?d:O.wrap<=0?1:(O.wrap===2?(N(O,255&w.adler),N(O,w.adler>>8&255),N(O,w.adler>>16&255),N(O,w.adler>>24&255),N(O,255&w.total_in),N(O,w.total_in>>8&255),N(O,w.total_in>>16&255),N(O,w.total_in>>24&255)):(J(O,w.adler>>>16),J(O,65535&w.adler)),B(w),0<O.wrap&&(O.wrap=-O.wrap),O.pending!==0?d:1)},o.deflateEnd=function(w){var Y;return w&&w.state?(Y=w.state.status)!==T&&Y!==69&&Y!==73&&Y!==91&&Y!==103&&Y!==M&&Y!==666?W(w,x):(w.state=null,Y===M?W(w,-3):d):x},o.deflateSetDictionary=function(w,Y){var H,O,j,F,ee,ne,Z,ie,ce=Y.length;if(!w||!w.state||(F=(H=w.state).wrap)===2||F===1&&H.status!==T||H.lookahead)return x;for(F===1&&(w.adler=l(w.adler,Y,ce,0)),H.wrap=0,ce>=H.w_size&&(F===0&&(A(H.head),H.strstart=0,H.block_start=0,H.insert=0),ie=new s.Buf8(H.w_size),s.arraySet(ie,Y,ce-H.w_size,H.w_size,0),Y=ie,ce=H.w_size),ee=w.avail_in,ne=w.next_in,Z=w.input,w.avail_in=ce,w.next_in=0,w.input=Y,pe(H);H.lookahead>=P;){for(O=H.strstart,j=H.lookahead-(P-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[O+P-1])&H.hash_mask,H.prev[O&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=O,O++,--j;);H.strstart=O,H.lookahead=P-1,pe(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=P-1,H.match_available=0,w.next_in=ne,w.input=Z,w.avail_in=ee,H.wrap=F,d},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(i,s){var a,l,c,u,f,p,d,x,m,y,g,v,k,S,C,E,I,z,P,L,V,T,M,b,D;a=i.state,l=i.next_in,b=i.input,c=l+(i.avail_in-5),u=i.next_out,D=i.output,f=u-(s-i.avail_out),p=u+(i.avail_out-257),d=a.dmax,x=a.wsize,m=a.whave,y=a.wnext,g=a.window,v=a.hold,k=a.bits,S=a.lencode,C=a.distcode,E=(1<<a.lenbits)-1,I=(1<<a.distbits)-1;e:do{k<15&&(v+=b[l++]<<k,k+=8,v+=b[l++]<<k,k+=8),z=S[v&E];t:for(;;){if(v>>>=P=z>>>24,k-=P,(P=z>>>16&255)===0)D[u++]=65535&z;else{if(!(16&P)){if((64&P)==0){z=S[(65535&z)+(v&(1<<P)-1)];continue t}if(32&P){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}L=65535&z,(P&=15)&&(k<P&&(v+=b[l++]<<k,k+=8),L+=v&(1<<P)-1,v>>>=P,k-=P),k<15&&(v+=b[l++]<<k,k+=8,v+=b[l++]<<k,k+=8),z=C[v&I];n:for(;;){if(v>>>=P=z>>>24,k-=P,!(16&(P=z>>>16&255))){if((64&P)==0){z=C[(65535&z)+(v&(1<<P)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(V=65535&z,k<(P&=15)&&(v+=b[l++]<<k,(k+=8)<P&&(v+=b[l++]<<k,k+=8)),d<(V+=v&(1<<P)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=P,k-=P,(P=u-f)<V){if(m<(P=V-P)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(M=g,(T=0)===y){if(T+=x-P,P<L){for(L-=P;D[u++]=g[T++],--P;);T=u-V,M=D}}else if(y<P){if(T+=x+y-P,(P-=y)<L){for(L-=P;D[u++]=g[T++],--P;);if(T=0,y<L){for(L-=P=y;D[u++]=g[T++],--P;);T=u-V,M=D}}}else if(T+=y-P,P<L){for(L-=P;D[u++]=g[T++],--P;);T=u-V,M=D}for(;2<L;)D[u++]=M[T++],D[u++]=M[T++],D[u++]=M[T++],L-=3;L&&(D[u++]=M[T++],1<L&&(D[u++]=M[T++]))}else{for(T=u-V;D[u++]=D[T++],D[u++]=D[T++],D[u++]=D[T++],2<(L-=3););L&&(D[u++]=D[T++],1<L&&(D[u++]=D[T++]))}break}}break}}while(l<c&&u<p);l-=L=k>>3,v&=(1<<(k-=L<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<p?p-u+257:257-(u-p),a.hold=v,a.bits=k}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,f=2,p=0,d=-2,x=1,m=852,y=592;function g(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(T){var M;return T&&T.state?(M=T.state,T.total_in=T.total_out=M.total=0,T.msg="",M.wrap&&(T.adler=1&M.wrap),M.mode=x,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new i.Buf32(m),M.distcode=M.distdyn=new i.Buf32(y),M.sane=1,M.back=-1,p):d}function S(T){var M;return T&&T.state?((M=T.state).wsize=0,M.whave=0,M.wnext=0,k(T)):d}function C(T,M){var b,D;return T&&T.state?(D=T.state,M<0?(b=0,M=-M):(b=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15<M)?d:(D.window!==null&&D.wbits!==M&&(D.window=null),D.wrap=b,D.wbits=M,S(T))):d}function E(T,M){var b,D;return T?(D=new v,(T.state=D).window=null,(b=C(T,M))!==p&&(T.state=null),b):d}var I,z,P=!0;function L(T){if(P){var M;for(I=new i.Buf32(512),z=new i.Buf32(32),M=0;M<144;)T.lens[M++]=8;for(;M<256;)T.lens[M++]=9;for(;M<280;)T.lens[M++]=7;for(;M<288;)T.lens[M++]=8;for(c(u,T.lens,0,288,I,0,T.work,{bits:9}),M=0;M<32;)T.lens[M++]=5;c(f,T.lens,0,32,z,0,T.work,{bits:5}),P=!1}T.lencode=I,T.lenbits=9,T.distcode=z,T.distbits=5}function V(T,M,b,D){var K,U=T.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new i.Buf8(U.wsize)),D>=U.wsize?(i.arraySet(U.window,M,b-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(D<(K=U.wsize-U.wnext)&&(K=D),i.arraySet(U.window,M,b-D,K,U.wnext),(D-=K)?(i.arraySet(U.window,M,b-D,D,0),U.wnext=D,U.whave=U.wsize):(U.wnext+=K,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=K))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(T){return E(T,15)},o.inflateInit2=E,o.inflate=function(T,M){var b,D,K,U,W,q,A,B,R,N,J,Q,pe,X,ae,de,me,xe,Ee,Pe,w,Y,H,O,j=0,F=new i.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return d;(b=T.state).mode===12&&(b.mode=13),W=T.next_out,K=T.output,A=T.avail_out,U=T.next_in,D=T.input,q=T.avail_in,B=b.hold,R=b.bits,N=q,J=A,Y=p;e:for(;;)switch(b.mode){case x:if(b.wrap===0){b.mode=13;break}for(;R<16;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if(2&b.wrap&&B===35615){F[b.check=0]=255&B,F[1]=B>>>8&255,b.check=a(b.check,F,2,0),R=B=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&B)<<8)+(B>>8))%31){T.msg="incorrect header check",b.mode=30;break}if((15&B)!=8){T.msg="unknown compression method",b.mode=30;break}if(R-=4,w=8+(15&(B>>>=4)),b.wbits===0)b.wbits=w;else if(w>b.wbits){T.msg="invalid window size",b.mode=30;break}b.dmax=1<<w,T.adler=b.check=1,b.mode=512&B?10:12,R=B=0;break;case 2:for(;R<16;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if(b.flags=B,(255&b.flags)!=8){T.msg="unknown compression method",b.mode=30;break}if(57344&b.flags){T.msg="unknown header flags set",b.mode=30;break}b.head&&(b.head.text=B>>8&1),512&b.flags&&(F[0]=255&B,F[1]=B>>>8&255,b.check=a(b.check,F,2,0)),R=B=0,b.mode=3;case 3:for(;R<32;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}b.head&&(b.head.time=B),512&b.flags&&(F[0]=255&B,F[1]=B>>>8&255,F[2]=B>>>16&255,F[3]=B>>>24&255,b.check=a(b.check,F,4,0)),R=B=0,b.mode=4;case 4:for(;R<16;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}b.head&&(b.head.xflags=255&B,b.head.os=B>>8),512&b.flags&&(F[0]=255&B,F[1]=B>>>8&255,b.check=a(b.check,F,2,0)),R=B=0,b.mode=5;case 5:if(1024&b.flags){for(;R<16;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}b.length=B,b.head&&(b.head.extra_len=B),512&b.flags&&(F[0]=255&B,F[1]=B>>>8&255,b.check=a(b.check,F,2,0)),R=B=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(q<(Q=b.length)&&(Q=q),Q&&(b.head&&(w=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),i.arraySet(b.head.extra,D,U,Q,w)),512&b.flags&&(b.check=a(b.check,D,Q,U)),q-=Q,U+=Q,b.length-=Q),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(q===0)break e;for(Q=0;w=D[U+Q++],b.head&&w&&b.length<65536&&(b.head.name+=String.fromCharCode(w)),w&&Q<q;);if(512&b.flags&&(b.check=a(b.check,D,Q,U)),q-=Q,U+=Q,w)break e}else b.head&&(b.head.name=null);b.length=0,b.mode=8;case 8:if(4096&b.flags){if(q===0)break e;for(Q=0;w=D[U+Q++],b.head&&w&&b.length<65536&&(b.head.comment+=String.fromCharCode(w)),w&&Q<q;);if(512&b.flags&&(b.check=a(b.check,D,Q,U)),q-=Q,U+=Q,w)break e}else b.head&&(b.head.comment=null);b.mode=9;case 9:if(512&b.flags){for(;R<16;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if(B!==(65535&b.check)){T.msg="header crc mismatch",b.mode=30;break}R=B=0}b.head&&(b.head.hcrc=b.flags>>9&1,b.head.done=!0),T.adler=b.check=0,b.mode=12;break;case 10:for(;R<32;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}T.adler=b.check=g(B),R=B=0,b.mode=11;case 11:if(b.havedict===0)return T.next_out=W,T.avail_out=A,T.next_in=U,T.avail_in=q,b.hold=B,b.bits=R,2;T.adler=b.check=1,b.mode=12;case 12:if(M===5||M===6)break e;case 13:if(b.last){B>>>=7&R,R-=7&R,b.mode=27;break}for(;R<3;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}switch(b.last=1&B,R-=1,3&(B>>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,M!==6)break;B>>>=2,R-=2;break e;case 2:b.mode=17;break;case 3:T.msg="invalid block type",b.mode=30}B>>>=2,R-=2;break;case 14:for(B>>>=7&R,R-=7&R;R<32;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if((65535&B)!=(B>>>16^65535)){T.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&B,R=B=0,b.mode=15,M===6)break e;case 15:b.mode=16;case 16:if(Q=b.length){if(q<Q&&(Q=q),A<Q&&(Q=A),Q===0)break e;i.arraySet(K,D,U,Q,W),q-=Q,U+=Q,A-=Q,W+=Q,b.length-=Q;break}b.mode=12;break;case 17:for(;R<14;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if(b.nlen=257+(31&B),B>>>=5,R-=5,b.ndist=1+(31&B),B>>>=5,R-=5,b.ncode=4+(15&B),B>>>=4,R-=4,286<b.nlen||30<b.ndist){T.msg="too many length or distance symbols",b.mode=30;break}b.have=0,b.mode=18;case 18:for(;b.have<b.ncode;){for(;R<3;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}b.lens[ee[b.have++]]=7&B,B>>>=3,R-=3}for(;b.have<19;)b.lens[ee[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,H={bits:b.lenbits},Y=c(0,b.lens,0,19,b.lencode,0,b.work,H),b.lenbits=H.bits,Y){T.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have<b.nlen+b.ndist;){for(;de=(j=b.lencode[B&(1<<b.lenbits)-1])>>>16&255,me=65535&j,!((ae=j>>>24)<=R);){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if(me<16)B>>>=ae,R-=ae,b.lens[b.have++]=me;else{if(me===16){for(O=ae+2;R<O;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if(B>>>=ae,R-=ae,b.have===0){T.msg="invalid bit length repeat",b.mode=30;break}w=b.lens[b.have-1],Q=3+(3&B),B>>>=2,R-=2}else if(me===17){for(O=ae+3;R<O;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}R-=ae,w=0,Q=3+(7&(B>>>=ae)),B>>>=3,R-=3}else{for(O=ae+7;R<O;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}R-=ae,w=0,Q=11+(127&(B>>>=ae)),B>>>=7,R-=7}if(b.have+Q>b.nlen+b.ndist){T.msg="invalid bit length repeat",b.mode=30;break}for(;Q--;)b.lens[b.have++]=w}}if(b.mode===30)break;if(b.lens[256]===0){T.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,H={bits:b.lenbits},Y=c(u,b.lens,0,b.nlen,b.lencode,0,b.work,H),b.lenbits=H.bits,Y){T.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,H={bits:b.distbits},Y=c(f,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,H),b.distbits=H.bits,Y){T.msg="invalid distances set",b.mode=30;break}if(b.mode=20,M===6)break e;case 20:b.mode=21;case 21:if(6<=q&&258<=A){T.next_out=W,T.avail_out=A,T.next_in=U,T.avail_in=q,b.hold=B,b.bits=R,l(T,J),W=T.next_out,K=T.output,A=T.avail_out,U=T.next_in,D=T.input,q=T.avail_in,B=b.hold,R=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;de=(j=b.lencode[B&(1<<b.lenbits)-1])>>>16&255,me=65535&j,!((ae=j>>>24)<=R);){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if(de&&(240&de)==0){for(xe=ae,Ee=de,Pe=me;de=(j=b.lencode[Pe+((B&(1<<xe+Ee)-1)>>xe)])>>>16&255,me=65535&j,!(xe+(ae=j>>>24)<=R);){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}B>>>=xe,R-=xe,b.back+=xe}if(B>>>=ae,R-=ae,b.back+=ae,b.length=me,de===0){b.mode=26;break}if(32&de){b.back=-1,b.mode=12;break}if(64&de){T.msg="invalid literal/length code",b.mode=30;break}b.extra=15&de,b.mode=22;case 22:if(b.extra){for(O=b.extra;R<O;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}b.length+=B&(1<<b.extra)-1,B>>>=b.extra,R-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;de=(j=b.distcode[B&(1<<b.distbits)-1])>>>16&255,me=65535&j,!((ae=j>>>24)<=R);){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if((240&de)==0){for(xe=ae,Ee=de,Pe=me;de=(j=b.distcode[Pe+((B&(1<<xe+Ee)-1)>>xe)])>>>16&255,me=65535&j,!(xe+(ae=j>>>24)<=R);){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}B>>>=xe,R-=xe,b.back+=xe}if(B>>>=ae,R-=ae,b.back+=ae,64&de){T.msg="invalid distance code",b.mode=30;break}b.offset=me,b.extra=15&de,b.mode=24;case 24:if(b.extra){for(O=b.extra;R<O;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}b.offset+=B&(1<<b.extra)-1,B>>>=b.extra,R-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){T.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(A===0)break e;if(Q=J-A,b.offset>Q){if((Q=b.offset-Q)>b.whave&&b.sane){T.msg="invalid distance too far back",b.mode=30;break}pe=Q>b.wnext?(Q-=b.wnext,b.wsize-Q):b.wnext-Q,Q>b.length&&(Q=b.length),X=b.window}else X=K,pe=W-b.offset,Q=b.length;for(A<Q&&(Q=A),A-=Q,b.length-=Q;K[W++]=X[pe++],--Q;);b.length===0&&(b.mode=21);break;case 26:if(A===0)break e;K[W++]=b.length,A--,b.mode=21;break;case 27:if(b.wrap){for(;R<32;){if(q===0)break e;q--,B|=D[U++]<<R,R+=8}if(J-=A,T.total_out+=J,b.total+=J,J&&(T.adler=b.check=b.flags?a(b.check,K,J,W-J):s(b.check,K,J,W-J)),J=A,(b.flags?B:g(B))!==b.check){T.msg="incorrect data check",b.mode=30;break}R=B=0}b.mode=28;case 28:if(b.wrap&&b.flags){for(;R<32;){if(q===0)break e;q--,B+=D[U++]<<R,R+=8}if(B!==(4294967295&b.total)){T.msg="incorrect length check",b.mode=30;break}R=B=0}b.mode=29;case 29:Y=1;break e;case 30:Y=-3;break e;case 31:return-4;default:return d}return T.next_out=W,T.avail_out=A,T.next_in=U,T.avail_in=q,b.hold=B,b.bits=R,(b.wsize||J!==T.avail_out&&b.mode<30&&(b.mode<27||M!==4))&&V(T,T.output,T.next_out,J-T.avail_out)?(b.mode=31,-4):(N-=T.avail_in,J-=T.avail_out,T.total_in+=N,T.total_out+=J,b.total+=J,b.wrap&&J&&(T.adler=b.check=b.flags?a(b.check,K,J,T.next_out-J):s(b.check,K,J,T.next_out-J)),T.data_type=b.bits+(b.last?64:0)+(b.mode===12?128:0)+(b.mode===20||b.mode===15?256:0),(N==0&&J===0||M===4)&&Y===p&&(Y=-5),Y)},o.inflateEnd=function(T){if(!T||!T.state)return d;var M=T.state;return M.window&&(M.window=null),T.state=null,p},o.inflateGetHeader=function(T,M){var b;return T&&T.state?(2&(b=T.state).wrap)==0?d:((b.head=M).done=!1,p):d},o.inflateSetDictionary=function(T,M){var b,D=M.length;return T&&T.state?(b=T.state).wrap!==0&&b.mode!==11?d:b.mode===11&&s(1,M,D,0)!==b.check?-3:V(T,M,D,D)?(b.mode=31,-4):(b.havedict=1,p):d},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var i=n("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,f,p,d,x,m,y,g){var v,k,S,C,E,I,z,P,L,V=g.bits,T=0,M=0,b=0,D=0,K=0,U=0,W=0,q=0,A=0,B=0,R=null,N=0,J=new i.Buf16(16),Q=new i.Buf16(16),pe=null,X=0;for(T=0;T<=15;T++)J[T]=0;for(M=0;M<d;M++)J[f[p+M]]++;for(K=V,D=15;1<=D&&J[D]===0;D--);if(D<K&&(K=D),D===0)return x[m++]=20971520,x[m++]=20971520,g.bits=1,0;for(b=1;b<D&&J[b]===0;b++);for(K<b&&(K=b),T=q=1;T<=15;T++)if(q<<=1,(q-=J[T])<0)return-1;if(0<q&&(u===0||D!==1))return-1;for(Q[1]=0,T=1;T<15;T++)Q[T+1]=Q[T]+J[T];for(M=0;M<d;M++)f[p+M]!==0&&(y[Q[f[p+M]]++]=M);if(I=u===0?(R=pe=y,19):u===1?(R=s,N-=257,pe=a,X-=257,256):(R=l,pe=c,-1),T=b,E=m,W=M=B=0,S=-1,C=(A=1<<(U=K))-1,u===1&&852<A||u===2&&592<A)return 1;for(;;){for(z=T-W,L=y[M]<I?(P=0,y[M]):y[M]>I?(P=pe[X+y[M]],R[N+y[M]]):(P=96,0),v=1<<T-W,b=k=1<<U;x[E+(B>>W)+(k-=v)]=z<<24|P<<16|L|0,k!==0;);for(v=1<<T-1;B&v;)v>>=1;if(v!==0?(B&=v-1,B+=v):B=0,M++,--J[T]==0){if(T===D)break;T=f[p+y[M]]}if(K<T&&(B&C)!==S){for(W===0&&(W=K),E+=b,q=1<<(U=T-W);U+W<D&&!((q-=J[U+W])<=0);)U++,q<<=1;if(A+=1<<U,u===1&&852<A||u===2&&592<A)return 1;x[S=B&C]=K<<24|U<<16|E-m|0}}return B!==0&&(x[E+B]=T-W<<24|64<<16|0),g.bits=K,0}},{"../utils/common":41}],51:[function(n,r,o){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,o){var i=n("../utils/common"),s=0,a=1;function l(j){for(var F=j.length;0<=--F;)j[F]=0}var c=0,u=29,f=256,p=f+1+u,d=30,x=19,m=2*p+1,y=15,g=16,v=7,k=256,S=16,C=17,E=18,I=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],V=new Array(2*(p+2));l(V);var T=new Array(2*d);l(T);var M=new Array(512);l(M);var b=new Array(256);l(b);var D=new Array(u);l(D);var K,U,W,q=new Array(d);function A(j,F,ee,ne,Z){this.static_tree=j,this.extra_bits=F,this.extra_base=ee,this.elems=ne,this.max_length=Z,this.has_stree=j&&j.length}function B(j,F){this.dyn_tree=j,this.max_code=0,this.stat_desc=F}function R(j){return j<256?M[j]:M[256+(j>>>7)]}function N(j,F){j.pending_buf[j.pending++]=255&F,j.pending_buf[j.pending++]=F>>>8&255}function J(j,F,ee){j.bi_valid>g-ee?(j.bi_buf|=F<<j.bi_valid&65535,N(j,j.bi_buf),j.bi_buf=F>>g-j.bi_valid,j.bi_valid+=ee-g):(j.bi_buf|=F<<j.bi_valid&65535,j.bi_valid+=ee)}function Q(j,F,ee){J(j,ee[2*F],ee[2*F+1])}function pe(j,F){for(var ee=0;ee|=1&j,j>>>=1,ee<<=1,0<--F;);return ee>>>1}function X(j,F,ee){var ne,Z,ie=new Array(y+1),ce=0;for(ne=1;ne<=y;ne++)ie[ne]=ce=ce+ee[ne-1]<<1;for(Z=0;Z<=F;Z++){var se=j[2*Z+1];se!==0&&(j[2*Z]=pe(ie[se]++,se))}}function ae(j){var F;for(F=0;F<p;F++)j.dyn_ltree[2*F]=0;for(F=0;F<d;F++)j.dyn_dtree[2*F]=0;for(F=0;F<x;F++)j.bl_tree[2*F]=0;j.dyn_ltree[2*k]=1,j.opt_len=j.static_len=0,j.last_lit=j.matches=0}function de(j){8<j.bi_valid?N(j,j.bi_buf):0<j.bi_valid&&(j.pending_buf[j.pending++]=j.bi_buf),j.bi_buf=0,j.bi_valid=0}function me(j,F,ee,ne){var Z=2*F,ie=2*ee;return j[Z]<j[ie]||j[Z]===j[ie]&&ne[F]<=ne[ee]}function xe(j,F,ee){for(var ne=j.heap[ee],Z=ee<<1;Z<=j.heap_len&&(Z<j.heap_len&&me(F,j.heap[Z+1],j.heap[Z],j.depth)&&Z++,!me(F,ne,j.heap[Z],j.depth));)j.heap[ee]=j.heap[Z],ee=Z,Z<<=1;j.heap[ee]=ne}function Ee(j,F,ee){var ne,Z,ie,ce,se=0;if(j.last_lit!==0)for(;ne=j.pending_buf[j.d_buf+2*se]<<8|j.pending_buf[j.d_buf+2*se+1],Z=j.pending_buf[j.l_buf+se],se++,ne===0?Q(j,Z,F):(Q(j,(ie=b[Z])+f+1,F),(ce=I[ie])!==0&&J(j,Z-=D[ie],ce),Q(j,ie=R(--ne),ee),(ce=z[ie])!==0&&J(j,ne-=q[ie],ce)),se<j.last_lit;);Q(j,k,F)}function Pe(j,F){var ee,ne,Z,ie=F.dyn_tree,ce=F.stat_desc.static_tree,se=F.stat_desc.has_stree,$=F.stat_desc.elems,te=-1;for(j.heap_len=0,j.heap_max=m,ee=0;ee<$;ee++)ie[2*ee]!==0?(j.heap[++j.heap_len]=te=ee,j.depth[ee]=0):ie[2*ee+1]=0;for(;j.heap_len<2;)ie[2*(Z=j.heap[++j.heap_len]=te<2?++te:0)]=1,j.depth[Z]=0,j.opt_len--,se&&(j.static_len-=ce[2*Z+1]);for(F.max_code=te,ee=j.heap_len>>1;1<=ee;ee--)xe(j,ie,ee);for(Z=$;ee=j.heap[1],j.heap[1]=j.heap[j.heap_len--],xe(j,ie,1),ne=j.heap[1],j.heap[--j.heap_max]=ee,j.heap[--j.heap_max]=ne,ie[2*Z]=ie[2*ee]+ie[2*ne],j.depth[Z]=(j.depth[ee]>=j.depth[ne]?j.depth[ee]:j.depth[ne])+1,ie[2*ee+1]=ie[2*ne+1]=Z,j.heap[1]=Z++,xe(j,ie,1),2<=j.heap_len;);j.heap[--j.heap_max]=j.heap[1],(function(le,ve){var Ae,Ze,it,je,_t,Pt,$e=ve.dyn_tree,Rt=ve.max_code,gt=ve.stat_desc.static_tree,uh=ve.stat_desc.has_stree,dh=ve.stat_desc.extra_bits,Ms=ve.stat_desc.extra_base,Wn=ve.stat_desc.max_length,xr=0;for(je=0;je<=y;je++)le.bl_count[je]=0;for($e[2*le.heap[le.heap_max]+1]=0,Ae=le.heap_max+1;Ae<m;Ae++)Wn<(je=$e[2*$e[2*(Ze=le.heap[Ae])+1]+1]+1)&&(je=Wn,xr++),$e[2*Ze+1]=je,Rt<Ze||(le.bl_count[je]++,_t=0,Ms<=Ze&&(_t=dh[Ze-Ms]),Pt=$e[2*Ze],le.opt_len+=Pt*(je+_t),uh&&(le.static_len+=Pt*(gt[2*Ze+1]+_t)));if(xr!==0){do{for(je=Wn-1;le.bl_count[je]===0;)je--;le.bl_count[je]--,le.bl_count[je+1]+=2,le.bl_count[Wn]--,xr-=2}while(0<xr);for(je=Wn;je!==0;je--)for(Ze=le.bl_count[je];Ze!==0;)Rt<(it=le.heap[--Ae])||($e[2*it+1]!==je&&(le.opt_len+=(je-$e[2*it+1])*$e[2*it],$e[2*it+1]=je),Ze--)}})(j,F),X(ie,te,j.bl_count)}function w(j,F,ee){var ne,Z,ie=-1,ce=F[1],se=0,$=7,te=4;for(ce===0&&($=138,te=3),F[2*(ee+1)+1]=65535,ne=0;ne<=ee;ne++)Z=ce,ce=F[2*(ne+1)+1],++se<$&&Z===ce||(se<te?j.bl_tree[2*Z]+=se:Z!==0?(Z!==ie&&j.bl_tree[2*Z]++,j.bl_tree[2*S]++):se<=10?j.bl_tree[2*C]++:j.bl_tree[2*E]++,ie=Z,te=(se=0)===ce?($=138,3):Z===ce?($=6,3):($=7,4))}function Y(j,F,ee){var ne,Z,ie=-1,ce=F[1],se=0,$=7,te=4;for(ce===0&&($=138,te=3),ne=0;ne<=ee;ne++)if(Z=ce,ce=F[2*(ne+1)+1],!(++se<$&&Z===ce)){if(se<te)for(;Q(j,Z,j.bl_tree),--se!=0;);else Z!==0?(Z!==ie&&(Q(j,Z,j.bl_tree),se--),Q(j,S,j.bl_tree),J(j,se-3,2)):se<=10?(Q(j,C,j.bl_tree),J(j,se-3,3)):(Q(j,E,j.bl_tree),J(j,se-11,7));ie=Z,te=(se=0)===ce?($=138,3):Z===ce?($=6,3):($=7,4)}}l(q);var H=!1;function O(j,F,ee,ne){J(j,(c<<1)+(ne?1:0),3),(function(Z,ie,ce,se){de(Z),N(Z,ce),N(Z,~ce),i.arraySet(Z.pending_buf,Z.window,ie,ce,Z.pending),Z.pending+=ce})(j,F,ee)}o._tr_init=function(j){H||((function(){var F,ee,ne,Z,ie,ce=new Array(y+1);for(Z=ne=0;Z<u-1;Z++)for(D[Z]=ne,F=0;F<1<<I[Z];F++)b[ne++]=Z;for(b[ne-1]=Z,Z=ie=0;Z<16;Z++)for(q[Z]=ie,F=0;F<1<<z[Z];F++)M[ie++]=Z;for(ie>>=7;Z<d;Z++)for(q[Z]=ie<<7,F=0;F<1<<z[Z]-7;F++)M[256+ie++]=Z;for(ee=0;ee<=y;ee++)ce[ee]=0;for(F=0;F<=143;)V[2*F+1]=8,F++,ce[8]++;for(;F<=255;)V[2*F+1]=9,F++,ce[9]++;for(;F<=279;)V[2*F+1]=7,F++,ce[7]++;for(;F<=287;)V[2*F+1]=8,F++,ce[8]++;for(X(V,p+1,ce),F=0;F<d;F++)T[2*F+1]=5,T[2*F]=pe(F,5);K=new A(V,I,f+1,p,y),U=new A(T,z,0,d,y),W=new A(new Array(0),P,0,x,v)})(),H=!0),j.l_desc=new B(j.dyn_ltree,K),j.d_desc=new B(j.dyn_dtree,U),j.bl_desc=new B(j.bl_tree,W),j.bi_buf=0,j.bi_valid=0,ae(j)},o._tr_stored_block=O,o._tr_flush_block=function(j,F,ee,ne){var Z,ie,ce=0;0<j.level?(j.strm.data_type===2&&(j.strm.data_type=(function(se){var $,te=4093624447;for($=0;$<=31;$++,te>>>=1)if(1&te&&se.dyn_ltree[2*$]!==0)return s;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for($=32;$<f;$++)if(se.dyn_ltree[2*$]!==0)return a;return s})(j)),Pe(j,j.l_desc),Pe(j,j.d_desc),ce=(function(se){var $;for(w(se,se.dyn_ltree,se.l_desc.max_code),w(se,se.dyn_dtree,se.d_desc.max_code),Pe(se,se.bl_desc),$=x-1;3<=$&&se.bl_tree[2*L[$]+1]===0;$--);return se.opt_len+=3*($+1)+5+5+4,$})(j),Z=j.opt_len+3+7>>>3,(ie=j.static_len+3+7>>>3)<=Z&&(Z=ie)):Z=ie=ee+5,ee+4<=Z&&F!==-1?O(j,F,ee,ne):j.strategy===4||ie===Z?(J(j,2+(ne?1:0),3),Ee(j,V,T)):(J(j,4+(ne?1:0),3),(function(se,$,te,le){var ve;for(J(se,$-257,5),J(se,te-1,5),J(se,le-4,4),ve=0;ve<le;ve++)J(se,se.bl_tree[2*L[ve]+1],3);Y(se,se.dyn_ltree,$-1),Y(se,se.dyn_dtree,te-1)})(j,j.l_desc.max_code+1,j.d_desc.max_code+1,ce+1),Ee(j,j.dyn_ltree,j.dyn_dtree)),ae(j),ne&&de(j)},o._tr_tally=function(j,F,ee){return j.pending_buf[j.d_buf+2*j.last_lit]=F>>>8&255,j.pending_buf[j.d_buf+2*j.last_lit+1]=255&F,j.pending_buf[j.l_buf+j.last_lit]=255&ee,j.last_lit++,F===0?j.dyn_ltree[2*ee]++:(j.matches++,F--,j.dyn_ltree[2*(b[ee]+f+1)]++,j.dyn_dtree[2*R(F)]++),j.last_lit===j.lit_bufsize-1},o._tr_align=function(j){J(j,2,3),Q(j,k,V),(function(F){F.bi_valid===16?(N(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)})(j)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,u,f,p=1,d={},x=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){v(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,C=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=C,S}})()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(f+S,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(S){v(S.data)},function(S){u.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){v(S),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(S){setTimeout(v,0,S)},y.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),E=0;E<C.length;E++)C[E]=arguments[E+1];var I={callback:S,args:C};return d[p]=I,l(p),p++},y.clearImmediate=g}function g(S){delete d[S]}function v(S){if(x)setTimeout(v,0,S);else{var C=d[S];if(C){x=!0;try{(function(E){var I=E.callback,z=E.args;switch(z.length){case 0:I();break;case 1:I(z[0]);break;case 2:I(z[0],z[1]);break;case 3:I(z[0],z[1],z[2]);break;default:I.apply(a,z)}})(C)}finally{g(S),x=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(f)===0&&v(+S.data.slice(f.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof yr<"u"?yr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Oo)),Oo.exports}var wv=bv();const _v=Di(wv);async function kv(e){try{const t=await fetch(`/api/logs/${e}/chunks`);if(!t.ok)return null;const n=await t.json();return JSON.stringify(n,null,2)}catch{return null}}async function Sv(e){const t=new _v;for(const s of e)s.rawRequestBody!==null&&t.file(`#${s.id}.Request.json`,s.rawRequestBody),s.responseText!==null&&t.file(`#${s.id}.Response.json`,s.responseText);const n=e.filter(s=>s.streaming);await Promise.allSettled(n.map(async s=>{const a=await kv(s.id);a!==null&&t.file(`#${s.id}.SSE.Response.json`,a)}));const r=await t.generateAsync({type:"blob"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=`llm-inspector-export-${new Date().toISOString().slice(0,10)}.zip`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}const Cv="1.8.0",Ev={version:Cv};function Lc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Lc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Lc(e))&&(r&&(r+=" "),r+=t);return r}const Tv=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Nv=(e,t)=>({classGroupId:e,validator:t}),$c=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wr="-",pa=[],Av="arbitrary..",zv=e=>{const t=Iv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return jv(s);const a=s.split(Wr),l=a[0]===""&&a.length>1?1:0;return Bc(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],c=n[s];return l?c?Tv(c,l):l:c||pa}return n[s]||pa}}},Bc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const c=Bc(e,t+1,i);if(c)return c}const s=n.validators;if(s===null)return;const a=t===0?e.join(Wr):e.slice(t).join(Wr),l=s.length;for(let c=0;c<l;c++){const u=s[c];if(u.validator(a))return u.classGroupId}},jv=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Av+r:void 0})(),Iv=e=>{const{theme:t,classGroups:n}=e;return Ov(n,t)},Ov=(e,t)=>{const n=$c();for(const r in e){const o=e[r];qi(o,n,r,t)}return n},qi=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Pv(s,t,n,r)}},Pv=(e,t,n,r)=>{if(typeof e=="string"){Rv(e,t,n);return}if(typeof e=="function"){Dv(e,t,n,r);return}Mv(e,t,n,r)},Rv=(e,t,n)=>{const r=e===""?t:Uc(t,e);r.classGroupId=n},Dv=(e,t,n,r)=>{if(Lv(e)){qi(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Nv(n,e))},Mv=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];qi(l,Uc(t,a),n,r)}},Uc=(e,t)=>{let n=e;const r=t.split(Wr),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=$c(),n.nextPart.set(s,a)),n=a}return n},Lv=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Fv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},di="!",ma=":",$v=[],ga=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Bv=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,c;const u=o.length;for(let m=0;m<u;m++){const y=o[m];if(s===0&&a===0){if(y===ma){i.push(o.slice(l,m)),l=m+1;continue}if(y==="/"){c=m;continue}}y==="["?s++:y==="]"?s--:y==="("?a++:y===")"&&a--}const f=i.length===0?o:o.slice(l);let p=f,d=!1;f.endsWith(di)?(p=f.slice(0,-1),d=!0):f.startsWith(di)&&(p=f.slice(1),d=!0);const x=c&&c>l?c-l:void 0;return ga(i,d,p,x)};if(t){const o=t+ma,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):ga($v,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Uv=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},Zv=e=>({cache:Fv(e.cacheSize),parseClassName:Bv(e),sortModifiers:Uv(e),...zv(e)}),Vv=/\s+/,Wv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Vv);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:f,modifiers:p,hasImportantModifier:d,baseClassName:x,maybePostfixModifierPosition:m}=n(u);if(f){l=u+(l.length>0?" "+l:l);continue}let y=!!m,g=r(y?x.substring(0,m):x);if(!g){if(!y){l=u+(l.length>0?" "+l:l);continue}if(g=r(x),!g){l=u+(l.length>0?" "+l:l);continue}y=!1}const v=p.length===0?"":p.length===1?p[0]:i(p).join(":"),k=d?v+di:v,S=k+g;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(g,y);for(let E=0;E<C.length;++E){const I=C[E];s.push(k+I)}l=u+(l.length>0?" "+l:l)}return l},Hv=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Zc(n))&&(o&&(o+=" "),o+=r);return o},Zc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zc(e[r]))&&(n&&(n+=" "),n+=t);return n},qv=(e,...t)=>{let n,r,o,i;const s=l=>{const c=t.reduce((u,f)=>f(u),e());return n=Zv(c),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=Wv(l,n);return o(l,u),u};return i=s,(...l)=>i(Hv(...l))},Kv=[],He=e=>{const t=n=>n[e]||Kv;return t.isThemeGetter=!0,t},Vc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Wc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gv=/^\d+\/\d+$/,Jv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hn=e=>Gv.test(e),Ce=e=>!!e&&!Number.isNaN(Number(e)),$t=e=>!!e&&Number.isInteger(Number(e)),Po=e=>e.endsWith("%")&&Ce(e.slice(0,-1)),Dt=e=>Jv.test(e),tb=()=>!0,nb=e=>Yv.test(e)&&!Xv.test(e),Hc=()=>!1,rb=e=>Qv.test(e),ob=e=>eb.test(e),ib=e=>!fe(e)&&!he(e),sb=e=>Ln(e,Gc,Hc),fe=e=>Vc.test(e),en=e=>Ln(e,Jc,nb),Ro=e=>Ln(e,db,Ce),xa=e=>Ln(e,qc,Hc),ab=e=>Ln(e,Kc,ob),kr=e=>Ln(e,Yc,rb),he=e=>Wc.test(e),qn=e=>Fn(e,Jc),lb=e=>Fn(e,fb),ya=e=>Fn(e,qc),cb=e=>Fn(e,Gc),ub=e=>Fn(e,Kc),Sr=e=>Fn(e,Yc,!0),Ln=(e,t,n)=>{const r=Vc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Fn=(e,t,n=!1)=>{const r=Wc.exec(e);return r?r[1]?t(r[1]):n:!1},qc=e=>e==="position"||e==="percentage",Kc=e=>e==="image"||e==="url",Gc=e=>e==="length"||e==="size"||e==="bg-size",Jc=e=>e==="length",db=e=>e==="number",fb=e=>e==="family-name",Yc=e=>e==="shadow",hb=()=>{const e=He("color"),t=He("font"),n=He("text"),r=He("font-weight"),o=He("tracking"),i=He("leading"),s=He("breakpoint"),a=He("container"),l=He("spacing"),c=He("radius"),u=He("shadow"),f=He("inset-shadow"),p=He("text-shadow"),d=He("drop-shadow"),x=He("blur"),m=He("perspective"),y=He("aspect"),g=He("ease"),v=He("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),he,fe],E=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],z=()=>[he,fe,l],P=()=>[hn,"full","auto",...z()],L=()=>[$t,"none","subgrid",he,fe],V=()=>["auto",{span:["full",$t,he,fe]},$t,he,fe],T=()=>[$t,"auto",he,fe],M=()=>["auto","min","max","fr",he,fe],b=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...z()],U=()=>[hn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],W=()=>[e,he,fe],q=()=>[...S(),ya,xa,{position:[he,fe]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",cb,sb,{size:[he,fe]}],R=()=>[Po,qn,en],N=()=>["","none","full",c,he,fe],J=()=>["",Ce,qn,en],Q=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Ce,Po,ya,xa],ae=()=>["","none",x,he,fe],de=()=>["none",Ce,he,fe],me=()=>["none",Ce,he,fe],xe=()=>[Ce,he,fe],Ee=()=>[hn,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dt],breakpoint:[Dt],color:[tb],container:[Dt],"drop-shadow":[Dt],ease:["in","out","in-out"],font:[ib],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dt],shadow:[Dt],spacing:["px",Ce],text:[Dt],"text-shadow":[Dt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",hn,fe,he,y]}],container:["container"],columns:[{columns:[Ce,fe,he,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[$t,"auto",he,fe]}],basis:[{basis:[hn,"full","auto",a,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,hn,"auto","initial","none",fe]}],grow:[{grow:["",Ce,he,fe]}],shrink:[{shrink:["",Ce,he,fe]}],order:[{order:[$t,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...b(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...b()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":b()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[a,"screen",...U()]}],"min-w":[{"min-w":[a,"screen","none",...U()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",n,qn,en]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,he,Ro]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Po,fe]}],"font-family":[{font:[lb,fe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,he,fe]}],"line-clamp":[{"line-clamp":[Ce,"none",he,Ro]}],leading:[{leading:[i,...z()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",he,en]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Ce,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$t,he,fe],radial:["",he,fe],conic:[$t,he,fe]},ub,ab]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,he,fe]}],"outline-w":[{outline:["",Ce,qn,en]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",u,Sr,kr]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",f,Sr,kr]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Ce,en]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",p,Sr,kr]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Ce,he,fe]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:ae()}],brightness:[{brightness:[Ce,he,fe]}],contrast:[{contrast:[Ce,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",d,Sr,kr]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Ce,he,fe]}],"hue-rotate":[{"hue-rotate":[Ce,he,fe]}],invert:[{invert:["",Ce,he,fe]}],saturate:[{saturate:[Ce,he,fe]}],sepia:[{sepia:["",Ce,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",Ce,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",he,fe]}],ease:[{ease:["linear","initial",g,he,fe]}],delay:[{delay:[Ce,he,fe]}],animate:[{animate:["none",v,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,he,fe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,fe]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Ce,qn,en,Ro]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},pb=qv(hb);function ze(...e){return pb(Fc(e))}function Ke(e){return e>=1048576?(e/1048576).toFixed(1).replace(/\.0$/,"")+"M":e>=1024?(e/1024).toFixed(1).replace(/\.0$/,"")+"K":e.toString()}function Xc(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}function va(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function mb({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:i,expanded:s,onToggle:a}){return h.jsxs("div",{role:"button",tabIndex:0,className:ze("flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none","border border-border rounded-lg mb-2 bg-muted/30"),onClick:a,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())},children:[s?h.jsx(At,{className:"size-4 text-muted-foreground shrink-0"}):h.jsx(Wt,{className:"size-4 text-muted-foreground shrink-0"}),h.jsx("span",{className:"text-purple-400/90 font-mono text-xs font-semibold shrink-0",title:e,children:e.length>24?e.slice(0,12)+"…"+e.slice(-12):e}),h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(Hi,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[va(t)," - ",va(n)]})]}),h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(Rc,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),h.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[h.jsx(dr,{className:"size-3 text-muted-foreground"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[h.jsx("span",{className:"text-blue-400",children:Ke(o)})," / ",h.jsx("span",{className:"text-amber-400",children:Ke(i)})]})]}),h.jsx("span",{className:"flex-1 min-w-0"})]})}function gb(e){if(e.sessionId!==null&&e.sessionId!=="")return e.sessionId;const t=e.clientPid!==null?`PID:${e.clientPid}`:"unknown",n=e.clientProjectFolder!==null?e.clientProjectFolder:"no-folder";return`${t}|${n}`}function xb(e){const t=new Map;for(const r of e){const o=gb(r),i=t.get(o);i!==void 0?i.push(r):t.set(o,[r])}const n=[];for(const[r,o]of t){const i=[...o].sort((s,a)=>s.timestamp.localeCompare(a.timestamp));n.push({id:r,conversationId:r,logs:i})}return n.sort((r,o)=>(r.logs[0]?.timestamp??"").localeCompare(o.logs[0]?.timestamp??"")),n}const ba=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wa=Fc,Ki=(e,t)=>n=>{var r;if(t?.variants==null)return wa(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],f=i?.[c];if(u===null)return null;const p=ba(u)||ba(f);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:p,...d}=u;return Object.entries(d).every(x=>{let[m,y]=x;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...c,f,p]:c},[]);return wa(e,s,l,n?.class,n?.className)},yb=Ki("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ft({className:e,variant:t,size:n,...r}){return h.jsx("button",{"data-slot":"button",className:ze(yb({variant:t,size:n,className:e})),...r})}function vb(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const bb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_b={};function _a(e,t){return(_b.jsx?wb:bb).test(e)}const kb=/[ \t\n\f\r]/g;function Sb(e){return typeof e=="object"?e.type==="text"?ka(e.value):!1:ka(e)}function ka(e){return e.replace(kb,"")===""}class fr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}fr.prototype.normal={};fr.prototype.property={};fr.prototype.space=void 0;function Qc(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new fr(n,r,t)}function fi(e){return e.toLowerCase()}class ot{constructor(t,n){this.attribute=n,this.property=t}}ot.prototype.attribute="";ot.prototype.booleanish=!1;ot.prototype.boolean=!1;ot.prototype.commaOrSpaceSeparated=!1;ot.prototype.commaSeparated=!1;ot.prototype.defined=!1;ot.prototype.mustUseProperty=!1;ot.prototype.number=!1;ot.prototype.overloadedBoolean=!1;ot.prototype.property="";ot.prototype.spaceSeparated=!1;ot.prototype.space=void 0;let Cb=0;const Se=un(),We=un(),hi=un(),oe=un(),Re=un(),Sn=un(),st=un();function un(){return 2**++Cb}const pi=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:We,commaOrSpaceSeparated:st,commaSeparated:Sn,number:oe,overloadedBoolean:hi,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),Do=Object.keys(pi);class Gi extends ot{constructor(t,n,r,o){let i=-1;if(super(t,n),Sa(this,"space",o),typeof r=="number")for(;++i<Do.length;){const s=Do[i];Sa(this,Do[i],(r&pi[s])===pi[s])}}}Gi.prototype.defined=!0;function Sa(e,t,n){n&&(e[t]=n)}function $n(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Gi(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[fi(r)]=r,n[fi(i.attribute)]=r}return new fr(t,n,e.space)}const eu=$n({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:Re,ariaCurrent:null,ariaDescribedBy:Re,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Re,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Re,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Re,ariaLevel:oe,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Re,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Re,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:We,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tu(e,t){return t in e?e[t]:t}function nu(e,t){return tu(e,t.toLowerCase())}const Eb=$n({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Sn,acceptCharset:Re,accessKey:Re,action:null,allow:null,allowFullScreen:Se,allowPaymentRequest:Se,allowUserMedia:Se,alt:null,as:null,async:Se,autoCapitalize:null,autoComplete:Re,autoFocus:Se,autoPlay:Se,blocking:Re,capture:null,charSet:null,checked:Se,cite:null,className:Re,cols:oe,colSpan:null,content:null,contentEditable:We,controls:Se,controlsList:Re,coords:oe|Sn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Se,defer:Se,dir:null,dirName:null,disabled:Se,download:hi,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Se,formTarget:null,headers:Re,height:oe,hidden:hi,high:oe,href:null,hrefLang:null,htmlFor:Re,httpEquiv:Re,id:null,imageSizes:null,imageSrcSet:null,inert:Se,inputMode:null,integrity:null,is:null,isMap:Se,itemId:null,itemProp:Re,itemRef:Re,itemScope:Se,itemType:Re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Se,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:Se,muted:Se,name:null,nonce:null,noModule:Se,noValidate:Se,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Se,optimum:oe,pattern:null,ping:Re,placeholder:null,playsInline:Se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Se,referrerPolicy:null,rel:Re,required:Se,reversed:Se,rows:oe,rowSpan:oe,sandbox:Re,scope:null,scoped:Se,seamless:Se,selected:Se,shadowRootClonable:Se,shadowRootDelegatesFocus:Se,shadowRootMode:null,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:Se,useMap:null,value:We,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Re,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Se,declare:Se,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:Se,noHref:Se,noShade:Se,noWrap:Se,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Se,disableRemotePlayback:Se,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:nu}),Tb=$n({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:st,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:Re,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:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:Se,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,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:Sn,g2:Sn,glyphName:Sn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:st,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,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:oe,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:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:st,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:st,rev:st,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:st,requiredFeatures:st,requiredFonts:st,requiredFormats:st,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:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:st,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:st,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:st,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tu}),ru=$n({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ou=$n({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nu}),iu=$n({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Nb={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"},Ab=/[A-Z]/g,Ca=/-[a-z]/g,zb=/^data[-\w.:]+$/i;function jb(e,t){const n=fi(t);let r=t,o=ot;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&zb.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Ca,Ob);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Ca.test(i)){let s=i.replace(Ab,Ib);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Gi}return new o(r,t)}function Ib(e){return"-"+e.toLowerCase()}function Ob(e){return e.charAt(1).toUpperCase()}const Pb=Qc([eu,Eb,ru,ou,iu],"html"),Ji=Qc([eu,Tb,ru,ou,iu],"svg");function Rb(e){return e.join(" ").trim()}var pn={},Mo,Ea;function Db(){if(Ea)return Mo;Ea=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
41
|
-
`,c="/",u="*",f="",p="comment",d="declaration";function x(y,g){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];g=g||{};var v=1,k=1;function S(b){var D=b.match(t);D&&(v+=D.length);var K=b.lastIndexOf(l);k=~K?b.length-K:k+b.length}function C(){var b={line:v,column:k};return function(D){return D.position=new E(b),P(),D}}function E(b){this.start=b,this.end={line:v,column:k},this.source=g.source}E.prototype.content=y;function I(b){var D=new Error(g.source+":"+v+":"+k+": "+b);if(D.reason=b,D.filename=g.source,D.line=v,D.column=k,D.source=y,!g.silent)throw D}function z(b){var D=b.exec(y);if(D){var K=D[0];return S(K),y=y.slice(K.length),D}}function P(){z(n)}function L(b){var D;for(b=b||[];D=V();)D!==!1&&b.push(D);return b}function V(){var b=C();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var D=2;f!=y.charAt(D)&&(u!=y.charAt(D)||c!=y.charAt(D+1));)++D;if(D+=2,f===y.charAt(D-1))return I("End of comment missing");var K=y.slice(2,D-2);return k+=2,S(K),y=y.slice(D),k+=2,b({type:p,comment:K})}}function T(){var b=C(),D=z(r);if(D){if(V(),!z(o))return I("property missing ':'");var K=z(i),U=b({type:d,property:m(D[0].replace(e,f)),value:K?m(K[0].replace(e,f)):f});return z(s),U}}function M(){var b=[];L(b);for(var D;D=T();)D!==!1&&(b.push(D),L(b));return b}return P(),M()}function m(y){return y?y.replace(a,f):f}return Mo=x,Mo}var Ta;function Mb(){if(Ta)return pn;Ta=1;var e=pn&&pn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pn,"__esModule",{value:!0}),pn.default=n;const t=e(Db());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const s=(0,t.default)(r),a=typeof o=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?o(c,u,l):u&&(i=i||{},i[c]=u)}),i}return pn}var Kn={},Na;function Lb(){if(Na)return Kn;Na=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,a):c=c.replace(r,a),c.replace(t,s))};return Kn.camelCase=l,Kn}var Gn,Aa;function Fb(){if(Aa)return Gn;Aa=1;var e=Gn&&Gn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Mb()),n=Lb();function r(o,i){var s={};return!o||typeof o!="string"||(0,t.default)(o,function(a,l){a&&l&&(s[(0,n.camelCase)(a,i)]=l)}),s}return r.default=r,Gn=r,Gn}var $b=Fb();const Bb=Di($b),su=au("end"),Yi=au("start");function au(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 Ub(e){const t=Yi(e),n=su(e);if(t&&n)return{start:t,end:n}}function er(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?za(e.position):"start"in e||"end"in e?za(e):"line"in e||"column"in e?mi(e):""}function mi(e){return ja(e&&e.line)+":"+ja(e&&e.column)}function za(e){return mi(e&&e.start)+"-"+mi(e&&e.end)}function ja(e){return e&&typeof e=="number"?e:1}class Ge extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=er(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;const Xi={}.hasOwnProperty,Zb=new Map,Vb=/[A-Z]/g,Wb=new Set(["table","tbody","thead","tfoot","tr"]),Hb=new Set(["td","th"]),lu="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qb(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=t1(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=e1(n,t.jsx,t.jsxs)}const o={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"?Ji:Pb,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=cu(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function cu(e,t,n){if(t.type==="element")return Kb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Gb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Yb(e,t,n);if(t.type==="mdxjsEsm")return Jb(e,t);if(t.type==="root")return Xb(e,t,n);if(t.type==="text")return Qb(e,t)}function Kb(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Ji,e.schema=o),e.ancestors.push(t);const i=du(e,t.tagName,!1),s=n1(e,t);let a=es(e,t);return Wb.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Sb(l):!0})),uu(e,s,i,t),Qi(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Gb(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)}ir(e,t.position)}function Jb(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ir(e,t.position)}function Yb(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Ji,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:du(e,t.name,!0),s=r1(e,t),a=es(e,t);return uu(e,s,i,t),Qi(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Xb(e,t,n){const r={};return Qi(r,es(e,t)),e.create(t,e.Fragment,r,n)}function Qb(e,t){return t.value}function uu(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function e1(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function t1(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=Yi(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function n1(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Xi.call(t.properties,o)){const i=o1(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Hb.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function r1(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ir(e,t.position);else{const o=r.name;let i;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,i=e.evaluater.evaluateExpression(a.expression)}else ir(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function es(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Zb;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=cu(e,i,s);a!==void 0&&n.push(a)}return n}function o1(e,t,n){const r=jb(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?vb(n):Rb(n)),r.property==="style"){let o=typeof n=="object"?n:i1(e,String(n));return e.stylePropertyNameCase==="css"&&(o=s1(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Nb[r.property]||r.property:r.attribute,n]}}function i1(e,t){try{return Bb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Ge("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=lu+"#cannot-parse-style-attribute",o}}function du(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=_a(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=_a(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Xi.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);ir(e)}function ir(e,t){const n=new Ge("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=lu+"#cannot-handle-mdx-estrees-without-createevaluater",n}function s1(e){const t={};let n;for(n in e)Xi.call(e,n)&&(t[a1(n)]=e[n]);return t}function a1(e){let t=e.replace(Vb,l1);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function l1(e){return"-"+e.toLowerCase()}const Lo={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"]},c1={};function u1(e,t){const n=c1,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return fu(e,r,o)}function fu(e,t,n){if(d1(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 Ia(e.children,t,n)}return Array.isArray(e)?Ia(e,t,n):""}function Ia(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=fu(e[o],t,n);return r.join("")}function d1(e){return!!(e&&typeof e=="object")}const Oa=document.createElement("i");function ts(e){const t="&"+e+";";Oa.innerHTML=t;const n=Oa.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function zt(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o: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);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function ut(e,t){return e.length>0?(zt(e,e.length,0,t),e):t}const Pa={}.hasOwnProperty;function f1(e){const t={};let n=-1;for(;++n<e.length;)h1(t,e[n]);return t}function h1(e,t){let n;for(n in t){const o=(Pa.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Pa.call(o,s)||(o[s]=[]);const a=i[s];p1(o[s],Array.isArray(a)?a:a?[a]:[])}}}function p1(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);zt(e,0,0,r)}function hu(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 Cn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const St=Yt(/[A-Za-z]/),lt=Yt(/[\dA-Za-z]/),m1=Yt(/[#-'*+\--9=?A-Z^-~]/);function gi(e){return e!==null&&(e<32||e===127)}const xi=Yt(/\d/),g1=Yt(/[\dA-Fa-f]/),x1=Yt(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function nt(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const y1=Yt(new RegExp("\\p{P}|\\p{S}","u")),v1=Yt(/\s/);function Yt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Bn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&<(e.charCodeAt(n+1))&<(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function De(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Ie(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ie(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const b1={tokenize:w1};function w1(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),De(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,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"),i):(e.consume(a),s)}}const _1={tokenize:k1},Ra={tokenize:S1};function k1(e){const t=this,n=[];let r=0,o,i,s;return a;function a(k){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(k)}return c(k)}function l(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&v();const S=t.events.length;let C=S,E;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){E=t.events[C][1].end;break}g(r);let I=S;for(;I<t.events.length;)t.events[I][1].end={...E},I++;return zt(t.events,C+1,0,t.events.slice(S)),t.events.length=I,c(k)}return a(k)}function c(k){if(r===n.length){if(!o)return p(k);if(o.currentConstruct&&o.currentConstruct.concrete)return x(k);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ra,u,f)(k)}function u(k){return o&&v(),g(r),p(k)}function f(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(k)}function p(k){return t.containerState={},e.attempt(Ra,d,x)(k)}function d(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function x(k){if(k===null){o&&v(),g(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(k)}function m(k){if(k===null){y(e.exit("chunkFlow"),!0),g(0),e.consume(k);return}return we(k)?(e.consume(k),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(k),m)}function y(k,S){const C=t.sliceStream(k);if(S&&C.push(null),k.previous=i,i&&(i.next=k),i=k,o.defineSkip(k.start),o.write(C),t.parser.lazy[k.start.line]){let E=o.events.length;for(;E--;)if(o.events[E][1].start.offset<s&&(!o.events[E][1].end||o.events[E][1].end.offset>s))return;const I=t.events.length;let z=I,P,L;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(P){L=t.events[z][1].end;break}P=!0}for(g(r),E=I;E<t.events.length;)t.events[E][1].end={...L},E++;zt(t.events,z+1,0,t.events.slice(I)),t.events.length=E}}function g(k){let S=n.length;for(;S-- >k;){const C=n[S];t.containerState=C[1],C[0].exit.call(t,e)}n.length=k}function v(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function S1(e,t,n){return De(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Da(e){if(e===null||nt(e)||v1(e))return 1;if(y1(e))return 2}function ns(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const yi={name:"attention",resolveAll:C1,tokenize:E1};function C1(e,t){let n=-1,r,o,i,s,a,l,c,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;l=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 f={...e[r][1].end},p={...e[n][1].start};Ma(f,-l),Ma(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ut(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ut(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=ut(c,ns(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ut(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=ut(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,zt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function E1(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Da(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Da(l),f=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(o||!p)),c._close=!!(i===42?p:p&&(u||!f)),t(l)}}function Ma(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const T1={name:"autolink",tokenize:N1};function N1(e,t,n){let r=0;return o;function o(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(d){return St(d)?(e.consume(d),s):d===64?n(d):c(d)}function s(d){return d===43||d===45||d===46||lt(d)?(r=1,a(d)):c(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||lt(d))&&r++<32?(e.consume(d),a):(r=0,c(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||gi(d)?n(d):(e.consume(d),l)}function c(d){return d===64?(e.consume(d),u):m1(d)?(e.consume(d),c):n(d)}function u(d){return lt(d)?f(d):n(d)}function f(d){return d===46?(e.consume(d),r=0,u):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):p(d)}function p(d){if((d===45||lt(d))&&r++<63){const x=d===45?p:f;return e.consume(d),x}return n(d)}}const lo={partial:!0,tokenize:A1};function A1(e,t,n){return r;function r(i){return Ie(i)?De(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||we(i)?t(i):n(i)}}const pu={continuation:{tokenize:j1},exit:I1,name:"blockQuote",tokenize:z1};function z1(e,t,n){const r=this;return o;function o(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"),i}return n(s)}function i(s){return Ie(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function j1(e,t,n){const r=this;return o;function o(s){return Ie(s)?De(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(pu,t,n)(s)}}function I1(e){e.exit("blockQuote")}const mu={name:"characterEscape",tokenize:O1};function O1(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return x1(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const gu={name:"characterReference",tokenize:P1};function P1(e,t,n){const r=this;let o=0,i,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=lt,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=g1,u):(e.enter("characterReferenceValue"),i=7,s=xi,u(f))}function u(f){if(f===59&&o){const p=e.exit("characterReferenceValue");return s===lt&&!ts(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&o++<i?(e.consume(f),u):n(f)}}const La={partial:!0,tokenize:D1},Fa={concrete:!0,name:"codeFenced",tokenize:R1};function R1(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,s=0,a;return l;function l(E){return c(E)}function c(E){const I=r.events[r.events.length-1];return i=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===a?(s++,e.consume(E),u):s<3?n(E):(e.exit("codeFencedFenceSequence"),Ie(E)?De(e,f,"whitespace")(E):f(E))}function f(E){return E===null||we(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(La,m,S)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||we(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(E)):Ie(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),De(e,d,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),p)}function d(E){return E===null||we(E)?f(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===null||we(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(E)):E===96&&E===a?n(E):(e.consume(E),x)}function m(E){return e.attempt(o,S,y)(E)}function y(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),g}function g(E){return i>0&&Ie(E)?De(e,v,"linePrefix",i+1)(E):v(E)}function v(E){return E===null||we(E)?e.check(La,m,S)(E):(e.enter("codeFlowValue"),k(E))}function k(E){return E===null||we(E)?(e.exit("codeFlowValue"),v(E)):(e.consume(E),k)}function S(E){return e.exit("codeFenced"),t(E)}function C(E,I,z){let P=0;return L;function L(D){return E.enter("lineEnding"),E.consume(D),E.exit("lineEnding"),V}function V(D){return E.enter("codeFencedFence"),Ie(D)?De(E,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):T(D)}function T(D){return D===a?(E.enter("codeFencedFenceSequence"),M(D)):z(D)}function M(D){return D===a?(P++,E.consume(D),M):P>=s?(E.exit("codeFencedFenceSequence"),Ie(D)?De(E,b,"whitespace")(D):b(D)):z(D)}function b(D){return D===null||we(D)?(E.exit("codeFencedFence"),I(D)):z(D)}}}function D1(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Fo={name:"codeIndented",tokenize:L1},M1={partial:!0,tokenize:F1};function L1(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),De(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):we(c)?e.attempt(M1,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||we(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function F1(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):De(e,i,"linePrefix",5)(s)}function i(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)?o(s):n(s)}}const $1={name:"codeText",previous:U1,resolve:B1,tokenize:Z1};function B1(e){let t=e.length-4,n=3,r,o;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;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function U1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Z1(e,t,n){let r=0,o,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),o=0,u(f)):we(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||we(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}class V1{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Jn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Jn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Jn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Jn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Jn(this.left,n.reverse())}}}function Jn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function xu(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new V1(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,W1(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return zt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function W1(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,f,p=-1,d=n,x=0,m=0;const y=[m];for(;d;){for(;e.get(++o)[1]!==d;);i.push(o),d._tokenizer||(u=r.sliceStream(d),d.next||u.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=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),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),p=y.length;p--;){const g=a.slice(y[p],y[p+1]),v=i.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),p=-1;++p<l.length;)c[x+l[p][0]]=x+l[p][1],x+=l[p][1]-l[p][0]-1;return c}const H1={resolve:K1,tokenize:G1},q1={partial:!0,tokenize:J1};function K1(e){return xu(e),e}function G1(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):we(a)?e.check(q1,s,i)(a):(e.consume(a),o)}function i(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,o}}function J1(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),De(e,i,"linePrefix")}function i(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 yu(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(g){return g===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(g),e.exit(i),p):g===null||g===32||g===41||gi(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(i),e.consume(g),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(g))}function d(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?x:d)}function x(g){return g===60||g===62||g===92?(e.consume(g),d):d(g)}function m(g){return!u&&(g===null||g===41||nt(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,m):g===41?(e.consume(g),u--,m):g===null||g===32||g===40||gi(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 vu(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(d){return e.enter(r),e.enter(o),e.consume(d),e.exit(o),e.enter(i),u}function u(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):we(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||we(d)||a++>999?(e.exit("chunkString"),u(d)):(e.consume(d),l||(l=!Ie(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function bu(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):we(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),De(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||we(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:u)}function f(p){return p===s||p===92?(e.consume(p),u):u(p)}}function tr(e,t){let n;return r;function r(o){return we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Ie(o)?De(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Y1={name:"definition",tokenize:Q1},X1={partial:!0,tokenize:ew};function Q1(e,t,n){const r=this;let o;return i;function i(d){return e.enter("definition"),s(d)}function s(d){return vu.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return o=Cn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return nt(d)?tr(e,c)(d):c(d)}function c(d){return yu(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return e.attempt(X1,f,f)(d)}function f(d){return Ie(d)?De(e,p,"whitespace")(d):p(d)}function p(d){return d===null||we(d)?(e.exit("definition"),r.parser.defined.push(o),t(d)):n(d)}}function ew(e,t,n){return r;function r(a){return nt(a)?tr(e,o)(a):n(a)}function o(a){return bu(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Ie(a)?De(e,s,"whitespace")(a):s(a)}function s(a){return a===null||we(a)?t(a):n(a)}}const tw={name:"hardBreakEscape",tokenize:nw};function nw(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return we(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const rw={name:"headingAtx",resolve:ow,tokenize:iw};function ow(e,t){let n=e.length-2,r=3,o,i;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&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},zt(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function iw(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||nt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||we(u)?(e.exit("atxHeading"),t(u)):Ie(u)?De(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||nt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const sw=["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"],$a=["pre","script","style","textarea"],aw={concrete:!0,name:"htmlFlow",resolveTo:uw,tokenize:dw},lw={partial:!0,tokenize:hw},cw={partial:!0,tokenize:fw};function uw(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 dw(e,t,n){const r=this;let o,i,s,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),i=!0,m):N===63?(e.consume(N),o=3,r.interrupt?t:A):St(N)?(e.consume(N),s=String.fromCharCode(N),y):n(N)}function p(N){return N===45?(e.consume(N),o=2,d):N===91?(e.consume(N),o=5,a=0,x):St(N)?(e.consume(N),o=4,r.interrupt?t:A):n(N)}function d(N){return N===45?(e.consume(N),r.interrupt?t:A):n(N)}function x(N){const J="CDATA[";return N===J.charCodeAt(a++)?(e.consume(N),a===J.length?r.interrupt?t:T:x):n(N)}function m(N){return St(N)?(e.consume(N),s=String.fromCharCode(N),y):n(N)}function y(N){if(N===null||N===47||N===62||nt(N)){const J=N===47,Q=s.toLowerCase();return!J&&!i&&$a.includes(Q)?(o=1,r.interrupt?t(N):T(N)):sw.includes(s.toLowerCase())?(o=6,J?(e.consume(N),g):r.interrupt?t(N):T(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?v(N):k(N))}return N===45||lt(N)?(e.consume(N),s+=String.fromCharCode(N),y):n(N)}function g(N){return N===62?(e.consume(N),r.interrupt?t:T):n(N)}function v(N){return Ie(N)?(e.consume(N),v):L(N)}function k(N){return N===47?(e.consume(N),L):N===58||N===95||St(N)?(e.consume(N),S):Ie(N)?(e.consume(N),k):L(N)}function S(N){return N===45||N===46||N===58||N===95||lt(N)?(e.consume(N),S):C(N)}function C(N){return N===61?(e.consume(N),E):Ie(N)?(e.consume(N),C):k(N)}function E(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,I):Ie(N)?(e.consume(N),E):z(N)}function I(N){return N===l?(e.consume(N),l=null,P):N===null||we(N)?n(N):(e.consume(N),I)}function z(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||nt(N)?C(N):(e.consume(N),z)}function P(N){return N===47||N===62||Ie(N)?k(N):n(N)}function L(N){return N===62?(e.consume(N),V):n(N)}function V(N){return N===null||we(N)?T(N):Ie(N)?(e.consume(N),V):n(N)}function T(N){return N===45&&o===2?(e.consume(N),K):N===60&&o===1?(e.consume(N),U):N===62&&o===4?(e.consume(N),B):N===63&&o===3?(e.consume(N),A):N===93&&o===5?(e.consume(N),q):we(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(lw,R,M)(N)):N===null||we(N)?(e.exit("htmlFlowData"),M(N)):(e.consume(N),T)}function M(N){return e.check(cw,b,R)(N)}function b(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),D}function D(N){return N===null||we(N)?M(N):(e.enter("htmlFlowData"),T(N))}function K(N){return N===45?(e.consume(N),A):T(N)}function U(N){return N===47?(e.consume(N),s="",W):T(N)}function W(N){if(N===62){const J=s.toLowerCase();return $a.includes(J)?(e.consume(N),B):T(N)}return St(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),W):T(N)}function q(N){return N===93?(e.consume(N),A):T(N)}function A(N){return N===62?(e.consume(N),B):N===45&&o===2?(e.consume(N),A):T(N)}function B(N){return N===null||we(N)?(e.exit("htmlFlowData"),R(N)):(e.consume(N),B)}function R(N){return e.exit("htmlFlow"),t(N)}}function fw(e,t,n){const r=this;return o;function o(s){return we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function hw(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(lo,t,n)}}const pw={name:"htmlText",tokenize:mw};function mw(e,t,n){const r=this;let o,i,s;return a;function a(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),C):A===63?(e.consume(A),k):St(A)?(e.consume(A),z):n(A)}function c(A){return A===45?(e.consume(A),u):A===91?(e.consume(A),i=0,x):St(A)?(e.consume(A),v):n(A)}function u(A){return A===45?(e.consume(A),d):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),p):we(A)?(s=f,U(A)):(e.consume(A),f)}function p(A){return A===45?(e.consume(A),d):f(A)}function d(A){return A===62?K(A):A===45?p(A):f(A)}function x(A){const B="CDATA[";return A===B.charCodeAt(i++)?(e.consume(A),i===B.length?m:x):n(A)}function m(A){return A===null?n(A):A===93?(e.consume(A),y):we(A)?(s=m,U(A)):(e.consume(A),m)}function y(A){return A===93?(e.consume(A),g):m(A)}function g(A){return A===62?K(A):A===93?(e.consume(A),g):m(A)}function v(A){return A===null||A===62?K(A):we(A)?(s=v,U(A)):(e.consume(A),v)}function k(A){return A===null?n(A):A===63?(e.consume(A),S):we(A)?(s=k,U(A)):(e.consume(A),k)}function S(A){return A===62?K(A):k(A)}function C(A){return St(A)?(e.consume(A),E):n(A)}function E(A){return A===45||lt(A)?(e.consume(A),E):I(A)}function I(A){return we(A)?(s=I,U(A)):Ie(A)?(e.consume(A),I):K(A)}function z(A){return A===45||lt(A)?(e.consume(A),z):A===47||A===62||nt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),K):A===58||A===95||St(A)?(e.consume(A),L):we(A)?(s=P,U(A)):Ie(A)?(e.consume(A),P):K(A)}function L(A){return A===45||A===46||A===58||A===95||lt(A)?(e.consume(A),L):V(A)}function V(A){return A===61?(e.consume(A),T):we(A)?(s=V,U(A)):Ie(A)?(e.consume(A),V):P(A)}function T(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),o=A,M):we(A)?(s=T,U(A)):Ie(A)?(e.consume(A),T):(e.consume(A),b)}function M(A){return A===o?(e.consume(A),o=void 0,D):A===null?n(A):we(A)?(s=M,U(A)):(e.consume(A),M)}function b(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||nt(A)?P(A):(e.consume(A),b)}function D(A){return A===47||A===62||nt(A)?P(A):n(A)}function K(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function U(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),W}function W(A){return Ie(A)?De(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):q(A)}function q(A){return e.enter("htmlTextData"),s(A)}}const rs={name:"labelEnd",resolveAll:vw,resolveTo:bw,tokenize:ww},gw={tokenize:_w},xw={tokenize:kw},yw={tokenize:Sw};function vw(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&zt(e,0,e.length,n),e}function bw(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=ut(a,e.slice(i+1,i+r+3)),a=ut(a,[["enter",u,t]]),a=ut(a,ns(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=ut(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=ut(a,e.slice(s+1)),a=ut(a,[["exit",l,t]]),zt(e,i,e.length,a),e}function ww(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(p){return i?i._inactive?f(p):(s=r.parser.defined.includes(Cn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(gw,u,s?u:f)(p):p===91?e.attempt(xw,u,s?c:f)(p):s?u(p):f(p)}function c(p){return e.attempt(yw,u,f)(p)}function u(p){return t(p)}function f(p){return i._balanced=!0,n(p)}}function _w(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return nt(f)?tr(e,i)(f):i(f)}function i(f){return f===41?u(f):yu(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return nt(f)?tr(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?bu(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return nt(f)?tr(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function kw(e,t,n){const r=this;return o;function o(a){return vu.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Cn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Sw(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const Cw={name:"labelStartImage",resolveAll:rs.resolveAll,tokenize:Ew};function Ew(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(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 Tw={name:"labelStartLink",resolveAll:rs.resolveAll,tokenize:Nw};function Nw(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const $o={name:"lineEnding",tokenize:Aw};function Aw(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),De(e,t,"linePrefix")}}const Dr={name:"thematicBreak",tokenize:zw};function zw(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||we(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ie(c)?De(e,a,"whitespace")(c):a(c))}}const et={continuation:{tokenize:Pw},exit:Dw,name:"list",tokenize:Ow},jw={partial:!0,tokenize:Mw},Iw={partial:!0,tokenize:Rw};function Ow(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(d){const x=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:xi(d)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Dr,n,c)(d):c(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return xi(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),c(d)):n(d)}function c(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(lo,r.interrupt?n:u,e.attempt(jw,p,f))}function u(d){return r.containerState.initialBlankLine=!0,i++,p(d)}function f(d){return Ie(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Pw(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(lo,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,De(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Ie(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(Iw,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,De(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Rw(e,t,n){const r=this;return De(e,o,"listItemIndent",r.containerState.size+1);function o(i){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(i):n(i)}}function Dw(e){e.exit(this.containerState.type)}function Mw(e,t,n){const r=this;return De(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Ie(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Ba={name:"setextUnderline",resolveTo:Lw,tokenize:Fw};function Lw(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Fw(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Ie(c)?De(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||we(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const $w={tokenize:Bw};function Bw(e){const t=this,n=e.attempt(lo,r,e.attempt(this.parser.constructs.flowInitial,o,De(e,e.attempt(this.parser.constructs.flow,o,e.attempt(H1,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Uw={resolveAll:_u()},Zw=wu("string"),Vw=wu("text");function wu(e){return{resolveAll:_u(e==="text"?Ww:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=o[u];let p=-1;if(f)for(;++p<f.length;){const d=f[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function _u(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function Ww(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],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Hw={42:et,43:et,45:et,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,62:pu},qw={91:Y1},Kw={[-2]:Fo,[-1]:Fo,32:Fo},Gw={35:rw,42:Dr,45:[Ba,Dr],60:aw,61:Ba,95:Dr,96:Fa,126:Fa},Jw={38:gu,92:mu},Yw={[-5]:$o,[-4]:$o,[-3]:$o,33:Cw,38:gu,42:yi,60:[T1,pw],91:Tw,92:[tw,mu],93:rs,95:yi,96:$1},Xw={null:[yi,Uw]},Qw={null:[42,95]},e2={null:[]},t2=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qw,contentInitial:qw,disable:e2,document:Hw,flow:Gw,flowInitial:Kw,insideSpan:Xw,string:Jw,text:Yw},Symbol.toStringTag,{value:"Module"}));function n2(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:I(C),check:I(E),consume:v,enter:k,exit:S,interrupt:I(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(V){return s=ut(s,V),y(),s[s.length-1]!==null?[]:(z(t,0),c.events=ns(i,c.events,c),c.events)}function p(V,T){return o2(d(V),T)}function d(V){return r2(s,V)}function x(){const{_bufferIndex:V,_index:T,line:M,column:b,offset:D}=r;return{_bufferIndex:V,_index:T,line:M,column:b,offset:D}}function m(V){o[V.line]=V.column,L()}function y(){let V;for(;r._index<s.length;){const T=s[r._index];if(typeof T=="string")for(V=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===V&&r._bufferIndex<T.length;)g(T.charCodeAt(r._bufferIndex));else g(T)}}function g(V){u=u(V)}function v(V){we(V)?(r.line++,r.column=1,r.offset+=V===-3?2:1,L()):V!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=V}function k(V,T){const M=T||{};return M.type=V,M.start=x(),c.events.push(["enter",M,c]),a.push(M),M}function S(V){const T=a.pop();return T.end=x(),c.events.push(["exit",T,c]),T}function C(V,T){z(V,T.from)}function E(V,T){T.restore()}function I(V,T){return M;function M(b,D,K){let U,W,q,A;return Array.isArray(b)?R(b):"tokenize"in b?R([b]):B(b);function B(pe){return X;function X(ae){const de=ae!==null&&pe[ae],me=ae!==null&&pe.null,xe=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(me)?me:me?[me]:[]];return R(xe)(ae)}}function R(pe){return U=pe,W=0,pe.length===0?K:N(pe[W])}function N(pe){return X;function X(ae){return A=P(),q=pe,pe.partial||(c.currentConstruct=pe),pe.name&&c.parser.constructs.disable.null.includes(pe.name)?Q():pe.tokenize.call(T?Object.assign(Object.create(c),T):c,l,J,Q)(ae)}}function J(pe){return V(q,A),D}function Q(pe){return A.restore(),++W<U.length?N(U[W]):K}}}function z(V,T){V.resolveAll&&!i.includes(V)&&i.push(V),V.resolve&&zt(c.events,T,c.events.length-T,V.resolve(c.events.slice(T),c)),V.resolveTo&&(c.events=V.resolveTo(c.events,c))}function P(){const V=x(),T=c.previous,M=c.currentConstruct,b=c.events.length,D=Array.from(a);return{from:b,restore:K};function K(){r=V,c.previous=T,c.currentConstruct=M,c.events.length=b,a=D,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function r2(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function o2(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
39
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function vc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=s=>{const a=e.seen.get(s);if(a.ref===null)return;const l=a.def??a.schema,c={...l},u=a.ref;if(a.ref=null,u){r(u);const p=e.seen.get(u),d=p.schema;if(d.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(d)):Object.assign(l,d),Object.assign(l,c),s._zod.parent===u)for(const m in l)m==="$ref"||m==="allOf"||m in c||delete l[m];if(d.$ref&&p.def)for(const m in l)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(l[m])===JSON.stringify(p.def[m])&&delete l[m]}const f=s._zod.parent;if(f&&f!==u){r(f);const p=e.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(const d in l)d==="$ref"||d==="allOf"||d in p.def&&JSON.stringify(l[d])===JSON.stringify(p.def[d])&&delete l[d]}e.override({zodSchema:s,jsonSchema:l,path:a.path??[]})};for(const s of[...e.seen.entries()].reverse())r(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Zr(t,"input",e.processors),output:Zr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Je(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Je(r.element,n);if(r.type==="set")return Je(r.valueType,n);if(r.type==="lazy")return Je(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Je(r.innerType,n);if(r.type==="intersection")return Je(r.left,n)||Je(r.right,n);if(r.type==="record"||r.type==="map")return Je(r.keyType,n)||Je(r.valueType,n);if(r.type==="pipe")return Je(r.in,n)||Je(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Je(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Je(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Je(o,n))return!0;return!!(r.rest&&Je(r.rest,n))}return!1}const gg=(e,t={})=>n=>{const r=xc({...n,processors:t});return Ve(e,r),yc(r,e),vc(r,e)},Zr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=xc({...o??{},target:i,io:t,processors:n});return Ve(e,s),yc(s,e),vc(s,e)},xg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yg=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=xg[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},vg=(e,t,n,r)=>{const o=n,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof i=="number"&&(o.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof s=="number"&&(o.maximum=s,typeof c=="number"&&t.target!=="draft-04"&&(c<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},bg=(e,t,n,r)=>{n.type="boolean"},wg=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},_g=(e,t,n,r)=>{n.not={}},kg=(e,t,n,r)=>{},Sg=(e,t,n,r)=>{const o=e._zod.def,i=Jl(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},Cg=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},Eg=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Tg=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ng=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Ve(i.element,t,{...r,path:[...r.path,"items"]})},Ag=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const c in s)o.properties[c]=Ve(s[c],t,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Ve(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},jg=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,l)=>Ve(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=s:n.anyOf=s},zg=(e,t,n,r)=>{const o=e._zod.def,i=Ve(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Ve(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l},Ig=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const u=Ve(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const f of l)o.patternProperties[f.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Ve(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Ve(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const u=[...c].filter(f=>typeof f=="string"||typeof f=="number");u.length>0&&(o.required=u)}},Og=(e,t,n,r)=>{const o=e._zod.def,i=Ve(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Pg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Rg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Dg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Mg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Lg=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ve(i,t,r);const s=t.seen.get(e);s.ref=i},Fg=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},bc=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},$g=(e,t,n,r)=>{const o=e._zod.innerType;Ve(o,t,r);const i=t.seen.get(e);i.ref=o},Bg=G("ZodISODateTime",(e,t)=>{Mp.init(e,t),Ue.init(e,t)});function Ug(e){return Wm(Bg,e)}const Zg=G("ZodISODate",(e,t)=>{Lp.init(e,t),Ue.init(e,t)});function Vg(e){return Hm(Zg,e)}const Wg=G("ZodISOTime",(e,t)=>{Fp.init(e,t),Ue.init(e,t)});function Hg(e){return qm(Wg,e)}const qg=G("ZodISODuration",(e,t)=>{$p.init(e,t),Ue.init(e,t)});function Kg(e){return Km(qg,e)}const Gg=(e,t)=>{ec.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Ah(e,n)},flatten:{value:n=>Nh(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ii,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ii,2)}},isEmpty:{get(){return e.issues.length===0}}})},ht=G("ZodError",Gg,{Parent:Error}),Jg=$i(ht),Yg=Bi(ht),Xg=oo(ht),Qg=io(ht),e0=Ih(ht),t0=Oh(ht),n0=Ph(ht),r0=Rh(ht),o0=Dh(ht),i0=Mh(ht),s0=Lh(ht),a0=Fh(ht),Le=G("ZodType",(e,t)=>(Me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Zr(e,"input"),output:Zr(e,"output")}}),e.toJSONSchema=gg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Kt(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Gt(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Jg(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Xg(e,n,r),e.parseAsync=async(n,r)=>Yg(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Qg(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>e0(e,n,r),e.decode=(n,r)=>t0(e,n,r),e.encodeAsync=async(n,r)=>n0(e,n,r),e.decodeAsync=async(n,r)=>r0(e,n,r),e.safeEncode=(n,r)=>o0(e,n,r),e.safeDecode=(n,r)=>i0(e,n,r),e.safeEncodeAsync=async(n,r)=>s0(e,n,r),e.safeDecodeAsync=async(n,r)=>a0(e,n,r),e.refine=(n,r)=>e.check(rx(n,r)),e.superRefine=n=>e.check(ox(n)),e.overwrite=n=>e.check(Dn(n)),e.optional=()=>ra(e),e.exactOptional=()=>U0(e),e.nullable=()=>oa(e),e.nullish=()=>ra(oa(e)),e.nonoptional=n=>K0(e,n),e.array=()=>Be(e),e.or=n=>Jt([e,n]),e.and=n=>D0(e,n),e.transform=n=>ia(e,$0(n)),e.default=n=>W0(e,n),e.prefault=n=>q0(e,n),e.catch=n=>J0(e,n),e.pipe=n=>ia(e,n),e.readonly=()=>Q0(e),e.describe=n=>{const r=e.clone();return Qn.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Qn.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Qn.get(e);const r=e.clone();return Qn.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),wc=G("_ZodString",(e,t)=>{Ui.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>yg(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(tg(...r)),e.includes=(...r)=>e.check(og(...r)),e.startsWith=(...r)=>e.check(ig(...r)),e.endsWith=(...r)=>e.check(sg(...r)),e.min=(...r)=>e.check(Ur(...r)),e.max=(...r)=>e.check(mc(...r)),e.length=(...r)=>e.check(gc(...r)),e.nonempty=(...r)=>e.check(Ur(1,...r)),e.lowercase=r=>e.check(ng(r)),e.uppercase=r=>e.check(rg(r)),e.trim=()=>e.check(lg()),e.normalize=(...r)=>e.check(ag(...r)),e.toLowerCase=()=>e.check(cg()),e.toUpperCase=()=>e.check(ug()),e.slugify=()=>e.check(dg())}),l0=G("ZodString",(e,t)=>{Ui.init(e,t),wc.init(e,t),e.email=n=>e.check(Sm(c0,n)),e.url=n=>e.check(Am(u0,n)),e.jwt=n=>e.check(Vm(C0,n)),e.emoji=n=>e.check(jm(d0,n)),e.guid=n=>e.check(Js(ea,n)),e.uuid=n=>e.check(Cm(_r,n)),e.uuidv4=n=>e.check(Em(_r,n)),e.uuidv6=n=>e.check(Tm(_r,n)),e.uuidv7=n=>e.check(Nm(_r,n)),e.nanoid=n=>e.check(zm(f0,n)),e.guid=n=>e.check(Js(ea,n)),e.cuid=n=>e.check(Im(h0,n)),e.cuid2=n=>e.check(Om(p0,n)),e.ulid=n=>e.check(Pm(m0,n)),e.base64=n=>e.check(Bm(_0,n)),e.base64url=n=>e.check(Um(k0,n)),e.xid=n=>e.check(Rm(g0,n)),e.ksuid=n=>e.check(Dm(x0,n)),e.ipv4=n=>e.check(Mm(y0,n)),e.ipv6=n=>e.check(Lm(v0,n)),e.cidrv4=n=>e.check(Fm(b0,n)),e.cidrv6=n=>e.check($m(w0,n)),e.e164=n=>e.check(Zm(S0,n)),e.datetime=n=>e.check(Ug(n)),e.date=n=>e.check(Vg(n)),e.time=n=>e.check(Hg(n)),e.duration=n=>e.check(Kg(n))});function re(e){return km(l0,e)}const Ue=G("ZodStringFormat",(e,t)=>{Fe.init(e,t),wc.init(e,t)}),c0=G("ZodEmail",(e,t)=>{Np.init(e,t),Ue.init(e,t)}),ea=G("ZodGUID",(e,t)=>{Ep.init(e,t),Ue.init(e,t)}),_r=G("ZodUUID",(e,t)=>{Tp.init(e,t),Ue.init(e,t)}),u0=G("ZodURL",(e,t)=>{Ap.init(e,t),Ue.init(e,t)}),d0=G("ZodEmoji",(e,t)=>{jp.init(e,t),Ue.init(e,t)}),f0=G("ZodNanoID",(e,t)=>{zp.init(e,t),Ue.init(e,t)}),h0=G("ZodCUID",(e,t)=>{Ip.init(e,t),Ue.init(e,t)}),p0=G("ZodCUID2",(e,t)=>{Op.init(e,t),Ue.init(e,t)}),m0=G("ZodULID",(e,t)=>{Pp.init(e,t),Ue.init(e,t)}),g0=G("ZodXID",(e,t)=>{Rp.init(e,t),Ue.init(e,t)}),x0=G("ZodKSUID",(e,t)=>{Dp.init(e,t),Ue.init(e,t)}),y0=G("ZodIPv4",(e,t)=>{Bp.init(e,t),Ue.init(e,t)}),v0=G("ZodIPv6",(e,t)=>{Up.init(e,t),Ue.init(e,t)}),b0=G("ZodCIDRv4",(e,t)=>{Zp.init(e,t),Ue.init(e,t)}),w0=G("ZodCIDRv6",(e,t)=>{Vp.init(e,t),Ue.init(e,t)}),_0=G("ZodBase64",(e,t)=>{Wp.init(e,t),Ue.init(e,t)}),k0=G("ZodBase64URL",(e,t)=>{qp.init(e,t),Ue.init(e,t)}),S0=G("ZodE164",(e,t)=>{Kp.init(e,t),Ue.init(e,t)}),C0=G("ZodJWT",(e,t)=>{Jp.init(e,t),Ue.init(e,t)}),_c=G("ZodNumber",(e,t)=>{uc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>vg(e,r,o),e.gt=(r,o)=>e.check(Xs(r,o)),e.gte=(r,o)=>e.check(Io(r,o)),e.min=(r,o)=>e.check(Io(r,o)),e.lt=(r,o)=>e.check(Ys(r,o)),e.lte=(r,o)=>e.check(zo(r,o)),e.max=(r,o)=>e.check(zo(r,o)),e.int=r=>e.check(ta(r)),e.safe=r=>e.check(ta(r)),e.positive=r=>e.check(Xs(0,r)),e.nonnegative=r=>e.check(Io(0,r)),e.negative=r=>e.check(Ys(0,r)),e.nonpositive=r=>e.check(zo(0,r)),e.multipleOf=(r,o)=>e.check(Qs(r,o)),e.step=(r,o)=>e.check(Qs(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ye(e){return Gm(_c,e)}const E0=G("ZodNumberFormat",(e,t)=>{Yp.init(e,t),_c.init(e,t)});function ta(e){return Jm(E0,e)}const T0=G("ZodBoolean",(e,t)=>{Xp.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bg(e,n,r)});function yt(e){return Ym(T0,e)}const N0=G("ZodNull",(e,t)=>{Qp.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wg(e,n,r)});function ai(e){return Xm(N0,e)}const A0=G("ZodUnknown",(e,t)=>{em.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kg()});function na(){return Qm(A0)}const j0=G("ZodNever",(e,t)=>{tm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_g(e,n,r)});function z0(e){return eg(j0,e)}const I0=G("ZodArray",(e,t)=>{nm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ng(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Ur(n,r)),e.nonempty=n=>e.check(Ur(1,n)),e.max=(n,r)=>e.check(mc(n,r)),e.length=(n,r)=>e.check(gc(n,r)),e.unwrap=()=>e.element});function Be(e,t){return fg(I0,e,t)}const O0=G("ZodObject",(e,t)=>{om.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ag(e,n,r,o),Ne(e,"shape",()=>t.shape),e.keyof=()=>Mn(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:na()}),e.loose=()=>e.clone({...e._zod.def,catchall:na()}),e.strict=()=>e.clone({...e._zod.def,catchall:z0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>kh(e,n),e.safeExtend=n=>Sh(e,n),e.merge=n=>Ch(e,n),e.pick=n=>wh(e,n),e.omit=n=>_h(e,n),e.partial=(...n)=>Eh(Sc,e,n[0]),e.required=(...n)=>Th(Cc,e,n[0])});function ce(e,t){const n={type:"object",shape:e??{},...ge(t)};return new O0(n)}const kc=G("ZodUnion",(e,t)=>{hc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jg(e,n,r,o),e.options=t.options});function Jt(e,t){return new kc({type:"union",options:e,...ge(t)})}const P0=G("ZodDiscriminatedUnion",(e,t)=>{kc.init(e,t),im.init(e,t)});function cn(e,t,n){return new P0({type:"union",options:t,discriminator:e,...ge(n)})}const R0=G("ZodIntersection",(e,t)=>{sm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zg(e,n,r,o)});function D0(e,t){return new R0({type:"intersection",left:e,right:t})}const M0=G("ZodRecord",(e,t)=>{am.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ig(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function tn(e,t,n){return new M0({type:"record",keyType:e,valueType:t,...ge(n)})}const li=G("ZodEnum",(e,t)=>{lm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Sg(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new li({...t,checks:[],...ge(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new li({...t,checks:[],...ge(o),entries:i})}});function Mn(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new li({type:"enum",entries:n,...ge(t)})}const L0=G("ZodLiteral",(e,t)=>{cm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cg(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Te(e,t){return new L0({type:"literal",values:Array.isArray(e)?e:[e],...ge(t)})}const F0=G("ZodTransform",(e,t)=>{um.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tg(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Kl(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(ir(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(ir(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function $0(e){return new F0({type:"transform",transform:e})}const Sc=G("ZodOptional",(e,t)=>{pc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ra(e){return new Sc({type:"optional",innerType:e})}const B0=G("ZodExactOptional",(e,t)=>{dm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function U0(e){return new B0({type:"optional",innerType:e})}const Z0=G("ZodNullable",(e,t)=>{fm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Og(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function oa(e){return new Z0({type:"nullable",innerType:e})}const V0=G("ZodDefault",(e,t)=>{hm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function W0(e,t){return new V0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Xl(t)}})}const H0=G("ZodPrefault",(e,t)=>{pm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function q0(e,t){return new H0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Xl(t)}})}const Cc=G("ZodNonOptional",(e,t)=>{mm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Pg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function K0(e,t){return new Cc({type:"nonoptional",innerType:e,...ge(t)})}const G0=G("ZodCatch",(e,t)=>{gm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function J0(e,t){return new G0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Y0=G("ZodPipe",(e,t)=>{xm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lg(e,n,r,o),e.in=t.in,e.out=t.out});function ia(e,t){return new Y0({type:"pipe",in:e,out:t})}const X0=G("ZodReadonly",(e,t)=>{ym.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Q0(e){return new X0({type:"readonly",innerType:e})}const ex=G("ZodLazy",(e,t)=>{vm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$g(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function tx(e){return new ex({type:"lazy",getter:e})}const nx=G("ZodCustom",(e,t)=>{bm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Eg(e,n)});function rx(e,t={}){return hg(nx,e,t)}function ox(e){return pg(e)}const jn=tx(()=>Jt([re(),ye(),yt(),ai(),Be(jn),tn(re(),jn)])),Zi=ce({type:re(),ttl:re().optional(),scope:re().optional()}),Vi=ce({type:Te("text"),text:re(),cache_control:Zi.optional()}),Ec=ce({type:Te("thinking"),thinking:re(),signature:re().optional()}),ix=ce({type:Te("base64"),media_type:re(),data:re()}),Tc=ce({type:Te("image"),source:ix}),Nc=ce({type:Te("tool_use"),id:re(),name:re(),input:tn(re(),jn)}),sx=cn("type",[Vi,Tc]),ax=ce({type:Te("tool_result"),tool_use_id:re().optional(),content:Jt([re(),Be(sx)]),is_error:yt().optional()}),lx=cn("type",[Vi,Ec,Tc,Nc,ax]),cx=Jt([re(),Be(lx)]),ux=ce({role:Mn(["user","assistant"]),content:cx}),dx=ce({type:Te("text"),text:re(),cache_control:Zi.optional()}),fx=ce({type:re(),properties:tn(re(),tn(re(),jn)).optional(),required:Be(re()).optional(),additionalProperties:yt().optional(),$schema:re().optional()}),hx=ce({name:re(),description:re().optional(),input_schema:fx.optional(),cache_control:Zi.optional()}),px=cn("type",[ce({type:Te("enabled"),budget_tokens:ye()}),ce({type:Te("disabled")}),ce({type:Te("adaptive")})]),mx=ce({model:re(),messages:Be(ux),system:Be(dx).optional(),tools:Be(hx).optional(),max_tokens:ye().optional(),temperature:ye().optional(),stream:yt().optional(),thinking:px.optional(),metadata:ce({user_id:re().optional()}).optional()}),Wi=cn("type",[Vi,Ec,Nc]),gx=ce({input_tokens:ye(),output_tokens:ye(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}),xx=ce({id:re(),type:Te("message"),model:re(),role:Te("assistant"),content:Be(Wi),stop_reason:re().nullable(),stop_sequence:re().nullable(),usage:gx}),yx=ce({type:Te("message_start"),message:ce({id:re(),type:Te("message"),model:re(),role:Te("assistant"),content:Be(Wi),stop_reason:ai(),stop_sequence:ai(),usage:ce({input_tokens:ye(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()})}),vx=ce({type:Te("content_block_start"),index:ye(),content_block:Wi}),bx=cn("type",[ce({type:Te("text_delta"),text:re()}),ce({type:Te("input_json_delta"),partial_json:re()}),ce({type:Te("thinking_delta"),thinking:re()}),ce({type:Te("signature_delta"),signature:re()})]),wx=ce({type:Te("content_block_delta"),index:ye(),delta:bx}),_x=ce({type:Te("content_block_stop"),index:ye()}),kx=ce({type:Te("message_delta"),delta:ce({stop_reason:re().nullable(),stop_sequence:re().nullable().optional()}),usage:ce({output_tokens:ye(),input_tokens:ye().optional(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()}),Sx=ce({type:Te("message_stop")}),Cx=ce({type:Te("ping")}),Ex=ce({type:Te("error"),error:ce({type:re(),message:re()})});cn("type",[yx,vx,wx,_x,kx,Sx,Cx,Ex]);const Tx=mx,Nx=xx,Ax=Jt([re(),Be(cn("type",[ce({type:Te("text"),text:re()}),ce({type:Te("image_url"),image_url:ce({url:re(),detail:re().optional()})})]))]),Ac=ce({role:Mn(["system","user","assistant","tool"]),content:Ax,name:re().optional(),reasoning_content:re().optional()}),jx=ce({name:re(),arguments:re()});Ac.extend({content:Jt([re(),Be(ce({type:Te("text"),text:re()}))]).optional(),function_call:jx.optional()});const zx=ce({type:Te("function"),function:ce({name:re(),description:re().optional(),parameters:tn(re(),jn)})});ce({model:re(),messages:Be(Ac),temperature:ye().optional(),max_tokens:ye().optional(),stream:yt().optional(),tools:Be(zx).optional(),tool_choice:Jt([ce({type:Te("auto")}),ce({type:Te("none")}),ce({type:Te("function"),function:ce({name:re()})})]).optional(),user:re().optional()});const jc=ce({role:Mn(["assistant"]).optional(),content:re().nullable().optional(),reasoning_content:re().nullable().optional(),function_call:ce({name:re().optional(),arguments:re().optional()}).optional(),tool_calls:Be(ce({index:ye(),id:re().optional(),type:Te("function").optional(),function:ce({name:re().optional(),arguments:re().optional()})})).optional()}),Ix=ce({index:ye(),message:ce({role:Mn(["assistant"]),content:re().nullable(),reasoning_content:re().optional(),function_call:ce({name:re(),arguments:re()}).optional()}).optional(),delta:jc.optional(),finish_reason:re().nullable()}),Ox=ce({id:re(),object:Te("chat.completion"),created:ye(),model:re(),choices:Be(Ix),usage:ce({prompt_tokens:ye(),completion_tokens:ye(),total_tokens:ye()})});ce({id:re(),object:Te("chat.completion.chunk"),created:ye(),model:re(),choices:Be(ce({index:ye(),delta:jc,finish_reason:re().nullable().optional()})),usage:ce({prompt_tokens:ye(),completion_tokens:ye(),total_tokens:ye()}).nullable().optional()});function Px(e){try{const t=JSON.parse(e),n=Ox.safeParse(t);return n.success?n.data:null}catch{return null}}const Rx=ce({index:ye(),timestamp:ye(),type:re(),data:jn}),Dx=ce({chunks:Be(Rx),truncated:yt().optional().default(!1)}),ci=ce({id:ye(),timestamp:re(),method:re(),path:re(),model:re().nullable(),sessionId:re().nullable(),rawRequestBody:re().nullable(),responseStatus:ye().nullable(),responseText:re().nullable(),inputTokens:ye().nullable(),outputTokens:ye().nullable(),cacheCreationInputTokens:ye().nullable(),cacheReadInputTokens:ye().nullable(),elapsedMs:ye().nullable(),streaming:yt(),userAgent:re().nullable(),origin:re().nullable(),rawHeaders:tn(re(),re()).optional(),headers:tn(re(),re()).optional(),apiFormat:Mn(["anthropic","openai","unknown"]).default("unknown"),isTest:yt().optional().default(!1),providerName:re().nullable().optional(),clientPort:ye().nullable().optional(),clientPid:ye().nullable().optional(),clientCwd:re().nullable().optional(),clientProjectFolder:re().nullable().optional(),streamingChunks:Dx.optional(),streamingChunksPath:re().nullable().optional(),error:re().nullable().optional()});ce({model:re()});function Mx(e){if(e===null)return null;try{const t=JSON.parse(e),n=Tx.safeParse(t);return n.success?n.data:null}catch{return null}}function Lx(e,t,n){const r=new Array(e);return new Proxy(r,{get(o,i,s){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let c=o[l];if(!c){const u=t[l*2];c=o[l]={index:l,key:n(l),start:u,size:t[l*2+1],end:u+t[l*2+1],lane:0}}return c}}if(i==="length")return e}return Reflect.get(o,i,s)}})}function fn(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){const a=e();return(a.length!==r.length||a.some((c,u)=>r[u]!==c))&&(r=a,o=t(...a),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1),o}return s.updateDeps=a=>{r=a},s}function sa(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const aa=(e,t)=>Math.abs(e-t)<1.01,Fx=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let Hn;const la=()=>{if(Hn!==void 0)return Hn;if(typeof navigator>"u")return Hn=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Hn=!0;const e=navigator.maxTouchPoints;return Hn=navigator.platform==="MacIntel"&&e!==void 0&&e>0},ca=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},$x=e=>e,Bx=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(r);for(let i=0;i<r;i++)o[i]=t+i;return o},Ux=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(ca(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(ca(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Vr={passive:!0},Zx=typeof window>"u"?!0:"onscrollend"in window,Vx=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&Zx;let s=0;const a=i?null:Fx(o,()=>t(s,!1),e.options.isScrollingResetDelay),l=f=>()=>{s=n(r),a?.(),t(s,f)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,Vr),i&&r.addEventListener("scrollend",u,Vr),()=>{r.removeEventListener("scroll",c),i&&r.removeEventListener("scrollend",u)}},Wx=(e,t)=>Vx(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),Hx=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},qx=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},Kx=qx;class Gx{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{const a=i.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[c,u]of this.elementsCache)if(u===a){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r,o;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:$x,rangeExtractor:Bx,onChange:()=>{},measureElement:Hx,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate"};for(const c in n){const u=n[c];u!==void 0&&(i[c]=u)}const s=this.options;let a=null,l=null;if(s!==void 0&&s.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const c=s.count,u=i.count,f=this.getMeasurements(),p=c>0?((r=f[0])==null?void 0:r.key)??s.getItemKey(0):null,d=c>0?((o=f[c-1])==null?void 0:o.key)??s.getItemKey(c-1):null;if(u!==c||c>0&&u>0&&(i.getItemKey(0)!==p||i.getItemKey(u-1)!==d)){const y=c>0?this.getVirtualItemForOffset(this.getScrollOffset())??f[0]:null;y&&(a=[y.key,this.getScrollOffset()-y.start]);const g=i.followOnAppend===!0?"auto":i.followOnAppend||null;g&&u>c&&this.isAtEnd(s.scrollEndThreshold)&&(c===0||i.getItemKey(u-1)!==d)&&(l=g)}}this.options=i,(a||l)&&(this.pendingScrollAnchor=[a?.[0]??null,a?.[1]??0,l])},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=fn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,s=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!la()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",s,Vr),i.addEventListener("touchend",a,Vr),this.unsubs.push(()=>{i.removeEventListener("touchstart",s),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,s,a]=o;if(i!==null){const{count:l,getItemKey:c}=this.options;let u=0;for(;u<l&&c(u)!==i;)u++;const f=u<l?this.getMeasurements()[u]:void 0;if(f){const p=f.start+s-this.getScrollOffset();aa(p,0)||this.applyScrollAdjustment(p)}}a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=fn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,o,i,s,a,l)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=fn(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l},c)=>{const u=this.itemSizeCache;if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const f=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),a===1){const x=this.options.gap,m=n*2;let y=this._flatMeasurements;if(!y||y.length<m){const k=new Float64Array(m);y&&f>0&&k.set(y.subarray(0,f*2)),y=k,this._flatMeasurements=y}let g;if(f===0)g=r+o;else{const k=f-1;g=y[k*2]+y[k*2+1]+x}for(let k=f;k<n;k++){const S=i(k),C=u.get(S),T=typeof C=="number"?C:this.options.estimateSize(k);y[k*2]=g,y[k*2+1]=T,g+=T+x}const b=Lx(n,y,i);return this.measurementsCache=b,b}const p=this.measurementsCache.slice(0,f),d=new Array(a).fill(void 0);for(let x=0;x<f;x++){const m=p[x];m&&(d[m.lane]=x)}for(let x=f;x<n;x++){const m=i(x),y=this.laneAssignments.get(x);let g,b;const k=l==="estimate"||u.has(m);if(y!==void 0&&this.options.lanes>1){g=y;const z=d[g],P=z!==void 0?p[z]:void 0;b=P?P.end+this.options.gap:r+o}else{const z=this.options.lanes===1?p[x-1]:this.getFurthestMeasurement(p,x);b=z?z.end+this.options.gap:r+o,g=z?z.lane:x%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(x,g)}const S=u.get(m),C=typeof S=="number"?S:this.options.estimateSize(x),T=b+C;p[x]={index:x,start:b,size:C,end:T,key:m,lane:g},d[g]=x}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=fn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?Jx({measurements:n,outerSize:r,scrollOffset:o,lanes:i,flat:i===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=fn(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),s=Math.max(0,o-i),a=Math.min(this.options.count-1,o+i);return n>=s&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,a)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),i=this.elementsCache.get(o);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o,i;if(n<0||n>=this.options.count)return;let s,a,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),a=c[n*2],s=c[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;l=p.key,a=p.start,s=p.size}const u=this.itemSizeCache.get(l)??s,f=r-u;if(f!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,d=p?this.getTotalSize():0,x=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:a,size:s,end:a+s,lane:0},f,this):a<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!=="backward");(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,p?this.applyScrollAdjustment(this.getTotalSize()-d):x&&this.applyScrollAdjustment(f),this.notify(!1)}},this.getVirtualItems=fn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const o=this._flatMeasurements,i=this.options.lanes===1&&o!=null,s=zc(0,r.length-1,i?a=>o[a*2]:a=>sa(r[a]).start,n);return sa(r[s])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),i=this.getScrollOffset(),s=this.measurementsCache[n];if(!s)return;if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const i=this.getOffsetForAlignment(n,r),s=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i,l=this.now();this.scrollState={index:n,align:a,behavior:o,startedAt:l,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,s=this._flatMeasurements;s!=null?o=s[i*2]+s[i*2+1]:o=((n=r[i])==null?void 0:n.end)??0}else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const o of r)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){t!==0&&(la()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,i=1,s=o!==this.scrollState.lastTargetOffset;if(!s&&aa(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const a=this.getSize()||600,l=Math.abs(o-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>a;this.scrollState.lastTargetOffset=o,c||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const zc=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function Jx({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const i=e.length-1,s=o?u=>o[u*2]:u=>e[u].start,a=o?u=>o[u*2]+o[u*2+1]:u=>e[u].end;if(e.length<=r)return{startIndex:0,endIndex:i};let l=zc(0,i,s,n),c=l;if(r===1)for(;c<i&&a(c)<n+t;)c++;else if(r>1){const u=Array(r).fill(0);for(;c<i&&u.some(p=>p<n+t);){const p=e[c];u[p.lane]=p.end,c++}const f=Array(r).fill(n+t);for(;l>=0&&f.some(p=>p>=n);){const p=e[l];f[p.lane]=p.start,l--}l=Math.max(0,l-l%r),c=Math.min(i,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const ua=typeof document<"u"?_.useLayoutEffect:_.useEffect;function Yx({useFlushSync:e=!0,...t}){const n=_.useReducer(i=>i+1,0)[1],r={...t,onChange:(i,s)=>{var a;e&&s?ur.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,s)}},[o]=_.useState(()=>new Gx(r));return o.setOptions(r),ua(()=>o._didMount(),[]),ua(()=>o._willUpdate()),o}function Xx(e){return Yx({observeElementRect:Ux,observeElementOffset:Wx,scrollToFn:Kx,...e})}const Ic=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Qx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ey=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const da=e=>{const t=ey(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ty={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ny=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const ry=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>_.createElement("svg",{ref:l,...ty,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ic("lucide",o),...!i&&!ny(a)&&{"aria-hidden":"true"},...a},[...s.map(([c,u])=>_.createElement(c,u)),...Array.isArray(i)?i:[i]]));const _e=(e,t)=>{const n=_.forwardRef(({className:r,...o},i)=>_.createElement(ry,{ref:i,iconNode:t,className:Ic(`lucide-${Qx(da(e))}`,`lucide-${e}`,r),...o}));return n.displayName=da(e),n};const oy=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],iy=_e("brain",oy);const sy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dr=_e("check",sy);const ay=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],At=_e("chevron-down",ay);const ly=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Wt=_e("chevron-right",ly);const cy=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],uy=_e("chevron-up",cy);const dy=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],fy=_e("chevrons-down",dy);const hy=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],py=_e("chevrons-up",hy);const my=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ui=_e("circle-alert",my);const gy=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],xy=_e("circle-check-big",gy);const yy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],vy=_e("circle-question-mark",yy);const by=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Oc=_e("circle-stop",by);const wy=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Hi=_e("clock",wy);const _y=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ao=_e("copy",_y);const ky=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Pc=_e("download",ky);const Sy=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Cy=_e("external-link",Sy);const Ey=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ty=_e("eye-off",Ey);const Ny=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ay=_e("eye",Ny);const jy=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]],zy=_e("file-terminal",jy);const Iy=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Oy=_e("gauge",Iy);const Py=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ry=_e("globe",Py);const Dy=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],My=_e("layout-grid",Dy);const Ly=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Fy=_e("list",Ly);const $y=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Rc=_e("loader-circle",$y);const By=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Uy=_e("lock",By);const Zy=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Dc=_e("message-square",Zy);const Vy=[["path",{d:"M5 12h14",key:"1ays0h"}]],Wy=_e("minus",Vy);const Hy=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],qy=_e("pencil",Hy);const Ky=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],fa=_e("plus",Ky);const Gy=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Jy=_e("radio",Gy);const Yy=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Mc=_e("rotate-ccw",Yy);const Xy=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Lc=_e("rotate-cw",Xy);const Qy=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ev=_e("server",Qy);const tv=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],nv=_e("settings",tv);const rv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ov=_e("terminal",rv);const iv=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],sv=_e("trash-2",iv);const av=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],lv=_e("triangle-alert",av);const cv=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],uv=_e("upload",cv);const dv=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],fv=_e("user",dv);const hv=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],pv=_e("wifi-off",hv);const mv=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],gv=_e("wifi",mv);const xv=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],yv=_e("wrench",xv);const vv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bv=_e("x",vv);const wv=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],fr=_e("zap",wv);function kr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Oo={exports:{}};var ha;function _v(){return ha||(ha=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,i){function s(c,u){if(!o[c]){if(!r[c]){var f=typeof kr=="function"&&kr;if(!u&&f)return f(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var d=o[c]={exports:{}};r[c][0].call(d.exports,function(x){var m=r[c][1][x];return s(m||x)},d,d.exports,n,r,o,i)}return o[c].exports}for(var a=typeof kr=="function"&&kr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(n,r,o){var i=n("./utils"),s=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,u,f,p,d,x,m,y=[],g=0,b=l.length,k=b,S=i.getTypeOf(l)!=="string";g<l.length;)k=b-g,f=S?(c=l[g++],u=g<b?l[g++]:0,g<b?l[g++]:0):(c=l.charCodeAt(g++),u=g<b?l.charCodeAt(g++):0,g<b?l.charCodeAt(g++):0),p=c>>2,d=(3&c)<<4|u>>4,x=1<k?(15&u)<<2|f>>6:64,m=2<k?63&f:64,y.push(a.charAt(p)+a.charAt(d)+a.charAt(x)+a.charAt(m));return y.join("")},o.decode=function(l){var c,u,f,p,d,x,m=0,y=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var b,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=s.uint8array?new Uint8Array(0|k):new Array(0|k);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(p=a.indexOf(l.charAt(m++)))>>4,u=(15&p)<<4|(d=a.indexOf(l.charAt(m++)))>>2,f=(3&d)<<6|(x=a.indexOf(l.charAt(m++))),b[y++]=c,d!==64&&(b[y++]=u),x!==64&&(b[y++]=f);return b}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,f,p,d,x){this.compressedSize=u,this.uncompressedSize=f,this.crc32=p,this.compression=d,this.compressedContent=x}c.prototype={getContentWorker:function(){var u=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,p){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var i=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var i=n("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,u,f,p){var d=s,x=p+f;c^=-1;for(var m=p;m<x;m++)c=c>>>8^d[255&(c^u[m])];return-1^c})(0|l,a,a.length,0):(function(c,u,f,p){var d=s,x=p+f;c^=-1;for(var m=p;m<x;m++)c=c>>>8^d[255&(c^u.charCodeAt(m))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var i=null;i=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:i}},{lie:37}],7:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=i?"uint8array":"array";function u(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},o.compressWorker=function(f){return new u("Deflate",f)},o.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(d,x){var m,y="";for(m=0;m<x;m++)y+=String.fromCharCode(255&d),d>>>=8;return y}function s(d,x,m,y,g,b){var k,S,C=d.file,T=d.compression,z=b!==c.utf8encode,P=a.transformTo("string",b(C.name)),O=a.transformTo("string",c.utf8encode(C.name)),M=C.comment,B=a.transformTo("string",b(M)),E=a.transformTo("string",c.utf8encode(M)),L=O.length!==C.name.length,v=E.length!==M.length,D="",K="",Z="",W=C.dir,q=C.date,A={crc32:0,compressedSize:0,uncompressedSize:0};x&&!m||(A.crc32=d.crc32,A.compressedSize=d.compressedSize,A.uncompressedSize=d.uncompressedSize);var U=0;x&&(U|=8),z||!L&&!v||(U|=2048);var R=0,N=0;W&&(R|=16),g==="UNIX"?(N=798,R|=(function(Q,pe){var X=Q;return Q||(X=pe?16893:33204),(65535&X)<<16})(C.unixPermissions,W)):(N=20,R|=(function(Q){return 63&(Q||0)})(C.dosPermissions)),k=q.getUTCHours(),k<<=6,k|=q.getUTCMinutes(),k<<=5,k|=q.getUTCSeconds()/2,S=q.getUTCFullYear()-1980,S<<=4,S|=q.getUTCMonth()+1,S<<=5,S|=q.getUTCDate(),L&&(K=i(1,1)+i(u(P),4)+O,D+="up"+i(K.length,2)+K),v&&(Z=i(1,1)+i(u(B),4)+E,D+="uc"+i(Z.length,2)+Z);var J="";return J+=`
|
|
40
|
+
\0`,J+=i(U,2),J+=T.magic,J+=i(k,2),J+=i(S,2),J+=i(A.crc32,4),J+=i(A.compressedSize,4),J+=i(A.uncompressedSize,4),J+=i(P.length,2),J+=i(D.length,2),{fileRecord:f.LOCAL_FILE_HEADER+J+P+D,dirRecord:f.CENTRAL_FILE_HEADER+i(N,2)+J+i(B.length,2)+"\0\0\0\0"+i(R,4)+i(y,4)+P+D+B}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function p(d,x,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(d){var x=d.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,l.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:m?(x+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var x=this.streamFiles&&!d.file.dir;if(x){var m=s(d,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(d){this.accumulate=!1;var x=this.streamFiles&&!d.file.dir,m=s(d,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),x)this.push({data:(function(y){return f.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)})(d),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var d=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var m=this.bytesWritten-d,y=(function(g,b,k,S,C){var T=a.transformTo("string",C(S));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(b,4)+i(k,4)+i(T.length,2)+T})(this.dirRecords.length,m,d,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(d){this._sources.push(d);var x=this;return d.on("data",function(m){x.processChunk(m)}),d.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),d.on("error",function(m){x.error(m)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(d){var x=this._sources;if(!l.prototype.error.call(this,d))return!1;for(var m=0;m<x.length;m++)try{x[m].error(d)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var d=this._sources,x=0;x<d.length;x++)d[x].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var i=n("../compressions"),s=n("./ZipFileWorker");o.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{a.forEach(function(p,d){f++;var x=(function(b,k){var S=b||k,C=i[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(d.options.compression,l.compression),m=d.options.compressionOptions||l.compressionOptions||{},y=d.dir,g=d.date;d._compressWorker(x,m).withStreamInfo("file",{name:p,dir:y,date:g,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(u)}),u.entriesCount=f}catch(p){u.error(p)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=n("./object")).loadAsync=n("./load"),i.support=n("./support"),i.defaults=n("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=n("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var i=n("./utils"),s=n("./external"),a=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function f(p){return new s.Promise(function(d,x){var m=p.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){x(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}r.exports=function(p,d){var x=this;return d=i.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",p,!0,d.optimizedBinaryString,d.base64).then(function(m){var y=new l(d);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],g=m.files;if(d.checkCRC32)for(var b=0;b<g.length;b++)y.push(f(g[b]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,b=0;b<g.length;b++){var k=g[b],S=k.fileNameStr,C=i.resolve(k.fileNameStr);x.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:d.createFolders}),k.dir||(x.file(C).unsafeOriginalName=S)}return y.zipComment.length&&(x.comment=y.zipComment),x})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var i=n("../utils"),s=n("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var i=n("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var u=this;a.on("data",function(f,p){u.push(f)||u._helper.pause(),c&&c(p)}).on("error",function(f){u.emit("error",f)}).on("end",function(){u.push(null)})}n("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(n,r,o){function i(C,T,z){var P,O=a.getTypeOf(T),M=a.extend(z||{},u);M.date=M.date||new Date,M.compression!==null&&(M.compression=M.compression.toUpperCase()),typeof M.unixPermissions=="string"&&(M.unixPermissions=parseInt(M.unixPermissions,8)),M.unixPermissions&&16384&M.unixPermissions&&(M.dir=!0),M.dosPermissions&&16&M.dosPermissions&&(M.dir=!0),M.dir&&(C=g(C)),M.createFolders&&(P=y(C))&&b.call(this,P,!0);var B=O==="string"&&M.binary===!1&&M.base64===!1;z&&z.binary!==void 0||(M.binary=!B),(T instanceof f&&T.uncompressedSize===0||M.dir||!T||T.length===0)&&(M.base64=!1,M.binary=!0,T="",M.compression="STORE",O="string");var E=null;E=T instanceof f||T instanceof l?T:x.isNode&&x.isStream(T)?new m(C,T):a.prepareContent(C,T,M.binary,M.optimizedBinaryString,M.base64);var L=new p(C,E,M);this.files[C]=L}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),f=n("./compressedObject"),p=n("./zipObject"),d=n("./generate"),x=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var T=C.lastIndexOf("/");return 0<T?C.substring(0,T):""},g=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},b=function(C,T){return T=T!==void 0?T:u.createFolders,C=g(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:T}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var T,z,P;for(T in this.files)P=this.files[T],(z=T.slice(this.root.length,T.length))&&T.slice(0,this.root.length)===this.root&&C(z,P)},filter:function(C){var T=[];return this.forEach(function(z,P){C(z,P)&&T.push(P)}),T},file:function(C,T,z){if(arguments.length!==1)return C=this.root+C,i.call(this,C,T,z),this;if(k(C)){var P=C;return this.filter(function(M,B){return!B.dir&&P.test(M)})}var O=this.files[this.root+C];return O&&!O.dir?O:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(O,M){return M.dir&&C.test(O)});var T=this.root+C,z=b.call(this,T),P=this.clone();return P.root=z.name,P},remove:function(C){C=this.root+C;var T=this.files[C];if(T||(C.slice(-1)!=="/"&&(C+="/"),T=this.files[C]),T&&!T.dir)delete this.files[C];else for(var z=this.filter(function(O,M){return M.name.slice(0,C.length)===C}),P=0;P<z.length;P++)delete this.files[z[P].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var T,z={};try{if((z=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=z.type.toLowerCase(),z.compression=z.compression.toUpperCase(),z.type==="binarystring"&&(z.type="string"),!z.type)throw new Error("No output type specified.");a.checkSupport(z.type),z.platform!=="darwin"&&z.platform!=="freebsd"&&z.platform!=="linux"&&z.platform!=="sunos"||(z.platform="UNIX"),z.platform==="win32"&&(z.platform="DOS");var P=z.comment||this.comment||"";T=d.generateWorker(this,z,P)}catch(O){(T=new l("error")).error(O)}return new c(T,z.type||"string",z.mimeType)},generateAsync:function(C,T){return this.generateInternalStream(C).accumulate(T)},generateNodeStream:function(C,T){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(T)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),f=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===u&&this.data[p+3]===f)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),f=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&u===p[2]&&f===p[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var i=n("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,o){var i=n("./Uint8ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var i=n("./ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var i=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var p=i.getTypeOf(f);return i.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(f):s.uint8array?new u(i.transformTo("uint8array",f)):new a(i.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var i=n("./GenericWorker"),s=n("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var i=n("./GenericWorker"),s=n("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=i},{}],29:[function(n,r,o){var i=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,m){return new u.Promise(function(y,g){var b=[],k=x._internalType,S=x._outputType,C=x._mimeType;x.on("data",function(T,z){b.push(T),m&&m(z)}).on("error",function(T){b=[],g(T)}).on("end",function(){try{var T=(function(z,P,O){switch(z){case"blob":return i.newBlob(i.transformTo("arraybuffer",P),O);case"base64":return l.encode(P);default:return i.transformTo(z,P)}})(S,(function(z,P){var O,M=0,B=null,E=0;for(O=0;O<P.length;O++)E+=P[O].length;switch(z){case"string":return P.join("");case"array":return Array.prototype.concat.apply([],P);case"uint8array":for(B=new Uint8Array(E),O=0;O<P.length;O++)B.set(P[O],M),M+=P[O].length;return B;case"nodebuffer":return Buffer.concat(P);default:throw new Error("concat : unsupported type '"+z+"'")}})(k,b),C);y(T)}catch(z){g(z)}b=[]}).resume()})}function d(x,m,y){var g=m;switch(m){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=m,this._mimeType=y,i.checkSupport(g),this._worker=x.pipe(new s(g)),x.lock()}catch(b){this._worker=new a("error"),this._worker.error(b)}}d.prototype={accumulate:function(x){return p(this,x)},on:function(x,m){var y=this;return x==="data"?this._worker.on(x,function(g){m.call(y,g.data,g.meta)}):this._worker.on(x,function(){i.delay(m,arguments,y)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},x)}},r.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var i=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}o.utf8encode=function(d){return s.nodebuffer?a.newBufferFrom(d,"utf-8"):(function(x){var m,y,g,b,k,S=x.length,C=0;for(b=0;b<S;b++)(64512&(y=x.charCodeAt(b)))==55296&&b+1<S&&(64512&(g=x.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),b++),C+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(C):new Array(C),b=k=0;k<C;b++)(64512&(y=x.charCodeAt(b)))==55296&&b+1<S&&(64512&(g=x.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),b++),y<128?m[k++]=y:(y<2048?m[k++]=192|y>>>6:(y<65536?m[k++]=224|y>>>12:(m[k++]=240|y>>>18,m[k++]=128|y>>>12&63),m[k++]=128|y>>>6&63),m[k++]=128|63&y);return m})(d)},o.utf8decode=function(d){return s.nodebuffer?i.transformTo("nodebuffer",d).toString("utf-8"):(function(x){var m,y,g,b,k=x.length,S=new Array(2*k);for(m=y=0;m<k;)if((g=x[m++])<128)S[y++]=g;else if(4<(b=c[g]))S[y++]=65533,m+=b-1;else{for(g&=b===2?31:b===3?15:7;1<b&&m<k;)g=g<<6|63&x[m++],b--;1<b?S[y++]=65533:g<65536?S[y++]=g:(g-=65536,S[y++]=55296|g>>10&1023,S[y++]=56320|1023&g)}return S.length!==y&&(S.subarray?S=S.subarray(0,y):S.length=y),i.applyFromCharCode(S)})(d=i.transformTo(s.uint8array?"uint8array":"array",d))},i.inherits(f,l),f.prototype.processChunk=function(d){var x=i.transformTo(s.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=x;(x=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),x.set(m,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var y=(function(b,k){var S;for((k=k||b.length)>b.length&&(k=b.length),S=k-1;0<=S&&(192&b[S])==128;)S--;return S<0||S===0?k:S+c[b[S]]>k?S:k})(x),g=x;y!==x.length&&(s.uint8array?(g=x.subarray(0,y),this.leftOver=x.subarray(y,x.length)):(g=x.slice(0,y),this.leftOver=x.slice(y,x.length))),this.push({data:o.utf8decode(g),meta:d.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=f,i.inherits(p,l),p.prototype.processChunk=function(d){this.push({data:o.utf8encode(d.data),meta:d.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var i=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(m){return m}function u(m,y){for(var g=0;g<m.length;++g)y[g]=255&m.charCodeAt(g);return y}n("setimmediate"),o.newBlob=function(m,y){o.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(m,y,g){var b=[],k=0,S=m.length;if(S<=g)return String.fromCharCode.apply(null,m);for(;k<S;)y==="array"||y==="nodebuffer"?b.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,S)))):b.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,S)))),k+=g;return b.join("")},stringifyByChar:function(m){for(var y="",g=0;g<m.length;g++)y+=String.fromCharCode(m[g]);return y},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var y=65536,g=o.getTypeOf(m),b=!0;if(g==="uint8array"?b=f.applyCanBeUsed.uint8array:g==="nodebuffer"&&(b=f.applyCanBeUsed.nodebuffer),b)for(;1<y;)try{return f.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return f.stringifyByChar(m)}function d(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}o.applyFromCharCode=p;var x={};x.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return x.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},x.array={string:p,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},x.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return d(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},x.uint8array={string:p,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},x.nodebuffer={string:p,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return x.nodebuffer.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:c},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var g=o.getTypeOf(y);return x[g][m](y)},o.resolve=function(m){for(var y=m.split("/"),g=[],b=0;b<y.length;b++){var k=y[b];k==="."||k===""&&b!==0&&b!==y.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,g,b="";for(g=0;g<(m||"").length;g++)b+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return b},o.delay=function(m,y,g){setImmediate(function(){m.apply(g||null,y||[])})},o.inherits=function(m,y){function g(){}g.prototype=y.prototype,m.prototype=new g},o.extend=function(){var m,y,g={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&g[y]===void 0&&(g[y]=arguments[m][y]);return g},o.prepareContent=function(m,y,g,b,k){return l.Promise.resolve(y).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,T){var z=new FileReader;z.onload=function(P){C(P.target.result)},z.onerror=function(P){T(P.target.error)},z.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(k?S=s.decode(S):g&&b!==!0&&(S=(function(T){return u(T,i.uint8array?new Uint8Array(T.length):new Array(T.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(f){this.files=[],this.loadOptions=f}u.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(p)+", expected "+s.pretty(f)+")")}},isSignature:function(f,p){var d=this.reader.index;this.reader.setIndex(f);var x=this.reader.readString(4)===p;return this.reader.setIndex(d),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",d=s.transformTo(p,f);this.zipComment=this.loadOptions.decodeFileName(d)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,p,d,x=this.zip64EndOfCentralSize-44;0<x;)f=this.reader.readInt(2),p=this.reader.readInt(4),d=this.reader.readData(p),this.zip64ExtensibleData[f]={id:f,length:p,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,p;for(f=0;f<this.files.length;f++)p=this.files[f],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var p=f;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var x=p-d;if(0<x)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=x);else if(x<0)throw new Error("Corrupted zip: missing "+Math.abs(x)+" bytes.")},prepareReader:function(f){this.reader=i(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),f=n("./support");function p(d,x){this.options=d,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var x,m;if(d.skip(22),this.fileNameLength=d.readInt(2),m=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(y){for(var g in u)if(Object.prototype.hasOwnProperty.call(u,g)&&u[g].magic===y)return u[g];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,x,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var x=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(x),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var x,m,y,g=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<g;)x=d.readInt(2),m=d.readInt(2),y=d.readData(m),this.extraFields[x]={id:x,length:m,value:y};d.setIndex(g)},handleUTF8:function(){var d=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var m=s.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=s.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var x=i(d.value);return x.readInt(1)!==1||l(this.fileName)!==x.readInt(4)?null:c.utf8decode(x.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var x=i(d.value);return x.readInt(1)!==1||l(this.fileComment)!==x.readInt(4)?null:c.utf8decode(x.readData(d.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function i(x,m,y){this.name=x,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");i.prototype={internalStream:function(x){var m=null,y="string";try{if(!x)throw new Error("No output type specified.");var g=(y=x.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var b=!this._dataBinary;b&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!b&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(k){(m=new u("error")).error(k)}return new s(m,y,"")},async:function(x,m){return this.internalStream(x).accumulate(m)},nodeStream:function(x,m){return this.internalStream(x||"nodebuffer").toNodejsStream(m)},_compressWorker:function(x,m){if(this._data instanceof c&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,x,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<f.length;d++)i.prototype[f[d]]=p;r.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,u=new l(x),f=i.document.createTextNode("");u.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var m=i.document.createElement("script");m.onreadystatechange=function(){x(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(x,0)};else{var p=new i.MessageChannel;p.port1.onmessage=x,s=function(){p.port2.postMessage(0)}}var d=[];function x(){var m,y;a=!0;for(var g=d.length;g;){for(y=d,d=[],m=-1;++m<g;)y[m]();g=d.length}a=!1}r.exports=function(m){d.push(m)!==1||a||s()}}).call(this,typeof vr<"u"?vr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function f(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,g!==s&&m(this,g)}function p(g,b,k){this.promise=g,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function d(g,b,k){i(function(){var S;try{S=b(k)}catch(C){return a.reject(g,C)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function x(g){var b=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof b=="function")return function(){b.apply(g,arguments)}}function m(g,b){var k=!1;function S(z){k||(k=!0,a.reject(g,z))}function C(z){k||(k=!0,a.resolve(g,z))}var T=y(function(){b(C,S)});T.status==="error"&&S(T.value)}function y(g,b){var k={};try{k.value=g(b),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=f).prototype.finally=function(g){if(typeof g!="function")return this;var b=this.constructor;return this.then(function(k){return b.resolve(g()).then(function(){return k})},function(k){return b.resolve(g()).then(function(){throw k})})},f.prototype.catch=function(g){return this.then(null,g)},f.prototype.then=function(g,b){if(typeof g!="function"&&this.state===c||typeof b!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==u?d(k,this.state===c?g:b,this.outcome):this.queue.push(new p(k,g,b)),k},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){d(this.promise,this.onFulfilled,g)},p.prototype.callRejected=function(g){a.reject(this.promise,g)},p.prototype.otherCallRejected=function(g){d(this.promise,this.onRejected,g)},a.resolve=function(g,b){var k=y(x,b);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)m(g,S);else{g.state=c,g.outcome=b;for(var C=-1,T=g.queue.length;++C<T;)g.queue[C].callFulfilled(b)}return g},a.reject=function(g,b){g.state=l,g.outcome=b;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(b);return g},f.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},f.reject=function(g){var b=new this(s);return a.reject(b,g)},f.all=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=new Array(k),T=0,z=-1,P=new this(s);++z<k;)O(g[z],z);return P;function O(M,B){b.resolve(M).then(function(E){C[B]=E,++T!==k||S||(S=!0,a.resolve(P,C))},function(E){S||(S=!0,a.reject(P,E))})}},f.race=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=-1,T=new this(s);++C<k;)z=g[C],b.resolve(z).then(function(P){S||(S=!0,a.resolve(T,P))},function(P){S||(S=!0,a.reject(T,P))});var z;return T}},{immediate:36}],38:[function(n,r,o){var i={};(0,n("./lib/utils/common").assign)(i,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var i=n("./zlib/deflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,f=0,p=-1,d=0,x=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:p,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},g||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(k!==f)throw new Error(l[k]);if(b.header&&i.deflateSetHeader(this.strm,b.header),b.dictionary){var S;if(S=typeof b.dictionary=="string"?a.string2buf(b.dictionary):u.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==f)throw new Error(l[k]);this._dict_set=!0}}function y(g,b){var k=new m(b);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}m.prototype.push=function(g,b){var k,S,C=this.strm,T=this.options.chunkSize;if(this.ended)return!1;S=b===~~b?b:b===!0?4:0,typeof g=="string"?C.input=a.string2buf(g):u.call(g)==="[object ArrayBuffer]"?C.input=new Uint8Array(g):C.input=g,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(T),C.next_out=0,C.avail_out=T),(k=i.deflate(C,S))!==1&&k!==f)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===f):S!==2||(this.onEnd(f),!(C.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=m,o.deflate=y,o.deflateRaw=function(g,b){return(b=b||{}).raw=!0,y(g,b)},o.gzip=function(g,b){return(b=b||{}).gzip=!0,y(g,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),f=n("./zlib/gzheader"),p=Object.prototype.toString;function d(m){if(!(this instanceof d))return new d(m);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,y.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new f,i.inflateGetHeader(this.strm,this.header)}function x(m,y){var g=new d(y);if(g.push(m,!0),g.err)throw g.msg||c[g.err];return g.result}d.prototype.push=function(m,y){var g,b,k,S,C,T,z=this.strm,P=this.options.chunkSize,O=this.options.dictionary,M=!1;if(this.ended)return!1;b=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?z.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?z.input=new Uint8Array(m):z.input=m,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new s.Buf8(P),z.next_out=0,z.avail_out=P),(g=i.inflate(z,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&O&&(T=typeof O=="string"?a.string2buf(O):p.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,g=i.inflateSetDictionary(this.strm,T)),g===l.Z_BUF_ERROR&&M===!0&&(g=l.Z_OK,M=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);z.next_out&&(z.avail_out!==0&&g!==l.Z_STREAM_END&&(z.avail_in!==0||b!==l.Z_FINISH&&b!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(z.output,z.next_out),S=z.next_out-k,C=a.buf2string(z.output,k),z.next_out=S,z.avail_out=P-S,S&&s.arraySet(z.output,z.output,k,S,0),this.onData(C)):this.onData(s.shrinkBuf(z.output,z.next_out)))),z.avail_in===0&&z.avail_out===0&&(M=!0)}while((0<z.avail_in||z.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(b=l.Z_FINISH),b===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):b!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(z.avail_out=0))},d.prototype.onData=function(m){this.chunks.push(m)},d.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=d,o.inflate=x,o.inflateRaw=function(m,y){return(y=y||{}).raw=!0,x(m,y)},o.ungzip=x},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var f in u)u.hasOwnProperty(f)&&(l[f]=u[f])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,u,f,p){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+f),p);else for(var d=0;d<f;d++)l[p+d]=c[u+d]},flattenChunks:function(l){var c,u,f,p,d,x;for(c=f=0,u=l.length;c<u;c++)f+=l[c].length;for(x=new Uint8Array(f),c=p=0,u=l.length;c<u;c++)d=l[c],x.set(d,p),p+=d.length;return x}},a={arraySet:function(l,c,u,f,p){for(var d=0;d<f;d++)l[p+d]=c[u+d]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(n,r,o){var i=n("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(f,p){if(p<65537&&(f.subarray&&a||!f.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(f,p));for(var d="",x=0;x<p;x++)d+=String.fromCharCode(f[x]);return d}l[254]=l[254]=1,o.string2buf=function(f){var p,d,x,m,y,g=f.length,b=0;for(m=0;m<g;m++)(64512&(d=f.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=f.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(x-56320),m++),b+=d<128?1:d<2048?2:d<65536?3:4;for(p=new i.Buf8(b),m=y=0;y<b;m++)(64512&(d=f.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=f.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(x-56320),m++),d<128?p[y++]=d:(d<2048?p[y++]=192|d>>>6:(d<65536?p[y++]=224|d>>>12:(p[y++]=240|d>>>18,p[y++]=128|d>>>12&63),p[y++]=128|d>>>6&63),p[y++]=128|63&d);return p},o.buf2binstring=function(f){return u(f,f.length)},o.binstring2buf=function(f){for(var p=new i.Buf8(f.length),d=0,x=p.length;d<x;d++)p[d]=f.charCodeAt(d);return p},o.buf2string=function(f,p){var d,x,m,y,g=p||f.length,b=new Array(2*g);for(d=x=0;d<g;)if((m=f[d++])<128)b[x++]=m;else if(4<(y=l[m]))b[x++]=65533,d+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&d<g;)m=m<<6|63&f[d++],y--;1<y?b[x++]=65533:m<65536?b[x++]=m:(m-=65536,b[x++]=55296|m>>10&1023,b[x++]=56320|1023&m)}return u(b,x)},o.utf8border=function(f,p){var d;for((p=p||f.length)>f.length&&(p=f.length),d=p-1;0<=d&&(192&f[d])==128;)d--;return d<0||d===0?p:d+l[f[d]]>p?d:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(i,s,a,l){for(var c=65535&i|0,u=i>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--f;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,c){var u=i,f=c+l;s^=-1;for(var p=c;p<f;p++)s=s>>>8^u[255&(s^a[p])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,p=4,d=0,x=-2,m=-1,y=4,g=2,b=8,k=9,S=286,C=30,T=19,z=2*S+1,P=15,O=3,M=258,B=M+O+1,E=42,L=113,v=1,D=2,K=3,Z=4;function W(w,Y){return w.msg=u[Y],Y}function q(w){return(w<<1)-(4<w?9:0)}function A(w){for(var Y=w.length;0<=--Y;)w[Y]=0}function U(w){var Y=w.state,H=Y.pending;H>w.avail_out&&(H=w.avail_out),H!==0&&(s.arraySet(w.output,Y.pending_buf,Y.pending_out,H,w.next_out),w.next_out+=H,Y.pending_out+=H,w.total_out+=H,w.avail_out-=H,Y.pending-=H,Y.pending===0&&(Y.pending_out=0))}function R(w,Y){a._tr_flush_block(w,0<=w.block_start?w.block_start:-1,w.strstart-w.block_start,Y),w.block_start=w.strstart,U(w.strm)}function N(w,Y){w.pending_buf[w.pending++]=Y}function J(w,Y){w.pending_buf[w.pending++]=Y>>>8&255,w.pending_buf[w.pending++]=255&Y}function Q(w,Y){var H,I,j=w.max_chain_length,F=w.strstart,ee=w.prev_length,ne=w.nice_match,V=w.strstart>w.w_size-B?w.strstart-(w.w_size-B):0,ie=w.window,ue=w.w_mask,se=w.prev,$=w.strstart+M,te=ie[F+ee-1],le=ie[F+ee];w.prev_length>=w.good_match&&(j>>=2),ne>w.lookahead&&(ne=w.lookahead);do if(ie[(H=Y)+ee]===le&&ie[H+ee-1]===te&&ie[H]===ie[F]&&ie[++H]===ie[F+1]){F+=2,H++;do;while(ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&ie[++F]===ie[++H]&&F<$);if(I=M-($-F),F=$-M,ee<I){if(w.match_start=Y,ne<=(ee=I))break;te=ie[F+ee-1],le=ie[F+ee]}}while((Y=se[Y&ue])>V&&--j!=0);return ee<=w.lookahead?ee:w.lookahead}function pe(w){var Y,H,I,j,F,ee,ne,V,ie,ue,se=w.w_size;do{if(j=w.window_size-w.lookahead-w.strstart,w.strstart>=se+(se-B)){for(s.arraySet(w.window,w.window,se,se,0),w.match_start-=se,w.strstart-=se,w.block_start-=se,Y=H=w.hash_size;I=w.head[--Y],w.head[Y]=se<=I?I-se:0,--H;);for(Y=H=se;I=w.prev[--Y],w.prev[Y]=se<=I?I-se:0,--H;);j+=se}if(w.strm.avail_in===0)break;if(ee=w.strm,ne=w.window,V=w.strstart+w.lookahead,ie=j,ue=void 0,ue=ee.avail_in,ie<ue&&(ue=ie),H=ue===0?0:(ee.avail_in-=ue,s.arraySet(ne,ee.input,ee.next_in,ue,V),ee.state.wrap===1?ee.adler=l(ee.adler,ne,ue,V):ee.state.wrap===2&&(ee.adler=c(ee.adler,ne,ue,V)),ee.next_in+=ue,ee.total_in+=ue,ue),w.lookahead+=H,w.lookahead+w.insert>=O)for(F=w.strstart-w.insert,w.ins_h=w.window[F],w.ins_h=(w.ins_h<<w.hash_shift^w.window[F+1])&w.hash_mask;w.insert&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[F+O-1])&w.hash_mask,w.prev[F&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=F,F++,w.insert--,!(w.lookahead+w.insert<O)););}while(w.lookahead<B&&w.strm.avail_in!==0)}function X(w,Y){for(var H,I;;){if(w.lookahead<B){if(pe(w),w.lookahead<B&&Y===f)return v;if(w.lookahead===0)break}if(H=0,w.lookahead>=O&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+O-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),H!==0&&w.strstart-H<=w.w_size-B&&(w.match_length=Q(w,H)),w.match_length>=O)if(I=a._tr_tally(w,w.strstart-w.match_start,w.match_length-O),w.lookahead-=w.match_length,w.match_length<=w.max_lazy_match&&w.lookahead>=O){for(w.match_length--;w.strstart++,w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+O-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart,--w.match_length!=0;);w.strstart++}else w.strstart+=w.match_length,w.match_length=0,w.ins_h=w.window[w.strstart],w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+1])&w.hash_mask;else I=a._tr_tally(w,0,w.window[w.strstart]),w.lookahead--,w.strstart++;if(I&&(R(w,!1),w.strm.avail_out===0))return v}return w.insert=w.strstart<O-1?w.strstart:O-1,Y===p?(R(w,!0),w.strm.avail_out===0?K:Z):w.last_lit&&(R(w,!1),w.strm.avail_out===0)?v:D}function ae(w,Y){for(var H,I,j;;){if(w.lookahead<B){if(pe(w),w.lookahead<B&&Y===f)return v;if(w.lookahead===0)break}if(H=0,w.lookahead>=O&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+O-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),w.prev_length=w.match_length,w.prev_match=w.match_start,w.match_length=O-1,H!==0&&w.prev_length<w.max_lazy_match&&w.strstart-H<=w.w_size-B&&(w.match_length=Q(w,H),w.match_length<=5&&(w.strategy===1||w.match_length===O&&4096<w.strstart-w.match_start)&&(w.match_length=O-1)),w.prev_length>=O&&w.match_length<=w.prev_length){for(j=w.strstart+w.lookahead-O,I=a._tr_tally(w,w.strstart-1-w.prev_match,w.prev_length-O),w.lookahead-=w.prev_length-1,w.prev_length-=2;++w.strstart<=j&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+O-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),--w.prev_length!=0;);if(w.match_available=0,w.match_length=O-1,w.strstart++,I&&(R(w,!1),w.strm.avail_out===0))return v}else if(w.match_available){if((I=a._tr_tally(w,0,w.window[w.strstart-1]))&&R(w,!1),w.strstart++,w.lookahead--,w.strm.avail_out===0)return v}else w.match_available=1,w.strstart++,w.lookahead--}return w.match_available&&(I=a._tr_tally(w,0,w.window[w.strstart-1]),w.match_available=0),w.insert=w.strstart<O-1?w.strstart:O-1,Y===p?(R(w,!0),w.strm.avail_out===0?K:Z):w.last_lit&&(R(w,!1),w.strm.avail_out===0)?v:D}function de(w,Y,H,I,j){this.good_length=w,this.max_lazy=Y,this.nice_length=H,this.max_chain=I,this.func=j}function me(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*z),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*T+1)),A(this.dyn_ltree),A(this.dyn_dtree),A(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(P+1),this.heap=new s.Buf16(2*S+1),A(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),A(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xe(w){var Y;return w&&w.state?(w.total_in=w.total_out=0,w.data_type=g,(Y=w.state).pending=0,Y.pending_out=0,Y.wrap<0&&(Y.wrap=-Y.wrap),Y.status=Y.wrap?E:L,w.adler=Y.wrap===2?0:1,Y.last_flush=f,a._tr_init(Y),d):W(w,x)}function Ee(w){var Y=xe(w);return Y===d&&(function(H){H.window_size=2*H.w_size,A(H.head),H.max_lazy_match=i[H.level].max_lazy,H.good_match=i[H.level].good_length,H.nice_match=i[H.level].nice_length,H.max_chain_length=i[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=O-1,H.match_available=0,H.ins_h=0})(w.state),Y}function Pe(w,Y,H,I,j,F){if(!w)return x;var ee=1;if(Y===m&&(Y=6),I<0?(ee=0,I=-I):15<I&&(ee=2,I-=16),j<1||k<j||H!==b||I<8||15<I||Y<0||9<Y||F<0||y<F)return W(w,x);I===8&&(I=9);var ne=new me;return(w.state=ne).strm=w,ne.wrap=ee,ne.gzhead=null,ne.w_bits=I,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=j+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+O-1)/O),ne.window=new s.Buf8(2*ne.w_size),ne.head=new s.Buf16(ne.hash_size),ne.prev=new s.Buf16(ne.w_size),ne.lit_bufsize=1<<j+6,ne.pending_buf_size=4*ne.lit_bufsize,ne.pending_buf=new s.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=Y,ne.strategy=F,ne.method=H,Ee(w)}i=[new de(0,0,0,0,function(w,Y){var H=65535;for(H>w.pending_buf_size-5&&(H=w.pending_buf_size-5);;){if(w.lookahead<=1){if(pe(w),w.lookahead===0&&Y===f)return v;if(w.lookahead===0)break}w.strstart+=w.lookahead,w.lookahead=0;var I=w.block_start+H;if((w.strstart===0||w.strstart>=I)&&(w.lookahead=w.strstart-I,w.strstart=I,R(w,!1),w.strm.avail_out===0)||w.strstart-w.block_start>=w.w_size-B&&(R(w,!1),w.strm.avail_out===0))return v}return w.insert=0,Y===p?(R(w,!0),w.strm.avail_out===0?K:Z):(w.strstart>w.block_start&&(R(w,!1),w.strm.avail_out),v)}),new de(4,4,8,4,X),new de(4,5,16,8,X),new de(4,6,32,32,X),new de(4,4,16,16,ae),new de(8,16,32,32,ae),new de(8,16,128,128,ae),new de(8,32,128,256,ae),new de(32,128,258,1024,ae),new de(32,258,258,4096,ae)],o.deflateInit=function(w,Y){return Pe(w,Y,b,15,8,0)},o.deflateInit2=Pe,o.deflateReset=Ee,o.deflateResetKeep=xe,o.deflateSetHeader=function(w,Y){return w&&w.state?w.state.wrap!==2?x:(w.state.gzhead=Y,d):x},o.deflate=function(w,Y){var H,I,j,F;if(!w||!w.state||5<Y||Y<0)return w?W(w,x):x;if(I=w.state,!w.output||!w.input&&w.avail_in!==0||I.status===666&&Y!==p)return W(w,w.avail_out===0?-5:x);if(I.strm=w,H=I.last_flush,I.last_flush=Y,I.status===E)if(I.wrap===2)w.adler=0,N(I,31),N(I,139),N(I,8),I.gzhead?(N(I,(I.gzhead.text?1:0)+(I.gzhead.hcrc?2:0)+(I.gzhead.extra?4:0)+(I.gzhead.name?8:0)+(I.gzhead.comment?16:0)),N(I,255&I.gzhead.time),N(I,I.gzhead.time>>8&255),N(I,I.gzhead.time>>16&255),N(I,I.gzhead.time>>24&255),N(I,I.level===9?2:2<=I.strategy||I.level<2?4:0),N(I,255&I.gzhead.os),I.gzhead.extra&&I.gzhead.extra.length&&(N(I,255&I.gzhead.extra.length),N(I,I.gzhead.extra.length>>8&255)),I.gzhead.hcrc&&(w.adler=c(w.adler,I.pending_buf,I.pending,0)),I.gzindex=0,I.status=69):(N(I,0),N(I,0),N(I,0),N(I,0),N(I,0),N(I,I.level===9?2:2<=I.strategy||I.level<2?4:0),N(I,3),I.status=L);else{var ee=b+(I.w_bits-8<<4)<<8;ee|=(2<=I.strategy||I.level<2?0:I.level<6?1:I.level===6?2:3)<<6,I.strstart!==0&&(ee|=32),ee+=31-ee%31,I.status=L,J(I,ee),I.strstart!==0&&(J(I,w.adler>>>16),J(I,65535&w.adler)),w.adler=1}if(I.status===69)if(I.gzhead.extra){for(j=I.pending;I.gzindex<(65535&I.gzhead.extra.length)&&(I.pending!==I.pending_buf_size||(I.gzhead.hcrc&&I.pending>j&&(w.adler=c(w.adler,I.pending_buf,I.pending-j,j)),U(w),j=I.pending,I.pending!==I.pending_buf_size));)N(I,255&I.gzhead.extra[I.gzindex]),I.gzindex++;I.gzhead.hcrc&&I.pending>j&&(w.adler=c(w.adler,I.pending_buf,I.pending-j,j)),I.gzindex===I.gzhead.extra.length&&(I.gzindex=0,I.status=73)}else I.status=73;if(I.status===73)if(I.gzhead.name){j=I.pending;do{if(I.pending===I.pending_buf_size&&(I.gzhead.hcrc&&I.pending>j&&(w.adler=c(w.adler,I.pending_buf,I.pending-j,j)),U(w),j=I.pending,I.pending===I.pending_buf_size)){F=1;break}F=I.gzindex<I.gzhead.name.length?255&I.gzhead.name.charCodeAt(I.gzindex++):0,N(I,F)}while(F!==0);I.gzhead.hcrc&&I.pending>j&&(w.adler=c(w.adler,I.pending_buf,I.pending-j,j)),F===0&&(I.gzindex=0,I.status=91)}else I.status=91;if(I.status===91)if(I.gzhead.comment){j=I.pending;do{if(I.pending===I.pending_buf_size&&(I.gzhead.hcrc&&I.pending>j&&(w.adler=c(w.adler,I.pending_buf,I.pending-j,j)),U(w),j=I.pending,I.pending===I.pending_buf_size)){F=1;break}F=I.gzindex<I.gzhead.comment.length?255&I.gzhead.comment.charCodeAt(I.gzindex++):0,N(I,F)}while(F!==0);I.gzhead.hcrc&&I.pending>j&&(w.adler=c(w.adler,I.pending_buf,I.pending-j,j)),F===0&&(I.status=103)}else I.status=103;if(I.status===103&&(I.gzhead.hcrc?(I.pending+2>I.pending_buf_size&&U(w),I.pending+2<=I.pending_buf_size&&(N(I,255&w.adler),N(I,w.adler>>8&255),w.adler=0,I.status=L)):I.status=L),I.pending!==0){if(U(w),w.avail_out===0)return I.last_flush=-1,d}else if(w.avail_in===0&&q(Y)<=q(H)&&Y!==p)return W(w,-5);if(I.status===666&&w.avail_in!==0)return W(w,-5);if(w.avail_in!==0||I.lookahead!==0||Y!==f&&I.status!==666){var ne=I.strategy===2?(function(V,ie){for(var ue;;){if(V.lookahead===0&&(pe(V),V.lookahead===0)){if(ie===f)return v;break}if(V.match_length=0,ue=a._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,ue&&(R(V,!1),V.strm.avail_out===0))return v}return V.insert=0,ie===p?(R(V,!0),V.strm.avail_out===0?K:Z):V.last_lit&&(R(V,!1),V.strm.avail_out===0)?v:D})(I,Y):I.strategy===3?(function(V,ie){for(var ue,se,$,te,le=V.window;;){if(V.lookahead<=M){if(pe(V),V.lookahead<=M&&ie===f)return v;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=O&&0<V.strstart&&(se=le[$=V.strstart-1])===le[++$]&&se===le[++$]&&se===le[++$]){te=V.strstart+M;do;while(se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&se===le[++$]&&$<te);V.match_length=M-(te-$),V.match_length>V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=O?(ue=a._tr_tally(V,1,V.match_length-O),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(ue=a._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),ue&&(R(V,!1),V.strm.avail_out===0))return v}return V.insert=0,ie===p?(R(V,!0),V.strm.avail_out===0?K:Z):V.last_lit&&(R(V,!1),V.strm.avail_out===0)?v:D})(I,Y):i[I.level].func(I,Y);if(ne!==K&&ne!==Z||(I.status=666),ne===v||ne===K)return w.avail_out===0&&(I.last_flush=-1),d;if(ne===D&&(Y===1?a._tr_align(I):Y!==5&&(a._tr_stored_block(I,0,0,!1),Y===3&&(A(I.head),I.lookahead===0&&(I.strstart=0,I.block_start=0,I.insert=0))),U(w),w.avail_out===0))return I.last_flush=-1,d}return Y!==p?d:I.wrap<=0?1:(I.wrap===2?(N(I,255&w.adler),N(I,w.adler>>8&255),N(I,w.adler>>16&255),N(I,w.adler>>24&255),N(I,255&w.total_in),N(I,w.total_in>>8&255),N(I,w.total_in>>16&255),N(I,w.total_in>>24&255)):(J(I,w.adler>>>16),J(I,65535&w.adler)),U(w),0<I.wrap&&(I.wrap=-I.wrap),I.pending!==0?d:1)},o.deflateEnd=function(w){var Y;return w&&w.state?(Y=w.state.status)!==E&&Y!==69&&Y!==73&&Y!==91&&Y!==103&&Y!==L&&Y!==666?W(w,x):(w.state=null,Y===L?W(w,-3):d):x},o.deflateSetDictionary=function(w,Y){var H,I,j,F,ee,ne,V,ie,ue=Y.length;if(!w||!w.state||(F=(H=w.state).wrap)===2||F===1&&H.status!==E||H.lookahead)return x;for(F===1&&(w.adler=l(w.adler,Y,ue,0)),H.wrap=0,ue>=H.w_size&&(F===0&&(A(H.head),H.strstart=0,H.block_start=0,H.insert=0),ie=new s.Buf8(H.w_size),s.arraySet(ie,Y,ue-H.w_size,H.w_size,0),Y=ie,ue=H.w_size),ee=w.avail_in,ne=w.next_in,V=w.input,w.avail_in=ue,w.next_in=0,w.input=Y,pe(H);H.lookahead>=O;){for(I=H.strstart,j=H.lookahead-(O-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[I+O-1])&H.hash_mask,H.prev[I&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=I,I++,--j;);H.strstart=I,H.lookahead=O-1,pe(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=O-1,H.match_available=0,w.next_in=ne,w.input=V,w.avail_in=ee,H.wrap=F,d},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(i,s){var a,l,c,u,f,p,d,x,m,y,g,b,k,S,C,T,z,P,O,M,B,E,L,v,D;a=i.state,l=i.next_in,v=i.input,c=l+(i.avail_in-5),u=i.next_out,D=i.output,f=u-(s-i.avail_out),p=u+(i.avail_out-257),d=a.dmax,x=a.wsize,m=a.whave,y=a.wnext,g=a.window,b=a.hold,k=a.bits,S=a.lencode,C=a.distcode,T=(1<<a.lenbits)-1,z=(1<<a.distbits)-1;e:do{k<15&&(b+=v[l++]<<k,k+=8,b+=v[l++]<<k,k+=8),P=S[b&T];t:for(;;){if(b>>>=O=P>>>24,k-=O,(O=P>>>16&255)===0)D[u++]=65535&P;else{if(!(16&O)){if((64&O)==0){P=S[(65535&P)+(b&(1<<O)-1)];continue t}if(32&O){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}M=65535&P,(O&=15)&&(k<O&&(b+=v[l++]<<k,k+=8),M+=b&(1<<O)-1,b>>>=O,k-=O),k<15&&(b+=v[l++]<<k,k+=8,b+=v[l++]<<k,k+=8),P=C[b&z];n:for(;;){if(b>>>=O=P>>>24,k-=O,!(16&(O=P>>>16&255))){if((64&O)==0){P=C[(65535&P)+(b&(1<<O)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(B=65535&P,k<(O&=15)&&(b+=v[l++]<<k,(k+=8)<O&&(b+=v[l++]<<k,k+=8)),d<(B+=b&(1<<O)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(b>>>=O,k-=O,(O=u-f)<B){if(m<(O=B-O)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(L=g,(E=0)===y){if(E+=x-O,O<M){for(M-=O;D[u++]=g[E++],--O;);E=u-B,L=D}}else if(y<O){if(E+=x+y-O,(O-=y)<M){for(M-=O;D[u++]=g[E++],--O;);if(E=0,y<M){for(M-=O=y;D[u++]=g[E++],--O;);E=u-B,L=D}}}else if(E+=y-O,O<M){for(M-=O;D[u++]=g[E++],--O;);E=u-B,L=D}for(;2<M;)D[u++]=L[E++],D[u++]=L[E++],D[u++]=L[E++],M-=3;M&&(D[u++]=L[E++],1<M&&(D[u++]=L[E++]))}else{for(E=u-B;D[u++]=D[E++],D[u++]=D[E++],D[u++]=D[E++],2<(M-=3););M&&(D[u++]=D[E++],1<M&&(D[u++]=D[E++]))}break}}break}}while(l<c&&u<p);l-=M=k>>3,b&=(1<<(k-=M<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<p?p-u+257:257-(u-p),a.hold=b,a.bits=k}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,f=2,p=0,d=-2,x=1,m=852,y=592;function g(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(E){var L;return E&&E.state?(L=E.state,E.total_in=E.total_out=L.total=0,E.msg="",L.wrap&&(E.adler=1&L.wrap),L.mode=x,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new i.Buf32(m),L.distcode=L.distdyn=new i.Buf32(y),L.sane=1,L.back=-1,p):d}function S(E){var L;return E&&E.state?((L=E.state).wsize=0,L.whave=0,L.wnext=0,k(E)):d}function C(E,L){var v,D;return E&&E.state?(D=E.state,L<0?(v=0,L=-L):(v=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?d:(D.window!==null&&D.wbits!==L&&(D.window=null),D.wrap=v,D.wbits=L,S(E))):d}function T(E,L){var v,D;return E?(D=new b,(E.state=D).window=null,(v=C(E,L))!==p&&(E.state=null),v):d}var z,P,O=!0;function M(E){if(O){var L;for(z=new i.Buf32(512),P=new i.Buf32(32),L=0;L<144;)E.lens[L++]=8;for(;L<256;)E.lens[L++]=9;for(;L<280;)E.lens[L++]=7;for(;L<288;)E.lens[L++]=8;for(c(u,E.lens,0,288,z,0,E.work,{bits:9}),L=0;L<32;)E.lens[L++]=5;c(f,E.lens,0,32,P,0,E.work,{bits:5}),O=!1}E.lencode=z,E.lenbits=9,E.distcode=P,E.distbits=5}function B(E,L,v,D){var K,Z=E.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new i.Buf8(Z.wsize)),D>=Z.wsize?(i.arraySet(Z.window,L,v-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize):(D<(K=Z.wsize-Z.wnext)&&(K=D),i.arraySet(Z.window,L,v-D,K,Z.wnext),(D-=K)?(i.arraySet(Z.window,L,v-D,D,0),Z.wnext=D,Z.whave=Z.wsize):(Z.wnext+=K,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=K))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(E){return T(E,15)},o.inflateInit2=T,o.inflate=function(E,L){var v,D,K,Z,W,q,A,U,R,N,J,Q,pe,X,ae,de,me,xe,Ee,Pe,w,Y,H,I,j=0,F=new i.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return d;(v=E.state).mode===12&&(v.mode=13),W=E.next_out,K=E.output,A=E.avail_out,Z=E.next_in,D=E.input,q=E.avail_in,U=v.hold,R=v.bits,N=q,J=A,Y=p;e:for(;;)switch(v.mode){case x:if(v.wrap===0){v.mode=13;break}for(;R<16;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if(2&v.wrap&&U===35615){F[v.check=0]=255&U,F[1]=U>>>8&255,v.check=a(v.check,F,2,0),R=U=0,v.mode=2;break}if(v.flags=0,v.head&&(v.head.done=!1),!(1&v.wrap)||(((255&U)<<8)+(U>>8))%31){E.msg="incorrect header check",v.mode=30;break}if((15&U)!=8){E.msg="unknown compression method",v.mode=30;break}if(R-=4,w=8+(15&(U>>>=4)),v.wbits===0)v.wbits=w;else if(w>v.wbits){E.msg="invalid window size",v.mode=30;break}v.dmax=1<<w,E.adler=v.check=1,v.mode=512&U?10:12,R=U=0;break;case 2:for(;R<16;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if(v.flags=U,(255&v.flags)!=8){E.msg="unknown compression method",v.mode=30;break}if(57344&v.flags){E.msg="unknown header flags set",v.mode=30;break}v.head&&(v.head.text=U>>8&1),512&v.flags&&(F[0]=255&U,F[1]=U>>>8&255,v.check=a(v.check,F,2,0)),R=U=0,v.mode=3;case 3:for(;R<32;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}v.head&&(v.head.time=U),512&v.flags&&(F[0]=255&U,F[1]=U>>>8&255,F[2]=U>>>16&255,F[3]=U>>>24&255,v.check=a(v.check,F,4,0)),R=U=0,v.mode=4;case 4:for(;R<16;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}v.head&&(v.head.xflags=255&U,v.head.os=U>>8),512&v.flags&&(F[0]=255&U,F[1]=U>>>8&255,v.check=a(v.check,F,2,0)),R=U=0,v.mode=5;case 5:if(1024&v.flags){for(;R<16;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}v.length=U,v.head&&(v.head.extra_len=U),512&v.flags&&(F[0]=255&U,F[1]=U>>>8&255,v.check=a(v.check,F,2,0)),R=U=0}else v.head&&(v.head.extra=null);v.mode=6;case 6:if(1024&v.flags&&(q<(Q=v.length)&&(Q=q),Q&&(v.head&&(w=v.head.extra_len-v.length,v.head.extra||(v.head.extra=new Array(v.head.extra_len)),i.arraySet(v.head.extra,D,Z,Q,w)),512&v.flags&&(v.check=a(v.check,D,Q,Z)),q-=Q,Z+=Q,v.length-=Q),v.length))break e;v.length=0,v.mode=7;case 7:if(2048&v.flags){if(q===0)break e;for(Q=0;w=D[Z+Q++],v.head&&w&&v.length<65536&&(v.head.name+=String.fromCharCode(w)),w&&Q<q;);if(512&v.flags&&(v.check=a(v.check,D,Q,Z)),q-=Q,Z+=Q,w)break e}else v.head&&(v.head.name=null);v.length=0,v.mode=8;case 8:if(4096&v.flags){if(q===0)break e;for(Q=0;w=D[Z+Q++],v.head&&w&&v.length<65536&&(v.head.comment+=String.fromCharCode(w)),w&&Q<q;);if(512&v.flags&&(v.check=a(v.check,D,Q,Z)),q-=Q,Z+=Q,w)break e}else v.head&&(v.head.comment=null);v.mode=9;case 9:if(512&v.flags){for(;R<16;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if(U!==(65535&v.check)){E.msg="header crc mismatch",v.mode=30;break}R=U=0}v.head&&(v.head.hcrc=v.flags>>9&1,v.head.done=!0),E.adler=v.check=0,v.mode=12;break;case 10:for(;R<32;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}E.adler=v.check=g(U),R=U=0,v.mode=11;case 11:if(v.havedict===0)return E.next_out=W,E.avail_out=A,E.next_in=Z,E.avail_in=q,v.hold=U,v.bits=R,2;E.adler=v.check=1,v.mode=12;case 12:if(L===5||L===6)break e;case 13:if(v.last){U>>>=7&R,R-=7&R,v.mode=27;break}for(;R<3;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}switch(v.last=1&U,R-=1,3&(U>>>=1)){case 0:v.mode=14;break;case 1:if(M(v),v.mode=20,L!==6)break;U>>>=2,R-=2;break e;case 2:v.mode=17;break;case 3:E.msg="invalid block type",v.mode=30}U>>>=2,R-=2;break;case 14:for(U>>>=7&R,R-=7&R;R<32;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if((65535&U)!=(U>>>16^65535)){E.msg="invalid stored block lengths",v.mode=30;break}if(v.length=65535&U,R=U=0,v.mode=15,L===6)break e;case 15:v.mode=16;case 16:if(Q=v.length){if(q<Q&&(Q=q),A<Q&&(Q=A),Q===0)break e;i.arraySet(K,D,Z,Q,W),q-=Q,Z+=Q,A-=Q,W+=Q,v.length-=Q;break}v.mode=12;break;case 17:for(;R<14;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if(v.nlen=257+(31&U),U>>>=5,R-=5,v.ndist=1+(31&U),U>>>=5,R-=5,v.ncode=4+(15&U),U>>>=4,R-=4,286<v.nlen||30<v.ndist){E.msg="too many length or distance symbols",v.mode=30;break}v.have=0,v.mode=18;case 18:for(;v.have<v.ncode;){for(;R<3;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}v.lens[ee[v.have++]]=7&U,U>>>=3,R-=3}for(;v.have<19;)v.lens[ee[v.have++]]=0;if(v.lencode=v.lendyn,v.lenbits=7,H={bits:v.lenbits},Y=c(0,v.lens,0,19,v.lencode,0,v.work,H),v.lenbits=H.bits,Y){E.msg="invalid code lengths set",v.mode=30;break}v.have=0,v.mode=19;case 19:for(;v.have<v.nlen+v.ndist;){for(;de=(j=v.lencode[U&(1<<v.lenbits)-1])>>>16&255,me=65535&j,!((ae=j>>>24)<=R);){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if(me<16)U>>>=ae,R-=ae,v.lens[v.have++]=me;else{if(me===16){for(I=ae+2;R<I;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if(U>>>=ae,R-=ae,v.have===0){E.msg="invalid bit length repeat",v.mode=30;break}w=v.lens[v.have-1],Q=3+(3&U),U>>>=2,R-=2}else if(me===17){for(I=ae+3;R<I;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}R-=ae,w=0,Q=3+(7&(U>>>=ae)),U>>>=3,R-=3}else{for(I=ae+7;R<I;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}R-=ae,w=0,Q=11+(127&(U>>>=ae)),U>>>=7,R-=7}if(v.have+Q>v.nlen+v.ndist){E.msg="invalid bit length repeat",v.mode=30;break}for(;Q--;)v.lens[v.have++]=w}}if(v.mode===30)break;if(v.lens[256]===0){E.msg="invalid code -- missing end-of-block",v.mode=30;break}if(v.lenbits=9,H={bits:v.lenbits},Y=c(u,v.lens,0,v.nlen,v.lencode,0,v.work,H),v.lenbits=H.bits,Y){E.msg="invalid literal/lengths set",v.mode=30;break}if(v.distbits=6,v.distcode=v.distdyn,H={bits:v.distbits},Y=c(f,v.lens,v.nlen,v.ndist,v.distcode,0,v.work,H),v.distbits=H.bits,Y){E.msg="invalid distances set",v.mode=30;break}if(v.mode=20,L===6)break e;case 20:v.mode=21;case 21:if(6<=q&&258<=A){E.next_out=W,E.avail_out=A,E.next_in=Z,E.avail_in=q,v.hold=U,v.bits=R,l(E,J),W=E.next_out,K=E.output,A=E.avail_out,Z=E.next_in,D=E.input,q=E.avail_in,U=v.hold,R=v.bits,v.mode===12&&(v.back=-1);break}for(v.back=0;de=(j=v.lencode[U&(1<<v.lenbits)-1])>>>16&255,me=65535&j,!((ae=j>>>24)<=R);){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if(de&&(240&de)==0){for(xe=ae,Ee=de,Pe=me;de=(j=v.lencode[Pe+((U&(1<<xe+Ee)-1)>>xe)])>>>16&255,me=65535&j,!(xe+(ae=j>>>24)<=R);){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}U>>>=xe,R-=xe,v.back+=xe}if(U>>>=ae,R-=ae,v.back+=ae,v.length=me,de===0){v.mode=26;break}if(32&de){v.back=-1,v.mode=12;break}if(64&de){E.msg="invalid literal/length code",v.mode=30;break}v.extra=15&de,v.mode=22;case 22:if(v.extra){for(I=v.extra;R<I;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}v.length+=U&(1<<v.extra)-1,U>>>=v.extra,R-=v.extra,v.back+=v.extra}v.was=v.length,v.mode=23;case 23:for(;de=(j=v.distcode[U&(1<<v.distbits)-1])>>>16&255,me=65535&j,!((ae=j>>>24)<=R);){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if((240&de)==0){for(xe=ae,Ee=de,Pe=me;de=(j=v.distcode[Pe+((U&(1<<xe+Ee)-1)>>xe)])>>>16&255,me=65535&j,!(xe+(ae=j>>>24)<=R);){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}U>>>=xe,R-=xe,v.back+=xe}if(U>>>=ae,R-=ae,v.back+=ae,64&de){E.msg="invalid distance code",v.mode=30;break}v.offset=me,v.extra=15&de,v.mode=24;case 24:if(v.extra){for(I=v.extra;R<I;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}v.offset+=U&(1<<v.extra)-1,U>>>=v.extra,R-=v.extra,v.back+=v.extra}if(v.offset>v.dmax){E.msg="invalid distance too far back",v.mode=30;break}v.mode=25;case 25:if(A===0)break e;if(Q=J-A,v.offset>Q){if((Q=v.offset-Q)>v.whave&&v.sane){E.msg="invalid distance too far back",v.mode=30;break}pe=Q>v.wnext?(Q-=v.wnext,v.wsize-Q):v.wnext-Q,Q>v.length&&(Q=v.length),X=v.window}else X=K,pe=W-v.offset,Q=v.length;for(A<Q&&(Q=A),A-=Q,v.length-=Q;K[W++]=X[pe++],--Q;);v.length===0&&(v.mode=21);break;case 26:if(A===0)break e;K[W++]=v.length,A--,v.mode=21;break;case 27:if(v.wrap){for(;R<32;){if(q===0)break e;q--,U|=D[Z++]<<R,R+=8}if(J-=A,E.total_out+=J,v.total+=J,J&&(E.adler=v.check=v.flags?a(v.check,K,J,W-J):s(v.check,K,J,W-J)),J=A,(v.flags?U:g(U))!==v.check){E.msg="incorrect data check",v.mode=30;break}R=U=0}v.mode=28;case 28:if(v.wrap&&v.flags){for(;R<32;){if(q===0)break e;q--,U+=D[Z++]<<R,R+=8}if(U!==(4294967295&v.total)){E.msg="incorrect length check",v.mode=30;break}R=U=0}v.mode=29;case 29:Y=1;break e;case 30:Y=-3;break e;case 31:return-4;default:return d}return E.next_out=W,E.avail_out=A,E.next_in=Z,E.avail_in=q,v.hold=U,v.bits=R,(v.wsize||J!==E.avail_out&&v.mode<30&&(v.mode<27||L!==4))&&B(E,E.output,E.next_out,J-E.avail_out)?(v.mode=31,-4):(N-=E.avail_in,J-=E.avail_out,E.total_in+=N,E.total_out+=J,v.total+=J,v.wrap&&J&&(E.adler=v.check=v.flags?a(v.check,K,J,E.next_out-J):s(v.check,K,J,E.next_out-J)),E.data_type=v.bits+(v.last?64:0)+(v.mode===12?128:0)+(v.mode===20||v.mode===15?256:0),(N==0&&J===0||L===4)&&Y===p&&(Y=-5),Y)},o.inflateEnd=function(E){if(!E||!E.state)return d;var L=E.state;return L.window&&(L.window=null),E.state=null,p},o.inflateGetHeader=function(E,L){var v;return E&&E.state?(2&(v=E.state).wrap)==0?d:((v.head=L).done=!1,p):d},o.inflateSetDictionary=function(E,L){var v,D=L.length;return E&&E.state?(v=E.state).wrap!==0&&v.mode!==11?d:v.mode===11&&s(1,L,D,0)!==v.check?-3:B(E,L,D,D)?(v.mode=31,-4):(v.havedict=1,p):d},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var i=n("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,f,p,d,x,m,y,g){var b,k,S,C,T,z,P,O,M,B=g.bits,E=0,L=0,v=0,D=0,K=0,Z=0,W=0,q=0,A=0,U=0,R=null,N=0,J=new i.Buf16(16),Q=new i.Buf16(16),pe=null,X=0;for(E=0;E<=15;E++)J[E]=0;for(L=0;L<d;L++)J[f[p+L]]++;for(K=B,D=15;1<=D&&J[D]===0;D--);if(D<K&&(K=D),D===0)return x[m++]=20971520,x[m++]=20971520,g.bits=1,0;for(v=1;v<D&&J[v]===0;v++);for(K<v&&(K=v),E=q=1;E<=15;E++)if(q<<=1,(q-=J[E])<0)return-1;if(0<q&&(u===0||D!==1))return-1;for(Q[1]=0,E=1;E<15;E++)Q[E+1]=Q[E]+J[E];for(L=0;L<d;L++)f[p+L]!==0&&(y[Q[f[p+L]]++]=L);if(z=u===0?(R=pe=y,19):u===1?(R=s,N-=257,pe=a,X-=257,256):(R=l,pe=c,-1),E=v,T=m,W=L=U=0,S=-1,C=(A=1<<(Z=K))-1,u===1&&852<A||u===2&&592<A)return 1;for(;;){for(P=E-W,M=y[L]<z?(O=0,y[L]):y[L]>z?(O=pe[X+y[L]],R[N+y[L]]):(O=96,0),b=1<<E-W,v=k=1<<Z;x[T+(U>>W)+(k-=b)]=P<<24|O<<16|M|0,k!==0;);for(b=1<<E-1;U&b;)b>>=1;if(b!==0?(U&=b-1,U+=b):U=0,L++,--J[E]==0){if(E===D)break;E=f[p+y[L]]}if(K<E&&(U&C)!==S){for(W===0&&(W=K),T+=v,q=1<<(Z=E-W);Z+W<D&&!((q-=J[Z+W])<=0);)Z++,q<<=1;if(A+=1<<Z,u===1&&852<A||u===2&&592<A)return 1;x[S=U&C]=K<<24|Z<<16|T-m|0}}return U!==0&&(x[T+U]=E-W<<24|64<<16|0),g.bits=K,0}},{"../utils/common":41}],51:[function(n,r,o){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,o){var i=n("../utils/common"),s=0,a=1;function l(j){for(var F=j.length;0<=--F;)j[F]=0}var c=0,u=29,f=256,p=f+1+u,d=30,x=19,m=2*p+1,y=15,g=16,b=7,k=256,S=16,C=17,T=18,z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=new Array(2*(p+2));l(B);var E=new Array(2*d);l(E);var L=new Array(512);l(L);var v=new Array(256);l(v);var D=new Array(u);l(D);var K,Z,W,q=new Array(d);function A(j,F,ee,ne,V){this.static_tree=j,this.extra_bits=F,this.extra_base=ee,this.elems=ne,this.max_length=V,this.has_stree=j&&j.length}function U(j,F){this.dyn_tree=j,this.max_code=0,this.stat_desc=F}function R(j){return j<256?L[j]:L[256+(j>>>7)]}function N(j,F){j.pending_buf[j.pending++]=255&F,j.pending_buf[j.pending++]=F>>>8&255}function J(j,F,ee){j.bi_valid>g-ee?(j.bi_buf|=F<<j.bi_valid&65535,N(j,j.bi_buf),j.bi_buf=F>>g-j.bi_valid,j.bi_valid+=ee-g):(j.bi_buf|=F<<j.bi_valid&65535,j.bi_valid+=ee)}function Q(j,F,ee){J(j,ee[2*F],ee[2*F+1])}function pe(j,F){for(var ee=0;ee|=1&j,j>>>=1,ee<<=1,0<--F;);return ee>>>1}function X(j,F,ee){var ne,V,ie=new Array(y+1),ue=0;for(ne=1;ne<=y;ne++)ie[ne]=ue=ue+ee[ne-1]<<1;for(V=0;V<=F;V++){var se=j[2*V+1];se!==0&&(j[2*V]=pe(ie[se]++,se))}}function ae(j){var F;for(F=0;F<p;F++)j.dyn_ltree[2*F]=0;for(F=0;F<d;F++)j.dyn_dtree[2*F]=0;for(F=0;F<x;F++)j.bl_tree[2*F]=0;j.dyn_ltree[2*k]=1,j.opt_len=j.static_len=0,j.last_lit=j.matches=0}function de(j){8<j.bi_valid?N(j,j.bi_buf):0<j.bi_valid&&(j.pending_buf[j.pending++]=j.bi_buf),j.bi_buf=0,j.bi_valid=0}function me(j,F,ee,ne){var V=2*F,ie=2*ee;return j[V]<j[ie]||j[V]===j[ie]&&ne[F]<=ne[ee]}function xe(j,F,ee){for(var ne=j.heap[ee],V=ee<<1;V<=j.heap_len&&(V<j.heap_len&&me(F,j.heap[V+1],j.heap[V],j.depth)&&V++,!me(F,ne,j.heap[V],j.depth));)j.heap[ee]=j.heap[V],ee=V,V<<=1;j.heap[ee]=ne}function Ee(j,F,ee){var ne,V,ie,ue,se=0;if(j.last_lit!==0)for(;ne=j.pending_buf[j.d_buf+2*se]<<8|j.pending_buf[j.d_buf+2*se+1],V=j.pending_buf[j.l_buf+se],se++,ne===0?Q(j,V,F):(Q(j,(ie=v[V])+f+1,F),(ue=z[ie])!==0&&J(j,V-=D[ie],ue),Q(j,ie=R(--ne),ee),(ue=P[ie])!==0&&J(j,ne-=q[ie],ue)),se<j.last_lit;);Q(j,k,F)}function Pe(j,F){var ee,ne,V,ie=F.dyn_tree,ue=F.stat_desc.static_tree,se=F.stat_desc.has_stree,$=F.stat_desc.elems,te=-1;for(j.heap_len=0,j.heap_max=m,ee=0;ee<$;ee++)ie[2*ee]!==0?(j.heap[++j.heap_len]=te=ee,j.depth[ee]=0):ie[2*ee+1]=0;for(;j.heap_len<2;)ie[2*(V=j.heap[++j.heap_len]=te<2?++te:0)]=1,j.depth[V]=0,j.opt_len--,se&&(j.static_len-=ue[2*V+1]);for(F.max_code=te,ee=j.heap_len>>1;1<=ee;ee--)xe(j,ie,ee);for(V=$;ee=j.heap[1],j.heap[1]=j.heap[j.heap_len--],xe(j,ie,1),ne=j.heap[1],j.heap[--j.heap_max]=ee,j.heap[--j.heap_max]=ne,ie[2*V]=ie[2*ee]+ie[2*ne],j.depth[V]=(j.depth[ee]>=j.depth[ne]?j.depth[ee]:j.depth[ne])+1,ie[2*ee+1]=ie[2*ne+1]=V,j.heap[1]=V++,xe(j,ie,1),2<=j.heap_len;);j.heap[--j.heap_max]=j.heap[1],(function(le,ve){var Ae,Ze,it,ze,_t,Pt,$e=ve.dyn_tree,Rt=ve.max_code,gt=ve.stat_desc.static_tree,dh=ve.stat_desc.has_stree,fh=ve.stat_desc.extra_bits,Ms=ve.stat_desc.extra_base,Wn=ve.stat_desc.max_length,yr=0;for(ze=0;ze<=y;ze++)le.bl_count[ze]=0;for($e[2*le.heap[le.heap_max]+1]=0,Ae=le.heap_max+1;Ae<m;Ae++)Wn<(ze=$e[2*$e[2*(Ze=le.heap[Ae])+1]+1]+1)&&(ze=Wn,yr++),$e[2*Ze+1]=ze,Rt<Ze||(le.bl_count[ze]++,_t=0,Ms<=Ze&&(_t=fh[Ze-Ms]),Pt=$e[2*Ze],le.opt_len+=Pt*(ze+_t),dh&&(le.static_len+=Pt*(gt[2*Ze+1]+_t)));if(yr!==0){do{for(ze=Wn-1;le.bl_count[ze]===0;)ze--;le.bl_count[ze]--,le.bl_count[ze+1]+=2,le.bl_count[Wn]--,yr-=2}while(0<yr);for(ze=Wn;ze!==0;ze--)for(Ze=le.bl_count[ze];Ze!==0;)Rt<(it=le.heap[--Ae])||($e[2*it+1]!==ze&&(le.opt_len+=(ze-$e[2*it+1])*$e[2*it],$e[2*it+1]=ze),Ze--)}})(j,F),X(ie,te,j.bl_count)}function w(j,F,ee){var ne,V,ie=-1,ue=F[1],se=0,$=7,te=4;for(ue===0&&($=138,te=3),F[2*(ee+1)+1]=65535,ne=0;ne<=ee;ne++)V=ue,ue=F[2*(ne+1)+1],++se<$&&V===ue||(se<te?j.bl_tree[2*V]+=se:V!==0?(V!==ie&&j.bl_tree[2*V]++,j.bl_tree[2*S]++):se<=10?j.bl_tree[2*C]++:j.bl_tree[2*T]++,ie=V,te=(se=0)===ue?($=138,3):V===ue?($=6,3):($=7,4))}function Y(j,F,ee){var ne,V,ie=-1,ue=F[1],se=0,$=7,te=4;for(ue===0&&($=138,te=3),ne=0;ne<=ee;ne++)if(V=ue,ue=F[2*(ne+1)+1],!(++se<$&&V===ue)){if(se<te)for(;Q(j,V,j.bl_tree),--se!=0;);else V!==0?(V!==ie&&(Q(j,V,j.bl_tree),se--),Q(j,S,j.bl_tree),J(j,se-3,2)):se<=10?(Q(j,C,j.bl_tree),J(j,se-3,3)):(Q(j,T,j.bl_tree),J(j,se-11,7));ie=V,te=(se=0)===ue?($=138,3):V===ue?($=6,3):($=7,4)}}l(q);var H=!1;function I(j,F,ee,ne){J(j,(c<<1)+(ne?1:0),3),(function(V,ie,ue,se){de(V),N(V,ue),N(V,~ue),i.arraySet(V.pending_buf,V.window,ie,ue,V.pending),V.pending+=ue})(j,F,ee)}o._tr_init=function(j){H||((function(){var F,ee,ne,V,ie,ue=new Array(y+1);for(V=ne=0;V<u-1;V++)for(D[V]=ne,F=0;F<1<<z[V];F++)v[ne++]=V;for(v[ne-1]=V,V=ie=0;V<16;V++)for(q[V]=ie,F=0;F<1<<P[V];F++)L[ie++]=V;for(ie>>=7;V<d;V++)for(q[V]=ie<<7,F=0;F<1<<P[V]-7;F++)L[256+ie++]=V;for(ee=0;ee<=y;ee++)ue[ee]=0;for(F=0;F<=143;)B[2*F+1]=8,F++,ue[8]++;for(;F<=255;)B[2*F+1]=9,F++,ue[9]++;for(;F<=279;)B[2*F+1]=7,F++,ue[7]++;for(;F<=287;)B[2*F+1]=8,F++,ue[8]++;for(X(B,p+1,ue),F=0;F<d;F++)E[2*F+1]=5,E[2*F]=pe(F,5);K=new A(B,z,f+1,p,y),Z=new A(E,P,0,d,y),W=new A(new Array(0),O,0,x,b)})(),H=!0),j.l_desc=new U(j.dyn_ltree,K),j.d_desc=new U(j.dyn_dtree,Z),j.bl_desc=new U(j.bl_tree,W),j.bi_buf=0,j.bi_valid=0,ae(j)},o._tr_stored_block=I,o._tr_flush_block=function(j,F,ee,ne){var V,ie,ue=0;0<j.level?(j.strm.data_type===2&&(j.strm.data_type=(function(se){var $,te=4093624447;for($=0;$<=31;$++,te>>>=1)if(1&te&&se.dyn_ltree[2*$]!==0)return s;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for($=32;$<f;$++)if(se.dyn_ltree[2*$]!==0)return a;return s})(j)),Pe(j,j.l_desc),Pe(j,j.d_desc),ue=(function(se){var $;for(w(se,se.dyn_ltree,se.l_desc.max_code),w(se,se.dyn_dtree,se.d_desc.max_code),Pe(se,se.bl_desc),$=x-1;3<=$&&se.bl_tree[2*M[$]+1]===0;$--);return se.opt_len+=3*($+1)+5+5+4,$})(j),V=j.opt_len+3+7>>>3,(ie=j.static_len+3+7>>>3)<=V&&(V=ie)):V=ie=ee+5,ee+4<=V&&F!==-1?I(j,F,ee,ne):j.strategy===4||ie===V?(J(j,2+(ne?1:0),3),Ee(j,B,E)):(J(j,4+(ne?1:0),3),(function(se,$,te,le){var ve;for(J(se,$-257,5),J(se,te-1,5),J(se,le-4,4),ve=0;ve<le;ve++)J(se,se.bl_tree[2*M[ve]+1],3);Y(se,se.dyn_ltree,$-1),Y(se,se.dyn_dtree,te-1)})(j,j.l_desc.max_code+1,j.d_desc.max_code+1,ue+1),Ee(j,j.dyn_ltree,j.dyn_dtree)),ae(j),ne&&de(j)},o._tr_tally=function(j,F,ee){return j.pending_buf[j.d_buf+2*j.last_lit]=F>>>8&255,j.pending_buf[j.d_buf+2*j.last_lit+1]=255&F,j.pending_buf[j.l_buf+j.last_lit]=255&ee,j.last_lit++,F===0?j.dyn_ltree[2*ee]++:(j.matches++,F--,j.dyn_ltree[2*(v[ee]+f+1)]++,j.dyn_dtree[2*R(F)]++),j.last_lit===j.lit_bufsize-1},o._tr_align=function(j){J(j,2,3),Q(j,k,B),(function(F){F.bi_valid===16?(N(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)})(j)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,u,f,p=1,d={},x=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){b(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,C=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=C,S}})()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(f+S,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(S){b(S.data)},function(S){u.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){b(S),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(S){setTimeout(b,0,S)},y.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),T=0;T<C.length;T++)C[T]=arguments[T+1];var z={callback:S,args:C};return d[p]=z,l(p),p++},y.clearImmediate=g}function g(S){delete d[S]}function b(S){if(x)setTimeout(b,0,S);else{var C=d[S];if(C){x=!0;try{(function(T){var z=T.callback,P=T.args;switch(P.length){case 0:z();break;case 1:z(P[0]);break;case 2:z(P[0],P[1]);break;case 3:z(P[0],P[1],P[2]);break;default:z.apply(a,P)}})(C)}finally{g(S),x=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(f)===0&&b(+S.data.slice(f.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof vr<"u"?vr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Oo)),Oo.exports}var kv=_v();const Sv=Di(kv);async function Cv(e){try{const t=await fetch(`/api/logs/${e}/chunks`);if(!t.ok)return null;const n=await t.json();return JSON.stringify(n,null,2)}catch{return null}}async function Ev(e){const t=new Sv;for(const s of e)s.rawRequestBody!==null&&t.file(`#${s.id}.Request.json`,s.rawRequestBody),s.responseText!==null&&t.file(`#${s.id}.Response.json`,s.responseText);const n=e.filter(s=>s.streaming);await Promise.allSettled(n.map(async s=>{const a=await Cv(s.id);a!==null&&t.file(`#${s.id}.SSE.Response.json`,a)}));const r=await t.generateAsync({type:"blob"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=`llm-inspector-export-${new Date().toISOString().slice(0,10)}.zip`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}const Tv="1.9.0",Nv={version:Tv};function Fc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Fc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $c(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Fc(e))&&(r&&(r+=" "),r+=t);return r}const Av=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},jv=(e,t)=>({classGroupId:e,validator:t}),Bc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wr="-",pa=[],zv="arbitrary..",Iv=e=>{const t=Pv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Ov(s);const a=s.split(Wr),l=a[0]===""&&a.length>1?1:0;return Uc(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],c=n[s];return l?c?Av(c,l):l:c||pa}return n[s]||pa}}},Uc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const c=Uc(e,t+1,i);if(c)return c}const s=n.validators;if(s===null)return;const a=t===0?e.join(Wr):e.slice(t).join(Wr),l=s.length;for(let c=0;c<l;c++){const u=s[c];if(u.validator(a))return u.classGroupId}},Ov=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?zv+r:void 0})(),Pv=e=>{const{theme:t,classGroups:n}=e;return Rv(n,t)},Rv=(e,t)=>{const n=Bc();for(const r in e){const o=e[r];qi(o,n,r,t)}return n},qi=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Dv(s,t,n,r)}},Dv=(e,t,n,r)=>{if(typeof e=="string"){Mv(e,t,n);return}if(typeof e=="function"){Lv(e,t,n,r);return}Fv(e,t,n,r)},Mv=(e,t,n)=>{const r=e===""?t:Zc(t,e);r.classGroupId=n},Lv=(e,t,n,r)=>{if($v(e)){qi(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(jv(n,e))},Fv=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];qi(l,Zc(t,a),n,r)}},Zc=(e,t)=>{let n=e;const r=t.split(Wr),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=Bc(),n.nextPart.set(s,a)),n=a}return n},$v=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Bv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},di="!",ma=":",Uv=[],ga=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Zv=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,c;const u=o.length;for(let m=0;m<u;m++){const y=o[m];if(s===0&&a===0){if(y===ma){i.push(o.slice(l,m)),l=m+1;continue}if(y==="/"){c=m;continue}}y==="["?s++:y==="]"?s--:y==="("?a++:y===")"&&a--}const f=i.length===0?o:o.slice(l);let p=f,d=!1;f.endsWith(di)?(p=f.slice(0,-1),d=!0):f.startsWith(di)&&(p=f.slice(1),d=!0);const x=c&&c>l?c-l:void 0;return ga(i,d,p,x)};if(t){const o=t+ma,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):ga(Uv,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Vv=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},Wv=e=>({cache:Bv(e.cacheSize),parseClassName:Zv(e),sortModifiers:Vv(e),...Iv(e)}),Hv=/\s+/,qv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Hv);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:f,modifiers:p,hasImportantModifier:d,baseClassName:x,maybePostfixModifierPosition:m}=n(u);if(f){l=u+(l.length>0?" "+l:l);continue}let y=!!m,g=r(y?x.substring(0,m):x);if(!g){if(!y){l=u+(l.length>0?" "+l:l);continue}if(g=r(x),!g){l=u+(l.length>0?" "+l:l);continue}y=!1}const b=p.length===0?"":p.length===1?p[0]:i(p).join(":"),k=d?b+di:b,S=k+g;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(g,y);for(let T=0;T<C.length;++T){const z=C[T];s.push(k+z)}l=u+(l.length>0?" "+l:l)}return l},Kv=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Vc(n))&&(o&&(o+=" "),o+=r);return o},Vc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Vc(e[r]))&&(n&&(n+=" "),n+=t);return n},Gv=(e,...t)=>{let n,r,o,i;const s=l=>{const c=t.reduce((u,f)=>f(u),e());return n=Wv(c),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=qv(l,n);return o(l,u),u};return i=s,(...l)=>i(Kv(...l))},Jv=[],He=e=>{const t=n=>n[e]||Jv;return t.isThemeGetter=!0,t},Wc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Yv=/^\d+\/\d+$/,Xv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hn=e=>Yv.test(e),Ce=e=>!!e&&!Number.isNaN(Number(e)),$t=e=>!!e&&Number.isInteger(Number(e)),Po=e=>e.endsWith("%")&&Ce(e.slice(0,-1)),Dt=e=>Xv.test(e),rb=()=>!0,ob=e=>Qv.test(e)&&!eb.test(e),qc=()=>!1,ib=e=>tb.test(e),sb=e=>nb.test(e),ab=e=>!fe(e)&&!he(e),lb=e=>Ln(e,Jc,qc),fe=e=>Wc.test(e),en=e=>Ln(e,Yc,ob),Ro=e=>Ln(e,hb,Ce),xa=e=>Ln(e,Kc,qc),cb=e=>Ln(e,Gc,sb),Sr=e=>Ln(e,Xc,ib),he=e=>Hc.test(e),qn=e=>Fn(e,Yc),ub=e=>Fn(e,pb),ya=e=>Fn(e,Kc),db=e=>Fn(e,Jc),fb=e=>Fn(e,Gc),Cr=e=>Fn(e,Xc,!0),Ln=(e,t,n)=>{const r=Wc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Fn=(e,t,n=!1)=>{const r=Hc.exec(e);return r?r[1]?t(r[1]):n:!1},Kc=e=>e==="position"||e==="percentage",Gc=e=>e==="image"||e==="url",Jc=e=>e==="length"||e==="size"||e==="bg-size",Yc=e=>e==="length",hb=e=>e==="number",pb=e=>e==="family-name",Xc=e=>e==="shadow",mb=()=>{const e=He("color"),t=He("font"),n=He("text"),r=He("font-weight"),o=He("tracking"),i=He("leading"),s=He("breakpoint"),a=He("container"),l=He("spacing"),c=He("radius"),u=He("shadow"),f=He("inset-shadow"),p=He("text-shadow"),d=He("drop-shadow"),x=He("blur"),m=He("perspective"),y=He("aspect"),g=He("ease"),b=He("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),he,fe],T=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],P=()=>[he,fe,l],O=()=>[hn,"full","auto",...P()],M=()=>[$t,"none","subgrid",he,fe],B=()=>["auto",{span:["full",$t,he,fe]},$t,he,fe],E=()=>[$t,"auto",he,fe],L=()=>["auto","min","max","fr",he,fe],v=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...P()],Z=()=>[hn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],W=()=>[e,he,fe],q=()=>[...S(),ya,xa,{position:[he,fe]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",db,lb,{size:[he,fe]}],R=()=>[Po,qn,en],N=()=>["","none","full",c,he,fe],J=()=>["",Ce,qn,en],Q=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Ce,Po,ya,xa],ae=()=>["","none",x,he,fe],de=()=>["none",Ce,he,fe],me=()=>["none",Ce,he,fe],xe=()=>[Ce,he,fe],Ee=()=>[hn,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dt],breakpoint:[Dt],color:[rb],container:[Dt],"drop-shadow":[Dt],ease:["in","out","in-out"],font:[ab],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dt],shadow:[Dt],spacing:["px",Ce],text:[Dt],"text-shadow":[Dt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",hn,fe,he,y]}],container:["container"],columns:[{columns:[Ce,fe,he,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[$t,"auto",he,fe]}],basis:[{basis:[hn,"full","auto",a,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,hn,"auto","initial","none",fe]}],grow:[{grow:["",Ce,he,fe]}],shrink:[{shrink:["",Ce,he,fe]}],order:[{order:[$t,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...v(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...v()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":v()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[a,"screen",...Z()]}],"min-w":[{"min-w":[a,"screen","none",...Z()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,qn,en]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,he,Ro]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Po,fe]}],"font-family":[{font:[ub,fe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,he,fe]}],"line-clamp":[{"line-clamp":[Ce,"none",he,Ro]}],leading:[{leading:[i,...P()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",he,en]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Ce,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$t,he,fe],radial:["",he,fe],conic:[$t,he,fe]},fb,cb]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,he,fe]}],"outline-w":[{outline:["",Ce,qn,en]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",u,Cr,Sr]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",f,Cr,Sr]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Ce,en]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",p,Cr,Sr]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Ce,he,fe]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:ae()}],brightness:[{brightness:[Ce,he,fe]}],contrast:[{contrast:[Ce,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",d,Cr,Sr]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Ce,he,fe]}],"hue-rotate":[{"hue-rotate":[Ce,he,fe]}],invert:[{invert:["",Ce,he,fe]}],saturate:[{saturate:[Ce,he,fe]}],sepia:[{sepia:["",Ce,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",Ce,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",he,fe]}],ease:[{ease:["linear","initial",g,he,fe]}],delay:[{delay:[Ce,he,fe]}],animate:[{animate:["none",b,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,he,fe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,fe]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Ce,qn,en,Ro]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},gb=Gv(mb);function je(...e){return gb($c(e))}function Ke(e){return e>=1048576?(e/1048576).toFixed(1).replace(/\.0$/,"")+"M":e>=1024?(e/1024).toFixed(1).replace(/\.0$/,"")+"K":e.toString()}function Qc(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}function va(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function xb({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:i,expanded:s,onToggle:a}){return h.jsxs("div",{role:"button",tabIndex:0,className:je("flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none","border border-border rounded-lg mb-2 bg-muted/30"),onClick:a,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())},children:[s?h.jsx(At,{className:"size-4 text-muted-foreground shrink-0"}):h.jsx(Wt,{className:"size-4 text-muted-foreground shrink-0"}),h.jsx("span",{className:"text-purple-400/90 font-mono text-xs font-semibold shrink-0",title:e,children:e.length>24?e.slice(0,12)+"…"+e.slice(-12):e}),h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(Hi,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[va(t)," - ",va(n)]})]}),h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(Dc,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),h.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[h.jsx(fr,{className:"size-3 text-muted-foreground"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[h.jsx("span",{className:"text-blue-400",children:Ke(o)})," / ",h.jsx("span",{className:"text-amber-400",children:Ke(i)})]})]}),h.jsx("span",{className:"flex-1 min-w-0"})]})}function yb(e){if(e.sessionId!==null&&e.sessionId!=="")return e.sessionId;const t=e.clientPid!==null?`PID:${e.clientPid}`:"unknown",n=e.clientProjectFolder!==null?e.clientProjectFolder:"no-folder";return`${t}|${n}`}function vb(e){const t=new Map;for(const r of e){const o=yb(r),i=t.get(o);i!==void 0?i.push(r):t.set(o,[r])}const n=[];for(const[r,o]of t){const i=[...o].sort((s,a)=>s.timestamp.localeCompare(a.timestamp));n.push({id:r,conversationId:r,logs:i})}return n.sort((r,o)=>(r.logs[0]?.timestamp??"").localeCompare(o.logs[0]?.timestamp??"")),n}const ba=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wa=$c,Ki=(e,t)=>n=>{var r;if(t?.variants==null)return wa(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],f=i?.[c];if(u===null)return null;const p=ba(u)||ba(f);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:p,...d}=u;return Object.entries(d).every(x=>{let[m,y]=x;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...c,f,p]:c},[]);return wa(e,s,l,n?.class,n?.className)},bb=Ki("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ft({className:e,variant:t,size:n,...r}){return h.jsx("button",{"data-slot":"button",className:je(bb({variant:t,size:n,className:e})),...r})}function wb(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _b=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sb={};function _a(e,t){return(Sb.jsx?kb:_b).test(e)}const Cb=/[ \t\n\f\r]/g;function Eb(e){return typeof e=="object"?e.type==="text"?ka(e.value):!1:ka(e)}function ka(e){return e.replace(Cb,"")===""}class hr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}hr.prototype.normal={};hr.prototype.property={};hr.prototype.space=void 0;function eu(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new hr(n,r,t)}function fi(e){return e.toLowerCase()}class ot{constructor(t,n){this.attribute=n,this.property=t}}ot.prototype.attribute="";ot.prototype.booleanish=!1;ot.prototype.boolean=!1;ot.prototype.commaOrSpaceSeparated=!1;ot.prototype.commaSeparated=!1;ot.prototype.defined=!1;ot.prototype.mustUseProperty=!1;ot.prototype.number=!1;ot.prototype.overloadedBoolean=!1;ot.prototype.property="";ot.prototype.spaceSeparated=!1;ot.prototype.space=void 0;let Tb=0;const Se=un(),We=un(),hi=un(),oe=un(),Re=un(),Sn=un(),st=un();function un(){return 2**++Tb}const pi=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:We,commaOrSpaceSeparated:st,commaSeparated:Sn,number:oe,overloadedBoolean:hi,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),Do=Object.keys(pi);class Gi extends ot{constructor(t,n,r,o){let i=-1;if(super(t,n),Sa(this,"space",o),typeof r=="number")for(;++i<Do.length;){const s=Do[i];Sa(this,Do[i],(r&pi[s])===pi[s])}}}Gi.prototype.defined=!0;function Sa(e,t,n){n&&(e[t]=n)}function $n(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Gi(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[fi(r)]=r,n[fi(i.attribute)]=r}return new hr(t,n,e.space)}const tu=$n({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:Re,ariaCurrent:null,ariaDescribedBy:Re,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Re,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Re,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Re,ariaLevel:oe,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Re,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Re,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:We,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function nu(e,t){return t in e?e[t]:t}function ru(e,t){return nu(e,t.toLowerCase())}const Nb=$n({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Sn,acceptCharset:Re,accessKey:Re,action:null,allow:null,allowFullScreen:Se,allowPaymentRequest:Se,allowUserMedia:Se,alt:null,as:null,async:Se,autoCapitalize:null,autoComplete:Re,autoFocus:Se,autoPlay:Se,blocking:Re,capture:null,charSet:null,checked:Se,cite:null,className:Re,cols:oe,colSpan:null,content:null,contentEditable:We,controls:Se,controlsList:Re,coords:oe|Sn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Se,defer:Se,dir:null,dirName:null,disabled:Se,download:hi,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Se,formTarget:null,headers:Re,height:oe,hidden:hi,high:oe,href:null,hrefLang:null,htmlFor:Re,httpEquiv:Re,id:null,imageSizes:null,imageSrcSet:null,inert:Se,inputMode:null,integrity:null,is:null,isMap:Se,itemId:null,itemProp:Re,itemRef:Re,itemScope:Se,itemType:Re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Se,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:Se,muted:Se,name:null,nonce:null,noModule:Se,noValidate:Se,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Se,optimum:oe,pattern:null,ping:Re,placeholder:null,playsInline:Se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Se,referrerPolicy:null,rel:Re,required:Se,reversed:Se,rows:oe,rowSpan:oe,sandbox:Re,scope:null,scoped:Se,seamless:Se,selected:Se,shadowRootClonable:Se,shadowRootDelegatesFocus:Se,shadowRootMode:null,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:Se,useMap:null,value:We,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Re,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Se,declare:Se,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:Se,noHref:Se,noShade:Se,noWrap:Se,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Se,disableRemotePlayback:Se,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:ru}),Ab=$n({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:st,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:Re,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:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:Se,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,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:Sn,g2:Sn,glyphName:Sn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:st,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,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:oe,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:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:st,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:st,rev:st,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:st,requiredFeatures:st,requiredFonts:st,requiredFormats:st,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:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:st,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:st,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:st,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nu}),ou=$n({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),iu=$n({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ru}),su=$n({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jb={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"},zb=/[A-Z]/g,Ca=/-[a-z]/g,Ib=/^data[-\w.:]+$/i;function Ob(e,t){const n=fi(t);let r=t,o=ot;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ib.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Ca,Rb);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Ca.test(i)){let s=i.replace(zb,Pb);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Gi}return new o(r,t)}function Pb(e){return"-"+e.toLowerCase()}function Rb(e){return e.charAt(1).toUpperCase()}const Db=eu([tu,Nb,ou,iu,su],"html"),Ji=eu([tu,Ab,ou,iu,su],"svg");function Mb(e){return e.join(" ").trim()}var pn={},Mo,Ea;function Lb(){if(Ea)return Mo;Ea=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
41
|
+
`,c="/",u="*",f="",p="comment",d="declaration";function x(y,g){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];g=g||{};var b=1,k=1;function S(v){var D=v.match(t);D&&(b+=D.length);var K=v.lastIndexOf(l);k=~K?v.length-K:k+v.length}function C(){var v={line:b,column:k};return function(D){return D.position=new T(v),O(),D}}function T(v){this.start=v,this.end={line:b,column:k},this.source=g.source}T.prototype.content=y;function z(v){var D=new Error(g.source+":"+b+":"+k+": "+v);if(D.reason=v,D.filename=g.source,D.line=b,D.column=k,D.source=y,!g.silent)throw D}function P(v){var D=v.exec(y);if(D){var K=D[0];return S(K),y=y.slice(K.length),D}}function O(){P(n)}function M(v){var D;for(v=v||[];D=B();)D!==!1&&v.push(D);return v}function B(){var v=C();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var D=2;f!=y.charAt(D)&&(u!=y.charAt(D)||c!=y.charAt(D+1));)++D;if(D+=2,f===y.charAt(D-1))return z("End of comment missing");var K=y.slice(2,D-2);return k+=2,S(K),y=y.slice(D),k+=2,v({type:p,comment:K})}}function E(){var v=C(),D=P(r);if(D){if(B(),!P(o))return z("property missing ':'");var K=P(i),Z=v({type:d,property:m(D[0].replace(e,f)),value:K?m(K[0].replace(e,f)):f});return P(s),Z}}function L(){var v=[];M(v);for(var D;D=E();)D!==!1&&(v.push(D),M(v));return v}return O(),L()}function m(y){return y?y.replace(a,f):f}return Mo=x,Mo}var Ta;function Fb(){if(Ta)return pn;Ta=1;var e=pn&&pn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pn,"__esModule",{value:!0}),pn.default=n;const t=e(Lb());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const s=(0,t.default)(r),a=typeof o=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?o(c,u,l):u&&(i=i||{},i[c]=u)}),i}return pn}var Kn={},Na;function $b(){if(Na)return Kn;Na=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,a):c=c.replace(r,a),c.replace(t,s))};return Kn.camelCase=l,Kn}var Gn,Aa;function Bb(){if(Aa)return Gn;Aa=1;var e=Gn&&Gn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Fb()),n=$b();function r(o,i){var s={};return!o||typeof o!="string"||(0,t.default)(o,function(a,l){a&&l&&(s[(0,n.camelCase)(a,i)]=l)}),s}return r.default=r,Gn=r,Gn}var Ub=Bb();const Zb=Di(Ub),au=lu("end"),Yi=lu("start");function lu(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 Vb(e){const t=Yi(e),n=au(e);if(t&&n)return{start:t,end:n}}function tr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ja(e.position):"start"in e||"end"in e?ja(e):"line"in e||"column"in e?mi(e):""}function mi(e){return za(e&&e.line)+":"+za(e&&e.column)}function ja(e){return mi(e&&e.start)+"-"+mi(e&&e.end)}function za(e){return e&&typeof e=="number"?e:1}class Ge extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=tr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;const Xi={}.hasOwnProperty,Wb=new Map,Hb=/[A-Z]/g,qb=new Set(["table","tbody","thead","tfoot","tr"]),Kb=new Set(["td","th"]),cu="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gb(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=r1(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=n1(n,t.jsx,t.jsxs)}const o={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"?Ji:Db,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=uu(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function uu(e,t,n){if(t.type==="element")return Jb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qb(e,t,n);if(t.type==="mdxjsEsm")return Xb(e,t);if(t.type==="root")return e1(e,t,n);if(t.type==="text")return t1(e,t)}function Jb(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Ji,e.schema=o),e.ancestors.push(t);const i=fu(e,t.tagName,!1),s=o1(e,t);let a=es(e,t);return qb.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Eb(l):!0})),du(e,s,i,t),Qi(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Yb(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)}sr(e,t.position)}function Xb(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sr(e,t.position)}function Qb(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Ji,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:fu(e,t.name,!0),s=i1(e,t),a=es(e,t);return du(e,s,i,t),Qi(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function e1(e,t,n){const r={};return Qi(r,es(e,t)),e.create(t,e.Fragment,r,n)}function t1(e,t){return t.value}function du(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function n1(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function r1(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=Yi(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function o1(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Xi.call(t.properties,o)){const i=s1(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Kb.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function i1(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else sr(e,t.position);else{const o=r.name;let i;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,i=e.evaluater.evaluateExpression(a.expression)}else sr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function es(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Wb;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=uu(e,i,s);a!==void 0&&n.push(a)}return n}function s1(e,t,n){const r=Ob(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wb(n):Mb(n)),r.property==="style"){let o=typeof n=="object"?n:a1(e,String(n));return e.stylePropertyNameCase==="css"&&(o=l1(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?jb[r.property]||r.property:r.attribute,n]}}function a1(e,t){try{return Zb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Ge("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=cu+"#cannot-parse-style-attribute",o}}function fu(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=_a(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=_a(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Xi.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);sr(e)}function sr(e,t){const n=new Ge("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=cu+"#cannot-handle-mdx-estrees-without-createevaluater",n}function l1(e){const t={};let n;for(n in e)Xi.call(e,n)&&(t[c1(n)]=e[n]);return t}function c1(e){let t=e.replace(Hb,u1);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function u1(e){return"-"+e.toLowerCase()}const Lo={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"]},d1={};function f1(e,t){const n=d1,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hu(e,r,o)}function hu(e,t,n){if(h1(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 Ia(e.children,t,n)}return Array.isArray(e)?Ia(e,t,n):""}function Ia(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=hu(e[o],t,n);return r.join("")}function h1(e){return!!(e&&typeof e=="object")}const Oa=document.createElement("i");function ts(e){const t="&"+e+";";Oa.innerHTML=t;const n=Oa.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function jt(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o: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);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function ut(e,t){return e.length>0?(jt(e,e.length,0,t),e):t}const Pa={}.hasOwnProperty;function p1(e){const t={};let n=-1;for(;++n<e.length;)m1(t,e[n]);return t}function m1(e,t){let n;for(n in t){const o=(Pa.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Pa.call(o,s)||(o[s]=[]);const a=i[s];g1(o[s],Array.isArray(a)?a:a?[a]:[])}}}function g1(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);jt(e,0,0,r)}function pu(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 Cn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const St=Yt(/[A-Za-z]/),lt=Yt(/[\dA-Za-z]/),x1=Yt(/[#-'*+\--9=?A-Z^-~]/);function gi(e){return e!==null&&(e<32||e===127)}const xi=Yt(/\d/),y1=Yt(/[\dA-Fa-f]/),v1=Yt(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function nt(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const b1=Yt(new RegExp("\\p{P}|\\p{S}","u")),w1=Yt(/\s/);function Yt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Bn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&<(e.charCodeAt(n+1))&<(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function De(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Ie(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ie(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const _1={tokenize:k1};function k1(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),De(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,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"),i):(e.consume(a),s)}}const S1={tokenize:C1},Ra={tokenize:E1};function C1(e){const t=this,n=[];let r=0,o,i,s;return a;function a(k){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(k)}return c(k)}function l(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const S=t.events.length;let C=S,T;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){T=t.events[C][1].end;break}g(r);let z=S;for(;z<t.events.length;)t.events[z][1].end={...T},z++;return jt(t.events,C+1,0,t.events.slice(S)),t.events.length=z,c(k)}return a(k)}function c(k){if(r===n.length){if(!o)return p(k);if(o.currentConstruct&&o.currentConstruct.concrete)return x(k);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ra,u,f)(k)}function u(k){return o&&b(),g(r),p(k)}function f(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(k)}function p(k){return t.containerState={},e.attempt(Ra,d,x)(k)}function d(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function x(k){if(k===null){o&&b(),g(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(k)}function m(k){if(k===null){y(e.exit("chunkFlow"),!0),g(0),e.consume(k);return}return we(k)?(e.consume(k),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(k),m)}function y(k,S){const C=t.sliceStream(k);if(S&&C.push(null),k.previous=i,i&&(i.next=k),i=k,o.defineSkip(k.start),o.write(C),t.parser.lazy[k.start.line]){let T=o.events.length;for(;T--;)if(o.events[T][1].start.offset<s&&(!o.events[T][1].end||o.events[T][1].end.offset>s))return;const z=t.events.length;let P=z,O,M;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(O){M=t.events[P][1].end;break}O=!0}for(g(r),T=z;T<t.events.length;)t.events[T][1].end={...M},T++;jt(t.events,P+1,0,t.events.slice(z)),t.events.length=T}}function g(k){let S=n.length;for(;S-- >k;){const C=n[S];t.containerState=C[1],C[0].exit.call(t,e)}n.length=k}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function E1(e,t,n){return De(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Da(e){if(e===null||nt(e)||w1(e))return 1;if(b1(e))return 2}function ns(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const yi={name:"attention",resolveAll:T1,tokenize:N1};function T1(e,t){let n=-1,r,o,i,s,a,l,c,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;l=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 f={...e[r][1].end},p={...e[n][1].start};Ma(f,-l),Ma(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ut(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ut(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=ut(c,ns(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ut(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=ut(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,jt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function N1(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Da(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Da(l),f=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(o||!p)),c._close=!!(i===42?p:p&&(u||!f)),t(l)}}function Ma(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const A1={name:"autolink",tokenize:j1};function j1(e,t,n){let r=0;return o;function o(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(d){return St(d)?(e.consume(d),s):d===64?n(d):c(d)}function s(d){return d===43||d===45||d===46||lt(d)?(r=1,a(d)):c(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||lt(d))&&r++<32?(e.consume(d),a):(r=0,c(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||gi(d)?n(d):(e.consume(d),l)}function c(d){return d===64?(e.consume(d),u):x1(d)?(e.consume(d),c):n(d)}function u(d){return lt(d)?f(d):n(d)}function f(d){return d===46?(e.consume(d),r=0,u):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):p(d)}function p(d){if((d===45||lt(d))&&r++<63){const x=d===45?p:f;return e.consume(d),x}return n(d)}}const lo={partial:!0,tokenize:z1};function z1(e,t,n){return r;function r(i){return Ie(i)?De(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||we(i)?t(i):n(i)}}const mu={continuation:{tokenize:O1},exit:P1,name:"blockQuote",tokenize:I1};function I1(e,t,n){const r=this;return o;function o(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"),i}return n(s)}function i(s){return Ie(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function O1(e,t,n){const r=this;return o;function o(s){return Ie(s)?De(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(mu,t,n)(s)}}function P1(e){e.exit("blockQuote")}const gu={name:"characterEscape",tokenize:R1};function R1(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return v1(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const xu={name:"characterReference",tokenize:D1};function D1(e,t,n){const r=this;let o=0,i,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=lt,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=y1,u):(e.enter("characterReferenceValue"),i=7,s=xi,u(f))}function u(f){if(f===59&&o){const p=e.exit("characterReferenceValue");return s===lt&&!ts(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&o++<i?(e.consume(f),u):n(f)}}const La={partial:!0,tokenize:L1},Fa={concrete:!0,name:"codeFenced",tokenize:M1};function M1(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,s=0,a;return l;function l(T){return c(T)}function c(T){const z=r.events[r.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,a=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(T)}function u(T){return T===a?(s++,e.consume(T),u):s<3?n(T):(e.exit("codeFencedFenceSequence"),Ie(T)?De(e,f,"whitespace")(T):f(T))}function f(T){return T===null||we(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(La,m,S)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(T))}function p(T){return T===null||we(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(T)):Ie(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),De(e,d,"whitespace")(T)):T===96&&T===a?n(T):(e.consume(T),p)}function d(T){return T===null||we(T)?f(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||we(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(T)):T===96&&T===a?n(T):(e.consume(T),x)}function m(T){return e.attempt(o,S,y)(T)}function y(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),g}function g(T){return i>0&&Ie(T)?De(e,b,"linePrefix",i+1)(T):b(T)}function b(T){return T===null||we(T)?e.check(La,m,S)(T):(e.enter("codeFlowValue"),k(T))}function k(T){return T===null||we(T)?(e.exit("codeFlowValue"),b(T)):(e.consume(T),k)}function S(T){return e.exit("codeFenced"),t(T)}function C(T,z,P){let O=0;return M;function M(D){return T.enter("lineEnding"),T.consume(D),T.exit("lineEnding"),B}function B(D){return T.enter("codeFencedFence"),Ie(D)?De(T,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):E(D)}function E(D){return D===a?(T.enter("codeFencedFenceSequence"),L(D)):P(D)}function L(D){return D===a?(O++,T.consume(D),L):O>=s?(T.exit("codeFencedFenceSequence"),Ie(D)?De(T,v,"whitespace")(D):v(D)):P(D)}function v(D){return D===null||we(D)?(T.exit("codeFencedFence"),z(D)):P(D)}}}function L1(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Fo={name:"codeIndented",tokenize:$1},F1={partial:!0,tokenize:B1};function $1(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),De(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):we(c)?e.attempt(F1,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||we(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function B1(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):De(e,i,"linePrefix",5)(s)}function i(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)?o(s):n(s)}}const U1={name:"codeText",previous:V1,resolve:Z1,tokenize:W1};function Z1(e){let t=e.length-4,n=3,r,o;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;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function V1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function W1(e,t,n){let r=0,o,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),o=0,u(f)):we(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||we(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}class H1{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Jn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Jn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Jn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Jn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Jn(this.left,n.reverse())}}}function Jn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yu(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new H1(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,q1(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return jt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function q1(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,f,p=-1,d=n,x=0,m=0;const y=[m];for(;d;){for(;e.get(++o)[1]!==d;);i.push(o),d._tokenizer||(u=r.sliceStream(d),d.next||u.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=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),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),p=y.length;p--;){const g=a.slice(y[p],y[p+1]),b=i.pop();l.push([b,b+g.length-1]),e.splice(b,2,g)}for(l.reverse(),p=-1;++p<l.length;)c[x+l[p][0]]=x+l[p][1],x+=l[p][1]-l[p][0]-1;return c}const K1={resolve:J1,tokenize:Y1},G1={partial:!0,tokenize:X1};function J1(e){return yu(e),e}function Y1(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):we(a)?e.check(G1,s,i)(a):(e.consume(a),o)}function i(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,o}}function X1(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),De(e,i,"linePrefix")}function i(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 vu(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(g){return g===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(g),e.exit(i),p):g===null||g===32||g===41||gi(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(i),e.consume(g),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(g))}function d(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?x:d)}function x(g){return g===60||g===62||g===92?(e.consume(g),d):d(g)}function m(g){return!u&&(g===null||g===41||nt(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,m):g===41?(e.consume(g),u--,m):g===null||g===32||g===40||gi(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 bu(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(d){return e.enter(r),e.enter(o),e.consume(d),e.exit(o),e.enter(i),u}function u(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):we(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||we(d)||a++>999?(e.exit("chunkString"),u(d)):(e.consume(d),l||(l=!Ie(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function wu(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):we(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),De(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||we(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:u)}function f(p){return p===s||p===92?(e.consume(p),u):u(p)}}function nr(e,t){let n;return r;function r(o){return we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Ie(o)?De(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Q1={name:"definition",tokenize:tw},ew={partial:!0,tokenize:nw};function tw(e,t,n){const r=this;let o;return i;function i(d){return e.enter("definition"),s(d)}function s(d){return bu.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return o=Cn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return nt(d)?nr(e,c)(d):c(d)}function c(d){return vu(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return e.attempt(ew,f,f)(d)}function f(d){return Ie(d)?De(e,p,"whitespace")(d):p(d)}function p(d){return d===null||we(d)?(e.exit("definition"),r.parser.defined.push(o),t(d)):n(d)}}function nw(e,t,n){return r;function r(a){return nt(a)?nr(e,o)(a):n(a)}function o(a){return wu(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Ie(a)?De(e,s,"whitespace")(a):s(a)}function s(a){return a===null||we(a)?t(a):n(a)}}const rw={name:"hardBreakEscape",tokenize:ow};function ow(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return we(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const iw={name:"headingAtx",resolve:sw,tokenize:aw};function sw(e,t){let n=e.length-2,r=3,o,i;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&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},jt(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function aw(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||nt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||we(u)?(e.exit("atxHeading"),t(u)):Ie(u)?De(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||nt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const lw=["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"],$a=["pre","script","style","textarea"],cw={concrete:!0,name:"htmlFlow",resolveTo:fw,tokenize:hw},uw={partial:!0,tokenize:mw},dw={partial:!0,tokenize:pw};function fw(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 hw(e,t,n){const r=this;let o,i,s,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),i=!0,m):N===63?(e.consume(N),o=3,r.interrupt?t:A):St(N)?(e.consume(N),s=String.fromCharCode(N),y):n(N)}function p(N){return N===45?(e.consume(N),o=2,d):N===91?(e.consume(N),o=5,a=0,x):St(N)?(e.consume(N),o=4,r.interrupt?t:A):n(N)}function d(N){return N===45?(e.consume(N),r.interrupt?t:A):n(N)}function x(N){const J="CDATA[";return N===J.charCodeAt(a++)?(e.consume(N),a===J.length?r.interrupt?t:E:x):n(N)}function m(N){return St(N)?(e.consume(N),s=String.fromCharCode(N),y):n(N)}function y(N){if(N===null||N===47||N===62||nt(N)){const J=N===47,Q=s.toLowerCase();return!J&&!i&&$a.includes(Q)?(o=1,r.interrupt?t(N):E(N)):lw.includes(s.toLowerCase())?(o=6,J?(e.consume(N),g):r.interrupt?t(N):E(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?b(N):k(N))}return N===45||lt(N)?(e.consume(N),s+=String.fromCharCode(N),y):n(N)}function g(N){return N===62?(e.consume(N),r.interrupt?t:E):n(N)}function b(N){return Ie(N)?(e.consume(N),b):M(N)}function k(N){return N===47?(e.consume(N),M):N===58||N===95||St(N)?(e.consume(N),S):Ie(N)?(e.consume(N),k):M(N)}function S(N){return N===45||N===46||N===58||N===95||lt(N)?(e.consume(N),S):C(N)}function C(N){return N===61?(e.consume(N),T):Ie(N)?(e.consume(N),C):k(N)}function T(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,z):Ie(N)?(e.consume(N),T):P(N)}function z(N){return N===l?(e.consume(N),l=null,O):N===null||we(N)?n(N):(e.consume(N),z)}function P(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||nt(N)?C(N):(e.consume(N),P)}function O(N){return N===47||N===62||Ie(N)?k(N):n(N)}function M(N){return N===62?(e.consume(N),B):n(N)}function B(N){return N===null||we(N)?E(N):Ie(N)?(e.consume(N),B):n(N)}function E(N){return N===45&&o===2?(e.consume(N),K):N===60&&o===1?(e.consume(N),Z):N===62&&o===4?(e.consume(N),U):N===63&&o===3?(e.consume(N),A):N===93&&o===5?(e.consume(N),q):we(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(uw,R,L)(N)):N===null||we(N)?(e.exit("htmlFlowData"),L(N)):(e.consume(N),E)}function L(N){return e.check(dw,v,R)(N)}function v(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),D}function D(N){return N===null||we(N)?L(N):(e.enter("htmlFlowData"),E(N))}function K(N){return N===45?(e.consume(N),A):E(N)}function Z(N){return N===47?(e.consume(N),s="",W):E(N)}function W(N){if(N===62){const J=s.toLowerCase();return $a.includes(J)?(e.consume(N),U):E(N)}return St(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),W):E(N)}function q(N){return N===93?(e.consume(N),A):E(N)}function A(N){return N===62?(e.consume(N),U):N===45&&o===2?(e.consume(N),A):E(N)}function U(N){return N===null||we(N)?(e.exit("htmlFlowData"),R(N)):(e.consume(N),U)}function R(N){return e.exit("htmlFlow"),t(N)}}function pw(e,t,n){const r=this;return o;function o(s){return we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function mw(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(lo,t,n)}}const gw={name:"htmlText",tokenize:xw};function xw(e,t,n){const r=this;let o,i,s;return a;function a(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),C):A===63?(e.consume(A),k):St(A)?(e.consume(A),P):n(A)}function c(A){return A===45?(e.consume(A),u):A===91?(e.consume(A),i=0,x):St(A)?(e.consume(A),b):n(A)}function u(A){return A===45?(e.consume(A),d):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),p):we(A)?(s=f,Z(A)):(e.consume(A),f)}function p(A){return A===45?(e.consume(A),d):f(A)}function d(A){return A===62?K(A):A===45?p(A):f(A)}function x(A){const U="CDATA[";return A===U.charCodeAt(i++)?(e.consume(A),i===U.length?m:x):n(A)}function m(A){return A===null?n(A):A===93?(e.consume(A),y):we(A)?(s=m,Z(A)):(e.consume(A),m)}function y(A){return A===93?(e.consume(A),g):m(A)}function g(A){return A===62?K(A):A===93?(e.consume(A),g):m(A)}function b(A){return A===null||A===62?K(A):we(A)?(s=b,Z(A)):(e.consume(A),b)}function k(A){return A===null?n(A):A===63?(e.consume(A),S):we(A)?(s=k,Z(A)):(e.consume(A),k)}function S(A){return A===62?K(A):k(A)}function C(A){return St(A)?(e.consume(A),T):n(A)}function T(A){return A===45||lt(A)?(e.consume(A),T):z(A)}function z(A){return we(A)?(s=z,Z(A)):Ie(A)?(e.consume(A),z):K(A)}function P(A){return A===45||lt(A)?(e.consume(A),P):A===47||A===62||nt(A)?O(A):n(A)}function O(A){return A===47?(e.consume(A),K):A===58||A===95||St(A)?(e.consume(A),M):we(A)?(s=O,Z(A)):Ie(A)?(e.consume(A),O):K(A)}function M(A){return A===45||A===46||A===58||A===95||lt(A)?(e.consume(A),M):B(A)}function B(A){return A===61?(e.consume(A),E):we(A)?(s=B,Z(A)):Ie(A)?(e.consume(A),B):O(A)}function E(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),o=A,L):we(A)?(s=E,Z(A)):Ie(A)?(e.consume(A),E):(e.consume(A),v)}function L(A){return A===o?(e.consume(A),o=void 0,D):A===null?n(A):we(A)?(s=L,Z(A)):(e.consume(A),L)}function v(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||nt(A)?O(A):(e.consume(A),v)}function D(A){return A===47||A===62||nt(A)?O(A):n(A)}function K(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function Z(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),W}function W(A){return Ie(A)?De(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):q(A)}function q(A){return e.enter("htmlTextData"),s(A)}}const rs={name:"labelEnd",resolveAll:ww,resolveTo:_w,tokenize:kw},yw={tokenize:Sw},vw={tokenize:Cw},bw={tokenize:Ew};function ww(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&jt(e,0,e.length,n),e}function _w(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=ut(a,e.slice(i+1,i+r+3)),a=ut(a,[["enter",u,t]]),a=ut(a,ns(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=ut(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=ut(a,e.slice(s+1)),a=ut(a,[["exit",l,t]]),jt(e,i,e.length,a),e}function kw(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(p){return i?i._inactive?f(p):(s=r.parser.defined.includes(Cn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(yw,u,s?u:f)(p):p===91?e.attempt(vw,u,s?c:f)(p):s?u(p):f(p)}function c(p){return e.attempt(bw,u,f)(p)}function u(p){return t(p)}function f(p){return i._balanced=!0,n(p)}}function Sw(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return nt(f)?nr(e,i)(f):i(f)}function i(f){return f===41?u(f):vu(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return nt(f)?nr(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?wu(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return nt(f)?nr(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Cw(e,t,n){const r=this;return o;function o(a){return bu.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Cn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ew(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const Tw={name:"labelStartImage",resolveAll:rs.resolveAll,tokenize:Nw};function Nw(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(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 Aw={name:"labelStartLink",resolveAll:rs.resolveAll,tokenize:jw};function jw(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const $o={name:"lineEnding",tokenize:zw};function zw(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),De(e,t,"linePrefix")}}const Dr={name:"thematicBreak",tokenize:Iw};function Iw(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||we(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ie(c)?De(e,a,"whitespace")(c):a(c))}}const et={continuation:{tokenize:Dw},exit:Lw,name:"list",tokenize:Rw},Ow={partial:!0,tokenize:Fw},Pw={partial:!0,tokenize:Mw};function Rw(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(d){const x=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:xi(d)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Dr,n,c)(d):c(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return xi(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),c(d)):n(d)}function c(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(lo,r.interrupt?n:u,e.attempt(Ow,p,f))}function u(d){return r.containerState.initialBlankLine=!0,i++,p(d)}function f(d){return Ie(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Dw(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(lo,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,De(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Ie(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(Pw,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,De(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Mw(e,t,n){const r=this;return De(e,o,"listItemIndent",r.containerState.size+1);function o(i){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(i):n(i)}}function Lw(e){e.exit(this.containerState.type)}function Fw(e,t,n){const r=this;return De(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Ie(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Ba={name:"setextUnderline",resolveTo:$w,tokenize:Bw};function $w(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Bw(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Ie(c)?De(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||we(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Uw={tokenize:Zw};function Zw(e){const t=this,n=e.attempt(lo,r,e.attempt(this.parser.constructs.flowInitial,o,De(e,e.attempt(this.parser.constructs.flow,o,e.attempt(K1,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Vw={resolveAll:ku()},Ww=_u("string"),Hw=_u("text");function _u(e){return{resolveAll:ku(e==="text"?qw:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=o[u];let p=-1;if(f)for(;++p<f.length;){const d=f[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function ku(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function qw(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],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Kw={42:et,43:et,45:et,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,62:mu},Gw={91:Q1},Jw={[-2]:Fo,[-1]:Fo,32:Fo},Yw={35:iw,42:Dr,45:[Ba,Dr],60:cw,61:Ba,95:Dr,96:Fa,126:Fa},Xw={38:xu,92:gu},Qw={[-5]:$o,[-4]:$o,[-3]:$o,33:Tw,38:xu,42:yi,60:[A1,gw],91:Aw,92:[rw,gu],93:rs,95:yi,96:U1},e2={null:[yi,Vw]},t2={null:[42,95]},n2={null:[]},r2=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:t2,contentInitial:Gw,disable:n2,document:Kw,flow:Yw,flowInitial:Jw,insideSpan:e2,string:Xw,text:Qw},Symbol.toStringTag,{value:"Module"}));function o2(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:z(C),check:z(T),consume:b,enter:k,exit:S,interrupt:z(T,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(B){return s=ut(s,B),y(),s[s.length-1]!==null?[]:(P(t,0),c.events=ns(i,c.events,c),c.events)}function p(B,E){return s2(d(B),E)}function d(B){return i2(s,B)}function x(){const{_bufferIndex:B,_index:E,line:L,column:v,offset:D}=r;return{_bufferIndex:B,_index:E,line:L,column:v,offset:D}}function m(B){o[B.line]=B.column,M()}function y(){let B;for(;r._index<s.length;){const E=s[r._index];if(typeof E=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<E.length;)g(E.charCodeAt(r._bufferIndex));else g(E)}}function g(B){u=u(B)}function b(B){we(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,M()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=B}function k(B,E){const L=E||{};return L.type=B,L.start=x(),c.events.push(["enter",L,c]),a.push(L),L}function S(B){const E=a.pop();return E.end=x(),c.events.push(["exit",E,c]),E}function C(B,E){P(B,E.from)}function T(B,E){E.restore()}function z(B,E){return L;function L(v,D,K){let Z,W,q,A;return Array.isArray(v)?R(v):"tokenize"in v?R([v]):U(v);function U(pe){return X;function X(ae){const de=ae!==null&&pe[ae],me=ae!==null&&pe.null,xe=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(me)?me:me?[me]:[]];return R(xe)(ae)}}function R(pe){return Z=pe,W=0,pe.length===0?K:N(pe[W])}function N(pe){return X;function X(ae){return A=O(),q=pe,pe.partial||(c.currentConstruct=pe),pe.name&&c.parser.constructs.disable.null.includes(pe.name)?Q():pe.tokenize.call(E?Object.assign(Object.create(c),E):c,l,J,Q)(ae)}}function J(pe){return B(q,A),D}function Q(pe){return A.restore(),++W<Z.length?N(Z[W]):K}}}function P(B,E){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&jt(c.events,E,c.events.length-E,B.resolve(c.events.slice(E),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function O(){const B=x(),E=c.previous,L=c.currentConstruct,v=c.events.length,D=Array.from(a);return{from:v,restore:K};function K(){r=B,c.previous=E,c.currentConstruct=L,c.events.length=v,a=D,M()}}function M(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function i2(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function s2(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
42
42
|
`;break}case-3:{s=`\r
|
|
43
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function i2(e){const r={constructs:f1([t2,...(e||{}).extensions||[]]),content:o(b1),defined:[],document:o(_1),flow:o($w),lazy:{},string:o(Zw),text:o(Vw)};return r;function o(i){return s;function s(a){return n2(r,i,a)}}}function s2(e){for(;!xu(e););return e}const Ua=/[\0\t\n\r]/g;function a2(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,f,p,d;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(Ua.lastIndex=f,c=Ua.exec(i),p=c&&c.index!==void 0?c.index:i.length,d=i.charCodeAt(p),!c){t=i.slice(f);break}if(d===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),e+=p-f),d){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const l2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function c2(e){return e.replace(l2,u2)}function u2(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return hu(n.slice(i?2:1),i?16:10)}return ts(n)||e}const ku={}.hasOwnProperty;function d2(e,t,n){return typeof t!="string"&&(n=t,t=void 0),f2(n)(s2(i2(n).document().write(a2()(e,t,!0))))}function f2(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(F),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Y),blockQuote:i(me),characterEscape:P,characterReference:P,codeFenced:i(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(xe,s),codeText:i(Ee,s),codeTextData:P,data:P,codeFlowValue:P,definition:i(Pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(w),hardBreakEscape:i(H),hardBreakTrailing:i(H),htmlFlow:i(O,s),htmlFlowData:P,htmlText:i(O,s),htmlTextData:P,image:i(j),label:s,link:i(F),listItem:i(ne),listItemValue:p,listOrdered:i(ee,f),listUnordered:i(ee),paragraph:i(Z),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Y),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:de,autolinkProtocol:ae,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:pe,characterReference:X,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:d,codeFencedFenceMeta:x,codeFlowValue:L,codeIndented:l(g),codeText:l(D),codeTextData:L,data:L,definition:l(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:k,emphasis:l(),hardBreakEscape:l(T),hardBreakTrailing:l(T),htmlFlow:l(M),htmlFlowData:L,htmlText:l(b),htmlTextData:L,image:l(U),label:q,labelText:W,lineEnding:V,link:l(K),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:J,resourceDestinationString:A,resourceTitleString:B,resource:R,setextHeading:l(z),setextHeadingLineSequence:I,setextHeadingText:E,strong:l(),thematicBreak:l()}};Su(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let te={type:"root",children:[]};const le={stack:[te],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},ve=[];let Ae=-1;for(;++Ae<$.length;)if($[Ae][1].type==="listOrdered"||$[Ae][1].type==="listUnordered")if($[Ae][0]==="enter")ve.push(Ae);else{const Ze=ve.pop();Ae=o($,Ze,Ae)}for(Ae=-1;++Ae<$.length;){const Ze=t[$[Ae][0]];ku.call(Ze,$[Ae][1].type)&&Ze[$[Ae][1].type].call(Object.assign({sliceSerialize:$[Ae][2].sliceSerialize},le),$[Ae][1])}if(le.tokenStack.length>0){const Ze=le.tokenStack[le.tokenStack.length-1];(Ze[1]||Za).call(le,void 0,Ze[0])}for(te.position={start:Bt($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Bt($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)te=t.transforms[Ae](te)||te;return te}function o($,te,le){let ve=te-1,Ae=-1,Ze=!1,it,je,_t,Pt;for(;++ve<=le;){const $e=$[ve];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?Ae++:Ae--,Pt=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(it&&!Pt&&!Ae&&!_t&&(_t=ve),Pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pt=void 0}if(!Ae&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||Ae===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(it){let Rt=ve;for(je=void 0;Rt--;){const gt=$[Rt];if(gt[1].type==="lineEnding"||gt[1].type==="lineEndingBlank"){if(gt[0]==="exit")continue;je&&($[je][1].type="lineEndingBlank",Ze=!0),gt[1].type="lineEnding",je=Rt}else if(!(gt[1].type==="linePrefix"||gt[1].type==="blockQuotePrefix"||gt[1].type==="blockQuotePrefixWhitespace"||gt[1].type==="blockQuoteMarker"||gt[1].type==="listItemIndent"))break}_t&&(!je||_t<je)&&(it._spread=!0),it.end=Object.assign({},je?$[je][1].start:$e[1].end),$.splice(je||ve,0,["exit",it,$e[2]]),ve++,le++}if($e[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};it=Rt,$.splice(ve,0,["enter",Rt,$e[2]]),ve++,le++,_t=void 0,Pt=!0}}}return $[te][1]._spread=Ze,le}function i($,te){return le;function le(ve){a.call(this,$(ve),ve),te&&te.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a($,te,le){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([te,le||void 0]),$.position={start:Bt(te.start),end:void 0}}function l($){return te;function te(le){$&&$.call(this,le),c.call(this,le)}}function c($,te){const le=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==$.type&&(te?te.call(this,$,ve[0]):(ve[1]||Za).call(this,$,ve[0]));else throw new Error("Cannot close `"+$.type+"` ("+er({start:$.start,end:$.end})+"): it’s not open");le.position.end=Bt($.end)}function u(){return u1(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p($){if(this.data.expectingFirstListItemValue){const te=this.stack[this.stack.length-2];te.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function d(){const $=this.resume(),te=this.stack[this.stack.length-1];te.lang=$}function x(){const $=this.resume(),te=this.stack[this.stack.length-1];te.meta=$}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$.replace(/(\r?\n|\r)$/g,"")}function v($){const te=this.resume(),le=this.stack[this.stack.length-1];le.label=te,le.identifier=Cn(this.sliceSerialize($)).toLowerCase()}function k(){const $=this.resume(),te=this.stack[this.stack.length-1];te.title=$}function S(){const $=this.resume(),te=this.stack[this.stack.length-1];te.url=$}function C($){const te=this.stack[this.stack.length-1];if(!te.depth){const le=this.sliceSerialize($).length;te.depth=le}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I($){const te=this.stack[this.stack.length-1];te.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function P($){const le=this.stack[this.stack.length-1].children;let ve=le[le.length-1];(!ve||ve.type!=="text")&&(ve=ce(),ve.position={start:Bt($.start),end:void 0},le.push(ve)),this.stack.push(ve)}function L($){const te=this.stack.pop();te.value+=this.sliceSerialize($),te.position.end=Bt($.end)}function V($){const te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=te.children[te.children.length-1];le.position.end=Bt($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(te.type)&&(P.call(this,$),L.call(this,$))}function T(){this.data.atHardBreak=!0}function M(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$}function b(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$}function D(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$}function K(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=te,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function U(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=te,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function W($){const te=this.sliceSerialize($),le=this.stack[this.stack.length-2];le.label=c2(te),le.identifier=Cn(te).toLowerCase()}function q(){const $=this.stack[this.stack.length-1],te=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const ve=$.children;le.children=ve}else le.alt=te}function A(){const $=this.resume(),te=this.stack[this.stack.length-1];te.url=$}function B(){const $=this.resume(),te=this.stack[this.stack.length-1];te.title=$}function R(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function J($){const te=this.resume(),le=this.stack[this.stack.length-1];le.label=te,le.identifier=Cn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function Q($){this.data.characterReferenceType=$.type}function pe($){const te=this.sliceSerialize($),le=this.data.characterReferenceType;let ve;le?(ve=hu(te,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=ts(te);const Ae=this.stack[this.stack.length-1];Ae.value+=ve}function X($){const te=this.stack.pop();te.position.end=Bt($.end)}function ae($){L.call(this,$);const te=this.stack[this.stack.length-1];te.url=this.sliceSerialize($)}function de($){L.call(this,$);const te=this.stack[this.stack.length-1];te.url="mailto:"+this.sliceSerialize($)}function me(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function w(){return{type:"emphasis",children:[]}}function Y(){return{type:"heading",depth:0,children:[]}}function H(){return{type:"break"}}function O(){return{type:"html",value:""}}function j(){return{type:"image",title:null,url:"",alt:null}}function F(){return{type:"link",title:null,url:"",children:[]}}function ee($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function ne($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function Z(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ce(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}function Bt(e){return{line:e.line,column:e.column,offset:e.offset}}function Su(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Su(e,r):h2(e,r)}}function h2(e,t){let n;for(n in t)if(ku.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 Za(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+er({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+er({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+er({start:t.start,end:t.end})+") is still open")}function p2(e){const t=this;t.parser=n;function n(r){return d2(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function m2(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 g2(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
44
|
-
`}]}function
|
|
45
|
-
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function
|
|
43
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function a2(e){const r={constructs:p1([r2,...(e||{}).extensions||[]]),content:o(_1),defined:[],document:o(S1),flow:o(Uw),lazy:{},string:o(Ww),text:o(Hw)};return r;function o(i){return s;function s(a){return o2(r,i,a)}}}function l2(e){for(;!yu(e););return e}const Ua=/[\0\t\n\r]/g;function c2(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,f,p,d;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(Ua.lastIndex=f,c=Ua.exec(i),p=c&&c.index!==void 0?c.index:i.length,d=i.charCodeAt(p),!c){t=i.slice(f);break}if(d===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),e+=p-f),d){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const u2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function d2(e){return e.replace(u2,f2)}function f2(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return pu(n.slice(i?2:1),i?16:10)}return ts(n)||e}const Su={}.hasOwnProperty;function h2(e,t,n){return typeof t!="string"&&(n=t,t=void 0),p2(n)(l2(a2(n).document().write(c2()(e,t,!0))))}function p2(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(F),autolinkProtocol:O,autolinkEmail:O,atxHeading:i(Y),blockQuote:i(me),characterEscape:O,characterReference:O,codeFenced:i(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(xe,s),codeText:i(Ee,s),codeTextData:O,data:O,codeFlowValue:O,definition:i(Pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(w),hardBreakEscape:i(H),hardBreakTrailing:i(H),htmlFlow:i(I,s),htmlFlowData:O,htmlText:i(I,s),htmlTextData:O,image:i(j),label:s,link:i(F),listItem:i(ne),listItemValue:p,listOrdered:i(ee,f),listUnordered:i(ee),paragraph:i(V),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Y),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:de,autolinkProtocol:ae,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:pe,characterReference:X,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:d,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:l(g),codeText:l(D),codeTextData:M,data:M,definition:l(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:k,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(L),htmlFlowData:M,htmlText:l(v),htmlTextData:M,image:l(Z),label:q,labelText:W,lineEnding:B,link:l(K),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:J,resourceDestinationString:A,resourceTitleString:U,resource:R,setextHeading:l(P),setextHeadingLineSequence:z,setextHeadingText:T,strong:l(),thematicBreak:l()}};Cu(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let te={type:"root",children:[]};const le={stack:[te],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},ve=[];let Ae=-1;for(;++Ae<$.length;)if($[Ae][1].type==="listOrdered"||$[Ae][1].type==="listUnordered")if($[Ae][0]==="enter")ve.push(Ae);else{const Ze=ve.pop();Ae=o($,Ze,Ae)}for(Ae=-1;++Ae<$.length;){const Ze=t[$[Ae][0]];Su.call(Ze,$[Ae][1].type)&&Ze[$[Ae][1].type].call(Object.assign({sliceSerialize:$[Ae][2].sliceSerialize},le),$[Ae][1])}if(le.tokenStack.length>0){const Ze=le.tokenStack[le.tokenStack.length-1];(Ze[1]||Za).call(le,void 0,Ze[0])}for(te.position={start:Bt($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Bt($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)te=t.transforms[Ae](te)||te;return te}function o($,te,le){let ve=te-1,Ae=-1,Ze=!1,it,ze,_t,Pt;for(;++ve<=le;){const $e=$[ve];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?Ae++:Ae--,Pt=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(it&&!Pt&&!Ae&&!_t&&(_t=ve),Pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pt=void 0}if(!Ae&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||Ae===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(it){let Rt=ve;for(ze=void 0;Rt--;){const gt=$[Rt];if(gt[1].type==="lineEnding"||gt[1].type==="lineEndingBlank"){if(gt[0]==="exit")continue;ze&&($[ze][1].type="lineEndingBlank",Ze=!0),gt[1].type="lineEnding",ze=Rt}else if(!(gt[1].type==="linePrefix"||gt[1].type==="blockQuotePrefix"||gt[1].type==="blockQuotePrefixWhitespace"||gt[1].type==="blockQuoteMarker"||gt[1].type==="listItemIndent"))break}_t&&(!ze||_t<ze)&&(it._spread=!0),it.end=Object.assign({},ze?$[ze][1].start:$e[1].end),$.splice(ze||ve,0,["exit",it,$e[2]]),ve++,le++}if($e[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};it=Rt,$.splice(ve,0,["enter",Rt,$e[2]]),ve++,le++,_t=void 0,Pt=!0}}}return $[te][1]._spread=Ze,le}function i($,te){return le;function le(ve){a.call(this,$(ve),ve),te&&te.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a($,te,le){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([te,le||void 0]),$.position={start:Bt(te.start),end:void 0}}function l($){return te;function te(le){$&&$.call(this,le),c.call(this,le)}}function c($,te){const le=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==$.type&&(te?te.call(this,$,ve[0]):(ve[1]||Za).call(this,$,ve[0]));else throw new Error("Cannot close `"+$.type+"` ("+tr({start:$.start,end:$.end})+"): it’s not open");le.position.end=Bt($.end)}function u(){return f1(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p($){if(this.data.expectingFirstListItemValue){const te=this.stack[this.stack.length-2];te.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function d(){const $=this.resume(),te=this.stack[this.stack.length-1];te.lang=$}function x(){const $=this.resume(),te=this.stack[this.stack.length-1];te.meta=$}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$.replace(/(\r?\n|\r)$/g,"")}function b($){const te=this.resume(),le=this.stack[this.stack.length-1];le.label=te,le.identifier=Cn(this.sliceSerialize($)).toLowerCase()}function k(){const $=this.resume(),te=this.stack[this.stack.length-1];te.title=$}function S(){const $=this.resume(),te=this.stack[this.stack.length-1];te.url=$}function C($){const te=this.stack[this.stack.length-1];if(!te.depth){const le=this.sliceSerialize($).length;te.depth=le}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function z($){const te=this.stack[this.stack.length-1];te.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function O($){const le=this.stack[this.stack.length-1].children;let ve=le[le.length-1];(!ve||ve.type!=="text")&&(ve=ue(),ve.position={start:Bt($.start),end:void 0},le.push(ve)),this.stack.push(ve)}function M($){const te=this.stack.pop();te.value+=this.sliceSerialize($),te.position.end=Bt($.end)}function B($){const te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=te.children[te.children.length-1];le.position.end=Bt($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(te.type)&&(O.call(this,$),M.call(this,$))}function E(){this.data.atHardBreak=!0}function L(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$}function v(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$}function D(){const $=this.resume(),te=this.stack[this.stack.length-1];te.value=$}function K(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=te,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function Z(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=te,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function W($){const te=this.sliceSerialize($),le=this.stack[this.stack.length-2];le.label=d2(te),le.identifier=Cn(te).toLowerCase()}function q(){const $=this.stack[this.stack.length-1],te=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const ve=$.children;le.children=ve}else le.alt=te}function A(){const $=this.resume(),te=this.stack[this.stack.length-1];te.url=$}function U(){const $=this.resume(),te=this.stack[this.stack.length-1];te.title=$}function R(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function J($){const te=this.resume(),le=this.stack[this.stack.length-1];le.label=te,le.identifier=Cn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function Q($){this.data.characterReferenceType=$.type}function pe($){const te=this.sliceSerialize($),le=this.data.characterReferenceType;let ve;le?(ve=pu(te,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=ts(te);const Ae=this.stack[this.stack.length-1];Ae.value+=ve}function X($){const te=this.stack.pop();te.position.end=Bt($.end)}function ae($){M.call(this,$);const te=this.stack[this.stack.length-1];te.url=this.sliceSerialize($)}function de($){M.call(this,$);const te=this.stack[this.stack.length-1];te.url="mailto:"+this.sliceSerialize($)}function me(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function w(){return{type:"emphasis",children:[]}}function Y(){return{type:"heading",depth:0,children:[]}}function H(){return{type:"break"}}function I(){return{type:"html",value:""}}function j(){return{type:"image",title:null,url:"",alt:null}}function F(){return{type:"link",title:null,url:"",children:[]}}function ee($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function ne($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function V(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ue(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}function Bt(e){return{line:e.line,column:e.column,offset:e.offset}}function Cu(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Cu(e,r):m2(e,r)}}function m2(e,t){let n;for(n in t)if(Su.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 Za(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+tr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+tr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+tr({start:t.start,end:t.end})+") is still open")}function g2(e){const t=this;t.parser=n;function n(r){return h2(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function x2(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 y2(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
44
|
+
`}]}function v2(e,t){const n=t.value?t.value+`
|
|
45
|
+
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function b2(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w2(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _2(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Bn(r.toLowerCase()),i=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=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function k2(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 S2(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Eu(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 o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function C2(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Eu(e,t);const o={src:Bn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function E2(e,t){const n={src:Bn(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 T2(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 N2(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Eu(e,t);const o={href:Bn(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function A2(e,t){const n={href:Bn(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 j2(e,t,n){const r=e.all(t),o=n?z2(n):Tu(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
46
46
|
`}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
47
|
-
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function
|
|
47
|
+
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function z2(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=Tu(n[r])}return t}function Tu(e){const t=e.spread;return t??e.children.length>1}function I2(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];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 i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function O2(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P2(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function R2(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D2(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Yi(t.children[1]),l=au(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function M2(e,t,n){const r=n?n.children:void 0,i=(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 l=-1;const c=[];for(;++l<a;){const f=t.children[l],p={},d=s?s[l]:void 0;d&&(p.align=d);let x={type:"element",tagName:i,properties:p,children:[]};f&&(x.children=e.all(f),e.patch(f,x),x=e.applyData(f,x)),c.push(x)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function L2(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Va=9,Wa=32;function F2(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Ha(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Ha(t.slice(o),o>0,!1)),i.join("")}function Ha(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Va||i===Wa;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Va||i===Wa;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function $2(e,t){const n={type:"text",value:F2(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function B2(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const U2={blockquote:x2,break:y2,code:v2,delete:b2,emphasis:w2,footnoteReference:_2,heading:k2,html:S2,imageReference:C2,image:E2,inlineCode:T2,linkReference:N2,link:A2,listItem:j2,list:I2,paragraph:O2,root:P2,strong:R2,table:D2,tableCell:L2,tableRow:M2,text:$2,thematicBreak:B2,toml:Er,yaml:Er,definition:Er,footnoteDefinition:Er};function Er(){}const Nu=-1,co=0,rr=1,Hr=2,os=3,is=4,ss=5,as=6,Au=7,ju=8,qa=typeof self=="object"?self:globalThis,Z2=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case co:case Nu:return n(s,o);case rr:{const a=n([],o);for(const l of s)a.push(r(l));return a}case Hr:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case os:return n(new Date(s),o);case is:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case ss:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case as:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case Au:{const{name:a,message:l}=s;return n(new qa[a](l),o)}case ju:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new qa[i](s),o)};return r},Ka=e=>Z2(new Map,e)(0),mn="",{toString:V2}={},{keys:W2}=Object,Yn=e=>{const t=typeof e;if(t!=="object"||!e)return[co,t];const n=V2.call(e).slice(8,-1);switch(n){case"Array":return[rr,mn];case"Object":return[Hr,mn];case"Date":return[os,mn];case"RegExp":return[is,mn];case"Map":return[ss,mn];case"Set":return[as,mn];case"DataView":return[rr,n]}return n.includes("Array")?[rr,n]:n.includes("Error")?[Au,n]:[Hr,n]},Tr=([e,t])=>e===co&&(t==="function"||t==="symbol"),H2=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=Yn(s);switch(a){case co:{let u=s;switch(l){case"bigint":a=ju,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([Nu],s)}return o([a,u],s)}case rr:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),o([l,[...p]],s)}const u=[],f=o([a,u],s);for(const p of s)u.push(i(p));return f}case Hr:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],f=o([a,u],s);for(const p of W2(s))(e||!Tr(Yn(s[p])))&&u.push([i(p),i(s[p])]);return f}case os:return o([a,s.toISOString()],s);case is:{const{source:u,flags:f}=s;return o([a,{source:u,flags:f}],s)}case ss:{const u=[],f=o([a,u],s);for(const[p,d]of s)(e||!(Tr(Yn(p))||Tr(Yn(d))))&&u.push([i(p),i(d)]);return f}case as:{const u=[],f=o([a,u],s);for(const p of s)(e||!Tr(Yn(p)))&&u.push(i(p));return f}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},Ga=(e,{json:t,lossy:n}={})=>{const r=[];return H2(!(t||n),!!t,new Map,r)(e),r},qr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ka(Ga(e,t)):structuredClone(e):(e,t)=>Ka(Ga(e,t));function q2(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 K2(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function G2(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||q2,r=e.options.footnoteBackLabel||K2,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),p=Bn(f.toLowerCase());let d=0;const x=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++d<=m;){x.length>0&&x.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,d);typeof b=="string"&&(b={type:"text",value:b}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...x)}else u.push(...x);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...qr(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
48
48
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
49
|
-
`}]}}const zu=(function(e){if(e==null)return
|
|
49
|
+
`}]}}const zu=(function(e){if(e==null)return Q2;if(typeof e=="function")return uo(e);if(typeof e=="object")return Array.isArray(e)?J2(e):Y2(e);if(typeof e=="string")return X2(e);throw new Error("Expected function, string, or object as test")});function J2(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zu(e[n]);return uo(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function Y2(e){const t=e;return uo(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function X2(e){return uo(t);function t(n){return n&&n.type===e}}function uo(e){return t;function t(n,r,o){return!!(e_(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function Q2(){return!0}function e_(e){return e!==null&&typeof e=="object"&&"type"in e}const Iu=[],t_=!0,Ja=!1,n_="skip";function r_(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=zu(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=Iu,x,m,y;if((!t||i(l,c,u[u.length-1]||void 0))&&(d=o_(n(l,u)),d[0]===Ja))return d;if("children"in l&&l.children){const g=l;if(g.children&&d[0]!==n_)for(m=(r?g.children.length:-1)+s,y=u.concat(g);m>-1&&m<g.children.length;){const b=g.children[m];if(x=a(b,m,y)(),x[0]===Ja)return x;m=typeof x[1]=="number"?x[1]:m+s}}return d}}}function o_(e){return Array.isArray(e)?e:typeof e=="number"?[t_,e]:e==null?Iu:[e]}function Ou(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),r_(e,i,a,o);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return s(l,f,u)}}const vi={}.hasOwnProperty,i_={};function s_(e,t){const n=t||i_,r=new Map,o=new Map,i=new Map,s={...U2,...n.handlers},a={all:c,applyData:l_,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:a_,wrap:u_};return Ou(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();f.has(p)||f.set(p,u)}}),a;function l(u,f){const p=u.type,d=a.handlers[p];if(vi.call(a.handlers,p)&&d)return d(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:m,...y}=u,g=qr(y);return g.children=a.all(u),g}return qr(u)}return(a.options.unknownHandler||c_)(a,u,f)}function c(u){const f=[];if("children"in u){const p=u.children;let d=-1;for(;++d<p.length;){const x=a.one(p[d],u);if(x){if(d&&p[d-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Ya(x.value)),!Array.isArray(x)&&x.type==="element")){const m=x.children[0];m&&m.type==="text"&&(m.value=Ya(m.value))}Array.isArray(x)?f.push(...x):f.push(x)}}}return f}}function a_(e,t){e.position&&(t.position=Vb(e))}function l_(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=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"&&i&&Object.assign(n.properties,qr(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function c_(e,t){const n=t.data||{},r="value"in t&&!(vi.call(n,"hProperties")||vi.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 u_(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
50
50
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
51
51
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
52
|
-
`}),n}function Ya(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xa(e,t){const n=
|
|
53
|
-
`},o),i}function c_(e,t){return e&&"run"in e?async function(n,r){const o=Xa(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Xa(n,{file:r,...e||t})}}function Qa(e){if(e)throw e}var Bo,el;function u_(){if(el)return Bo;el=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!f)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Bo=function l(){var c,u,f,p,d,x,m=arguments[0],y=1,g=arguments.length,v=!1;for(typeof m=="boolean"&&(v=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<g;++y)if(c=arguments[y],c!=null)for(u in c)f=a(m,u),p=a(c,u),m!==p&&(v&&p&&(i(p)||(d=o(p)))?(d?(d=!1,x=f&&o(f)?f:[]):x=f&&i(f)?f:{},s(m,{name:u,newValue:l(v,x,p)})):typeof p<"u"&&s(m,{name:u,newValue:p}));return m},Bo}var d_=u_();const Uo=Di(d_);function bi(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 f_(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?h_(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function h_(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const kt={basename:p_,dirname:m_,extname:g_,join:x_,sep:"/"};function p_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');hr(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function m_(e){if(hr(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 g_(e){hr(e);let t=e.length,n=-1,r=0,o=-1,i=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?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function x_(...e){let t=-1,n;for(;++t<e.length;)hr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":y_(n)}function y_(e){hr(e);const t=e.codePointAt(0)===47;let n=v_(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function v_(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function hr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const b_={cwd:w_};function w_(){return"/"}function wi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function __(e){if(typeof e=="string")e=new URL(e);else if(!wi(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 k_(e)}function k_(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 o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Zo=["history","path","basename","stem","extname","dirname"];class Ou{constructor(t){let n;t?wi(t)?n={path:t}:typeof t=="string"||S_(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":b_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zo.length;){const i=Zo[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Zo.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?kt.basename(this.path):void 0}set basename(t){Wo(t,"basename"),Vo(t,"basename"),this.path=kt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?kt.dirname(this.path):void 0}set dirname(t){tl(this.basename,"dirname"),this.path=kt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?kt.extname(this.path):void 0}set extname(t){if(Vo(t,"extname"),tl(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=kt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wi(t)&&(t=__(t)),Wo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?kt.basename(this.path,this.extname):void 0}set stem(t){Wo(t,"stem"),Vo(t,"stem"),this.path=kt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Ge(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Vo(e,t){if(e&&e.includes(kt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+kt.sep+"`")}function Wo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function tl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function S_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const C_=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),E_={}.hasOwnProperty;class ls extends C_{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=f_()}copy(){const t=new ls;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Uo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ko("data",this.frozen),this.namespace[t]=n,this):E_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ko("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 o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Tr(t),r=this.parser||this.Parser;return Ho("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ho("process",this.parser||this.Parser),qo("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Tr(t),l=r.parse(a);r.run(l,a,function(u,f,p){if(u||!f||!p)return c(u);const d=f,x=r.stringify(d,p);A_(x)?p.value=x:p.result=x,c(u,p)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Ho("processSync",this.parser||this.Parser),qo("processSync",this.compiler||this.Compiler),this.process(t,o),rl("processSync","process",n),r;function o(i,s){n=!0,Qa(i),r=s}}run(t,n,r){nl(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Tr(n);o.run(t,l,c);function c(u,f,p){const d=f||t;u?a(u):s?s(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),rl("runSync","run",r),o;function i(s,a){Qa(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Tr(n),o=this.compiler||this.Compiler;return qo("stringify",o),nl(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Ko("use",this.frozen),t!=null)if(typeof t=="function")l(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 i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))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(c.plugins),c.settings&&(o.settings=Uo(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===c){p=f;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[d,...x]=u;const m=r[p][1];bi(m)&&bi(d)&&(d=Uo(!0,m,d)),r[p]=[c,d,...x]}}}}const T_=new ls().freeze();function Ho(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ko(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 nl(e){if(!bi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Tr(e){return N_(e)?e:new Ou(e)}function N_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function A_(e){return typeof e=="string"||z_(e)}function z_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const j_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ol=[],il={allowDangerousHtml:!0},I_=/^(https?|ircs?|mailto|xmpp)$/i,O_=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function jn(e){const t=P_(e),n=R_(e);return D_(t.runSync(t.parse(n),n),e)}function P_(e){const t=e.rehypePlugins||ol,n=e.remarkPlugins||ol,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...il}:il;return T_().use(p2).use(n).use(c_,r).use(t)}function R_(e){const t=e.children||"",n=new Ou;return typeof t=="string"&&(n.value=t),n}function D_(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||M_;for(const u of O_)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+j_+u.id,void 0);return Iu(e,c),qb(e,{Fragment:h.Fragment,components:o,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,f,p){if(u.type==="raw"&&p&&typeof f=="number")return s?p.children.splice(f,1):p.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let d;for(d in Lo)if(Object.hasOwn(Lo,d)&&Object.hasOwn(u.properties,d)){const x=u.properties[d],m=Lo[d];(m===null||m.includes(u.tagName))&&(u.properties[d]=l(String(x||""),d,u))}}if(u.type==="element"){let d=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!d&&r&&typeof f=="number"&&(d=!r(u,f,p)),d&&p&&typeof f=="number")return a&&u.children?p.children.splice(f,1,...u.children):p.children.splice(f,1),f}}}function M_(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||I_.test(e.slice(0,t))?e:""}function sl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pu(...e){return t=>{let n=!1;const r=e.map(o=>{const i=sl(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():sl(e[o],null)}}}}function Oe(...e){return _.useCallback(Pu(...e),e)}function In(e){const t=F_(e),n=_.forwardRef((r,o)=>{const{children:i,...s}=r,a=_.Children.toArray(i),l=a.find(B_);if(l){const c=l.props.children,u=a.map(f=>f===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:f);return h.jsx(t,{...s,ref:o,children:_.isValidElement(c)?_.cloneElement(c,void 0,u):null})}return h.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var L_=In("Slot");function F_(e){const t=_.forwardRef((n,r)=>{const{children:o,...i}=n;if(_.isValidElement(o)){const s=Z_(o),a=U_(i,o.props);return o.type!==_.Fragment&&(a.ref=r?Pu(r,s):s),_.cloneElement(o,a)}return _.Children.count(o)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ru=Symbol("radix.slottable");function $_(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ru,t}function B_(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ru}function U_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Z_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var V_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=V_.reduce((e,t)=>{const n=In(`Primitive.${t}`),r=_.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function W_(e,t){e&&cr.flushSync(()=>e.dispatchEvent(t))}var Du=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),H_="VisuallyHidden",Mu=_.forwardRef((e,t)=>h.jsx(ke.span,{...e,ref:t,style:{...Du,...e.style}}));Mu.displayName=H_;var q_=Mu;function K_(e,t){const n=_.createContext(t),r=i=>{const{children:s,...a}=i,l=_.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=_.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Ft(e,t=[]){let n=[];function r(i,s){const a=_.createContext(s),l=n.length;n=[...n,s];const c=f=>{const{scope:p,children:d,...x}=f,m=p?.[e]?.[l]||a,y=_.useMemo(()=>x,Object.values(x));return h.jsx(m.Provider,{value:y,children:d})};c.displayName=i+"Provider";function u(f,p){const d=p?.[e]?.[l]||a,x=_.useContext(d);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>_.createContext(s));return function(a){const l=a?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,G_(o,...t)]}function G_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Lu(e){const t=e+"CollectionProvider",[n,r]=Ft(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:g}=m,v=tt.useRef(null),k=tt.useRef(new Map).current;return h.jsx(o,{scope:y,itemMap:k,collectionRef:v,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=In(a),c=tt.forwardRef((m,y)=>{const{scope:g,children:v}=m,k=i(a,g),S=Oe(y,k.collectionRef);return h.jsx(l,{ref:S,children:v})});c.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=In(u),d=tt.forwardRef((m,y)=>{const{scope:g,children:v,...k}=m,S=tt.useRef(null),C=Oe(y,S),E=i(u,g);return tt.useEffect(()=>(E.itemMap.set(S,{ref:S,...k}),()=>{E.itemMap.delete(S)})),h.jsx(p,{[f]:"",ref:C,children:v})});d.displayName=u;function x(m){const y=i(e+"CollectionConsumer",m);return tt.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((E,I)=>k.indexOf(E.ref.current)-k.indexOf(I.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:c,ItemSlot:d},x,r]}function be(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var qe=globalThis?.document?_.useLayoutEffect:()=>{},J_=Hl[" useInsertionEffect ".trim().toString()]||qe;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=Y_({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=_.useRef(e!==void 0);_.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=_.useCallback(u=>{if(a){const f=X_(u)?u(e):u;f!==e&&s.current?.(f)}else i(u)},[a,e,i,s]);return[l,c]}function Y_({defaultProp:e,onChange:t}){const[n,r]=_.useState(e),o=_.useRef(n),i=_.useRef(t);return J_(()=>{i.current=t},[t]),_.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function X_(e){return typeof e=="function"}function Q_(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var pt=e=>{const{present:t,children:n}=e,r=ek(t),o=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=Oe(r.ref,tk(o));return typeof n=="function"||r.isPresent?_.cloneElement(o,{ref:i}):null};pt.displayName="Presence";function ek(e){const[t,n]=_.useState(),r=_.useRef(null),o=_.useRef(e),i=_.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Q_(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=Nr(r.current);i.current=a==="mounted"?c:"none"},[a]),qe(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,d=Nr(c);e?l("MOUNT"):d==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==d?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),qe(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=d=>{const m=Nr(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=d=>{d.target===t&&(i.current=Nr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Nr(e){return e?.animationName||"none"}function tk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nk=Hl[" useId ".trim().toString()]||(()=>{}),rk=0;function Tt(e){const[t,n]=_.useState(nk());return qe(()=>{n(r=>r??String(rk++))},[e]),e||(t?`radix-${t}`:"")}var fo="Collapsible",[ok]=Ft(fo),[ik,cs]=ok(fo),Fu=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,c]=nn({prop:r,defaultProp:o??!1,onChange:s,caller:fo});return h.jsx(ik,{scope:n,disabled:i,contentId:Tt(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c]),children:h.jsx(ke.div,{"data-state":ds(l),"data-disabled":i?"":void 0,...a,ref:t})})});Fu.displayName=fo;var $u="CollapsibleTrigger",Bu=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=cs($u,n);return h.jsx(ke.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ds(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:be(e.onClick,o.onOpenToggle)})});Bu.displayName=$u;var us="CollapsibleContent",Uu=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=cs(us,e.__scopeCollapsible);return h.jsx(pt,{present:n||o.open,children:({present:i})=>h.jsx(sk,{...r,ref:t,present:i})})});Uu.displayName=us;var sk=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=cs(us,n),[a,l]=_.useState(r),c=_.useRef(null),u=Oe(t,c),f=_.useRef(0),p=f.current,d=_.useRef(0),x=d.current,m=s.open||a,y=_.useRef(m),g=_.useRef(void 0);return _.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),qe(()=>{const v=c.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const k=v.getBoundingClientRect();f.current=k.height,d.current=k.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),l(r)}},[s.open,r]),h.jsx(ke.div,{"data-state":ds(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&o})});function ds(e){return e?"open":"closed"}var ak=Fu,lk=_.createContext(void 0);function ho(e){const t=_.useContext(lk);return e||t||"ltr"}function Qe(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function ck(e,t=globalThis?.document){const n=Qe(e);_.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var uk="DismissableLayer",_i="dismissableLayer.update",dk="dismissableLayer.pointerDownOutside",fk="dismissableLayer.focusOutside",al,Zu=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),po=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=_.useContext(Zu),[u,f]=_.useState(null),p=u?.ownerDocument??globalThis?.document,[,d]=_.useState({}),x=Oe(t,I=>f(I)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),v=u?m.indexOf(u):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=g,C=mk(I=>{const z=I.target,P=[...c.branches].some(L=>L.contains(z));!S||P||(o?.(I),s?.(I),I.defaultPrevented||a?.())},p),E=gk(I=>{const z=I.target;[...c.branches].some(L=>L.contains(z))||(i?.(I),s?.(I),I.defaultPrevented||a?.())},p);return ck(I=>{v===c.layers.size-1&&(r?.(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},p),_.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(al=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ll(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=al)}},[u,p,n,c]),_.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ll())},[u,c]),_.useEffect(()=>{const I=()=>d({});return document.addEventListener(_i,I),()=>document.removeEventListener(_i,I)},[]),h.jsx(ke.div,{...l,ref:x,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,E.onFocusCapture),onBlurCapture:be(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,C.onPointerDownCapture)})});po.displayName=uk;var hk="DismissableLayerBranch",pk=_.forwardRef((e,t)=>{const n=_.useContext(Zu),r=_.useRef(null),o=Oe(t,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(ke.div,{...e,ref:o})});pk.displayName=hk;function mk(e,t=globalThis?.document){const n=Qe(e),r=_.useRef(!1),o=_.useRef(()=>{});return _.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Vu(dk,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function gk(e,t=globalThis?.document){const n=Qe(e),r=_.useRef(!1);return _.useEffect(()=>{const o=i=>{i.target&&!r.current&&Vu(fk,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ll(){const e=new CustomEvent(_i);document.dispatchEvent(e)}function Vu(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?W_(o,i):o.dispatchEvent(i)}var Go="focusScope.autoFocusOnMount",Jo="focusScope.autoFocusOnUnmount",cl={bubbles:!1,cancelable:!0},xk="FocusScope",fs=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=_.useState(null),c=Qe(o),u=Qe(i),f=_.useRef(null),p=Oe(t,m=>l(m)),d=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let m=function(k){if(d.paused||!a)return;const S=k.target;a.contains(S)?f.current=S:Ut(f.current,{select:!0})},y=function(k){if(d.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||Ut(f.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&Ut(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,d.paused]),_.useEffect(()=>{if(a){dl.add(d);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Go,cl);a.addEventListener(Go,c),a.dispatchEvent(g),g.defaultPrevented||(yk(kk(Wu(a)),{select:!0}),document.activeElement===m&&Ut(a))}return()=>{a.removeEventListener(Go,c),setTimeout(()=>{const g=new CustomEvent(Jo,cl);a.addEventListener(Jo,u),a.dispatchEvent(g),g.defaultPrevented||Ut(m??document.body,{select:!0}),a.removeEventListener(Jo,u),dl.remove(d)},0)}}},[a,c,u,d]);const x=_.useCallback(m=>{if(!n&&!r||d.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[k,S]=vk(v);k&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Ut(k,{select:!0})):m.shiftKey&&g===k&&(m.preventDefault(),n&&Ut(S,{select:!0})):g===v&&m.preventDefault()}},[n,r,d.paused]);return h.jsx(ke.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});fs.displayName=xk;function yk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ut(r,{select:t}),document.activeElement!==n)return}function vk(e){const t=Wu(e),n=ul(t,e),r=ul(t.reverse(),e);return[n,r]}function Wu(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ul(e,t){for(const n of e)if(!bk(n,{upTo:t}))return n}function bk(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 wk(e){return e instanceof HTMLInputElement&&"select"in e}function Ut(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wk(e)&&t&&e.select()}}var dl=_k();function _k(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fl(e,t),e.unshift(t)},remove(t){e=fl(e,t),e[0]?.resume()}}}function fl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kk(e){return e.filter(t=>t.tagName!=="A")}var Sk="Portal",mo=_.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=_.useState(!1);qe(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?fh.createPortal(h.jsx(ke.div,{...r,ref:t}),s):null});mo.displayName=Sk;var Yo=0;function Hu(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hl()),document.body.insertAdjacentElement("beforeend",e[1]??hl()),Yo++,()=>{Yo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yo--}},[])}function hl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ct=function(){return Ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ct.apply(this,arguments)};function qu(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ck(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Mr="right-scroll-bar-position",Lr="width-before-scroll-bar",Ek="with-scroll-bars-hidden",Tk="--removed-body-scroll-bar-size";function Xo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nk(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Ak=typeof window<"u"?_.useLayoutEffect:_.useEffect,pl=new WeakMap;function zk(e,t){var n=Nk(null,function(r){return e.forEach(function(o){return Xo(o,r)})});return Ak(function(){var r=pl.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Xo(a,null)}),i.forEach(function(a){o.has(a)||Xo(a,s)})}pl.set(n,e)},[e]),n}function jk(e){return e}function Ik(e,t){t===void 0&&(t=jk);var n=[],r=!1,o={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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function Ok(e){e===void 0&&(e={});var t=Ik(null);return t.options=Ct({async:!0,ssr:!1},e),t}var Ku=function(e){var t=e.sideCar,n=qu(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 _.createElement(r,Ct({},n))};Ku.isSideCarExport=!0;function Pk(e,t){return e.useMedium(t),Ku}var Gu=Ok(),Qo=function(){},go=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:Qo,onWheelCapture:Qo,onTouchMoveCapture:Qo}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,d=e.noRelative,x=e.noIsolation,m=e.inert,y=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,k=e.gapMode,S=qu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,E=zk([n,t]),I=Ct(Ct({},S),o);return _.createElement(_.Fragment,null,u&&_.createElement(C,{sideCar:Gu,removeScrollBar:c,shards:f,noRelative:d,noIsolation:x,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:k}),s?_.cloneElement(_.Children.only(a),Ct(Ct({},I),{ref:E})):_.createElement(v,Ct({},I,{className:l,ref:E}),a))});go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};go.classNames={fullWidth:Lr,zeroRight:Mr};var Rk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Dk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Rk();return t&&e.setAttribute("nonce",t),e}function Mk(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Lk(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Fk=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Dk())&&(Mk(t,n),Lk(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$k=function(){var e=Fk();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ju=function(){var e=$k(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Bk={left:0,top:0,right:0,gap:0},ei=function(e){return parseInt(e||"",10)||0},Uk=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ei(n),ei(r),ei(o)]},Zk=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bk;var t=Uk(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])}},Vk=Ju(),En="data-scroll-locked",Wk=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
54
|
-
.`.concat(
|
|
52
|
+
`}),n}function Ya(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xa(e,t){const n=s_(e,t),r=n.one(e,void 0),o=G2(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
53
|
+
`},o),i}function d_(e,t){return e&&"run"in e?async function(n,r){const o=Xa(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Xa(n,{file:r,...e||t})}}function Qa(e){if(e)throw e}var Bo,el;function f_(){if(el)return Bo;el=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!f)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Bo=function l(){var c,u,f,p,d,x,m=arguments[0],y=1,g=arguments.length,b=!1;for(typeof m=="boolean"&&(b=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<g;++y)if(c=arguments[y],c!=null)for(u in c)f=a(m,u),p=a(c,u),m!==p&&(b&&p&&(i(p)||(d=o(p)))?(d?(d=!1,x=f&&o(f)?f:[]):x=f&&i(f)?f:{},s(m,{name:u,newValue:l(b,x,p)})):typeof p<"u"&&s(m,{name:u,newValue:p}));return m},Bo}var h_=f_();const Uo=Di(h_);function bi(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 p_(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?m_(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function m_(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const kt={basename:g_,dirname:x_,extname:y_,join:v_,sep:"/"};function g_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pr(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function x_(e){if(pr(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 y_(e){pr(e);let t=e.length,n=-1,r=0,o=-1,i=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?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function v_(...e){let t=-1,n;for(;++t<e.length;)pr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":b_(n)}function b_(e){pr(e);const t=e.codePointAt(0)===47;let n=w_(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function w_(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function pr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const __={cwd:k_};function k_(){return"/"}function wi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function S_(e){if(typeof e=="string")e=new URL(e);else if(!wi(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 C_(e)}function C_(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 o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Zo=["history","path","basename","stem","extname","dirname"];class Pu{constructor(t){let n;t?wi(t)?n={path:t}:typeof t=="string"||E_(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":__.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zo.length;){const i=Zo[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Zo.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?kt.basename(this.path):void 0}set basename(t){Wo(t,"basename"),Vo(t,"basename"),this.path=kt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?kt.dirname(this.path):void 0}set dirname(t){tl(this.basename,"dirname"),this.path=kt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?kt.extname(this.path):void 0}set extname(t){if(Vo(t,"extname"),tl(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=kt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wi(t)&&(t=S_(t)),Wo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?kt.basename(this.path,this.extname):void 0}set stem(t){Wo(t,"stem"),Vo(t,"stem"),this.path=kt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Ge(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Vo(e,t){if(e&&e.includes(kt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+kt.sep+"`")}function Wo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function tl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function E_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const T_=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),N_={}.hasOwnProperty;class ls extends T_{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=p_()}copy(){const t=new ls;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Uo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ko("data",this.frozen),this.namespace[t]=n,this):N_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ko("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 o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Nr(t),r=this.parser||this.Parser;return Ho("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ho("process",this.parser||this.Parser),qo("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Nr(t),l=r.parse(a);r.run(l,a,function(u,f,p){if(u||!f||!p)return c(u);const d=f,x=r.stringify(d,p);z_(x)?p.value=x:p.result=x,c(u,p)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Ho("processSync",this.parser||this.Parser),qo("processSync",this.compiler||this.Compiler),this.process(t,o),rl("processSync","process",n),r;function o(i,s){n=!0,Qa(i),r=s}}run(t,n,r){nl(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Nr(n);o.run(t,l,c);function c(u,f,p){const d=f||t;u?a(u):s?s(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),rl("runSync","run",r),o;function i(s,a){Qa(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Nr(n),o=this.compiler||this.Compiler;return qo("stringify",o),nl(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Ko("use",this.frozen),t!=null)if(typeof t=="function")l(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 i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))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(c.plugins),c.settings&&(o.settings=Uo(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===c){p=f;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[d,...x]=u;const m=r[p][1];bi(m)&&bi(d)&&(d=Uo(!0,m,d)),r[p]=[c,d,...x]}}}}const A_=new ls().freeze();function Ho(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ko(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 nl(e){if(!bi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Nr(e){return j_(e)?e:new Pu(e)}function j_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function z_(e){return typeof e=="string"||I_(e)}function I_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const O_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ol=[],il={allowDangerousHtml:!0},P_=/^(https?|ircs?|mailto|xmpp)$/i,R_=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function zn(e){const t=D_(e),n=M_(e);return L_(t.runSync(t.parse(n),n),e)}function D_(e){const t=e.rehypePlugins||ol,n=e.remarkPlugins||ol,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...il}:il;return A_().use(g2).use(n).use(d_,r).use(t)}function M_(e){const t=e.children||"",n=new Pu;return typeof t=="string"&&(n.value=t),n}function L_(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||F_;for(const u of R_)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+O_+u.id,void 0);return Ou(e,c),Gb(e,{Fragment:h.Fragment,components:o,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,f,p){if(u.type==="raw"&&p&&typeof f=="number")return s?p.children.splice(f,1):p.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let d;for(d in Lo)if(Object.hasOwn(Lo,d)&&Object.hasOwn(u.properties,d)){const x=u.properties[d],m=Lo[d];(m===null||m.includes(u.tagName))&&(u.properties[d]=l(String(x||""),d,u))}}if(u.type==="element"){let d=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!d&&r&&typeof f=="number"&&(d=!r(u,f,p)),d&&p&&typeof f=="number")return a&&u.children?p.children.splice(f,1,...u.children):p.children.splice(f,1),f}}}function F_(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||P_.test(e.slice(0,t))?e:""}function sl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ru(...e){return t=>{let n=!1;const r=e.map(o=>{const i=sl(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():sl(e[o],null)}}}}function Oe(...e){return _.useCallback(Ru(...e),e)}function In(e){const t=B_(e),n=_.forwardRef((r,o)=>{const{children:i,...s}=r,a=_.Children.toArray(i),l=a.find(Z_);if(l){const c=l.props.children,u=a.map(f=>f===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:f);return h.jsx(t,{...s,ref:o,children:_.isValidElement(c)?_.cloneElement(c,void 0,u):null})}return h.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var $_=In("Slot");function B_(e){const t=_.forwardRef((n,r)=>{const{children:o,...i}=n;if(_.isValidElement(o)){const s=W_(o),a=V_(i,o.props);return o.type!==_.Fragment&&(a.ref=r?Ru(r,s):s),_.cloneElement(o,a)}return _.Children.count(o)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Du=Symbol("radix.slottable");function U_(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Du,t}function Z_(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Du}function V_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function W_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var H_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=H_.reduce((e,t)=>{const n=In(`Primitive.${t}`),r=_.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function q_(e,t){e&&ur.flushSync(()=>e.dispatchEvent(t))}var Mu=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),K_="VisuallyHidden",Lu=_.forwardRef((e,t)=>h.jsx(ke.span,{...e,ref:t,style:{...Mu,...e.style}}));Lu.displayName=K_;var G_=Lu;function J_(e,t){const n=_.createContext(t),r=i=>{const{children:s,...a}=i,l=_.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=_.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Ft(e,t=[]){let n=[];function r(i,s){const a=_.createContext(s),l=n.length;n=[...n,s];const c=f=>{const{scope:p,children:d,...x}=f,m=p?.[e]?.[l]||a,y=_.useMemo(()=>x,Object.values(x));return h.jsx(m.Provider,{value:y,children:d})};c.displayName=i+"Provider";function u(f,p){const d=p?.[e]?.[l]||a,x=_.useContext(d);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>_.createContext(s));return function(a){const l=a?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Y_(o,...t)]}function Y_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Fu(e){const t=e+"CollectionProvider",[n,r]=Ft(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:g}=m,b=tt.useRef(null),k=tt.useRef(new Map).current;return h.jsx(o,{scope:y,itemMap:k,collectionRef:b,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=In(a),c=tt.forwardRef((m,y)=>{const{scope:g,children:b}=m,k=i(a,g),S=Oe(y,k.collectionRef);return h.jsx(l,{ref:S,children:b})});c.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=In(u),d=tt.forwardRef((m,y)=>{const{scope:g,children:b,...k}=m,S=tt.useRef(null),C=Oe(y,S),T=i(u,g);return tt.useEffect(()=>(T.itemMap.set(S,{ref:S,...k}),()=>{T.itemMap.delete(S)})),h.jsx(p,{[f]:"",ref:C,children:b})});d.displayName=u;function x(m){const y=i(e+"CollectionConsumer",m);return tt.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const k=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((T,z)=>k.indexOf(T.ref.current)-k.indexOf(z.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:c,ItemSlot:d},x,r]}function be(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var qe=globalThis?.document?_.useLayoutEffect:()=>{},X_=ql[" useInsertionEffect ".trim().toString()]||qe;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=Q_({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=_.useRef(e!==void 0);_.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=_.useCallback(u=>{if(a){const f=ek(u)?u(e):u;f!==e&&s.current?.(f)}else i(u)},[a,e,i,s]);return[l,c]}function Q_({defaultProp:e,onChange:t}){const[n,r]=_.useState(e),o=_.useRef(n),i=_.useRef(t);return X_(()=>{i.current=t},[t]),_.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function ek(e){return typeof e=="function"}function tk(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var pt=e=>{const{present:t,children:n}=e,r=nk(t),o=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=Oe(r.ref,rk(o));return typeof n=="function"||r.isPresent?_.cloneElement(o,{ref:i}):null};pt.displayName="Presence";function nk(e){const[t,n]=_.useState(),r=_.useRef(null),o=_.useRef(e),i=_.useRef("none"),s=e?"mounted":"unmounted",[a,l]=tk(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=Ar(r.current);i.current=a==="mounted"?c:"none"},[a]),qe(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,d=Ar(c);e?l("MOUNT"):d==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==d?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),qe(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=d=>{const m=Ar(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=d=>{d.target===t&&(i.current=Ar(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Ar(e){return e?.animationName||"none"}function rk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ok=ql[" useId ".trim().toString()]||(()=>{}),ik=0;function Tt(e){const[t,n]=_.useState(ok());return qe(()=>{n(r=>r??String(ik++))},[e]),e||(t?`radix-${t}`:"")}var fo="Collapsible",[sk]=Ft(fo),[ak,cs]=sk(fo),$u=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,c]=nn({prop:r,defaultProp:o??!1,onChange:s,caller:fo});return h.jsx(ak,{scope:n,disabled:i,contentId:Tt(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c]),children:h.jsx(ke.div,{"data-state":ds(l),"data-disabled":i?"":void 0,...a,ref:t})})});$u.displayName=fo;var Bu="CollapsibleTrigger",Uu=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=cs(Bu,n);return h.jsx(ke.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ds(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:be(e.onClick,o.onOpenToggle)})});Uu.displayName=Bu;var us="CollapsibleContent",Zu=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=cs(us,e.__scopeCollapsible);return h.jsx(pt,{present:n||o.open,children:({present:i})=>h.jsx(lk,{...r,ref:t,present:i})})});Zu.displayName=us;var lk=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=cs(us,n),[a,l]=_.useState(r),c=_.useRef(null),u=Oe(t,c),f=_.useRef(0),p=f.current,d=_.useRef(0),x=d.current,m=s.open||a,y=_.useRef(m),g=_.useRef(void 0);return _.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),qe(()=>{const b=c.current;if(b){g.current=g.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const k=b.getBoundingClientRect();f.current=k.height,d.current=k.width,y.current||(b.style.transitionDuration=g.current.transitionDuration,b.style.animationName=g.current.animationName),l(r)}},[s.open,r]),h.jsx(ke.div,{"data-state":ds(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&o})});function ds(e){return e?"open":"closed"}var ck=$u,uk=_.createContext(void 0);function ho(e){const t=_.useContext(uk);return e||t||"ltr"}function Qe(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function dk(e,t=globalThis?.document){const n=Qe(e);_.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var fk="DismissableLayer",_i="dismissableLayer.update",hk="dismissableLayer.pointerDownOutside",pk="dismissableLayer.focusOutside",al,Vu=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),po=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=_.useContext(Vu),[u,f]=_.useState(null),p=u?.ownerDocument??globalThis?.document,[,d]=_.useState({}),x=Oe(t,z=>f(z)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),b=u?m.indexOf(u):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,S=b>=g,C=xk(z=>{const P=z.target,O=[...c.branches].some(M=>M.contains(P));!S||O||(o?.(z),s?.(z),z.defaultPrevented||a?.())},p),T=yk(z=>{const P=z.target;[...c.branches].some(M=>M.contains(P))||(i?.(z),s?.(z),z.defaultPrevented||a?.())},p);return dk(z=>{b===c.layers.size-1&&(r?.(z),!z.defaultPrevented&&a&&(z.preventDefault(),a()))},p),_.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(al=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ll(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=al)}},[u,p,n,c]),_.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ll())},[u,c]),_.useEffect(()=>{const z=()=>d({});return document.addEventListener(_i,z),()=>document.removeEventListener(_i,z)},[]),h.jsx(ke.div,{...l,ref:x,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,T.onFocusCapture),onBlurCapture:be(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,C.onPointerDownCapture)})});po.displayName=fk;var mk="DismissableLayerBranch",gk=_.forwardRef((e,t)=>{const n=_.useContext(Vu),r=_.useRef(null),o=Oe(t,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(ke.div,{...e,ref:o})});gk.displayName=mk;function xk(e,t=globalThis?.document){const n=Qe(e),r=_.useRef(!1),o=_.useRef(()=>{});return _.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Wu(hk,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yk(e,t=globalThis?.document){const n=Qe(e),r=_.useRef(!1);return _.useEffect(()=>{const o=i=>{i.target&&!r.current&&Wu(pk,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ll(){const e=new CustomEvent(_i);document.dispatchEvent(e)}function Wu(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?q_(o,i):o.dispatchEvent(i)}var Go="focusScope.autoFocusOnMount",Jo="focusScope.autoFocusOnUnmount",cl={bubbles:!1,cancelable:!0},vk="FocusScope",fs=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=_.useState(null),c=Qe(o),u=Qe(i),f=_.useRef(null),p=Oe(t,m=>l(m)),d=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let m=function(k){if(d.paused||!a)return;const S=k.target;a.contains(S)?f.current=S:Ut(f.current,{select:!0})},y=function(k){if(d.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||Ut(f.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&Ut(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(g);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,d.paused]),_.useEffect(()=>{if(a){dl.add(d);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Go,cl);a.addEventListener(Go,c),a.dispatchEvent(g),g.defaultPrevented||(bk(Ck(Hu(a)),{select:!0}),document.activeElement===m&&Ut(a))}return()=>{a.removeEventListener(Go,c),setTimeout(()=>{const g=new CustomEvent(Jo,cl);a.addEventListener(Jo,u),a.dispatchEvent(g),g.defaultPrevented||Ut(m??document.body,{select:!0}),a.removeEventListener(Jo,u),dl.remove(d)},0)}}},[a,c,u,d]);const x=_.useCallback(m=>{if(!n&&!r||d.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const b=m.currentTarget,[k,S]=wk(b);k&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Ut(k,{select:!0})):m.shiftKey&&g===k&&(m.preventDefault(),n&&Ut(S,{select:!0})):g===b&&m.preventDefault()}},[n,r,d.paused]);return h.jsx(ke.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});fs.displayName=vk;function bk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ut(r,{select:t}),document.activeElement!==n)return}function wk(e){const t=Hu(e),n=ul(t,e),r=ul(t.reverse(),e);return[n,r]}function Hu(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ul(e,t){for(const n of e)if(!_k(n,{upTo:t}))return n}function _k(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 kk(e){return e instanceof HTMLInputElement&&"select"in e}function Ut(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&kk(e)&&t&&e.select()}}var dl=Sk();function Sk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fl(e,t),e.unshift(t)},remove(t){e=fl(e,t),e[0]?.resume()}}}function fl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ck(e){return e.filter(t=>t.tagName!=="A")}var Ek="Portal",mo=_.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=_.useState(!1);qe(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?hh.createPortal(h.jsx(ke.div,{...r,ref:t}),s):null});mo.displayName=Ek;var Yo=0;function qu(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hl()),document.body.insertAdjacentElement("beforeend",e[1]??hl()),Yo++,()=>{Yo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yo--}},[])}function hl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ct=function(){return Ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ct.apply(this,arguments)};function Ku(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Tk(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Mr="right-scroll-bar-position",Lr="width-before-scroll-bar",Nk="with-scroll-bars-hidden",Ak="--removed-body-scroll-bar-size";function Xo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function jk(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var zk=typeof window<"u"?_.useLayoutEffect:_.useEffect,pl=new WeakMap;function Ik(e,t){var n=jk(null,function(r){return e.forEach(function(o){return Xo(o,r)})});return zk(function(){var r=pl.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Xo(a,null)}),i.forEach(function(a){o.has(a)||Xo(a,s)})}pl.set(n,e)},[e]),n}function Ok(e){return e}function Pk(e,t){t===void 0&&(t=Ok);var n=[],r=!1,o={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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function Rk(e){e===void 0&&(e={});var t=Pk(null);return t.options=Ct({async:!0,ssr:!1},e),t}var Gu=function(e){var t=e.sideCar,n=Ku(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 _.createElement(r,Ct({},n))};Gu.isSideCarExport=!0;function Dk(e,t){return e.useMedium(t),Gu}var Ju=Rk(),Qo=function(){},go=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:Qo,onWheelCapture:Qo,onTouchMoveCapture:Qo}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,d=e.noRelative,x=e.noIsolation,m=e.inert,y=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,k=e.gapMode,S=Ku(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,T=Ik([n,t]),z=Ct(Ct({},S),o);return _.createElement(_.Fragment,null,u&&_.createElement(C,{sideCar:Ju,removeScrollBar:c,shards:f,noRelative:d,noIsolation:x,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:k}),s?_.cloneElement(_.Children.only(a),Ct(Ct({},z),{ref:T})):_.createElement(b,Ct({},z,{className:l,ref:T}),a))});go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};go.classNames={fullWidth:Lr,zeroRight:Mr};var Mk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Mk();return t&&e.setAttribute("nonce",t),e}function Fk(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $k(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Bk=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lk())&&(Fk(t,n),$k(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Uk=function(){var e=Bk();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Yu=function(){var e=Uk(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Zk={left:0,top:0,right:0,gap:0},ei=function(e){return parseInt(e||"",10)||0},Vk=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ei(n),ei(r),ei(o)]},Wk=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Zk;var t=Vk(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])}},Hk=Yu(),En="data-scroll-locked",qk=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
54
|
+
.`.concat(Nk,` {
|
|
55
55
|
overflow: hidden `).concat(r,`;
|
|
56
56
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
57
57
|
}
|
|
@@ -85,13 +85,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
body[`).concat(En,`] {
|
|
88
|
-
`).concat(
|
|
88
|
+
`).concat(Ak,": ").concat(a,`px;
|
|
89
89
|
}
|
|
90
|
-
`)},ml=function(){var e=parseInt(document.body.getAttribute(En)||"0",10);return isFinite(e)?e:0},
|
|
90
|
+
`)},ml=function(){var e=parseInt(document.body.getAttribute(En)||"0",10);return isFinite(e)?e:0},Kk=function(){_.useEffect(function(){return document.body.setAttribute(En,(ml()+1).toString()),function(){var e=ml()-1;e<=0?document.body.removeAttribute(En):document.body.setAttribute(En,e.toString())}},[])},Gk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Kk();var i=_.useMemo(function(){return Wk(o)},[o]);return _.createElement(Hk,{styles:qk(i,!t,o,n?"":"!important")})},ki=!1;if(typeof window<"u")try{var jr=Object.defineProperty({},"passive",{get:function(){return ki=!0,!0}});window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch{ki=!1}var gn=ki?{passive:!1}:!1,Jk=function(e){return e.tagName==="TEXTAREA"},Xu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Jk(e)&&n[t]==="visible")},Yk=function(e){return Xu(e,"overflowY")},Xk=function(e){return Xu(e,"overflowX")},gl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Qu(e,r);if(o){var i=ed(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qk=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eS=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Qu=function(e,t){return e==="v"?Yk(t):Xk(t)},ed=function(e,t){return e==="v"?Qk(t):eS(t)},tS=function(e,t){return e==="h"&&t==="rtl"?-1:1},nS=function(e,t,n,r,o){var i=tS(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,p=0;do{if(!a)break;var d=ed(e,a),x=d[0],m=d[1],y=d[2],g=m-y-i*x;(x||g)&&Qu(e,a)&&(f+=g,p+=x);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(f)<1||!u&&Math.abs(p)<1)&&(c=!0),c},zr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xl=function(e){return[e.deltaX,e.deltaY]},yl=function(e){return e&&"current"in e?e.current:e},rS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oS=function(e){return`
|
|
91
91
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
92
92
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
93
|
-
`)},
|
|
93
|
+
`)},iS=0,xn=[];function sS(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),o=_.useState(iS++)[0],i=_.useState(Yu)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Tk([e.lockRef.current],(e.shards||[]).map(yl),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=_.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=zr(m),b=n.current,k="deltaX"in m?m.deltaX:b[0]-g[0],S="deltaY"in m?m.deltaY:b[1]-g[1],C,T=m.target,z=Math.abs(k)>Math.abs(S)?"h":"v";if("touches"in m&&z==="h"&&T.type==="range")return!1;var P=window.getSelection(),O=P&&P.anchorNode,M=O?O===T||O.contains(T):!1;if(M)return!1;var B=gl(z,T);if(!B)return!0;if(B?C=z:(C=z==="v"?"h":"v",B=gl(z,T)),!B)return!1;if(!r.current&&"changedTouches"in m&&(k||S)&&(r.current=C),!C)return!0;var E=r.current||C;return nS(E,y,m,E==="h"?k:S)},[]),l=_.useCallback(function(m){var y=m;if(!(!xn.length||xn[xn.length-1]!==i)){var g="deltaY"in y?xl(y):zr(y),b=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&rS(C.delta,g)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var k=(s.current.shards||[]).map(yl).filter(Boolean).filter(function(C){return C.contains(y.target)}),S=k.length>0?a(y,k[0]):!s.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),c=_.useCallback(function(m,y,g,b){var k={name:m,delta:y,target:g,should:b,shadowParent:aS(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(S){return S!==k})},1)},[]),u=_.useCallback(function(m){n.current=zr(m),r.current=void 0},[]),f=_.useCallback(function(m){c(m.type,xl(m),m.target,a(m,e.lockRef.current))},[]),p=_.useCallback(function(m){c(m.type,zr(m),m.target,a(m,e.lockRef.current))},[]);_.useEffect(function(){return xn.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,gn),document.addEventListener("touchmove",l,gn),document.addEventListener("touchstart",u,gn),function(){xn=xn.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,gn),document.removeEventListener("touchmove",l,gn),document.removeEventListener("touchstart",u,gn)}},[]);var d=e.removeScrollBar,x=e.inert;return _.createElement(_.Fragment,null,x?_.createElement(i,{styles:oS(o)}):null,d?_.createElement(Gk,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lS=Dk(Ju,sS);var hs=_.forwardRef(function(e,t){return _.createElement(go,Ct({},e,{ref:t,sideCar:lS}))});hs.classNames=go.classNames;var cS=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yn=new WeakMap,Ir=new WeakMap,Or={},ti=0,td=function(e){return e&&(e.host||td(e.parentNode))},uS=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=td(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})},dS=function(e,t,n,r){var o=uS(t,Array.isArray(e)?e:[e]);Or[n]||(Or[n]=new WeakMap);var i=Or[n],s=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))u(p);else try{var d=p.getAttribute(r),x=d!==null&&d!=="false",m=(yn.get(p)||0)+1,y=(i.get(p)||0)+1;yn.set(p,m),i.set(p,y),s.push(p),m===1&&x&&Ir.set(p,!0),y===1&&p.setAttribute(n,"true"),x||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return u(t),a.clear(),ti++,function(){s.forEach(function(f){var p=yn.get(f)-1,d=i.get(f)-1;yn.set(f,p),i.set(f,d),p||(Ir.has(f)||f.removeAttribute(r),Ir.delete(f)),d||f.removeAttribute(n)}),ti--,ti||(yn=new WeakMap,yn=new WeakMap,Ir=new WeakMap,Or={})}},nd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=cS(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),dS(r,o,n,"aria-hidden")):function(){return null}},xo="Dialog",[rd]=Ft(xo),[fS,wt]=rd(xo),od=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=_.useRef(null),l=_.useRef(null),[c,u]=nn({prop:r,defaultProp:o??!1,onChange:i,caller:xo});return h.jsx(fS,{scope:t,triggerRef:a,contentRef:l,contentId:Tt(),titleId:Tt(),descriptionId:Tt(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(f=>!f),[u]),modal:s,children:n})};od.displayName=xo;var id="DialogTrigger",sd=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(id,n),i=Oe(t,o.triggerRef);return h.jsx(ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gs(o.open),...r,ref:i,onClick:be(e.onClick,o.onOpenToggle)})});sd.displayName=id;var ps="DialogPortal",[hS,ad]=rd(ps,{forceMount:void 0}),ld=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=wt(ps,t);return h.jsx(hS,{scope:t,forceMount:n,children:_.Children.map(r,s=>h.jsx(pt,{present:n||i.open,children:h.jsx(mo,{asChild:!0,container:o,children:s})}))})};ld.displayName=ps;var Kr="DialogOverlay",cd=_.forwardRef((e,t)=>{const n=ad(Kr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=wt(Kr,e.__scopeDialog);return i.modal?h.jsx(pt,{present:r||i.open,children:h.jsx(mS,{...o,ref:t})}):null});cd.displayName=Kr;var pS=In("DialogOverlay.RemoveScroll"),mS=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(Kr,n);return h.jsx(hs,{as:pS,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(ke.div,{"data-state":gs(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),rn="DialogContent",ud=_.forwardRef((e,t)=>{const n=ad(rn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=wt(rn,e.__scopeDialog);return h.jsx(pt,{present:r||i.open,children:i.modal?h.jsx(gS,{...o,ref:t}):h.jsx(xS,{...o,ref:t})})});ud.displayName=rn;var gS=_.forwardRef((e,t)=>{const n=wt(rn,e.__scopeDialog),r=_.useRef(null),o=Oe(t,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return nd(i)},[]),h.jsx(dd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:be(e.onFocusOutside,i=>i.preventDefault())})}),xS=_.forwardRef((e,t)=>{const n=wt(rn,e.__scopeDialog),r=_.useRef(!1),o=_.useRef(!1);return h.jsx(dd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),dd=_.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=wt(rn,n),l=_.useRef(null),c=Oe(t,l);return qu(),h.jsxs(h.Fragment,{children:[h.jsx(fs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:h.jsx(po,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":gs(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(vS,{titleId:a.titleId}),h.jsx(wS,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ms="DialogTitle",fd=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(ms,n);return h.jsx(ke.h2,{id:o.titleId,...r,ref:t})});fd.displayName=ms;var hd="DialogDescription",yS=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(hd,n);return h.jsx(ke.p,{id:o.descriptionId,...r,ref:t})});yS.displayName=hd;var pd="DialogClose",md=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(pd,n);return h.jsx(ke.button,{type:"button",...r,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});md.displayName=pd;function gs(e){return e?"open":"closed"}var gd="DialogTitleWarning",[tT,xd]=J_(gd,{contentName:rn,titleName:ms,docsSlug:"dialog"}),vS=({titleId:e})=>{const t=xd(gd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
94
94
|
|
|
95
95
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
96
96
|
|
|
97
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},yS="DialogDescriptionWarning",vS=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gd(yS).contentName}}.`;return _.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},bS=rd,wS=id,_S=ad,kS=ld,SS=cd,CS=dd,ES=pd;function TS(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function NS(e){const[t,n]=_.useState(void 0);return qe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const AS=["top","right","bottom","left"],Ht=Math.min,at=Math.max,Gr=Math.round,Or=Math.floor,Nt=e=>({x:e,y:e}),zS={left:"right",right:"left",bottom:"top",top:"bottom"},jS={start:"end",end:"start"};function Si(e,t,n){return at(e,Ht(t,n))}function Mt(e,t){return typeof e=="function"?e(t):e}function Lt(e){return e.split("-")[0]}function Un(e){return e.split("-")[1]}function xs(e){return e==="x"?"y":"x"}function ys(e){return e==="y"?"height":"width"}const IS=new Set(["top","bottom"]);function Et(e){return IS.has(Lt(e))?"y":"x"}function vs(e){return xs(Et(e))}function OS(e,t,n){n===void 0&&(n=!1);const r=Un(e),o=vs(e),i=ys(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function PS(e){const t=Jr(e);return[Ci(e),t,Ci(t)]}function Ci(e){return e.replace(/start|end/g,t=>jS[t])}const vl=["left","right"],bl=["right","left"],RS=["top","bottom"],DS=["bottom","top"];function MS(e,t,n){switch(e){case"top":case"bottom":return n?t?bl:vl:t?vl:bl;case"left":case"right":return t?RS:DS;default:return[]}}function LS(e,t,n,r){const o=Un(e);let i=MS(Lt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ci)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>zS[t])}function FS(e){return{top:0,right:0,bottom:0,left:0,...e}}function xd(e){return typeof e!="number"?FS(e):{top:e,right:e,bottom:e,left:e}}function Yr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function wl(e,t,n){let{reference:r,floating:o}=e;const i=Et(t),s=vs(t),a=ys(s),l=Lt(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let d;switch(l){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(Un(t)){case"start":d[s]-=p*(n&&c?-1:1);break;case"end":d[s]+=p*(n&&c?-1:1);break}return d}async function $S(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=Mt(t,e),x=xd(d),y=a[p?f==="floating"?"reference":"floating":f],g=Yr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},C=Yr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:l}):v);return{top:(g.top-C.top+x.top)/S.y,bottom:(C.bottom-g.bottom+x.bottom)/S.y,left:(g.left-C.left+x.left)/S.x,right:(C.right-g.right+x.right)/S.x}}const BS=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=wl(c,r,l),p=r,d={},x=0;for(let y=0;y<a.length;y++){var m;const{name:g,fn:v}=a[y],{x:k,y:S,data:C,reset:E}=await v({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:$S},elements:{reference:e,floating:t}});u=k??u,f=S??f,d={...d,[g]:{...d[g],...C}},E&&x<=50&&(x++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=wl(c,p,l)),y=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}},US=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Mt(e,t)||{};if(c==null)return{};const f=xd(u),p={x:n,y:r},d=vs(o),x=ys(d),m=await s.getDimensions(c),y=d==="y",g=y?"top":"left",v=y?"bottom":"right",k=y?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[d]-p[d]-i.floating[x],C=p[d]-i.reference[d],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let I=E?E[k]:0;(!I||!await(s.isElement==null?void 0:s.isElement(E)))&&(I=a.floating[k]||i.floating[x]);const z=S/2-C/2,P=I/2-m[x]/2-1,L=Ht(f[g],P),V=Ht(f[v],P),T=L,M=I-m[x]-V,b=I/2-m[x]/2+z,D=Si(T,b,M),K=!l.arrow&&Un(o)!=null&&b!==D&&i.reference[x]/2-(b<T?L:V)-m[x]/2<0,U=K?b<T?b-T:b-M:0;return{[d]:p[d]+U,data:{[d]:D,centerOffset:b-D-U,...K&&{alignmentOffset:U}},reset:K}}}),ZS=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...y}=Mt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Lt(o),v=Et(a),k=Lt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(k||!m?[Jr(a)]:PS(a)),E=x!=="none";!p&&E&&C.push(...LS(a,m,x,S));const I=[a,...C],z=await l.detectOverflow(t,y),P=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&P.push(z[g]),f){const b=OS(o,s,S);P.push(z[b[0]],z[b[1]])}if(L=[...L,{placement:o,overflows:P}],!P.every(b=>b<=0)){var V,T;const b=(((V=i.flip)==null?void 0:V.index)||0)+1,D=I[b];if(D&&(!(f==="alignment"?v!==Et(D):!1)||L.every(W=>Et(W.placement)===v?W.overflows[0]>0:!0)))return{data:{index:b,overflows:L},reset:{placement:D}};let K=(T=L.filter(U=>U.overflows[0]<=0).sort((U,W)=>U.overflows[1]-W.overflows[1])[0])==null?void 0:T.placement;if(!K)switch(d){case"bestFit":{var M;const U=(M=L.filter(W=>{if(E){const q=Et(W.placement);return q===v||q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(q=>q>0).reduce((q,A)=>q+A,0)]).sort((W,q)=>W[1]-q[1])[0])==null?void 0:M[0];U&&(K=U);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}};function _l(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kl(e){return AS.some(t=>e[t]>=0)}const VS=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Mt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=_l(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:kl(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=_l(s,n.floating);return{data:{escapedOffsets:a,escaped:kl(a)}}}default:return{}}}}},yd=new Set(["left","top"]);async function WS(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Lt(n),a=Un(n),l=Et(n)==="y",c=yd.has(s)?-1:1,u=i&&l?-1:1,f=Mt(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof x=="number"&&(d=a==="end"?x*-1:x),l?{x:d*u,y:p*c}:{x:p*c,y:d*u}}const HS=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await WS(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},qS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:v,y:k}=g;return{x:v,y:k}}},...c}=Mt(e,t),u={x:n,y:r},f=await i.detectOverflow(t,c),p=Et(Lt(o)),d=xs(p);let x=u[d],m=u[p];if(s){const g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",k=x+f[g],S=x-f[v];x=Si(k,x,S)}if(a){const g=p==="y"?"top":"left",v=p==="y"?"bottom":"right",k=m+f[g],S=m-f[v];m=Si(k,m,S)}const y=l.fn({...t,[d]:x,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[d]:s,[p]:a}}}}}},KS=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Mt(e,t),u={x:n,y:r},f=Et(o),p=xs(f);let d=u[p],x=u[f];const m=Mt(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const k=p==="y"?"height":"width",S=i.reference[p]-i.floating[k]+y.mainAxis,C=i.reference[p]+i.reference[k]-y.mainAxis;d<S?d=S:d>C&&(d=C)}if(c){var g,v;const k=p==="y"?"width":"height",S=yd.has(Lt(o)),C=i.reference[f]-i.floating[k]+(S&&((g=s.offset)==null?void 0:g[f])||0)+(S?0:y.crossAxis),E=i.reference[f]+i.reference[k]+(S?0:((v=s.offset)==null?void 0:v[f])||0)-(S?y.crossAxis:0);x<C?x=C:x>E&&(x=E)}return{[p]:d,[f]:x}}}},GS=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Mt(e,t),u=await s.detectOverflow(t,c),f=Lt(o),p=Un(o),d=Et(o)==="y",{width:x,height:m}=i.floating;let y,g;f==="top"||f==="bottom"?(y=f,g=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,y=p==="end"?"top":"bottom");const v=m-u.top-u.bottom,k=x-u.left-u.right,S=Ht(m-u[y],v),C=Ht(x-u[g],k),E=!t.middlewareData.shift;let I=S,z=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=v),E&&!p){const L=at(u.left,0),V=at(u.right,0),T=at(u.top,0),M=at(u.bottom,0);d?z=x-2*(L!==0||V!==0?L+V:at(u.left,u.right)):I=m-2*(T!==0||M!==0?T+M:at(u.top,u.bottom))}await l({...t,availableWidth:z,availableHeight:I});const P=await s.getDimensions(a.floating);return x!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function yo(){return typeof window<"u"}function Zn(e){return vd(e)?(e.nodeName||"").toLowerCase():"#document"}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function It(e){var t;return(t=(vd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vd(e){return yo()?e instanceof Node||e instanceof ct(e).Node:!1}function vt(e){return yo()?e instanceof Element||e instanceof ct(e).Element:!1}function jt(e){return yo()?e instanceof HTMLElement||e instanceof ct(e).HTMLElement:!1}function Sl(e){return!yo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot}const JS=new Set(["inline","contents"]);function pr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!JS.has(o)}const YS=new Set(["table","td","th"]);function XS(e){return YS.has(Zn(e))}const QS=[":popover-open",":modal"];function vo(e){return QS.some(t=>{try{return e.matches(t)}catch{return!1}})}const eC=["transform","translate","scale","rotate","perspective"],tC=["transform","translate","scale","rotate","perspective","filter"],nC=["paint","layout","strict","content"];function bs(e){const t=ws(),n=vt(e)?bt(e):e;return eC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||tC.some(r=>(n.willChange||"").includes(r))||nC.some(r=>(n.contain||"").includes(r))}function rC(e){let t=qt(e);for(;jt(t)&&!On(t);){if(bs(t))return t;if(vo(t))return null;t=qt(t)}return null}function ws(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const oC=new Set(["html","body","#document"]);function On(e){return oC.has(Zn(e))}function bt(e){return ct(e).getComputedStyle(e)}function bo(e){return vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if(Zn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sl(e)&&e.host||It(e);return Sl(t)?t.host:t}function bd(e){const t=qt(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&pr(t)?t:bd(t)}function sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=bd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ct(o);if(i){const a=Ei(s);return t.concat(s,s.visualViewport||[],pr(o)?o:[],a&&n?sr(a):[])}return t.concat(o,sr(o,[],n))}function Ei(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wd(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=jt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Gr(n)!==i||Gr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function _s(e){return vt(e)?e:e.contextElement}function Tn(e){const t=_s(e);if(!jt(t))return Nt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=wd(t);let s=(i?Gr(n.width):n.width)/r,a=(i?Gr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const iC=Nt(0);function _d(e){const t=ct(e);return!ws()||!t.visualViewport?iC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ct(e)?!1:t}function on(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=_s(e);let s=Nt(1);t&&(r?vt(r)&&(s=Tn(r)):s=Tn(e));const a=sC(i,n,r)?_d(i):Nt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const p=ct(i),d=r&&vt(r)?ct(r):r;let x=p,m=Ei(x);for(;m&&r&&d!==x;){const y=Tn(m),g=m.getBoundingClientRect(),v=bt(m),k=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*y.x,S=g.top+(m.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=k,c+=S,x=ct(m),m=Ei(x)}}return Yr({width:u,height:f,x:l,y:c})}function wo(e,t){const n=bo(e).scrollLeft;return t?t.left+n:on(It(e)).left+n}function kd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function aC(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=It(r),a=t?vo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Nt(1);const u=Nt(0),f=jt(r);if((f||!f&&!i)&&((Zn(r)!=="body"||pr(s))&&(l=bo(r)),jt(r))){const d=on(r);c=Tn(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const p=s&&!f&&!i?kd(s,l):Nt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function lC(e){return Array.from(e.getClientRects())}function cC(e){const t=It(e),n=bo(e),r=e.ownerDocument.body,o=at(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=at(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wo(e);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(s+=at(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Cl=25;function uC(e,t){const n=ct(e),r=It(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=ws();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=wo(r);if(c<=0){const u=r.ownerDocument,f=u.body,p=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-f.clientWidth-d);x<=Cl&&(i-=x)}else c<=Cl&&(i+=c);return{width:i,height:s,x:a,y:l}}const dC=new Set(["absolute","fixed"]);function fC(e,t){const n=on(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=jt(e)?Tn(e):Nt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function El(e,t,n){let r;if(t==="viewport")r=uC(e,n);else if(t==="document")r=cC(It(e));else if(vt(t))r=fC(t,n);else{const o=_d(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Yr(r)}function Sd(e,t){const n=qt(e);return n===t||!vt(n)||On(n)?!1:bt(n).position==="fixed"||Sd(n,t)}function hC(e,t){const n=t.get(e);if(n)return n;let r=sr(e,[],!1).filter(a=>vt(a)&&Zn(a)!=="body"),o=null;const i=bt(e).position==="fixed";let s=i?qt(e):e;for(;vt(s)&&!On(s);){const a=bt(s),l=bs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&dC.has(o.position)||pr(s)&&!l&&Sd(e,s))?r=r.filter(u=>u!==s):o=a,s=qt(s)}return t.set(e,r),r}function pC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vo(t)?[]:hC(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=El(t,u,o);return c.top=at(f.top,c.top),c.right=Ht(f.right,c.right),c.bottom=Ht(f.bottom,c.bottom),c.left=at(f.left,c.left),c},El(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function mC(e){const{width:t,height:n}=wd(e);return{width:t,height:n}}function gC(e,t,n){const r=jt(t),o=It(t),i=n==="fixed",s=on(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Nt(0);function c(){l.x=wo(o)}if(r||!r&&!i)if((Zn(t)!=="body"||pr(o))&&(a=bo(t)),r){const d=on(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?kd(o,a):Nt(0),f=s.left+a.scrollLeft-l.x-u.x,p=s.top+a.scrollTop-l.y-u.y;return{x:f,y:p,width:s.width,height:s.height}}function ni(e){return bt(e).position==="static"}function Tl(e,t){if(!jt(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return It(e)===n&&(n=n.ownerDocument.body),n}function Cd(e,t){const n=ct(e);if(vo(e))return n;if(!jt(e)){let o=qt(e);for(;o&&!On(o);){if(vt(o)&&!ni(o))return o;o=qt(o)}return n}let r=Tl(e,t);for(;r&&XS(r)&&ni(r);)r=Tl(r,t);return r&&On(r)&&ni(r)&&!bs(r)?n:r||rC(e)||n}const xC=async function(e){const t=this.getOffsetParent||Cd,n=this.getDimensions,r=await n(e.floating);return{reference:gC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yC(e){return bt(e).direction==="rtl"}const vC={convertOffsetParentRelativeRectToViewportRelativeRect:aC,getDocumentElement:It,getClippingRect:pC,getOffsetParent:Cd,getElementRects:xC,getClientRects:lC,getDimensions:mC,getScale:Tn,isElement:vt,isRTL:yC};function Ed(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bC(e,t){let n=null,r;const o=It(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:d}=c;if(a||t(),!p||!d)return;const x=Or(f),m=Or(o.clientWidth-(u+p)),y=Or(o.clientHeight-(f+d)),g=Or(u),k={rootMargin:-x+"px "+-m+"px "+-y+"px "+-g+"px",threshold:at(0,Ht(1,l))||1};let S=!0;function C(E){const I=E[0].intersectionRatio;if(I!==l){if(!S)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!Ed(c,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,k)}n.observe(e)}return s(!0),i}function wC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=_s(e),u=o||i?[...c?sr(c):[],...sr(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=c&&a?bC(c,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(g=>{let[v]=g;v&&v.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=d)==null||k.observe(t)})),n()}),c&&!l&&d.observe(c),d.observe(t));let x,m=l?on(e):null;l&&y();function y(){const g=on(e);m&&!Ed(m,g)&&n(),m=g,x=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),f?.(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(x)}}const _C=HS,kC=qS,SC=ZS,CC=GS,EC=VS,Nl=US,TC=KS,NC=(e,t,n)=>{const r=new Map,o={platform:vC,...n},i={...o.platform,_c:r};return BS(e,t,{...o,platform:i})};var AC=typeof document<"u",zC=function(){},Fr=AC?_.useLayoutEffect:zC;function Xr(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,o;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(!Xr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Xr(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Td(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Al(e,t){const n=Td(e);return Math.round(t*n)/n}function ri(e){const t=_.useRef(e);return Fr(()=>{t.current=e}),t}function jC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=_.useState(r);Xr(p,r)||d(r);const[x,m]=_.useState(null),[y,g]=_.useState(null),v=_.useCallback(W=>{W!==E.current&&(E.current=W,m(W))},[]),k=_.useCallback(W=>{W!==I.current&&(I.current=W,g(W))},[]),S=i||x,C=s||y,E=_.useRef(null),I=_.useRef(null),z=_.useRef(u),P=l!=null,L=ri(l),V=ri(o),T=ri(c),M=_.useCallback(()=>{if(!E.current||!I.current)return;const W={placement:t,strategy:n,middleware:p};V.current&&(W.platform=V.current),NC(E.current,I.current,W).then(q=>{const A={...q,isPositioned:T.current!==!1};b.current&&!Xr(z.current,A)&&(z.current=A,cr.flushSync(()=>{f(A)}))})},[p,t,n,V,T]);Fr(()=>{c===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(W=>({...W,isPositioned:!1})))},[c]);const b=_.useRef(!1);Fr(()=>(b.current=!0,()=>{b.current=!1}),[]),Fr(()=>{if(S&&(E.current=S),C&&(I.current=C),S&&C){if(L.current)return L.current(S,C,M);M()}},[S,C,M,L,P]);const D=_.useMemo(()=>({reference:E,floating:I,setReference:v,setFloating:k}),[v,k]),K=_.useMemo(()=>({reference:S,floating:C}),[S,C]),U=_.useMemo(()=>{const W={position:n,left:0,top:0};if(!K.floating)return W;const q=Al(K.floating,u.x),A=Al(K.floating,u.y);return a?{...W,transform:"translate("+q+"px, "+A+"px)",...Td(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:A}},[n,a,K.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:M,refs:D,elements:K,floatingStyles:U}),[u,M,D,K,U])}const IC=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Nl({element:r.current,padding:o}).fn(n):{}:r?Nl({element:r,padding:o}).fn(n):{}}}},OC=(e,t)=>({..._C(e),options:[e,t]}),PC=(e,t)=>({...kC(e),options:[e,t]}),RC=(e,t)=>({...TC(e),options:[e,t]}),DC=(e,t)=>({...SC(e),options:[e,t]}),MC=(e,t)=>({...CC(e),options:[e,t]}),LC=(e,t)=>({...EC(e),options:[e,t]}),FC=(e,t)=>({...IC(e),options:[e,t]});var $C="Arrow",Nd=_.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return h.jsx(ke.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nd.displayName=$C;var BC=Nd,ks="Popper",[Ad,_o]=Ft(ks),[UC,zd]=Ad(ks),jd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=_.useState(null);return h.jsx(UC,{scope:t,anchor:r,onAnchorChange:o,children:n})};jd.displayName=ks;var Id="PopperAnchor",Od=_.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=zd(Id,n),s=_.useRef(null),a=Oe(t,s),l=_.useRef(null);return _.useEffect(()=>{const c=l.current;l.current=r?.current||s.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:h.jsx(ke.div,{...o,ref:a})});Od.displayName=Id;var Ss="PopperContent",[ZC,VC]=Ad(Ss),Pd=_.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:d="optimized",onPlaced:x,...m}=e,y=zd(Ss,n),[g,v]=_.useState(null),k=Oe(t,X=>v(X)),[S,C]=_.useState(null),E=NS(S),I=E?.width??0,z=E?.height??0,P=r+(i!=="center"?"-"+i:""),L=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},V=Array.isArray(c)?c:[c],T=V.length>0,M={padding:L,boundary:V.filter(HC),altBoundary:T},{refs:b,floatingStyles:D,placement:K,isPositioned:U,middlewareData:W}=jC({strategy:"fixed",placement:P,whileElementsMounted:(...X)=>wC(...X,{animationFrame:d==="always"}),elements:{reference:y.anchor},middleware:[OC({mainAxis:o+z,alignmentAxis:s}),l&&PC({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?RC():void 0,...M}),l&&DC({...M}),MC({...M,apply:({elements:X,rects:ae,availableWidth:de,availableHeight:me})=>{const{width:xe,height:Ee}=ae.reference,Pe=X.floating.style;Pe.setProperty("--radix-popper-available-width",`${de}px`),Pe.setProperty("--radix-popper-available-height",`${me}px`),Pe.setProperty("--radix-popper-anchor-width",`${xe}px`),Pe.setProperty("--radix-popper-anchor-height",`${Ee}px`)}}),S&&FC({element:S,padding:a}),qC({arrowWidth:I,arrowHeight:z}),p&&LC({strategy:"referenceHidden",...M})]}),[q,A]=Md(K),B=Qe(x);qe(()=>{U&&B?.()},[U,B]);const R=W.arrow?.x,N=W.arrow?.y,J=W.arrow?.centerOffset!==0,[Q,pe]=_.useState();return qe(()=>{g&&pe(window.getComputedStyle(g).zIndex)},[g]),h.jsx("div",{ref:b.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:U?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(ZC,{scope:n,placedSide:q,onArrowChange:C,arrowX:R,arrowY:N,shouldHideArrow:J,children:h.jsx(ke.div,{"data-side":q,"data-align":A,...m,ref:k,style:{...m.style,animation:U?void 0:"none"}})})})});Pd.displayName=Ss;var Rd="PopperArrow",WC={top:"bottom",right:"left",bottom:"top",left:"right"},Dd=_.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=VC(Rd,r),s=WC[i.placedSide];return h.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:h.jsx(BC,{...o,ref:n,style:{...o.style,display:"block"}})})});Dd.displayName=Rd;function HC(e){return e!==null}var qC=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=Md(n),f={start:"0%",center:"50%",end:"100%"}[u],p=(o.arrow?.x??0)+a/2,d=(o.arrow?.y??0)+l/2;let x="",m="";return c==="bottom"?(x=s?f:`${p}px`,m=`${-l}px`):c==="top"?(x=s?f:`${p}px`,m=`${r.floating.height+l}px`):c==="right"?(x=`${-l}px`,m=s?f:`${d}px`):c==="left"&&(x=`${r.floating.width+l}px`,m=s?f:`${d}px`),{data:{x,y:m}}}});function Md(e){const[t,n="center"]=e.split("-");return[t,n]}var Ld=jd,Fd=Od,$d=Pd,Bd=Dd,oi="rovingFocusGroup.onEntryFocus",KC={bubbles:!1,cancelable:!0},mr="RovingFocusGroup",[Ti,Ud,GC]=Lu(mr),[JC,Zd]=Ft(mr,[GC]),[YC,XC]=JC(mr),Vd=_.forwardRef((e,t)=>h.jsx(Ti.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Ti.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(QC,{...e,ref:t})})}));Vd.displayName=mr;var QC=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,p=_.useRef(null),d=Oe(t,p),x=ho(i),[m,y]=nn({prop:s,defaultProp:a??null,onChange:l,caller:mr}),[g,v]=_.useState(!1),k=Qe(c),S=Ud(n),C=_.useRef(!1),[E,I]=_.useState(0);return _.useEffect(()=>{const z=p.current;if(z)return z.addEventListener(oi,k),()=>z.removeEventListener(oi,k)},[k]),h.jsx(YC,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:_.useCallback(z=>y(z),[y]),onItemShiftTab:_.useCallback(()=>v(!0),[]),onFocusableItemAdd:_.useCallback(()=>I(z=>z+1),[]),onFocusableItemRemove:_.useCallback(()=>I(z=>z-1),[]),children:h.jsx(ke.div,{tabIndex:g||E===0?-1:0,"data-orientation":r,...f,ref:d,style:{outline:"none",...e.style},onMouseDown:be(e.onMouseDown,()=>{C.current=!0}),onFocus:be(e.onFocus,z=>{const P=!C.current;if(z.target===z.currentTarget&&P&&!g){const L=new CustomEvent(oi,KC);if(z.currentTarget.dispatchEvent(L),!L.defaultPrevented){const V=S().filter(K=>K.focusable),T=V.find(K=>K.active),M=V.find(K=>K.id===m),D=[T,M,...V].filter(Boolean).map(K=>K.ref.current);qd(D,u)}}C.current=!1}),onBlur:be(e.onBlur,()=>v(!1))})})}),Wd="RovingFocusGroupItem",Hd=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=Tt(),c=i||l,u=XC(Wd,n),f=u.currentTabStopId===c,p=Ud(n),{onFocusableItemAdd:d,onFocusableItemRemove:x,currentTabStopId:m}=u;return _.useEffect(()=>{if(r)return d(),()=>x()},[r,d,x]),h.jsx(Ti.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:h.jsx(ke.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:be(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:be(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:be(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=nE(y,u.orientation,u.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")k.reverse();else if(g==="prev"||g==="next"){g==="prev"&&k.reverse();const S=k.indexOf(y.currentTarget);k=u.loop?rE(k,S+1):k.slice(S+1)}setTimeout(()=>qd(k))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:m!=null}):s})})});Hd.displayName=Wd;var eE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nE(e,t,n){const r=tE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return eE[r]}function qd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var oE=Vd,iE=Hd;function Ni(e,[t,n]){return Math.min(n,Math.max(t,e))}function sE(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var Cs="ScrollArea",[Kd]=Ft(Cs),[aE,mt]=Kd(Cs),Gd=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=_.useState(null),[c,u]=_.useState(null),[f,p]=_.useState(null),[d,x]=_.useState(null),[m,y]=_.useState(null),[g,v]=_.useState(0),[k,S]=_.useState(0),[C,E]=_.useState(!1),[I,z]=_.useState(!1),P=Oe(t,V=>l(V)),L=ho(o);return h.jsx(aE,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:f,onContentChange:p,scrollbarX:d,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:E,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:I,onScrollbarYEnabledChange:z,onCornerWidthChange:v,onCornerHeightChange:S,children:h.jsx(ke.div,{dir:L,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});Gd.displayName=Cs;var Jd="ScrollAreaViewport",Yd=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=mt(Jd,n),a=_.useRef(null),l=Oe(t,a,s.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("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}"},nonce:o}),h.jsx(ke.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Yd.displayName=Jd;var Ot="ScrollAreaScrollbar",Xd=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=mt(Ot,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return _.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?h.jsx(lE,{...r,ref:t,forceMount:n}):o.type==="scroll"?h.jsx(cE,{...r,ref:t,forceMount:n}):o.type==="auto"?h.jsx(Qd,{...r,ref:t,forceMount:n}):o.type==="always"?h.jsx(Es,{...r,ref:t}):null});Xd.displayName=Ot;var lE=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=mt(Ot,e.__scopeScrollArea),[i,s]=_.useState(!1);return _.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),h.jsx(pt,{present:n||i,children:h.jsx(Qd,{"data-state":i?"visible":"hidden",...r,ref:t})})}),cE=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=mt(Ot,e.__scopeScrollArea),i=e.orientation==="horizontal",s=So(()=>l("SCROLL_END"),100),[a,l]=sE("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 _.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),_.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let f=c[u];const p=()=>{const d=c[u];f!==d&&(l("SCROLL"),s()),f=d};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),h.jsx(pt,{present:n||a!=="hidden",children:h.jsx(Es,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:be(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Qd=_.forwardRef((e,t)=>{const n=mt(Ot,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=_.useState(!1),a=e.orientation==="horizontal",l=So(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Pn(n.viewport,l),Pn(n.content,l),h.jsx(pt,{present:r||i,children:h.jsx(Es,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Es=_.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=mt(Ot,e.__scopeScrollArea),i=_.useRef(null),s=_.useRef(0),[a,l]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=of(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function f(p,d){return mE(p,s.current,a,d)}return n==="horizontal"?h.jsx(uE,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,d=zl(p,a,o.dir);i.current.style.transform=`translate3d(${d}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):n==="vertical"?h.jsx(dE,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,d=zl(p,a);i.current.style.transform=`translate3d(0, ${d}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),uE=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=mt(Ot,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=Oe(t,l,i.onScrollbarXChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(tf,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),af(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:eo(s.paddingLeft),paddingEnd:eo(s.paddingRight)}})}})}),dE=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=mt(Ot,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=Oe(t,l,i.onScrollbarYChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(tf,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),af(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:eo(s.paddingTop),paddingEnd:eo(s.paddingBottom)}})}})}),[fE,ef]=Kd(Ot),tf=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:f,...p}=e,d=mt(Ot,n),[x,m]=_.useState(null),y=Oe(t,P=>m(P)),g=_.useRef(null),v=_.useRef(""),k=d.viewport,S=r.content-r.viewport,C=Qe(u),E=Qe(l),I=So(f,10);function z(P){if(g.current){const L=P.clientX-g.current.left,V=P.clientY-g.current.top;c({x:L,y:V})}}return _.useEffect(()=>{const P=L=>{const V=L.target;x?.contains(V)&&C(L,S)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[k,x,S,C]),_.useEffect(E,[r,E]),Pn(x,I),Pn(d.content,I),h.jsx(fE,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Qe(i),onThumbPointerUp:Qe(s),onThumbPositionChange:E,onThumbPointerDown:Qe(a),children:h.jsx(ke.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:be(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),g.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",d.viewport&&(d.viewport.style.scrollBehavior="auto"),z(P))}),onPointerMove:be(e.onPointerMove,z),onPointerUp:be(e.onPointerUp,P=>{const L=P.target;L.hasPointerCapture(P.pointerId)&&L.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=v.current,d.viewport&&(d.viewport.style.scrollBehavior=""),g.current=null})})})}),Qr="ScrollAreaThumb",nf=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ef(Qr,e.__scopeScrollArea);return h.jsx(pt,{present:n||o.hasThumb,children:h.jsx(hE,{ref:t,...r})})}),hE=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=mt(Qr,n),s=ef(Qr,n),{onThumbPositionChange:a}=s,l=Oe(t,f=>s.onThumbChange(f)),c=_.useRef(void 0),u=So(()=>{c.current&&(c.current(),c.current=void 0)},100);return _.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(u(),!c.current){const d=gE(f,a);c.current=d,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,u,a]),h.jsx(ke.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:be(e.onPointerDownCapture,f=>{const d=f.target.getBoundingClientRect(),x=f.clientX-d.left,m=f.clientY-d.top;s.onThumbPointerDown({x,y:m})}),onPointerUp:be(e.onPointerUp,s.onThumbPointerUp)})});nf.displayName=Qr;var Ts="ScrollAreaCorner",rf=_.forwardRef((e,t)=>{const n=mt(Ts,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(pE,{...e,ref:t}):null});rf.displayName=Ts;var pE=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=mt(Ts,n),[i,s]=_.useState(0),[a,l]=_.useState(0),c=!!(i&&a);return Pn(o.scrollbarX,()=>{const u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),Pn(o.scrollbarY,()=>{const u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),s(u)}),c?h.jsx(ke.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function eo(e){return e?parseInt(e,10):0}function of(e,t){const n=e/t;return isNaN(n)?0:n}function ko(e){const t=of(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function mE(e,t,n,r="ltr"){const o=ko(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return sf([l,c],f)(e)}function zl(e,t,n="ltr"){const r=ko(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Ni(e,l);return sf([0,s],[0,a])(c)}function sf(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 af(e,t){return e>0&&e<t}var gE=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function So(e,t){const n=Qe(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Pn(e,t){const n=Qe(t);qe(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var xE=Gd,yE=Yd,vE=rf,bE=[" ","Enter","ArrowUp","ArrowDown"],wE=[" ","Enter"],sn="Select",[Co,Eo,_E]=Lu(sn),[Vn]=Ft(sn,[_E,_o]),To=_o(),[kE,Xt]=Vn(sn),[SE,CE]=Vn(sn),lf=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:d,form:x}=e,m=To(t),[y,g]=_.useState(null),[v,k]=_.useState(null),[S,C]=_.useState(!1),E=ho(c),[I,z]=nn({prop:r,defaultProp:o??!1,onChange:i,caller:sn}),[P,L]=nn({prop:s,defaultProp:a,onChange:l,caller:sn}),V=_.useRef(null),T=y?x||!!y.closest("form"):!0,[M,b]=_.useState(new Set),D=Array.from(M).map(K=>K.props.value).join(";");return h.jsx(Ld,{...m,children:h.jsxs(kE,{required:d,scope:t,trigger:y,onTriggerChange:g,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Tt(),value:P,onValueChange:L,open:I,onOpenChange:z,dir:E,triggerPointerDownPosRef:V,disabled:p,children:[h.jsx(Co.Provider,{scope:t,children:h.jsx(SE,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(K=>{b(U=>new Set(U).add(K))},[]),onNativeOptionRemove:_.useCallback(K=>{b(U=>{const W=new Set(U);return W.delete(K),W})},[]),children:n})}),T?h.jsxs(zf,{"aria-hidden":!0,required:d,tabIndex:-1,name:u,autoComplete:f,value:P,onChange:K=>L(K.target.value),disabled:p,form:x,children:[P===void 0?h.jsx("option",{value:""}):null,Array.from(M)]},D):null]})})};lf.displayName=sn;var cf="SelectTrigger",uf=_.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=To(n),s=Xt(cf,n),a=s.disabled||r,l=Oe(t,s.onTriggerChange),c=Eo(n),u=_.useRef("touch"),[f,p,d]=If(m=>{const y=c().filter(k=>!k.disabled),g=y.find(k=>k.value===s.value),v=Of(y,m,g);v!==void 0&&s.onValueChange(v.value)}),x=m=>{a||(s.onOpenChange(!0),d()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return h.jsx(Fd,{asChild:!0,...i,children:h.jsx(ke.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":jf(s.value)?"":void 0,...o,ref:l,onClick:be(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&x(m)}),onPointerDown:be(o.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:be(o.onKeyDown,m=>{const y=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(y&&m.key===" ")&&bE.includes(m.key)&&(x(),m.preventDefault())})})})});uf.displayName=cf;var df="SelectValue",ff=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Xt(df,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=Oe(t,l.onValueNodeChange);return qe(()=>{c(u)},[c,u]),h.jsx(ke.span,{...a,ref:f,style:{pointerEvents:"none"},children:jf(l.value)?h.jsx(h.Fragment,{children:s}):i})});ff.displayName=df;var EE="SelectIcon",hf=_.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return h.jsx(ke.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});hf.displayName=EE;var TE="SelectPortal",pf=e=>h.jsx(mo,{asChild:!0,...e});pf.displayName=TE;var an="SelectContent",mf=_.forwardRef((e,t)=>{const n=Xt(an,e.__scopeSelect),[r,o]=_.useState();if(qe(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?cr.createPortal(h.jsx(gf,{scope:e.__scopeSelect,children:h.jsx(Co.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),i):null}return h.jsx(xf,{...e,ref:t})});mf.displayName=an;var xt=10,[gf,Qt]=Vn(an),NE="SelectContentImpl",AE=In("SelectContent.RemoveScroll"),xf=_.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:d,sticky:x,hideWhenDetached:m,avoidCollisions:y,...g}=e,v=Xt(an,n),[k,S]=_.useState(null),[C,E]=_.useState(null),I=Oe(t,X=>S(X)),[z,P]=_.useState(null),[L,V]=_.useState(null),T=Eo(n),[M,b]=_.useState(!1),D=_.useRef(!1);_.useEffect(()=>{if(k)return td(k)},[k]),Hu();const K=_.useCallback(X=>{const[ae,...de]=T().map(Ee=>Ee.ref.current),[me]=de.slice(-1),xe=document.activeElement;for(const Ee of X)if(Ee===xe||(Ee?.scrollIntoView({block:"nearest"}),Ee===ae&&C&&(C.scrollTop=0),Ee===me&&C&&(C.scrollTop=C.scrollHeight),Ee?.focus(),document.activeElement!==xe))return},[T,C]),U=_.useCallback(()=>K([z,k]),[K,z,k]);_.useEffect(()=>{M&&U()},[M,U]);const{onOpenChange:W,triggerPointerDownPosRef:q}=v;_.useEffect(()=>{if(k){let X={x:0,y:0};const ae=me=>{X={x:Math.abs(Math.round(me.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(me.pageY)-(q.current?.y??0))}},de=me=>{X.x<=10&&X.y<=10?me.preventDefault():k.contains(me.target)||W(!1),document.removeEventListener("pointermove",ae),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",de,{capture:!0})}}},[k,W,q]),_.useEffect(()=>{const X=()=>W(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[W]);const[A,B]=If(X=>{const ae=T().filter(xe=>!xe.disabled),de=ae.find(xe=>xe.ref.current===document.activeElement),me=Of(ae,X,de);me&&setTimeout(()=>me.ref.current.focus())}),R=_.useCallback((X,ae,de)=>{const me=!D.current&&!de;(v.value!==void 0&&v.value===ae||me)&&(P(X),me&&(D.current=!0))},[v.value]),N=_.useCallback(()=>k?.focus(),[k]),J=_.useCallback((X,ae,de)=>{const me=!D.current&&!de;(v.value!==void 0&&v.value===ae||me)&&V(X)},[v.value]),Q=r==="popper"?Ai:yf,pe=Q===Ai?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:d,sticky:x,hideWhenDetached:m,avoidCollisions:y}:{};return h.jsx(gf,{scope:n,content:k,viewport:C,onViewportChange:E,itemRefCallback:R,selectedItem:z,onItemLeave:N,itemTextRefCallback:J,focusSelectedItem:U,selectedItemText:L,position:r,isPositioned:M,searchRef:A,children:h.jsx(hs,{as:AE,allowPinchZoom:!0,children:h.jsx(fs,{asChild:!0,trapped:v.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:be(o,X=>{v.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:h.jsx(po,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:h.jsx(Q,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:X=>X.preventDefault(),...g,...pe,onPlaced:()=>b(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:be(g.onKeyDown,X=>{const ae=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ae&&X.key.length===1&&B(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let me=T().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const xe=X.target,Ee=me.indexOf(xe);me=me.slice(Ee+1)}setTimeout(()=>K(me)),X.preventDefault()}})})})})})})});xf.displayName=NE;var zE="SelectItemAlignedPosition",yf=_.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Xt(an,n),s=Qt(an,n),[a,l]=_.useState(null),[c,u]=_.useState(null),f=Oe(t,I=>u(I)),p=Eo(n),d=_.useRef(!1),x=_.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=s,k=_.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&y&&g){const I=i.trigger.getBoundingClientRect(),z=c.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),L=g.getBoundingClientRect();if(i.dir!=="rtl"){const xe=L.left-z.left,Ee=P.left-xe,Pe=I.left-Ee,w=I.width+Pe,Y=Math.max(w,z.width),H=window.innerWidth-xt,O=Ni(Ee,[xt,Math.max(xt,H-Y)]);a.style.minWidth=w+"px",a.style.left=O+"px"}else{const xe=z.right-L.right,Ee=window.innerWidth-P.right-xe,Pe=window.innerWidth-I.right-Ee,w=I.width+Pe,Y=Math.max(w,z.width),H=window.innerWidth-xt,O=Ni(Ee,[xt,Math.max(xt,H-Y)]);a.style.minWidth=w+"px",a.style.right=O+"px"}const V=p(),T=window.innerHeight-xt*2,M=m.scrollHeight,b=window.getComputedStyle(c),D=parseInt(b.borderTopWidth,10),K=parseInt(b.paddingTop,10),U=parseInt(b.borderBottomWidth,10),W=parseInt(b.paddingBottom,10),q=D+K+M+W+U,A=Math.min(y.offsetHeight*5,q),B=window.getComputedStyle(m),R=parseInt(B.paddingTop,10),N=parseInt(B.paddingBottom,10),J=I.top+I.height/2-xt,Q=T-J,pe=y.offsetHeight/2,X=y.offsetTop+pe,ae=D+K+X,de=q-ae;if(ae<=J){const xe=V.length>0&&y===V[V.length-1].ref.current;a.style.bottom="0px";const Ee=c.clientHeight-m.offsetTop-m.offsetHeight,Pe=Math.max(Q,pe+(xe?N:0)+Ee+U),w=ae+Pe;a.style.height=w+"px"}else{const xe=V.length>0&&y===V[0].ref.current;a.style.top="0px";const Pe=Math.max(J,D+m.offsetTop+(xe?R:0)+pe)+de;a.style.height=Pe+"px",m.scrollTop=ae-J+m.offsetTop}a.style.margin=`${xt}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=T+"px",r?.(),requestAnimationFrame(()=>d.current=!0)}},[p,i.trigger,i.valueNode,a,c,m,y,g,i.dir,r]);qe(()=>k(),[k]);const[S,C]=_.useState();qe(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const E=_.useCallback(I=>{I&&x.current===!0&&(k(),v?.(),x.current=!1)},[k,v]);return h.jsx(IE,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:d,onScrollButtonChange:E,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:h.jsx(ke.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});yf.displayName=zE;var jE="SelectPopperPosition",Ai=_.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=xt,...i}=e,s=To(n);return h.jsx($d,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ai.displayName=jE;var[IE,Ns]=Vn(an,{}),zi="SelectViewport",vf=_.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Qt(zi,n),s=Ns(zi,n),a=Oe(t,i.onViewportChange),l=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Co.Slot,{scope:n,children:h.jsx(ke.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=s;if(p?.current&&f){const d=Math.abs(l.current-u.scrollTop);if(d>0){const x=window.innerHeight-xt*2,m=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),g=Math.max(m,y);if(g<x){const v=g+d,k=Math.min(x,v),S=v-k;f.style.height=k+"px",f.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});vf.displayName=zi;var bf="SelectGroup",[OE,PE]=Vn(bf),RE=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tt();return h.jsx(OE,{scope:n,id:o,children:h.jsx(ke.div,{role:"group","aria-labelledby":o,...r,ref:t})})});RE.displayName=bf;var wf="SelectLabel",DE=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=PE(wf,n);return h.jsx(ke.div,{id:o.id,...r,ref:t})});DE.displayName=wf;var to="SelectItem",[ME,_f]=Vn(to),kf=_.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Xt(to,n),l=Qt(to,n),c=a.value===r,[u,f]=_.useState(i??""),[p,d]=_.useState(!1),x=Oe(t,v=>l.itemRefCallback?.(v,r,o)),m=Tt(),y=_.useRef("touch"),g=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(ME,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:_.useCallback(v=>{f(k=>k||(v?.textContent??"").trim())},[]),children:h.jsx(Co.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:h.jsx(ke.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:x,onFocus:be(s.onFocus,()=>d(!0)),onBlur:be(s.onBlur,()=>d(!1)),onClick:be(s.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:be(s.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:be(s.onPointerDown,v=>{y.current=v.pointerType}),onPointerMove:be(s.onPointerMove,v=>{y.current=v.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:be(s.onKeyDown,v=>{l.searchRef?.current!==""&&v.key===" "||(wE.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});kf.displayName=to;var Qn="SelectItemText",Sf=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Xt(Qn,n),a=Qt(Qn,n),l=_f(Qn,n),c=CE(Qn,n),[u,f]=_.useState(null),p=Oe(t,g=>f(g),l.onItemTextChange,g=>a.itemTextRefCallback?.(g,l.value,l.disabled)),d=u?.textContent,x=_.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:d},l.value),[l.disabled,l.value,d]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return qe(()=>(m(x),()=>y(x)),[m,y,x]),h.jsxs(h.Fragment,{children:[h.jsx(ke.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?cr.createPortal(i.children,s.valueNode):null]})});Sf.displayName=Qn;var Cf="SelectItemIndicator",Ef=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return _f(Cf,n).isSelected?h.jsx(ke.span,{"aria-hidden":!0,...r,ref:t}):null});Ef.displayName=Cf;var ji="SelectScrollUpButton",Tf=_.forwardRef((e,t)=>{const n=Qt(ji,e.__scopeSelect),r=Ns(ji,e.__scopeSelect),[o,i]=_.useState(!1),s=Oe(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?h.jsx(Af,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Tf.displayName=ji;var Ii="SelectScrollDownButton",Nf=_.forwardRef((e,t)=>{const n=Qt(Ii,e.__scopeSelect),r=Ns(Ii,e.__scopeSelect),[o,i]=_.useState(!1),s=Oe(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?h.jsx(Af,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Nf.displayName=Ii;var Af=_.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Qt("SelectScrollButton",n),s=_.useRef(null),a=Eo(n),l=_.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),qe(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),h.jsx(ke.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:be(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:be(o.onPointerLeave,()=>{l()})})}),LE="SelectSeparator",FE=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(ke.div,{"aria-hidden":!0,...r,ref:t})});FE.displayName=LE;var Oi="SelectArrow",$E=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=To(n),i=Xt(Oi,n),s=Qt(Oi,n);return i.open&&s.position==="popper"?h.jsx(Bd,{...o,...r,ref:t}):null});$E.displayName=Oi;var BE="SelectBubbleInput",zf=_.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=_.useRef(null),i=Oe(r,o),s=TS(t);return _.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),h.jsx(ke.select,{...n,style:{...Du,...n.style},ref:i,defaultValue:t})});zf.displayName=BE;function jf(e){return e===""||e===void 0}function If(e){const t=Qe(e),n=_.useRef(""),r=_.useRef(0),o=_.useCallback(s=>{const a=n.current+s;t(a),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Of(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=UE(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function UE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ZE=lf,VE=uf,WE=ff,HE=hf,qE=pf,KE=mf,GE=vf,JE=kf,YE=Sf,XE=Ef,QE=Tf,e3=Nf,t3="Separator",jl="horizontal",n3=["horizontal","vertical"],Pf=_.forwardRef((e,t)=>{const{decorative:n,orientation:r=jl,...o}=e,i=r3(r)?r:jl,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return h.jsx(ke.div,{"data-orientation":i,...a,...o,ref:t})});Pf.displayName=t3;function r3(e){return n3.includes(e)}var o3=Pf,No="Tabs",[i3]=Ft(No,[Zd]),Rf=Zd(),[s3,As]=i3(No),Df=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ho(a),[f,p]=nn({prop:r,onChange:o,defaultProp:i??"",caller:No});return h.jsx(s3,{scope:n,baseId:Tt(),value:f,onValueChange:p,orientation:s,dir:u,activationMode:l,children:h.jsx(ke.div,{dir:u,"data-orientation":s,...c,ref:t})})});Df.displayName=No;var Mf="TabsList",Lf=_.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=As(Mf,n),s=Rf(n);return h.jsx(oE,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:h.jsx(ke.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Lf.displayName=Mf;var Ff="TabsTrigger",$f=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=As(Ff,n),a=Rf(n),l=Zf(s.baseId,r),c=Vf(s.baseId,r),u=r===s.value;return h.jsx(iE,{asChild:!0,...a,focusable:!o,active:u,children:h.jsx(ke.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:be(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:be(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:be(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})})});$f.displayName=Ff;var Bf="TabsContent",Uf=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=As(Bf,n),l=Zf(a.baseId,r),c=Vf(a.baseId,r),u=r===a.value,f=_.useRef(u);return _.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),h.jsx(pt,{present:o||u,children:({present:p})=>h.jsx(ke.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&i})})});Uf.displayName=Bf;function Zf(e,t){return`${e}-trigger-${t}`}function Vf(e,t){return`${e}-content-${t}`}var a3=Df,l3=Lf,c3=$f,u3=Uf,[Ao]=Ft("Tooltip",[_o]),zo=_o(),Wf="TooltipProvider",d3=700,Pi="tooltip.open",[f3,zs]=Ao(Wf),Hf=e=>{const{__scopeTooltip:t,delayDuration:n=d3,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=_.useRef(!0),a=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(f3,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:_.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Hf.displayName=Wf;var ar="Tooltip",[h3,gr]=Ao(ar),qf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=zs(ar,e.__scopeTooltip),c=zo(t),[u,f]=_.useState(null),p=Tt(),d=_.useRef(0),x=s??l.disableHoverableContent,m=a??l.delayDuration,y=_.useRef(!1),[g,v]=nn({prop:r,defaultProp:o??!1,onChange:I=>{I?(l.onOpen(),document.dispatchEvent(new CustomEvent(Pi))):l.onClose(),i?.(I)},caller:ar}),k=_.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),S=_.useCallback(()=>{window.clearTimeout(d.current),d.current=0,y.current=!1,v(!0)},[v]),C=_.useCallback(()=>{window.clearTimeout(d.current),d.current=0,v(!1)},[v]),E=_.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{y.current=!0,v(!0),d.current=0},m)},[m,v]);return _.useEffect(()=>()=>{d.current&&(window.clearTimeout(d.current),d.current=0)},[]),h.jsx(Ld,{...c,children:h.jsx(h3,{scope:t,contentId:p,open:g,stateAttribute:k,trigger:u,onTriggerChange:f,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:_.useCallback(()=>{x?C():(window.clearTimeout(d.current),d.current=0)},[C,x]),onOpen:S,onClose:C,disableHoverableContent:x,children:n})})};qf.displayName=ar;var Ri="TooltipTrigger",Kf=_.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gr(Ri,n),i=zs(Ri,n),s=zo(n),a=_.useRef(null),l=Oe(t,a,o.onTriggerChange),c=_.useRef(!1),u=_.useRef(!1),f=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),h.jsx(Fd,{asChild:!0,...s,children:h.jsx(ke.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:be(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:be(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:be(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:be(e.onBlur,o.onClose),onClick:be(e.onClick,o.onClose)})})});Kf.displayName=Ri;var js="TooltipPortal",[p3,m3]=Ao(js,{forceMount:void 0}),Gf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=gr(js,t);return h.jsx(p3,{scope:t,forceMount:n,children:h.jsx(pt,{present:n||i.open,children:h.jsx(mo,{asChild:!0,container:o,children:r})})})};Gf.displayName=js;var Rn="TooltipContent",Jf=_.forwardRef((e,t)=>{const n=m3(Rn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=gr(Rn,e.__scopeTooltip);return h.jsx(pt,{present:r||s.open,children:s.disableHoverableContent?h.jsx(Yf,{side:o,...i,ref:t}):h.jsx(g3,{side:o,...i,ref:t})})}),g3=_.forwardRef((e,t)=>{const n=gr(Rn,e.__scopeTooltip),r=zs(Rn,e.__scopeTooltip),o=_.useRef(null),i=Oe(t,o),[s,a]=_.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,p=_.useCallback(()=>{a(null),f(!1)},[f]),d=_.useCallback((x,m)=>{const y=x.currentTarget,g={x:x.clientX,y:x.clientY},v=b3(g,y.getBoundingClientRect()),k=w3(g,v),S=_3(m.getBoundingClientRect()),C=S3([...k,...S]);a(C),f(!0)},[f]);return _.useEffect(()=>()=>p(),[p]),_.useEffect(()=>{if(l&&u){const x=y=>d(y,u),m=y=>d(y,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",m)}}},[l,u,d,p]),_.useEffect(()=>{if(s){const x=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},v=l?.contains(y)||u?.contains(y),k=!k3(g,s);v?p():k&&(p(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,s,c,p]),h.jsx(Yf,{...e,ref:i})}),[x3,y3]=Ao(ar,{isInside:!1}),v3=$_("TooltipContent"),Yf=_.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=gr(Rn,n),c=zo(n),{onClose:u}=l;return _.useEffect(()=>(document.addEventListener(Pi,u),()=>document.removeEventListener(Pi,u)),[u]),_.useEffect(()=>{if(l.trigger){const f=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),h.jsx(po,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:h.jsxs($d,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(v3,{children:r}),h.jsx(x3,{scope:n,isInside:!0,children:h.jsx(q_,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Jf.displayName=Rn;var Xf="TooltipArrow",Qf=_.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zo(n);return y3(Xf,n).isInside?null:h.jsx(Bd,{...o,...r,ref:t})});Qf.displayName=Xf;function b3(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function w3(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function _3(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function k3(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,u=a.y,f=l.x,p=l.y;u>r!=p>r&&n<(f-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function S3(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),C3(t)}function C3(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var E3=Hf,T3=qf,N3=Kf,A3=Gf,z3=Jf,j3=Qf;function Il({delayDuration:e=0,...t}){return h.jsx(E3,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function I3({...e}){return h.jsx(T3,{"data-slot":"tooltip",...e})}function O3({...e}){return h.jsx(N3,{"data-slot":"tooltip-trigger",...e})}function P3({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(A3,{children:h.jsxs(z3,{"data-slot":"tooltip-content",sideOffset:t,className:ze("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,h.jsx(j3,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function eh(e){if(e===null)return"null";if(Array.isArray(e))return"array";switch(typeof e){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"object";case"bigint":case"symbol":case"undefined":case"function":return"object"}}function no(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function R3(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function Is(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=R3(e,t);return[t,lr(n)]}):[]}function Ol(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const Pl=120;function D3({text:e}){const[t,n]=_.useState(!1);return e.length>Pl?h.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?h.jsx("span",{className:"cursor-pointer prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",onClick:o=>{o.stopPropagation(),n(!1)},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),n(!1))},role:"button",tabIndex:0,children:h.jsx(jn,{children:e})}):h.jsxs(I3,{delayDuration:300,children:[h.jsxs(O3,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[h.jsx("span",{children:e.slice(0,Pl)}),h.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),h.jsxs(P3,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):h.jsxs("span",{className:"text-emerald-400 break-all",children:['"',h.jsx("span",{className:"prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",children:h.jsx(jn,{children:e})}),'"']})}function th({value:e}){if(e===null)return h.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return h.jsx(D3,{text:e});case"number":return h.jsx("span",{className:"text-amber-400",children:e});case"boolean":return h.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return h.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function Rl({value:e}){const[t,n]=_.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return h.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Copy JSON",children:t?h.jsx(ur,{className:"size-3 text-green-500"}):h.jsx(ao,{className:"size-3"})})}function M3({value:e}){const[t,n]=_.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return h.jsx("button",{type:"button",onClick:r,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:"Copy to clipboard",children:t?h.jsx(ur,{className:"size-3 text-green-500"}):h.jsx(ao,{className:"size-3 text-muted-foreground"})})}function L3(e){return no(e)?Is(e).some(([,t])=>no(t)):!1}function F3({allExpanded:e,onClick:t}){return h.jsx("button",{type:"button",onClick:t,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:e?"Collapse all":"Expand all",children:e?h.jsx(fy,{className:"size-3.5 text-muted-foreground"}):h.jsx(uy,{className:"size-3.5 text-muted-foreground"})})}function nh({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=_.useState(n<r),[a,l]=_.useState(0),[c,u]=_.useState(null),[f,p]=_.useState(!1),d=no(t),x=eh(t),m=x==="array"?"[":"{",y=x==="array"?"]":"}";function g(k){k.stopPropagation(),f?(s(!1),u(0),l(S=>S+1),p(!1)):(s(!0),u(Number.POSITIVE_INFINITY),l(S=>S+1),p(!0))}const v=c??r;return h.jsxs("div",{className:ze(n>0&&"border-l border-border/50 ml-2"),children:[h.jsxs("div",{className:ze("flex items-start gap-1 py-0.5 px-1 -ml-1 rounded-sm group/row",d&&"cursor-pointer hover:bg-muted/50"),onClick:d?()=>{i&&p(!1),s(!i)}:void 0,onKeyDown:d?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),s(!i))}:void 0,role:d?"button":void 0,tabIndex:d?0:void 0,children:[d?h.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:i?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"})}):h.jsx("span",{className:"w-4 shrink-0"}),h.jsx("span",{className:ze("shrink-0",o?"text-muted-foreground":"text-cyan-400"),children:o?e:`"${e}"`}),h.jsx("span",{className:"text-muted-foreground shrink-0",children:d?"":":"}),d?h.jsxs("span",{className:"text-muted-foreground",children:[m,h.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",Ol(t)," ",Ol(t)===1?"item":"items"," ",y]})]}):h.jsx("span",{className:"min-w-0",children:h.jsx(th,{value:t})}),d&&L3(t)&&h.jsx(F3,{allExpanded:f,onClick:g}),h.jsx(M3,{value:t})]}),d&&i&&h.jsxs("div",{className:"pl-4",children:[Is(t).map(([k,S])=>h.jsx(nh,{name:k,value:S,level:n+1,defaultExpandDepth:v,isArrayItem:x==="array"},k)),h.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:y})]},a)]})}function Os({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!no(e))return h.jsx(Il,{children:h.jsx("div",{className:ze("font-mono text-xs leading-relaxed",n),children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(th,{value:e}),r&&h.jsx(Rl,{value:e})]})})});const s=eh(e)==="array";return h.jsx(Il,{children:h.jsxs("div",{className:ze("font-mono text-xs leading-relaxed",n),children:[r&&h.jsx(Rl,{value:e}),Is(e).map(([a,l])=>h.jsx(nh,{name:a,value:l,level:0,defaultExpandDepth:t,isArrayItem:s},a))]})})}function Dl({text:e,defaultExpandDepth:t=2,className:n}){try{const r=JSON.parse(e);return h.jsx(Os,{data:lr(r),defaultExpandDepth:t,className:n})}catch{return h.jsx("pre",{className:ze("font-mono text-xs whitespace-pre-wrap break-words",n),children:e})}}function lr(e){if(e==null)return null;switch(typeof e){case"string":return e;case"number":return e;case"boolean":return e;case"object":{if(Array.isArray(e))return e.map(n=>lr(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=lr(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function wn({className:e,orientation:t="horizontal",...n}){return h.jsx(a3,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ze("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const $3=Ki("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function _n({className:e,variant:t="default",...n}){return h.jsx(l3,{"data-slot":"tabs-list","data-variant":t,className:ze($3({variant:t}),e),...n})}function Ye({className:e,...t}){return h.jsx(c3,{"data-slot":"tabs-trigger",className:ze("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Xe({className:e,...t}){return h.jsx(u3,{"data-slot":"tabs-content",className:ze("flex-1 outline-none",e),...t})}const B3=Ki("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function dt({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?L_:"span";return h.jsx(o,{"data-slot":"badge","data-variant":t,className:ze(B3({variant:t}),e),...r})}const U3="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='0%206.603%201192.672%201193.397'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m233.96%20800.215%20234.684-131.678%203.947-11.436-3.947-6.363h-11.436l-39.221-2.416-134.094-3.624-116.296-4.832-112.67-6.04-28.35-6.04-26.577-35.035%202.738-17.477%2023.84-16.027%2034.147%202.98%2075.463%205.155%20113.235%207.812%2082.147%204.832%20121.692%2012.644h19.329l2.738-7.812-6.604-4.832-5.154-4.832-117.182-79.41-126.845-83.92-66.443-48.321-35.92-24.484-18.12-22.953-7.813-50.093%2032.618-35.92%2043.812%202.98%2011.195%202.98%2044.375%2034.147%2094.792%2073.37%20123.786%2091.167%2018.12%2015.06%207.249-5.154.886-3.624-8.135-13.61-67.329-121.692-71.838-123.785-31.974-51.302-8.456-30.765c-2.98-12.645-5.154-23.275-5.154-36.242l37.127-50.416%2020.537-6.604%2049.53%206.604%2020.86%2018.121%2030.765%2070.39%2049.852%20110.818%2077.315%20150.684%2022.631%2044.698%2012.08%2041.396%204.51%2012.645h7.813v-7.248l6.362-84.886%2011.759-104.215%2011.436-134.094%203.946-37.772%2018.685-45.262%2037.127-24.482%2028.994%2013.852%2023.839%2034.148-3.303%2022.067-14.174%2092.134-27.785%20144.323-18.121%2096.644h10.55l12.08-12.08%2048.887-64.913%2082.147-102.685%2036.242-40.752%2042.282-45.02%2027.14-21.423h51.303l37.772%2056.135-16.913%2057.986-52.832%2067.007-43.812%2056.779-62.82%2084.563-39.22%2067.651%203.623%205.396%209.343-.886%20141.906-30.201%2076.671-13.852%2091.49-15.705%2041.396%2019.329%204.51%2019.65-16.269%2040.189-97.852%2024.16-114.764%2022.954-170.9%2040.43-2.093%201.53%202.416%202.98%2076.993%207.248%2032.94%201.771h80.617l150.12%2011.195%2039.222%2025.933%2023.517%2031.732-3.946%2024.16-60.403%2030.766-81.503-19.33-190.228-45.26-65.235-16.27h-9.02v5.397l54.362%2053.154%2099.624%2089.96%20124.752%20115.973%206.362%2028.671-16.027%2022.63-16.912-2.415-109.611-82.47-42.282-37.127-95.758-80.618h-6.363v8.456l22.067%2032.296%20116.537%20175.167%206.04%2053.719-8.456%2017.476-30.201%2010.55-33.181-6.04-68.215-95.758-70.39-107.84-56.778-96.644-6.926%203.947-33.503%20360.886-15.705%2018.443-36.243%2013.852-30.201-22.953-16.027-37.127%2016.027-73.37%2019.329-95.758%2015.704-76.107%2014.175-94.55%208.456-31.41-.563-2.094-6.927.886-71.275%2097.852-108.402%20146.497-85.772%2091.812-20.537%208.134-35.597-18.443%203.301-32.94%2019.893-29.315%20118.712-151.007%2071.597-93.583%2046.228-54.04-.322-7.813h-2.738l-315.302%20204.725-56.135%207.248-24.16-22.63%202.98-37.128%2011.435-12.08%2094.792-65.236-.322.323z'%20fill='%23d97757'/%3e%3c/svg%3e",Z3="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='-1%20-.1%20949.1%20959.8'%20width='2474'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m925.8%20456.3c10.4%2023.2%2017%2048%2019.7%2073.3%202.6%2025.3%201.3%2050.9-4.1%2075.8-5.3%2024.9-14.5%2048.8-27.3%2070.8-8.4%2014.7-18.3%2028.5-29.7%2041.2-11.3%2012.6-23.9%2024-37.6%2034-13.8%2010-28.5%2018.4-44.1%2025.3-15.5%206.8-31.7%2012-48.3%2015.4-7.8%2024.2-19.4%2047.1-34.4%2067.7-14.9%2020.6-33%2038.7-53.6%2053.6-20.6%2015-43.4%2026.6-67.6%2034.4-24.2%207.9-49.5%2011.8-75%2011.8-16.9.1-33.9-1.7-50.5-5.1-16.5-3.5-32.7-8.8-48.2-15.7s-30.2-15.5-43.9-25.5c-13.6-10-26.2-21.5-37.4-34.2-25%205.4-50.6%206.7-75.9%204.1-25.3-2.7-50.1-9.3-73.4-19.7-23.2-10.3-44.7-24.3-63.6-41.4s-35-37.1-47.7-59.1c-8.5-14.7-15.5-30.2-20.8-46.3s-8.8-32.7-10.6-49.6c-1.8-16.8-1.7-33.8.1-50.7%201.8-16.8%205.5-33.4%2010.8-49.5-17-18.9-31-40.4-41.4-63.6-10.3-23.3-17-48-19.6-73.3-2.7-25.3-1.3-50.9%204-75.8s14.5-48.8%2027.3-70.8c8.4-14.7%2018.3-28.6%2029.6-41.2s24-24%2037.7-34%2028.5-18.5%2044-25.3c15.6-6.9%2031.8-12%2048.4-15.4%207.8-24.3%2019.4-47.1%2034.3-67.7%2015-20.6%2033.1-38.7%2053.7-53.7%2020.6-14.9%2043.4-26.5%2067.6-34.4%2024.2-7.8%2049.5-11.8%2075-11.7%2016.9-.1%2033.9%201.6%2050.5%205.1s32.8%208.7%2048.3%2015.6c15.5%207%2030.2%2015.5%2043.9%2025.5%2013.7%2010.1%2026.3%2021.5%2037.5%2034.2%2024.9-5.3%2050.5-6.6%2075.8-4s50%209.3%2073.3%2019.6c23.2%2010.4%2044.7%2024.3%2063.6%2041.4%2018.9%2017%2035%2036.9%2047.7%2059%208.5%2014.6%2015.5%2030.1%2020.8%2046.3%205.3%2016.1%208.9%2032.7%2010.6%2049.6%201.8%2016.9%201.8%2033.9-.1%2050.8-1.8%2016.9-5.5%2033.5-10.8%2049.6%2017.1%2018.9%2031%2040.3%2041.4%2063.6zm-333.2%20426.9c21.8-9%2041.6-22.3%2058.3-39s30-36.5%2039-58.4c9-21.8%2013.7-45.2%2013.7-68.8v-223q-.1-.3-.2-.7-.1-.3-.3-.6-.2-.3-.5-.5-.3-.3-.6-.4l-80.7-46.6v269.4c0%202.7-.4%205.5-1.1%208.1-.7%202.7-1.7%205.2-3.1%207.6s-3%204.6-5%206.5a32.1%2032.1%200%200%201%20-6.5%205l-191.1%20110.3c-1.6%201-4.3%202.4-5.7%203.2%207.9%206.7%2016.5%2012.6%2025.5%2017.8%209.1%205.2%2018.5%209.6%2028.3%2013.2%209.8%203.5%2019.9%206.2%2030.1%208%2010.3%201.8%2020.7%202.7%2031.1%202.7%2023.6%200%2047-4.7%2068.8-13.8zm-455.1-151.4c11.9%2020.5%2027.6%2038.3%2046.3%2052.7%2018.8%2014.4%2040.1%2024.9%2062.9%2031s46.6%207.7%2070%204.6%2045.9-10.7%2066.4-22.5l193.2-111.5.5-.5q.2-.2.3-.6.2-.3.3-.6v-94l-233.2%20134.9c-2.4%201.4-4.9%202.4-7.5%203.2-2.7.7-5.4%201-8.2%201-2.7%200-5.4-.3-8.1-1-2.6-.8-5.2-1.8-7.6-3.2l-191.1-110.4c-1.7-1-4.2-2.5-5.6-3.4-1.8%2010.3-2.7%2020.7-2.7%2031.1s1%2020.8%202.8%2031.1c1.8%2010.2%204.6%2020.3%208.1%2030.1%203.6%209.8%208%2019.2%2013.2%2028.2zm-50.2-417c-11.8%2020.5-19.4%2043.1-22.5%2066.5s-1.5%2047.1%204.6%2070c6.1%2022.8%2016.6%2044.1%2031%2062.9%2014.4%2018.7%2032.3%2034.4%2052.7%2046.2l193.1%20111.6q.3.1.7.2h.7q.4%200%20.7-.2.3-.1.6-.3l81-46.8-233.2-134.6c-2.3-1.4-4.5-3.1-6.5-5a32.1%2032.1%200%200%201%20-5-6.5c-1.3-2.4-2.4-4.9-3.1-7.6-.7-2.6-1.1-5.3-1-8.1v-227.1c-9.8%203.6-19.3%208-28.3%2013.2-9%205.3-17.5%2011.3-25.5%2018-7.9%206.7-15.3%2014.1-22%2022.1-6.7%207.9-12.6%2016.5-17.8%2025.5zm663.3%20154.4c2.4%201.4%204.6%203%206.6%205%201.9%201.9%203.6%204.1%205%206.5%201.3%202.4%202.4%205%203.1%207.6.6%202.7%201%205.4.9%208.2v227.1c32.1-11.8%2060.1-32.5%2080.8-59.7%2020.8-27.2%2033.3-59.7%2036.2-93.7s-3.9-68.2-19.7-98.5-39.9-55.5-69.5-72.5l-193.1-111.6q-.3-.1-.7-.2h-.7q-.3.1-.7.2-.3.1-.6.3l-80.6%2046.6%20233.2%20134.7zm80.5-121h-.1v.1zm-.1-.1c5.8-33.6%201.9-68.2-11.3-99.7-13.1-31.5-35-58.6-63-78.2-28-19.5-61-30.7-95.1-32.2-34.2-1.4-68%206.9-97.6%2023.9l-193.1%20111.5q-.3.2-.5.5l-.4.6q-.1.3-.2.7-.1.3-.1.7v93.2l233.2-134.7c2.4-1.4%205-2.4%207.6-3.2%202.7-.7%205.4-1%208.1-1%202.8%200%205.5.3%208.2%201%202.6.8%205.1%201.8%207.5%203.2l191.1%20110.4c1.7%201%204.2%202.4%205.6%203.3zm-505.3-103.2c0-2.7.4-5.4%201.1-8.1.7-2.6%201.7-5.2%203.1-7.6%201.4-2.3%203-4.5%205-6.5%201.9-1.9%204.1-3.6%206.5-4.9l191.1-110.3c1.8-1.1%204.3-2.5%205.7-3.2-26.2-21.9-58.2-35.9-92.1-40.2-33.9-4.4-68.3%201-99.2%2015.5-31%2014.5-57.2%2037.6-75.5%2066.4-18.3%2028.9-28%2062.3-28%2096.5v223q.1.4.2.7.1.3.3.6.2.3.5.6.2.2.6.4l80.7%2046.6zm43.8%20294.7%20103.9%2060%20103.9-60v-119.9l-103.8-60-103.9%2060z'/%3e%3c/svg%3e",V3="data:image/svg+xml,%3csvg%20fill='none'%20height='1320'%20viewBox='3.771%206.973%2023.993%2017.652'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m27.501%208.469c-.252-.123-.36.111-.508.23-.05.04-.093.09-.135.135-.368.395-.797.652-1.358.621-.821-.045-1.521.213-2.14.842-.132-.776-.57-1.238-1.235-1.535-.349-.155-.701-.309-.944-.645-.171-.238-.217-.504-.303-.765-.054-.159-.108-.32-.29-.348-.197-.031-.274.135-.352.273-.31.567-.43%201.192-.419%201.825.028%201.421.628%202.554%201.82%203.36.136.093.17.186.128.321-.081.278-.178.547-.264.824-.054.178-.135.217-.324.14a5.448%205.448%200%200%201%20-1.719-1.169c-.848-.82-1.614-1.726-2.57-2.435-.225-.166-.449-.32-.681-.467-.976-.95.128-1.729.383-1.82.267-.096.093-.428-.77-.424s-1.653.293-2.659.677a2.782%202.782%200%200%201%20-.46.135%209.554%209.554%200%200%200%20-2.853-.1c-1.866.21-3.356%201.092-4.452%202.6-1.315%201.81-1.625%203.87-1.246%206.018.399%202.261%201.552%204.136%203.326%205.601%201.837%201.518%203.955%202.262%206.37%202.12%201.466-.085%203.1-.282%204.942-1.842.465.23.952.322%201.762.392.623.059%201.223-.031%201.687-.127.728-.154.677-.828.414-.953-2.132-.994-1.665-.59-2.09-.916%201.084-1.285%202.717-2.619%203.356-6.94.05-.343.007-.558%200-.837-.004-.168.034-.235.228-.254a4.084%204.084%200%200%200%201.529-.47c1.382-.757%201.938-1.997%202.07-3.485.02-.227-.004-.463-.243-.582zm-12.041%2013.391c-2.067-1.627-3.07-2.162-3.483-2.138-.387.021-.318.465-.233.754.089.285.205.482.368.732.113.166.19.414-.112.598-.666.414-1.823-.139-1.878-.166-1.347-.793-2.473-1.842-3.267-3.276-.765-1.38-1.21-2.861-1.284-4.441-.02-.383.093-.518.472-.586a4.692%204.692%200%200%201%201.514-.04c2.109.31%203.905%201.255%205.41%202.749.86.853%201.51%201.871%202.18%202.865.711%201.057%201.478%202.063%202.454%202.887.343.289.619.51.881.672-.792.088-2.117.107-3.022-.61zm.99-6.38a.304.304%200%201%201%20.609%200c0%20.17-.136.304-.306.304a.3.3%200%200%201%20-.303-.305zm3.077%201.581c-.197.08-.394.15-.584.159a1.246%201.246%200%200%201%20-.79-.252c-.27-.227-.463-.354-.546-.752a1.752%201.752%200%200%201%20.016-.582c.07-.324-.008-.531-.235-.72-.187-.155-.422-.196-.682-.196a.551.551%200%200%201%20-.252-.078c-.108-.055-.197-.19-.112-.356.027-.053.159-.183.19-.207.352-.201.758-.135%201.134.016.349.142.611.404.99.773.388.448.457.573.678.906.174.264.333.534.441.842.066.192-.02.35-.248.448z'%20fill='%234d6bfe'/%3e%3c/svg%3e",W3="/assets/minimax-BPMzvuL-.jpeg",H3="/assets/alibaba-TTwafVwX.svg",q3="/assets/qwen-CONDcHqt.png",K3="/assets/zhipuai-BPNAnxo-.svg",G3={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function J3(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(G3))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const dn={width:24,height:24,objectFit:"contain"},Y3=tt.memo(({className:e})=>h.jsx("img",{src:U3,alt:"Anthropic",className:e,style:dn})),X3=tt.memo(({className:e})=>h.jsx("img",{src:Z3,alt:"OpenAI",className:e,style:{...dn,background:"white",borderRadius:"4px"}})),Q3=tt.memo(({className:e})=>h.jsx("img",{src:V3,alt:"DeepSeek",className:e,style:dn})),e5=tt.memo(({className:e})=>h.jsx("img",{src:W3,alt:"MiniMax",className:e,style:dn})),t5=tt.memo(({className:e})=>h.jsx("img",{src:H3,alt:"Alibaba",className:e,style:dn})),n5=tt.memo(({className:e})=>h.jsx("img",{src:q3,alt:"Qwen",className:e,style:dn})),r5=tt.memo(({className:e})=>h.jsx("img",{src:K3,alt:"ZhipuAI",className:e,style:dn}));function o5({provider:e,className:t}){switch(e){case"anthropic":return h.jsx(Y3,{className:t});case"openai":return h.jsx(X3,{className:t});case"deepseek":return h.jsx(Q3,{className:t});case"minimax":return h.jsx(e5,{className:t});case"alibaba":return h.jsx(t5,{className:t});case"qwen":return h.jsx(n5,{className:t});case"zhipuai":return h.jsx(r5,{className:t});case"unknown":return null}}const i5={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function s5(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const Ml={success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",client_error:"bg-amber-500/15 text-amber-400 border-amber-500/25",server_error:"",pending:"bg-muted text-muted-foreground border-border"},a5=_.memo(function({log:t,parsedRequest:n,expanded:r,onToggle:o}){const i=Xc(t.responseStatus),s=t.inputTokens!==null||t.outputTokens!==null,a=n!==null?n.messages.length:null,l=n!==null&&n.tools!==void 0&&n.tools.length>0?n.tools.length:null;return h.jsxs("div",{role:"button",tabIndex:0,className:ze("flex items-center gap-2.5 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none"),onClick:o,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())},children:[h.jsxs("span",{className:"text-blue-400/80 font-mono text-xs font-semibold tabular-nums shrink-0",children:["#",t.id]}),t.model!==null&&h.jsxs(h.Fragment,{children:[h.jsx(o5,{provider:J3(t.model),className:"size-4 shrink-0"}),h.jsx(dt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:t.model})]}),h.jsx(dt,{variant:"outline",className:ze("text-[10px] px-1.5 py-0 h-5 font-mono",t.apiFormat==="openai"&&"border-blue-500/40 text-blue-400",t.apiFormat==="anthropic"&&"border-orange-500/40 text-orange-400",t.apiFormat==="unknown"&&"border-muted text-muted-foreground"),children:i5[t.apiFormat]??t.apiFormat}),i==="server_error"?h.jsx(dt,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:t.responseStatus}):i==="pending"?h.jsx(dt,{variant:"outline",className:ze("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ml[i]),children:h.jsx(Pc,{className:"size-3 animate-spin"})}):h.jsx(dt,{variant:"outline",className:ze("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ml[i]),children:t.responseStatus}),t.elapsedMs!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(Hi,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums",children:s5(t.elapsedMs)})]}),s&&h.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[h.jsx(dr,{className:"size-3 text-muted-foreground"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[h.jsxs("span",{className:t.inputTokens!==null?"text-blue-400":"text-muted-foreground",children:["IN ",t.inputTokens!==null?Ke(t.inputTokens):"—"]})," / ",h.jsxs("span",{className:t.outputTokens!==null?"text-amber-400":"text-muted-foreground",children:["OUT ",t.outputTokens!==null?Ke(t.outputTokens):"—"]})]})]}),t.cacheCreationInputTokens!==null&&t.cacheCreationInputTokens>0&&h.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:h.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ke(t.cacheCreationInputTokens)]})}),t.cacheReadInputTokens!==null&&t.cacheReadInputTokens>0&&h.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:h.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ke(t.cacheReadInputTokens)]})}),a!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(Rc,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums",children:a})]}),l!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(gv,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums",children:l})]}),t.origin!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`Origin: ${t.origin}`,children:[h.jsx(Oy,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",title:t.origin,children:t.origin})]}),t.userAgent!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`User-Agent: ${t.userAgent}`,children:[h.jsx(uv,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums truncate max-w-[150px]",title:t.userAgent,children:t.userAgent})]}),(t.clientPid!==null||t.clientProjectFolder!==null)&&h.jsxs("span",{className:"flex items-center gap-1 text-purple-400/80 text-xs shrink-0",title:t.clientCwd!==null?`PID: ${t.clientPid??"?"} | CWD: ${t.clientCwd}`:`PID: ${t.clientPid??"?"}`,children:[h.jsx(Ay,{className:"size-3"}),t.clientProjectFolder!==null?h.jsx("span",{className:"font-mono tabular-nums",children:t.clientProjectFolder}):h.jsxs("span",{className:"font-mono tabular-nums",children:["PID ",t.clientPid]})]}),t.streaming&&h.jsx(Ky,{className:"size-3 text-muted-foreground/60 shrink-0"}),h.jsx("span",{className:"flex-1 min-w-0"}),r?h.jsx(At,{className:"size-4 text-muted-foreground shrink-0"}):h.jsx(Wt,{className:"size-4 text-muted-foreground shrink-0"})]})});function rh({...e}){return h.jsx(bS,{"data-slot":"dialog",...e})}function l5({...e}){return h.jsx(wS,{"data-slot":"dialog-trigger",...e})}function c5({...e}){return h.jsx(_S,{"data-slot":"dialog-portal",...e})}function u5({className:e,...t}){return h.jsx(kS,{"data-slot":"dialog-overlay",className:ze("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function oh({className:e,children:t,...n}){return h.jsxs(c5,{children:[h.jsx(u5,{}),h.jsxs(SS,{"data-slot":"dialog-content",className:ze("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,h.jsxs(ES,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(yv,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ih({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:ze("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function sh({className:e,...t}){return h.jsx(CS,{"data-slot":"dialog-title",className:ze("text-lg font-semibold leading-none tracking-tight",e),...t})}function ah({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return h.jsx(o3,{"data-slot":"separator",decorative:n,orientation:t,className:ze("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Ps({...e}){return h.jsx(ak,{"data-slot":"collapsible",...e})}function Rs({...e}){return h.jsx(Bu,{"data-slot":"collapsible-trigger",...e})}function Ds({...e}){return h.jsx(Uu,{"data-slot":"collapsible-content",...e})}function lh({className:e,children:t,...n}){return h.jsxs(xE,{"data-slot":"scroll-area",className:ze("relative",e),...n,children:[h.jsx(yE,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),h.jsx(d5,{}),h.jsx(vE,{})]})}function d5({className:e,orientation:t="vertical",...n}){return h.jsx(Xd,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ze("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:h.jsx(nf,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function f5(e){return h.jsx(h.Fragment,{})}function h5({text:e}){const[t,n]=_.useState(!1);return h.jsxs(Ps,{open:t,onOpenChange:n,children:[h.jsxs(Rs,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"}),h.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),h.jsx(Ds,{children:h.jsx("div",{className:"pl-4 pt-1",children:h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:h.jsx(jn,{children:e})})})})]})}function p5({text:e}){return e.includes("<system-reminder>")?h.jsx(h5,{text:e}):h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:h.jsx(jn,{children:e})})}function m5({thinking:e}){const[t,n]=_.useState(!1);return h.jsx(Ps,{open:t,onOpenChange:n,children:h.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[h.jsxs(Rs,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-purple-500/5 transition-colors rounded-r-sm group",children:[h.jsx(ry,{className:"size-3.5 text-purple-400 shrink-0"}),h.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),h.jsxs(dt,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[e.length.toLocaleString()," chars"]}),h.jsx("span",{className:"flex-1"}),t?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"})]}),h.jsx(Ds,{children:h.jsx("div",{className:"px-3 pb-2",children:h.jsx(lh,{className:"max-h-[60vh]",children:h.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function g5({name:e,input:t}){const[n,r]=_.useState(!1);return h.jsx(Ps,{open:n,onOpenChange:r,children:h.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[h.jsxs(Rs,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-blue-500/5 transition-colors rounded-r-sm group",children:[h.jsx(nv,{className:"size-3.5 text-blue-400 shrink-0"}),h.jsx(dt,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:e}),h.jsx("span",{className:"flex-1"}),n?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"})]}),h.jsx(Ds,{children:h.jsx("div",{className:"px-3 pb-2",children:h.jsx(lh,{className:"max-h-[60vh]",children:h.jsx(Os,{data:lr(t),defaultExpandDepth:2})})})})]})})}function x5({block:e}){switch(e.type){case"text":return h.jsx(p5,{text:e.text});case"thinking":return h.jsx(m5,{thinking:e.thinking});case"tool_use":return h.jsx(g5,{name:e.name,input:e.input});default:return f5()}}function y5({response:e}){return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(dt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&h.jsxs(dt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[h.jsx(Ic,{className:"size-2.5"}),e.stop_reason]}),h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[h.jsx(dr,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[Ke(e.usage.input_tokens)," in /"," ",Ke(e.usage.output_tokens)," out"]}),e.usage.cache_creation_input_tokens!==void 0&&e.usage.cache_creation_input_tokens>0&&h.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ke(e.usage.cache_creation_input_tokens)]}),e.usage.cache_read_input_tokens!==void 0&&e.usage.cache_read_input_tokens>0&&h.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ke(e.usage.cache_read_input_tokens)]})]})]}),h.jsx(ah,{className:"opacity-50"}),h.jsxs("div",{className:"space-y-2",children:[e.content.map((t,n)=>h.jsx(x5,{block:t},n)),e.content.length===0&&h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function v5({response:e}){const t=e.choices[0],n=t?.message;return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(dt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),t?.finish_reason!==null&&t?.finish_reason!==void 0&&h.jsxs(dt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[h.jsx(Ic,{className:"size-2.5"}),t.finish_reason]}),h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[h.jsx(dr,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[Ke(e.usage.prompt_tokens)," in /"," ",Ke(e.usage.completion_tokens)," out"]})]})]}),h.jsx(ah,{className:"opacity-50"}),h.jsxs("div",{className:"space-y-2",children:[n?.reasoning_content!==null&&n?.reasoning_content!==void 0&&n.reasoning_content.length>0&&h.jsxs("div",{className:"border border-purple-500/30 rounded-md p-3 bg-purple-500/5",children:[h.jsx("div",{className:"text-xs text-purple-400 font-mono mb-1",children:"thinking"}),h.jsx("div",{className:"text-sm text-purple-200 whitespace-pre-wrap",children:n.reasoning_content})]}),n?.content!==null&&n?.content!==void 0&&n.content.length>0&&h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:h.jsx(jn,{children:n.content})}),n?.function_call!==null&&n?.function_call!==void 0&&h.jsxs("div",{className:"border border-blue-500/30 rounded-md p-3 bg-blue-500/5",children:[h.jsx("div",{className:"text-xs text-blue-400 font-mono mb-1",children:"function_call"}),h.jsxs("div",{className:"font-mono text-xs",children:[h.jsx("span",{className:"text-blue-300",children:n.function_call.name}),h.jsxs("span",{className:"text-muted-foreground",children:["(",n.function_call.arguments,")"]})]})]}),(n?.content===null||n?.content===void 0||n.content.length===0)&&(n?.reasoning_content===null||n?.reasoning_content===void 0||n.reasoning_content.length===0)&&(n?.function_call===null||n?.function_call===void 0)&&h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function b5(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function w5(e,t){return b5(t)?h.jsx(v5,{response:t}):h.jsx(y5,{response:t})}function _5(e){switch(e){case"success":return"text-emerald-400";case"client_error":return"text-amber-400";case"server_error":return"text-red-400";case"pending":return"text-muted-foreground"}}function k5(e,t){try{const n=JSON.parse(e);if(t==="openai"){const o=Ix(e);if(o)return o}const r=Ex.safeParse(n);return r.success?r.data:null}catch{return null}}function Pr({status:e}){const t=Xc(e),n=_5(t);return e===null?h.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):h.jsxs("span",{className:ze("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&h.jsx(sv,{className:"size-3"}),e]})}function S5({text:e}){return h.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:h.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:e})})}function C5({text:e}){return h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:h.jsx(jn,{children:e})})}function $r({responseText:e,responseStatus:t,streaming:n,inputTokens:r,outputTokens:o,cacheCreationInputTokens:i,cacheReadInputTokens:s,apiFormat:a}){if(e===null)return h.jsxs("div",{className:"flex items-center gap-2 py-3",children:[h.jsx(Pr,{status:t}),h.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]});if(t!==null&&t>=400)return h.jsxs("div",{className:"space-y-2",children:[h.jsx(Pr,{status:t}),h.jsx(S5,{text:e})]});const c=k5(e,a);return c!==null?h.jsxs("div",{className:"space-y-2",children:[h.jsx(Pr,{status:t}),w5(a,c)]}):h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Pr,{status:t}),n&&(r!==null||o!==null)&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[h.jsx(dr,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?Ke(r):"—"," in /"," ",o!==null?Ke(o):"—"," out"]}),i!=null&&i>0&&h.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ke(i)]}),s!=null&&s>0&&h.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ke(s)]})]})]}),h.jsx(C5,{text:e})]})}const E5=ue({success:yt(),error:re().optional(),responseStatus:ye().optional(),responseText:re().optional(),inputTokens:ye().optional(),outputTokens:ye().optional(),elapsedMs:ye().optional(),streaming:yt().optional()});function T5({log:e,open:t,onOpenChange:n}){const[r,o]=_.useState(()=>e.rawRequestBody??"{}"),[i,s]=_.useState(null),[a,l]=_.useState(!1),[c,u]=_.useState(null);async function f(){l(!0),u(null),s(null);try{const x=await(await fetch(`/api/logs/${e.id}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({modifiedBody:r})})).json(),m=E5.safeParse(x);if(!m.success){u("Invalid response from server"),l(!1);return}const y=m.data;s(y),y.success||u(y.error??"Replay failed")}catch(d){u(d instanceof Error?d.message:"Network error")}finally{l(!1)}}function p(){s(null),u(null),n(!1)}return h.jsx(rh,{open:t,onOpenChange:p,children:h.jsxs(oh,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[h.jsx(ih,{children:h.jsxs(sh,{className:"flex items-center gap-2",children:[h.jsx(Dc,{className:"size-4"}),"Replay Request #",e.id]})}),h.jsxs(wn,{defaultValue:"modified",children:[h.jsxs(_n,{children:[h.jsx(Ye,{value:"modified",children:"Modified Request"}),h.jsx(Ye,{value:"original",children:"Original Response"}),i&&h.jsx(Ye,{value:"replay",children:"Replay Response"})]}),h.jsxs(Xe,{value:"modified",className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Request Body (JSON)"}),h.jsx("textarea",{className:"w-full h-64 p-3 font-mono text-xs bg-muted rounded-md border border-input resize-none focus:outline-none focus:ring-2 focus:ring-ring",value:r,onChange:d=>o(d.target.value),spellCheck:!1})]}),c!==null&&c!==""&&h.jsx("div",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:c}),h.jsx("div",{className:"flex justify-end",children:h.jsx(ft,{onClick:()=>{f()},disabled:a,children:a?"Replaying...":"Replay"})}),i&&i.success&&h.jsxs(wn,{defaultValue:"parsed",children:[h.jsxs(_n,{children:[h.jsx(Ye,{value:"parsed",children:"Parsed Response"}),h.jsx(Ye,{value:"raw",children:"Raw Response"})]}),h.jsx(Xe,{value:"parsed",children:h.jsx($r,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),h.jsx(Xe,{value:"raw",children:h.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText??"No response"})})]})]}),h.jsx(Xe,{value:"original",children:e.responseText!==null?h.jsxs(wn,{defaultValue:"parsed",children:[h.jsxs(_n,{children:[h.jsx(Ye,{value:"parsed",children:"Parsed Response"}),h.jsx(Ye,{value:"raw",children:"Raw Response"})]}),h.jsx(Xe,{value:"parsed",children:h.jsx($r,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat})}),h.jsx(Xe,{value:"raw",children:h.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:e.responseText})})]}):h.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No original response"})}),i&&i.success&&h.jsx(Xe,{value:"replay",children:i.responseText!==null?h.jsxs(wn,{defaultValue:"parsed",children:[h.jsxs(_n,{children:[h.jsx(Ye,{value:"parsed",children:"Parsed Response"}),h.jsx(Ye,{value:"raw",children:"Raw Response"})]}),h.jsx(Xe,{value:"parsed",children:h.jsx($r,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),h.jsx(Xe,{value:"raw",children:h.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText})})]}):h.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No replay response"})})]})]})})}function N5({logId:e,truncated:t}){const[n,r]=_.useState(!1),[o,i]=_.useState({status:"idle"}),[s,a]=_.useState(new Set);_.useEffect(()=>{!n||o.status!=="idle"||(i({status:"loading"}),fetch(`/api/logs/${e}/chunks`).then(f=>f.ok?f.json():Promise.reject(new Error("Chunks not found"))).then(f=>{i({status:"success",chunks:f.chunks})}).catch(()=>{i({status:"error",message:"Chunk data unavailable"})}))},[n,e,o.status]);const l=_.useMemo(()=>{if(o.status!=="success")return[];const f=new Map;for(const p of o.chunks){const d=f.get(p.index);d?d.push(p):f.set(p.index,[p])}return Array.from(f.entries()).map(([p,d])=>({index:p,chunks:d})).sort((p,d)=>p.index-d.index)},[o]),c=f=>{a(p=>{const d=new Set(p);return d.has(f)?d.delete(f):d.add(f),d})};function u(){return o.status==="idle"||o.status==="loading"?h.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[h.jsx(Pc,{className:"size-3 animate-spin"}),h.jsx("span",{children:"Loading chunks..."})]}):o.status==="error"?h.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:o.message}):h.jsxs("div",{className:"p-2 space-y-1",children:[h.jsxs("div",{className:"text-[10px] text-muted-foreground font-mono mb-2",children:[l.length," index group",l.length!==1?"s":""," available"]}),l.map(f=>{const p=s.has(f.index);return h.jsxs("div",{className:"rounded border border-border bg-background",children:[h.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-2 py-1.5 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>c(f.index),children:[p?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"}),h.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",f.index,"] ",f.chunks[0]?.type??""]}),h.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[f.chunks.length," chunk",f.chunks.length!==1?"s":""]})]}),p&&h.jsx("div",{className:"px-2 pb-2 space-y-1",children:f.chunks.map(d=>h.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",d.timestamp,"ms"]}),h.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:d.type})]}),h.jsx(Os,{data:d,defaultExpandDepth:1,showCopy:!0})]},d.index))})]},f.index)})]})}return h.jsxs("div",{className:"space-y-1",children:[h.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>r(f=>!f),children:[n?h.jsx(At,{className:"size-3"}):h.jsx(Wt,{className:"size-3"}),h.jsx("span",{children:"Raw SSE Events"}),h.jsxs(dt,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[e,t===!0?"+":""]})]}),n===!0?h.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:u()}):null]})}function Ll({text:e,label:t,copied:n,onCopy:r}){return e===null?null:h.jsx("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1 rounded hover:bg-muted",children:n?h.jsxs(h.Fragment,{children:[h.jsx(ur,{className:"size-3 text-green-500"}),h.jsx("span",{className:"text-green-500",children:"Copied!"})]}):h.jsxs(h.Fragment,{children:[h.jsx(ao,{className:"size-3"}),h.jsx("span",{children:t})]})})}const ch=_.memo(function({log:t,viewMode:n="simple"}){const[r,o]=_.useState(!1),[i,s]=_.useState(!1),[a,l]=_.useState(!1),[c,u]=_.useState(!1),f=_.useMemo(()=>Rx(t.rawRequestBody),[t.rawRequestBody]);function p(x){x.stopPropagation(),t.rawRequestBody!==null&&window.navigator.clipboard.writeText(t.rawRequestBody).then(()=>{s(!0),setTimeout(()=>s(!1),2e3)})}function d(x){x.stopPropagation(),t.responseText!==null&&window.navigator.clipboard.writeText(t.responseText).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})}return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:ze("border border-border rounded-lg mb-3 overflow-hidden"),children:[h.jsx(a5,{log:t,parsedRequest:f,expanded:r,onToggle:()=>o(!r)}),r&&h.jsx("div",{onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),children:h.jsxs(wn,{defaultValue:"request",children:[h.jsxs(_n,{className:"mx-4 mt-2",children:[n==="full"&&h.jsx(Ye,{value:"raw-headers",children:"Raw Headers"}),n==="full"&&h.jsx(Ye,{value:"headers",children:"Headers"}),h.jsx(Ye,{value:"request",children:"Request"}),n==="full"&&h.jsx(Ye,{value:"raw",children:"Raw Response"}),h.jsx(Ye,{value:"parsed",children:"Parsed Response"})]}),h.jsx(Xe,{value:"request",children:h.jsxs("div",{className:"px-4 py-3",children:[h.jsxs("div",{className:"flex justify-end gap-2 mb-2",children:[h.jsxs(ft,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:x=>{x.stopPropagation(),u(!0)},children:[h.jsx(Dc,{className:"size-3 mr-1"}),"Replay"]}),h.jsx(Ll,{text:t.rawRequestBody,label:"Copy Request",copied:i,onCopy:p})]}),t.rawRequestBody!==null?h.jsx(Dl,{text:t.rawRequestBody,defaultExpandDepth:1}):h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),n==="full"&&h.jsx(Xe,{value:"headers",children:h.jsx("div",{className:"px-4 py-3",children:t.headers&&Object.keys(t.headers).length>0?h.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(t.headers).sort(([x],[m])=>x.localeCompare(m)).map(([x,m])=>h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[x,":"]}),h.jsx("span",{className:"text-muted-foreground truncate",title:m,children:m})]},x))}):h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No headers captured"})})}),n==="full"&&h.jsx(Xe,{value:"raw-headers",children:h.jsx("div",{className:"px-4 py-3",children:t.rawHeaders&&Object.keys(t.rawHeaders).length>0?h.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(t.rawHeaders).sort(([x],[m])=>x.localeCompare(m)).map(([x,m])=>h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[x,":"]}),h.jsx("span",{className:"text-muted-foreground truncate",title:m,children:m})]},x))}):h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No raw headers captured"})})}),h.jsx(Xe,{value:"raw",children:h.jsxs("div",{className:"px-4 py-3 space-y-3",children:[h.jsx("div",{className:"flex justify-end",children:h.jsx(Ll,{text:t.responseText,label:"Copy Response",copied:a,onCopy:d})}),t.responseText!==null?h.jsx(Dl,{text:t.responseText,defaultExpandDepth:1}):h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No response"}),t.streaming===!0&&h.jsx(N5,{logId:t.id,truncated:t.streamingChunksPath!==null})]})}),h.jsx(Xe,{value:"parsed",children:h.jsx("div",{className:"px-4 py-3",children:h.jsx($r,{responseText:t.responseText,responseStatus:t.responseStatus,streaming:t.streaming,inputTokens:t.inputTokens,outputTokens:t.outputTokens,cacheCreationInputTokens:t.cacheCreationInputTokens,cacheReadInputTokens:t.cacheReadInputTokens,apiFormat:t.apiFormat})})})]})})]}),h.jsx(T5,{log:t,open:c,onOpenChange:u})]})});function A5(e){let t=0,n=0;for(const r of e)r.inputTokens!==null&&(t+=r.inputTokens),r.outputTokens!==null&&(n+=r.outputTokens);return{totalInputTokens:t,totalOutputTokens:n}}const z5=_.memo(function({group:t,viewMode:n="simple"}){const[r,o]=_.useState(!1),i=A5(t.logs),s=t.logs[0]?.timestamp??new Date().toISOString(),a=t.logs[t.logs.length-1]?.timestamp??new Date().toISOString(),l=t.conversationId.startsWith("PID:")||t.conversationId.includes("|")?t.conversationId:t.conversationId.length>24?t.conversationId.slice(0,12)+"…"+t.conversationId.slice(-12):t.conversationId;return h.jsxs("div",{className:"mb-4",children:[h.jsx(mb,{conversationId:l,startTime:s,endTime:a,totalCalls:t.logs.length,totalInputTokens:i.totalInputTokens,totalOutputTokens:i.totalOutputTokens,expanded:r,onToggle:()=>o(!r)}),r&&h.jsx("div",{className:"pl-4 border-l-2 border-muted ml-3",children:t.logs.map(c=>h.jsx(ch,{log:c,viewMode:n},c.id))})]})});function Fl({...e}){return h.jsx(ZE,{"data-slot":"select",...e})}function $l({...e}){return h.jsx(WE,{"data-slot":"select-value",...e})}function Bl({className:e,size:t="default",children:n,...r}){return h.jsxs(VE,{"data-slot":"select-trigger","data-size":t,className:ze("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(HE,{asChild:!0,children:h.jsx(At,{className:"size-4 opacity-50"})})]})}function Ul({className:e,children:t,position:n="popper",align:r="center",...o}){return h.jsx(qE,{children:h.jsxs(KE,{"data-slot":"select-content",className:ze("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...o,children:[h.jsx(j5,{}),h.jsx(GE,{className:ze("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),h.jsx(I5,{})]})})}function Rr({className:e,children:t,...n}){return h.jsxs(JE,{"data-slot":"select-item",className:ze("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[h.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(XE,{children:h.jsx(ur,{className:"size-4"})})}),h.jsx(YE,{children:t})]})}function j5({className:e,...t}){return h.jsx(QE,{"data-slot":"select-scroll-up-button",className:ze("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(ly,{className:"size-4"})})}function I5({className:e,...t}){return h.jsx(e3,{"data-slot":"select-scroll-down-button",className:ze("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(At,{className:"size-4"})})}const O5={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function P5(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}function R5(e){return Object.prototype.hasOwnProperty.call(e,"success")}function D5(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function M5(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return h.jsx(Hi,{...t});case"network_unreachable":return h.jsx(fv,{...t});case"connection_refused":return h.jsx(pv,{...t});case"auth_failed":return h.jsx($y,{...t});case"rate_limited":return h.jsx(jy,{...t});case"server_error":return h.jsx(Xy,{...t});case"invalid_response":return h.jsx(xy,{...t});case"unknown":return h.jsx(ui,{...t});default:return h.jsx(ui,{...t})}}function Zl({result:e}){if(!R5(e))return D5(e)?h.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[h.jsx(Zy,{className:"size-3"}),h.jsx("span",{children:"Not configured"})]}):h.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[h.jsx(Mc,{className:"size-3 animate-spin"}),h.jsx("span",{children:"Testing..."})]});if(e.success)return h.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 shrink-0",children:[h.jsx(my,{className:"size-3"}),h.jsx("span",{children:"Connected"})]});const t=e.error,n=t?.message??"Connection failed",r=t?.hint,o=t?.type??"unknown",i=r!==void 0?`${n} — ${r}`:n;return h.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600 shrink-0 max-w-[200px]",title:t?.details??i,children:[M5(o),h.jsx("span",{className:"truncate",children:n})]})}function L5({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,onEdit:o,onDelete:i,onTest:s}){const[a,l]=_.useState(!1);return h.jsxs("div",{className:"border rounded-lg p-4 flex flex-col gap-3 bg-card",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsx("div",{className:"flex items-center gap-2 min-w-0",children:h.jsx("span",{className:"font-medium truncate",children:e.model!==void 0&&e.model!==""?`${e.model} (${e.name})`:e.name})}),Object.entries(O5).map(([c,u])=>e.name.toLowerCase().includes(c)?h.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1 text-xs",title:"View API documentation",children:[h.jsx(ky,{className:"size-3"}),h.jsx("span",{className:"sr-only",children:"Docs"})]},c):null)]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded flex-1 truncate",children:a?e.apiKey:P5(e.apiKey)}),h.jsx("button",{type:"button",onClick:()=>l(c=>!c),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":a?"Hide API key":"Show API key",children:a?h.jsx(Cy,{className:"size-4"}):h.jsx(Ty,{className:"size-4"})})]}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[h.jsx("span",{className:"font-medium",children:"Anthropic:"})," ",h.jsx("span",{className:"truncate",children:e.anthropicBaseUrl})]}),t&&h.jsx(Zl,{result:t.anthropic.nonStreaming})]}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[h.jsx("span",{className:"font-medium",children:"OpenAI:"})," ",h.jsx("span",{className:"truncate",children:e.openaiBaseUrl})]}),t&&h.jsx(Zl,{result:t.openai.nonStreaming})]}),h.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[s!==void 0&&h.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[h.jsx(Mc,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),h.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>o(e),className:"text-xs h-7 gap-1",children:[h.jsx(Wy,{className:"size-3"}),"Edit"]}),h.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>i(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",children:[h.jsx(ov,{className:"size-3"}),"Delete"]})]})]})}const F5={deepseek:{format:"openai",baseUrl:"https://api.deepseek.com"},minimax:{format:"anthropic",baseUrl:"https://api.minimaxi.com/anthropic"},alibaba:{format:"openai",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode"}},Vl=["MiniMax M2.7","MiniMax M2.7-highspeed","MiniMax M2.5","MiniMax M2.5-highspeed","MiniMax M2.1","MiniMax M2.1-highspeed","MiniMax M2"],Wl=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function $5({provider:e,onSubmit:t,onCancel:n}){const[r,o]=_.useState(e?.name??"Provider Name"),[i,s]=_.useState(e?.apiKey??""),[a,l]=_.useState(e?.model??""),[c,u]=_.useState(e?.format??"anthropic"),[f,p]=_.useState(e?.baseUrl??""),[d,x]=_.useState({}),[m,y]=_.useState(!1),[g,v]=_.useState(!1),k=r.toLowerCase().includes("minimax"),S=r.toLowerCase().includes("alibaba");_.useEffect(()=>{e&&(o(e.name),s(e.apiKey),l(e.model??""),u(e.format??"anthropic"),p(e.baseUrl??""),v(!1))},[e]),_.useEffect(()=>{const z=r.toLowerCase();for(const[P,L]of Object.entries(F5))if(z.includes(P)){g||(u(L.format),p(L.baseUrl)),P==="minimax"&&!a&&l(Vl[0]??""),P==="alibaba"&&!a&&l(Wl[0]??"");break}},[r]);function C(){const z={};return r.trim()||(z.name="Name is required"),i.trim()||(z.apiKey="API key is required"),a.trim()||(z.model="Model is required"),f.trim()?E(f.trim())||(z.baseUrl="Invalid URL format"):z.baseUrl="Base URL is required",x(z),Object.keys(z).length===0}function E(z){try{return new URL(z),!0}catch{return!1}}function I(z){if(z.preventDefault(),!!C()){y(!0);try{t({name:r.trim(),apiKey:i.trim(),model:a.trim()||void 0,format:c,baseUrl:f.trim()||void 0})}finally{y(!1)}}}return h.jsxs("form",{onSubmit:I,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-name",className:"text-sm font-medium",children:["Name ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx("input",{id:"provider-name",type:"text",value:r,onChange:z=>o(z.target.value),placeholder:"Model Name",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),d.name!==void 0&&h.jsx("p",{className:"text-xs text-destructive",children:d.name})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-apikey",className:"text-sm font-medium",children:["API Key ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx("input",{id:"provider-apikey",type:"password",value:i,onChange:z=>s(z.target.value),placeholder:"sk-ant-...",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),d.apiKey!==void 0&&h.jsx("p",{className:"text-xs text-destructive",children:d.apiKey})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-model",className:"text-sm font-medium",children:["Model ",h.jsx("span",{className:"text-destructive",children:"*"})]}),k||S?h.jsx("select",{id:"provider-model",value:a,onChange:z=>l(z.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:(k?Vl:Wl).map(z=>h.jsx("option",{value:z,children:z},z))}):h.jsx("input",{id:"provider-model",type:"text",value:a,onChange:z=>l(z.target.value),placeholder:"",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),d.model!==void 0&&h.jsx("p",{className:"text-xs text-destructive",children:d.model})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-format",className:"text-sm font-medium",children:["API Format ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs("select",{id:"provider-format",value:c,onChange:z=>u(z.target.value==="anthropic"?"anthropic":"openai"),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:[h.jsx("option",{value:"anthropic",children:"Anthropic (/v1/messages)"}),h.jsx("option",{value:"openai",children:"OpenAI (/v1/chat/completions)"})]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:c==="anthropic"?"Use Anthropic format for /v1/messages endpoint":"Use OpenAI format for /v1/chat/completions endpoint"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-base-url",className:"text-sm font-medium",children:["Base URL ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx("input",{id:"provider-base-url",type:"text",value:f,onChange:z=>{v(!0),p(z.target.value)},placeholder:c==="anthropic"?"https://api.anthropic.com":"https://api.openai.com/v1",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),d.baseUrl!==void 0&&h.jsx("p",{className:"text-xs text-destructive",children:d.baseUrl}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Base URL for the provider API."})]}),h.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[h.jsx(ft,{type:"button",variant:"outline",onClick:n,disabled:m,children:"Cancel"}),h.jsx(ft,{type:"submit",disabled:m,children:m?"Saving...":e?"Update Provider":"Add Provider"})]})]})}function B5({externalProviders:e,externalTestResults:t,externalTestingProviders:n,externalTestingTimeLeft:r,onProvidersMutate:o,onTestResultsChange:i,onTestingProvidersChange:s,onTestingTimeLeftChange:a}){const[l,c]=_.useState(!1),[u,f]=_.useState(),[p,d]=_.useState(null),[x,m]=_.useState({}),[y,g]=_.useState(new Set),[v,k]=_.useState({}),[S,C]=_.useState(null),[E,I]=_.useState(!1),z=e??[],P=t??x,L=n??y,V=r??v,T=a?(R,N)=>a(R,N):(R,N)=>{k(N===void 0?J=>{const Q={...J};return delete Q[R],Q}:J=>({...J,[R]:N}))};_.useEffect(()=>{(async()=>{try{const R=await fetch("/api/config/paths");if(R.ok){const N=await R.json();C(N.providerConfig)}}catch{}})()},[]);const M=30,b=_.useCallback(async R=>{const N={anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}};i?i(R,N):m(X=>({...X,[R]:N})),s?s(R,!0):g(X=>new Set(X).add(R));const J=new AbortController;let Q=M;T(R,Q);const pe=setInterval(()=>{Q--,T(R,Q),Q<=0&&(clearInterval(pe),J.abort())},1e3);try{const X=await fetch(`/api/providers/${R}/test`,{method:"POST",signal:J.signal});if(X.ok){const ae=await X.json();i?i(R,ae):m(de=>({...de,[R]:ae}))}else{const ae={anthropic:{nonStreaming:{success:!1,error:{message:`HTTP ${X.status}: ${X.statusText}`,type:"server_error"}},streaming:{notConfigured:!0}},openai:{nonStreaming:{success:!1,error:{message:`HTTP ${X.status}: ${X.statusText}`,type:"server_error"}},streaming:{notConfigured:!0}}};i?i(R,ae):m(de=>({...de,[R]:ae}))}}catch(X){if(X instanceof Error&&X.name==="AbortError"){const de={anthropic:{nonStreaming:{success:!1,error:{message:"Request timed out",type:"timeout"}},streaming:{notConfigured:!0}},openai:{nonStreaming:{success:!1,error:{message:"Request timed out",type:"timeout"}},streaming:{notConfigured:!0}}};i?i(R,de):m(me=>({...me,[R]:de}))}}finally{clearInterval(pe),T(R,void 0);try{s?s(R,!1):g(X=>{const ae=new Set(X);return ae.delete(R),ae})}catch{}}},[s,i,T]);function D(R){(async()=>{const N={name:R.name,apiKey:R.apiKey,model:R.model,format:R.format,anthropicBaseUrl:R.format==="anthropic"?R.baseUrl:void 0,openaiBaseUrl:R.format==="openai"?R.baseUrl:void 0},J=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(!J.ok){const pe=await J.json();d(pe.error??"Failed to add provider");return}const Q=await J.json();o?.(),c(!1),await b(Q.id)})()}function K(R){u&&(async()=>{const N={name:R.name,apiKey:R.apiKey,model:R.model,format:R.format,anthropicBaseUrl:R.format==="anthropic"?R.baseUrl:void 0,openaiBaseUrl:R.format==="openai"?R.baseUrl:void 0},J=await fetch(`/api/providers/${u.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(!J.ok){const pe=await J.json();d(pe.error??"Failed to update provider");return}const Q=await J.json();o?.(),f(void 0),await b(Q.id)})()}function U(R){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{const N=await fetch(`/api/providers/${R}`,{method:"DELETE"});if(!N.ok){const J=await N.json();d(J.error??"Failed to delete provider");return}o?.()})()}const W=_.useRef(null);function q(R){const N="/api/providers/export";(async()=>{try{const J=await fetch(N);if(!J.ok){d("Failed to export providers");return}const Q=await J.blob(),pe=URL.createObjectURL(Q),X=document.createElement("a");X.href=pe,X.download=J.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(X),X.click(),document.body.removeChild(X),URL.revokeObjectURL(pe)}catch{d("Failed to export providers")}})()}function A(){W.current?.click()}function B(R){const N=R.target.files?.[0];N&&(async()=>{try{const J=await N.text(),Q=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}),X=ue({success:yt().optional(),imported:ye().optional(),message:re().optional(),errors:Be(re()).optional()}).parse(await Q.json());Q.ok&&X.imported!==void 0&&X.imported>0?(o?.(),d(null)):X.errors&&X.errors.length>0?d(X.errors.join("; ")):d(X.message??"Import failed")}catch{d("Failed to import providers")}R.target.value=""})()}return z.length===0?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading providers..."})}):l||u?h.jsxs("div",{className:"space-y-4",children:[h.jsx("div",{className:"flex items-center justify-between",children:h.jsx("h3",{className:"text-lg font-medium",children:u?"Edit Provider":"Add New Provider"})}),h.jsx($5,{provider:u,onSubmit:u?K:D,onCancel:()=>{c(!1),f(void 0)}})]}):h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-background pb-2",children:[h.jsx("h3",{className:"text-lg font-medium",children:"Providers"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>q(),className:"gap-1 hover:bg-muted",children:[h.jsx(Oc,{className:"size-3"}),"Export"]}),h.jsxs(ft,{variant:"outline",size:"sm",onClick:A,className:"gap-1 hover:bg-muted",children:[h.jsx(lv,{className:"size-3"}),"Import"]}),h.jsx("input",{type:"file",ref:W,accept:".json",onChange:B,style:{display:"none"}}),h.jsxs(ft,{onClick:()=>c(!0),size:"sm",className:"gap-1",children:[h.jsx(fa,{className:"size-4"}),"Add Provider"]})]})]}),S!==null&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/30 rounded-md px-3 py-2",children:[h.jsx("span",{className:"shrink-0",children:"Config:"}),h.jsx("span",{className:"font-mono truncate",title:S,children:S}),h.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(S).then(()=>{I(!0),setTimeout(()=>I(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:E?h.jsx(ur,{className:"size-3 text-green-500"}):h.jsx(ao,{className:"size-3"})})]}),p!==null&&h.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive bg-destructive/10 rounded-md px-3 py-2",children:[h.jsx(ui,{className:"size-4 shrink-0"}),p]}),z.length===0?h.jsxs("div",{className:"text-center py-12 space-y-3",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured yet."}),h.jsxs(ft,{onClick:()=>c(!0),variant:"outline",size:"sm",children:[h.jsx(fa,{className:"size-4"}),"Add Your First Provider"]})]}):h.jsx("div",{className:"space-y-3",children:z.map(R=>h.jsx(L5,{provider:R,testResults:P[R.id],isTesting:L.has(R.id),testingTimeLeft:V[R.id],onEdit:N=>f(N),onDelete:U,onTest:N=>{b(N)}},R.id))})]})}async function U5(e){const n=await(await fetch(e)).json();return Array.isArray(n)?n:[]}function Z5(){const e=hh("/api/providers",U5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function V5(){const[e,t]=_.useState(!1),[n,r]=_.useState("providers"),{providers:o,mutate:i}=Z5(),[s,a]=_.useState({}),[l,c]=_.useState(new Set),[u,f]=_.useState({}),p=_.useCallback((m,y)=>{a(g=>({...g,[m]:y}))},[]),d=_.useCallback((m,y)=>{c(g=>{const v=new Set(g);return y?v.add(m):v.delete(m),v})},[]),x=_.useCallback((m,y)=>{f(g=>{if(y===void 0){const v={...g};return delete v[m],v}return{...g,[m]:y}})},[]);return h.jsxs(rh,{open:e,onOpenChange:t,children:[h.jsx(l5,{asChild:!0,children:h.jsxs(ft,{variant:"ghost",size:"icon",className:"size-8",children:[h.jsx(ev,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Settings"})]})}),h.jsxs(oh,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[h.jsx(ih,{children:h.jsx(sh,{children:"Settings"})}),h.jsxs(wn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[h.jsx(_n,{children:h.jsx(Ye,{value:"providers",children:"Providers"})}),h.jsx("div",{className:"mt-4 overflow-y-auto flex-1",children:h.jsx(Xe,{value:"providers",children:h.jsx(B5,{externalProviders:o,externalTestResults:s,externalTestingProviders:l,externalTestingTimeLeft:u,onProvidersMutate:()=>{i()},onTestResultsChange:p,onTestingProvidersChange:d,onTestingTimeLeftChange:x})})})]})]})]})}function W5(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function H5(e){let t=0,n=0;for(const r of e)r.inputTokens!==null&&(t+=r.inputTokens),r.outputTokens!==null&&(n+=r.outputTokens);return{totalIn:t,totalOut:n}}function q5({command:e}){const[t,n]=_.useState(!1),r=_.useCallback(()=>{window.navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},[e]);return h.jsxs("div",{className:"inline-flex items-center gap-2 bg-muted rounded-md px-3 py-2",children:[h.jsx("pre",{className:"text-blue-500 font-mono text-sm m-0",children:e}),h.jsx("button",{type:"button",onClick:r,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 cursor-pointer","aria-label":"Copy command",children:t?h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M20 6 9 17l-5-5"})}):h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),h.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})]})}function K5({logs:e,sessions:t,models:n,selectedSession:r,selectedModel:o,onSessionChange:i,onModelChange:s,onClearAll:a,viewMode:l,onViewModeChange:c}){const{totalIn:u,totalOut:f}=H5(e),[p,d]=_.useState(!0),[x,m]=_.useState(!1),y=_.useCallback(async()=>{m(!0);try{await Sv(e)}finally{m(!1)}},[e]),g=_.useRef(null),v=_.useMemo(()=>xb(e),[e]),k=e.length>0&&p&&!(v.length===1&&v[0]?.logs.length===e.length),S=Jx({count:k?v.length:e.length,getScrollElement:()=>g.current,estimateSize:()=>150,measureElement:typeof window<"u"?C=>C.getBoundingClientRect().height:void 0,overscan:5});return h.jsxs("div",{className:"max-w-[1200px] mx-auto flex flex-col h-screen",style:{maxHeight:"100vh"},children:[h.jsxs("div",{className:"flex items-center gap-4 mb-4 px-6 pt-6",children:[h.jsx("h1",{className:"text-lg font-bold flex-1",children:"LLM Proxy Inspector"}),h.jsxs("span",{className:"text-muted-foreground text-xs font-mono",children:["v",Ev.version]}),h.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[h.jsx("button",{type:"button",onClick:()=>c("simple"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="simple"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Simple"}),h.jsx("button",{type:"button",onClick:()=>c("full"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="full"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Full"})]}),h.jsx(V5,{}),h.jsxs("span",{className:"text-muted-foreground text-xs font-mono",children:[e.length," request",e.length!==1?"s":"",u>0||f>0?` · ${u.toLocaleString()} in / ${f.toLocaleString()} out`:""]}),e.length>0&&h.jsx("button",{type:"button",onClick:()=>{y()},disabled:x,className:"text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-1",title:"Export all logs as JSON ZIP",children:x?h.jsx("span",{children:"Exporting..."}):h.jsxs(h.Fragment,{children:[h.jsx(Oc,{className:"size-3"}),h.jsx("span",{children:"Export All"})]})}),h.jsx("button",{type:"button",onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Clear all logs",children:"Clear All"})]}),h.jsxs("div",{className:"flex gap-3 px-6 mb-4",children:[h.jsxs(Fl,{value:r,onValueChange:i,children:[h.jsx(Bl,{className:"flex-1 max-w-[400px] text-xs",children:h.jsx($l,{placeholder:"All sessions"})}),h.jsxs(Ul,{children:[h.jsx(Rr,{value:"__all__",children:"All sessions"}),t.map(C=>h.jsx(Rr,{value:C,children:W5(C)},C))]})]}),h.jsxs(Fl,{value:o,onValueChange:s,children:[h.jsx(Bl,{className:"text-xs",children:h.jsx($l,{placeholder:"All models"})}),h.jsxs(Ul,{children:[h.jsx(Rr,{value:"__all__",children:"All models"}),n.map(C=>h.jsx(Rr,{value:C,children:C},C))]})]}),h.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[h.jsx("button",{type:"button",onClick:()=>d(!0),className:`px-2 py-1.5 cursor-pointer transition-colors ${p?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grouped view",children:h.jsx(Ry,{className:"size-4"})}),h.jsx("button",{type:"button",onClick:()=>d(!1),className:`px-2 py-1.5 cursor-pointer transition-colors ${p?"text-muted-foreground hover:bg-muted/50":"bg-muted text-foreground"}`,title:"Flat view",children:h.jsx(My,{className:"size-4"})})]})]}),h.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.length===0?h.jsxs("div",{className:"text-center text-muted-foreground py-16 space-y-4",children:[h.jsx("p",{className:"text-sm",children:"No requests captured yet."}),h.jsx("p",{className:"text-xs",children:"Route AI coding tools through the proxy:"}),h.jsx(q5,{command:"LLM_BASE_URL=http://localhost:25947/proxy <your-tool>"})]}):h.jsx("div",{ref:g,className:"overflow-y-auto h-full",children:h.jsx("div",{style:{height:`${S.getTotalSize()}px`,width:"100%",position:"relative"},children:S.getVirtualItems().map(C=>{if(k){const E=v[C.index];return E===void 0?null:h.jsx("div",{"data-index":C.index,ref:S.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${C.start}px)`},children:h.jsx(z5,{group:E,viewMode:l})},E.id)}else{const E=e[C.index];return E===void 0?null:h.jsx("div",{"data-index":C.index,ref:S.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${C.start}px)`},children:h.jsx(ch,{log:E,viewMode:l})},E.id)}})})})})]})}ue({logs:Be(ci),total:ye(),offset:ye(),limit:ye()});const G5=Jt([ue({type:Te("init"),logs:Be(ci)}),ue({type:Te("update"),log:ci})]);function J5(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function Y5(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function X5(){const[e,t]=_.useState([]),[n,r]=_.useState([]),[o,i]=_.useState([]),[s,a]=_.useState("__all__"),[l,c]=_.useState("__all__"),[u,f]=_.useState("simple"),[p,d]=_.useState(null),x=_.useRef(null),m=_.useCallback(async()=>{try{const[v,k]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(v.ok&&k.ok){const S=await v.json(),C=await k.json(),E=Be(re()).safeParse(S),I=Be(re()).safeParse(C);E.success&&r(E.data),I.success&&i(I.data)}}catch{}},[]),y=_.useCallback(()=>{x.current&&x.current.close();const v=new URLSearchParams;s!=="__all__"&&v.set("sessionId",s),l!=="__all__"&&v.set("model",l);const k=new EventSource(`/api/logs/stream?${v}`);x.current=k,k.onmessage=S=>{try{const C=String(S.data),E=JSON.parse(C),I=G5.safeParse(E);if(!I.success){d("Failed to parse SSE data");return}const z=I.data;z.type==="init"?(t(z.logs),r(J5(z.logs)),i(Y5(z.logs)),d(null)):z.type==="update"&&(t(P=>{const L=s==="__all__"||z.log.sessionId===s,V=l==="__all__"||z.log.model===l;return!L||!V?P:P.findIndex(M=>M.id===z.log.id)>=0?P.map(M=>M.id===z.log.id?z.log:M):[...P,z.log]}),r(P=>{const L=z.log.sessionId;return L!=null&&L!==""?P.includes(L)?P:[...P,L]:P}),i(P=>{const L=z.log.model;return L!=null&&L!==""?P.includes(L)?P:[...P,L]:P}))}catch{d("Failed to parse SSE data")}},k.onerror=()=>{d("SSE connection lost, reconnecting..."),k.close(),setTimeout(y,3e3)},m()},[s,l,m]);_.useEffect(()=>(y(),()=>{x.current&&(x.current.close(),x.current=null)}),[y]);const g=_.useCallback(()=>{(async()=>{try{if(!(await fetch("/api/logs",{method:"DELETE"})).ok){d("Failed to clear logs");return}t([]),r([]),i([]),d(null)}catch(v){d(v instanceof Error?v.message:"Unknown error clearing logs")}})()},[]);return h.jsxs(h.Fragment,{children:[p!==null&&h.jsx("div",{className:"fixed top-4 right-4 bg-destructive text-destructive-foreground px-4 py-2 rounded-md text-sm z-50",children:p}),h.jsx(K5,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:c,onClearAll:g,viewMode:u,onViewModeChange:f})]})}const tT=X5;export{tT as component};
|
|
97
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},bS="DialogDescriptionWarning",wS=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xd(bS).contentName}}.`;return _.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_S=od,kS=sd,SS=ld,CS=cd,ES=ud,TS=fd,NS=md;function AS(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function jS(e){const[t,n]=_.useState(void 0);return qe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const zS=["top","right","bottom","left"],Ht=Math.min,at=Math.max,Gr=Math.round,Pr=Math.floor,Nt=e=>({x:e,y:e}),IS={left:"right",right:"left",bottom:"top",top:"bottom"},OS={start:"end",end:"start"};function Si(e,t,n){return at(e,Ht(t,n))}function Mt(e,t){return typeof e=="function"?e(t):e}function Lt(e){return e.split("-")[0]}function Un(e){return e.split("-")[1]}function xs(e){return e==="x"?"y":"x"}function ys(e){return e==="y"?"height":"width"}const PS=new Set(["top","bottom"]);function Et(e){return PS.has(Lt(e))?"y":"x"}function vs(e){return xs(Et(e))}function RS(e,t,n){n===void 0&&(n=!1);const r=Un(e),o=vs(e),i=ys(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function DS(e){const t=Jr(e);return[Ci(e),t,Ci(t)]}function Ci(e){return e.replace(/start|end/g,t=>OS[t])}const vl=["left","right"],bl=["right","left"],MS=["top","bottom"],LS=["bottom","top"];function FS(e,t,n){switch(e){case"top":case"bottom":return n?t?bl:vl:t?vl:bl;case"left":case"right":return t?MS:LS;default:return[]}}function $S(e,t,n,r){const o=Un(e);let i=FS(Lt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ci)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>IS[t])}function BS(e){return{top:0,right:0,bottom:0,left:0,...e}}function yd(e){return typeof e!="number"?BS(e):{top:e,right:e,bottom:e,left:e}}function Yr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function wl(e,t,n){let{reference:r,floating:o}=e;const i=Et(t),s=vs(t),a=ys(s),l=Lt(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let d;switch(l){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(Un(t)){case"start":d[s]-=p*(n&&c?-1:1);break;case"end":d[s]+=p*(n&&c?-1:1);break}return d}async function US(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=Mt(t,e),x=yd(d),y=a[p?f==="floating"?"reference":"floating":f],g=Yr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},C=Yr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:k,strategy:l}):b);return{top:(g.top-C.top+x.top)/S.y,bottom:(C.bottom-g.bottom+x.bottom)/S.y,left:(g.left-C.left+x.left)/S.x,right:(C.right-g.right+x.right)/S.x}}const ZS=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=wl(c,r,l),p=r,d={},x=0;for(let y=0;y<a.length;y++){var m;const{name:g,fn:b}=a[y],{x:k,y:S,data:C,reset:T}=await b({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:US},elements:{reference:e,floating:t}});u=k??u,f=S??f,d={...d,[g]:{...d[g],...C}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(p=T.placement),T.rects&&(c=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:u,y:f}=wl(c,p,l)),y=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}},VS=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Mt(e,t)||{};if(c==null)return{};const f=yd(u),p={x:n,y:r},d=vs(o),x=ys(d),m=await s.getDimensions(c),y=d==="y",g=y?"top":"left",b=y?"bottom":"right",k=y?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[d]-p[d]-i.floating[x],C=p[d]-i.reference[d],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let z=T?T[k]:0;(!z||!await(s.isElement==null?void 0:s.isElement(T)))&&(z=a.floating[k]||i.floating[x]);const P=S/2-C/2,O=z/2-m[x]/2-1,M=Ht(f[g],O),B=Ht(f[b],O),E=M,L=z-m[x]-B,v=z/2-m[x]/2+P,D=Si(E,v,L),K=!l.arrow&&Un(o)!=null&&v!==D&&i.reference[x]/2-(v<E?M:B)-m[x]/2<0,Z=K?v<E?v-E:v-L:0;return{[d]:p[d]+Z,data:{[d]:D,centerOffset:v-D-Z,...K&&{alignmentOffset:Z}},reset:K}}}),WS=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...y}=Mt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Lt(o),b=Et(a),k=Lt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(k||!m?[Jr(a)]:DS(a)),T=x!=="none";!p&&T&&C.push(...$S(a,m,x,S));const z=[a,...C],P=await l.detectOverflow(t,y),O=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&O.push(P[g]),f){const v=RS(o,s,S);O.push(P[v[0]],P[v[1]])}if(M=[...M,{placement:o,overflows:O}],!O.every(v=>v<=0)){var B,E;const v=(((B=i.flip)==null?void 0:B.index)||0)+1,D=z[v];if(D&&(!(f==="alignment"?b!==Et(D):!1)||M.every(W=>Et(W.placement)===b?W.overflows[0]>0:!0)))return{data:{index:v,overflows:M},reset:{placement:D}};let K=(E=M.filter(Z=>Z.overflows[0]<=0).sort((Z,W)=>Z.overflows[1]-W.overflows[1])[0])==null?void 0:E.placement;if(!K)switch(d){case"bestFit":{var L;const Z=(L=M.filter(W=>{if(T){const q=Et(W.placement);return q===b||q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(q=>q>0).reduce((q,A)=>q+A,0)]).sort((W,q)=>W[1]-q[1])[0])==null?void 0:L[0];Z&&(K=Z);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}};function _l(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kl(e){return zS.some(t=>e[t]>=0)}const HS=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Mt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=_l(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:kl(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=_l(s,n.floating);return{data:{escapedOffsets:a,escaped:kl(a)}}}default:return{}}}}},vd=new Set(["left","top"]);async function qS(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Lt(n),a=Un(n),l=Et(n)==="y",c=vd.has(s)?-1:1,u=i&&l?-1:1,f=Mt(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof x=="number"&&(d=a==="end"?x*-1:x),l?{x:d*u,y:p*c}:{x:p*c,y:d*u}}const KS=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await qS(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},GS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:b,y:k}=g;return{x:b,y:k}}},...c}=Mt(e,t),u={x:n,y:r},f=await i.detectOverflow(t,c),p=Et(Lt(o)),d=xs(p);let x=u[d],m=u[p];if(s){const g=d==="y"?"top":"left",b=d==="y"?"bottom":"right",k=x+f[g],S=x-f[b];x=Si(k,x,S)}if(a){const g=p==="y"?"top":"left",b=p==="y"?"bottom":"right",k=m+f[g],S=m-f[b];m=Si(k,m,S)}const y=l.fn({...t,[d]:x,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[d]:s,[p]:a}}}}}},JS=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Mt(e,t),u={x:n,y:r},f=Et(o),p=xs(f);let d=u[p],x=u[f];const m=Mt(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const k=p==="y"?"height":"width",S=i.reference[p]-i.floating[k]+y.mainAxis,C=i.reference[p]+i.reference[k]-y.mainAxis;d<S?d=S:d>C&&(d=C)}if(c){var g,b;const k=p==="y"?"width":"height",S=vd.has(Lt(o)),C=i.reference[f]-i.floating[k]+(S&&((g=s.offset)==null?void 0:g[f])||0)+(S?0:y.crossAxis),T=i.reference[f]+i.reference[k]+(S?0:((b=s.offset)==null?void 0:b[f])||0)-(S?y.crossAxis:0);x<C?x=C:x>T&&(x=T)}return{[p]:d,[f]:x}}}},YS=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Mt(e,t),u=await s.detectOverflow(t,c),f=Lt(o),p=Un(o),d=Et(o)==="y",{width:x,height:m}=i.floating;let y,g;f==="top"||f==="bottom"?(y=f,g=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,y=p==="end"?"top":"bottom");const b=m-u.top-u.bottom,k=x-u.left-u.right,S=Ht(m-u[y],b),C=Ht(x-u[g],k),T=!t.middlewareData.shift;let z=S,P=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(z=b),T&&!p){const M=at(u.left,0),B=at(u.right,0),E=at(u.top,0),L=at(u.bottom,0);d?P=x-2*(M!==0||B!==0?M+B:at(u.left,u.right)):z=m-2*(E!==0||L!==0?E+L:at(u.top,u.bottom))}await l({...t,availableWidth:P,availableHeight:z});const O=await s.getDimensions(a.floating);return x!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function yo(){return typeof window<"u"}function Zn(e){return bd(e)?(e.nodeName||"").toLowerCase():"#document"}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function It(e){var t;return(t=(bd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bd(e){return yo()?e instanceof Node||e instanceof ct(e).Node:!1}function vt(e){return yo()?e instanceof Element||e instanceof ct(e).Element:!1}function zt(e){return yo()?e instanceof HTMLElement||e instanceof ct(e).HTMLElement:!1}function Sl(e){return!yo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot}const XS=new Set(["inline","contents"]);function mr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!XS.has(o)}const QS=new Set(["table","td","th"]);function eC(e){return QS.has(Zn(e))}const tC=[":popover-open",":modal"];function vo(e){return tC.some(t=>{try{return e.matches(t)}catch{return!1}})}const nC=["transform","translate","scale","rotate","perspective"],rC=["transform","translate","scale","rotate","perspective","filter"],oC=["paint","layout","strict","content"];function bs(e){const t=ws(),n=vt(e)?bt(e):e;return nC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||rC.some(r=>(n.willChange||"").includes(r))||oC.some(r=>(n.contain||"").includes(r))}function iC(e){let t=qt(e);for(;zt(t)&&!On(t);){if(bs(t))return t;if(vo(t))return null;t=qt(t)}return null}function ws(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sC=new Set(["html","body","#document"]);function On(e){return sC.has(Zn(e))}function bt(e){return ct(e).getComputedStyle(e)}function bo(e){return vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if(Zn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sl(e)&&e.host||It(e);return Sl(t)?t.host:t}function wd(e){const t=qt(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&mr(t)?t:wd(t)}function ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=wd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ct(o);if(i){const a=Ei(s);return t.concat(s,s.visualViewport||[],mr(o)?o:[],a&&n?ar(a):[])}return t.concat(o,ar(o,[],n))}function Ei(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _d(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=zt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Gr(n)!==i||Gr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function _s(e){return vt(e)?e:e.contextElement}function Tn(e){const t=_s(e);if(!zt(t))return Nt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=_d(t);let s=(i?Gr(n.width):n.width)/r,a=(i?Gr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const aC=Nt(0);function kd(e){const t=ct(e);return!ws()||!t.visualViewport?aC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ct(e)?!1:t}function on(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=_s(e);let s=Nt(1);t&&(r?vt(r)&&(s=Tn(r)):s=Tn(e));const a=lC(i,n,r)?kd(i):Nt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const p=ct(i),d=r&&vt(r)?ct(r):r;let x=p,m=Ei(x);for(;m&&r&&d!==x;){const y=Tn(m),g=m.getBoundingClientRect(),b=bt(m),k=g.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,S=g.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=k,c+=S,x=ct(m),m=Ei(x)}}return Yr({width:u,height:f,x:l,y:c})}function wo(e,t){const n=bo(e).scrollLeft;return t?t.left+n:on(It(e)).left+n}function Sd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function cC(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=It(r),a=t?vo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Nt(1);const u=Nt(0),f=zt(r);if((f||!f&&!i)&&((Zn(r)!=="body"||mr(s))&&(l=bo(r)),zt(r))){const d=on(r);c=Tn(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const p=s&&!f&&!i?Sd(s,l):Nt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function uC(e){return Array.from(e.getClientRects())}function dC(e){const t=It(e),n=bo(e),r=e.ownerDocument.body,o=at(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=at(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wo(e);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(s+=at(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Cl=25;function fC(e,t){const n=ct(e),r=It(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=ws();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=wo(r);if(c<=0){const u=r.ownerDocument,f=u.body,p=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-f.clientWidth-d);x<=Cl&&(i-=x)}else c<=Cl&&(i+=c);return{width:i,height:s,x:a,y:l}}const hC=new Set(["absolute","fixed"]);function pC(e,t){const n=on(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=zt(e)?Tn(e):Nt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function El(e,t,n){let r;if(t==="viewport")r=fC(e,n);else if(t==="document")r=dC(It(e));else if(vt(t))r=pC(t,n);else{const o=kd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Yr(r)}function Cd(e,t){const n=qt(e);return n===t||!vt(n)||On(n)?!1:bt(n).position==="fixed"||Cd(n,t)}function mC(e,t){const n=t.get(e);if(n)return n;let r=ar(e,[],!1).filter(a=>vt(a)&&Zn(a)!=="body"),o=null;const i=bt(e).position==="fixed";let s=i?qt(e):e;for(;vt(s)&&!On(s);){const a=bt(s),l=bs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&hC.has(o.position)||mr(s)&&!l&&Cd(e,s))?r=r.filter(u=>u!==s):o=a,s=qt(s)}return t.set(e,r),r}function gC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vo(t)?[]:mC(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=El(t,u,o);return c.top=at(f.top,c.top),c.right=Ht(f.right,c.right),c.bottom=Ht(f.bottom,c.bottom),c.left=at(f.left,c.left),c},El(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function xC(e){const{width:t,height:n}=_d(e);return{width:t,height:n}}function yC(e,t,n){const r=zt(t),o=It(t),i=n==="fixed",s=on(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Nt(0);function c(){l.x=wo(o)}if(r||!r&&!i)if((Zn(t)!=="body"||mr(o))&&(a=bo(t)),r){const d=on(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?Sd(o,a):Nt(0),f=s.left+a.scrollLeft-l.x-u.x,p=s.top+a.scrollTop-l.y-u.y;return{x:f,y:p,width:s.width,height:s.height}}function ni(e){return bt(e).position==="static"}function Tl(e,t){if(!zt(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return It(e)===n&&(n=n.ownerDocument.body),n}function Ed(e,t){const n=ct(e);if(vo(e))return n;if(!zt(e)){let o=qt(e);for(;o&&!On(o);){if(vt(o)&&!ni(o))return o;o=qt(o)}return n}let r=Tl(e,t);for(;r&&eC(r)&&ni(r);)r=Tl(r,t);return r&&On(r)&&ni(r)&&!bs(r)?n:r||iC(e)||n}const vC=async function(e){const t=this.getOffsetParent||Ed,n=this.getDimensions,r=await n(e.floating);return{reference:yC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bC(e){return bt(e).direction==="rtl"}const wC={convertOffsetParentRelativeRectToViewportRelativeRect:cC,getDocumentElement:It,getClippingRect:gC,getOffsetParent:Ed,getElementRects:vC,getClientRects:uC,getDimensions:xC,getScale:Tn,isElement:vt,isRTL:bC};function Td(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _C(e,t){let n=null,r;const o=It(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:d}=c;if(a||t(),!p||!d)return;const x=Pr(f),m=Pr(o.clientWidth-(u+p)),y=Pr(o.clientHeight-(f+d)),g=Pr(u),k={rootMargin:-x+"px "+-m+"px "+-y+"px "+-g+"px",threshold:at(0,Ht(1,l))||1};let S=!0;function C(T){const z=T[0].intersectionRatio;if(z!==l){if(!S)return s();z?s(!1,z):r=setTimeout(()=>{s(!1,1e-7)},1e3)}z===1&&!Td(c,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,k)}n.observe(e)}return s(!0),i}function kC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=_s(e),u=o||i?[...c?ar(c):[],...ar(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=c&&a?_C(c,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(g=>{let[b]=g;b&&b.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=d)==null||k.observe(t)})),n()}),c&&!l&&d.observe(c),d.observe(t));let x,m=l?on(e):null;l&&y();function y(){const g=on(e);m&&!Td(m,g)&&n(),m=g,x=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),f?.(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(x)}}const SC=KS,CC=GS,EC=WS,TC=YS,NC=HS,Nl=VS,AC=JS,jC=(e,t,n)=>{const r=new Map,o={platform:wC,...n},i={...o.platform,_c:r};return ZS(e,t,{...o,platform:i})};var zC=typeof document<"u",IC=function(){},Fr=zC?_.useLayoutEffect:IC;function Xr(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,o;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(!Xr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Xr(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Nd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Al(e,t){const n=Nd(e);return Math.round(t*n)/n}function ri(e){const t=_.useRef(e);return Fr(()=>{t.current=e}),t}function OC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=_.useState(r);Xr(p,r)||d(r);const[x,m]=_.useState(null),[y,g]=_.useState(null),b=_.useCallback(W=>{W!==T.current&&(T.current=W,m(W))},[]),k=_.useCallback(W=>{W!==z.current&&(z.current=W,g(W))},[]),S=i||x,C=s||y,T=_.useRef(null),z=_.useRef(null),P=_.useRef(u),O=l!=null,M=ri(l),B=ri(o),E=ri(c),L=_.useCallback(()=>{if(!T.current||!z.current)return;const W={placement:t,strategy:n,middleware:p};B.current&&(W.platform=B.current),jC(T.current,z.current,W).then(q=>{const A={...q,isPositioned:E.current!==!1};v.current&&!Xr(P.current,A)&&(P.current=A,ur.flushSync(()=>{f(A)}))})},[p,t,n,B,E]);Fr(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(W=>({...W,isPositioned:!1})))},[c]);const v=_.useRef(!1);Fr(()=>(v.current=!0,()=>{v.current=!1}),[]),Fr(()=>{if(S&&(T.current=S),C&&(z.current=C),S&&C){if(M.current)return M.current(S,C,L);L()}},[S,C,L,M,O]);const D=_.useMemo(()=>({reference:T,floating:z,setReference:b,setFloating:k}),[b,k]),K=_.useMemo(()=>({reference:S,floating:C}),[S,C]),Z=_.useMemo(()=>{const W={position:n,left:0,top:0};if(!K.floating)return W;const q=Al(K.floating,u.x),A=Al(K.floating,u.y);return a?{...W,transform:"translate("+q+"px, "+A+"px)",...Nd(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:A}},[n,a,K.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:L,refs:D,elements:K,floatingStyles:Z}),[u,L,D,K,Z])}const PC=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Nl({element:r.current,padding:o}).fn(n):{}:r?Nl({element:r,padding:o}).fn(n):{}}}},RC=(e,t)=>({...SC(e),options:[e,t]}),DC=(e,t)=>({...CC(e),options:[e,t]}),MC=(e,t)=>({...AC(e),options:[e,t]}),LC=(e,t)=>({...EC(e),options:[e,t]}),FC=(e,t)=>({...TC(e),options:[e,t]}),$C=(e,t)=>({...NC(e),options:[e,t]}),BC=(e,t)=>({...PC(e),options:[e,t]});var UC="Arrow",Ad=_.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return h.jsx(ke.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ad.displayName=UC;var ZC=Ad,ks="Popper",[jd,_o]=Ft(ks),[VC,zd]=jd(ks),Id=e=>{const{__scopePopper:t,children:n}=e,[r,o]=_.useState(null);return h.jsx(VC,{scope:t,anchor:r,onAnchorChange:o,children:n})};Id.displayName=ks;var Od="PopperAnchor",Pd=_.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=zd(Od,n),s=_.useRef(null),a=Oe(t,s),l=_.useRef(null);return _.useEffect(()=>{const c=l.current;l.current=r?.current||s.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:h.jsx(ke.div,{...o,ref:a})});Pd.displayName=Od;var Ss="PopperContent",[WC,HC]=jd(Ss),Rd=_.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:d="optimized",onPlaced:x,...m}=e,y=zd(Ss,n),[g,b]=_.useState(null),k=Oe(t,X=>b(X)),[S,C]=_.useState(null),T=jS(S),z=T?.width??0,P=T?.height??0,O=r+(i!=="center"?"-"+i:""),M=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},B=Array.isArray(c)?c:[c],E=B.length>0,L={padding:M,boundary:B.filter(KC),altBoundary:E},{refs:v,floatingStyles:D,placement:K,isPositioned:Z,middlewareData:W}=OC({strategy:"fixed",placement:O,whileElementsMounted:(...X)=>kC(...X,{animationFrame:d==="always"}),elements:{reference:y.anchor},middleware:[RC({mainAxis:o+P,alignmentAxis:s}),l&&DC({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?MC():void 0,...L}),l&&LC({...L}),FC({...L,apply:({elements:X,rects:ae,availableWidth:de,availableHeight:me})=>{const{width:xe,height:Ee}=ae.reference,Pe=X.floating.style;Pe.setProperty("--radix-popper-available-width",`${de}px`),Pe.setProperty("--radix-popper-available-height",`${me}px`),Pe.setProperty("--radix-popper-anchor-width",`${xe}px`),Pe.setProperty("--radix-popper-anchor-height",`${Ee}px`)}}),S&&BC({element:S,padding:a}),GC({arrowWidth:z,arrowHeight:P}),p&&$C({strategy:"referenceHidden",...L})]}),[q,A]=Ld(K),U=Qe(x);qe(()=>{Z&&U?.()},[Z,U]);const R=W.arrow?.x,N=W.arrow?.y,J=W.arrow?.centerOffset!==0,[Q,pe]=_.useState();return qe(()=>{g&&pe(window.getComputedStyle(g).zIndex)},[g]),h.jsx("div",{ref:v.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:Z?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(WC,{scope:n,placedSide:q,onArrowChange:C,arrowX:R,arrowY:N,shouldHideArrow:J,children:h.jsx(ke.div,{"data-side":q,"data-align":A,...m,ref:k,style:{...m.style,animation:Z?void 0:"none"}})})})});Rd.displayName=Ss;var Dd="PopperArrow",qC={top:"bottom",right:"left",bottom:"top",left:"right"},Md=_.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=HC(Dd,r),s=qC[i.placedSide];return h.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:h.jsx(ZC,{...o,ref:n,style:{...o.style,display:"block"}})})});Md.displayName=Dd;function KC(e){return e!==null}var GC=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=Ld(n),f={start:"0%",center:"50%",end:"100%"}[u],p=(o.arrow?.x??0)+a/2,d=(o.arrow?.y??0)+l/2;let x="",m="";return c==="bottom"?(x=s?f:`${p}px`,m=`${-l}px`):c==="top"?(x=s?f:`${p}px`,m=`${r.floating.height+l}px`):c==="right"?(x=`${-l}px`,m=s?f:`${d}px`):c==="left"&&(x=`${r.floating.width+l}px`,m=s?f:`${d}px`),{data:{x,y:m}}}});function Ld(e){const[t,n="center"]=e.split("-");return[t,n]}var Fd=Id,$d=Pd,Bd=Rd,Ud=Md,oi="rovingFocusGroup.onEntryFocus",JC={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[Ti,Zd,YC]=Fu(gr),[XC,Vd]=Ft(gr,[YC]),[QC,eE]=XC(gr),Wd=_.forwardRef((e,t)=>h.jsx(Ti.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Ti.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(tE,{...e,ref:t})})}));Wd.displayName=gr;var tE=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,p=_.useRef(null),d=Oe(t,p),x=ho(i),[m,y]=nn({prop:s,defaultProp:a??null,onChange:l,caller:gr}),[g,b]=_.useState(!1),k=Qe(c),S=Zd(n),C=_.useRef(!1),[T,z]=_.useState(0);return _.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(oi,k),()=>P.removeEventListener(oi,k)},[k]),h.jsx(QC,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:_.useCallback(P=>y(P),[y]),onItemShiftTab:_.useCallback(()=>b(!0),[]),onFocusableItemAdd:_.useCallback(()=>z(P=>P+1),[]),onFocusableItemRemove:_.useCallback(()=>z(P=>P-1),[]),children:h.jsx(ke.div,{tabIndex:g||T===0?-1:0,"data-orientation":r,...f,ref:d,style:{outline:"none",...e.style},onMouseDown:be(e.onMouseDown,()=>{C.current=!0}),onFocus:be(e.onFocus,P=>{const O=!C.current;if(P.target===P.currentTarget&&O&&!g){const M=new CustomEvent(oi,JC);if(P.currentTarget.dispatchEvent(M),!M.defaultPrevented){const B=S().filter(K=>K.focusable),E=B.find(K=>K.active),L=B.find(K=>K.id===m),D=[E,L,...B].filter(Boolean).map(K=>K.ref.current);Kd(D,u)}}C.current=!1}),onBlur:be(e.onBlur,()=>b(!1))})})}),Hd="RovingFocusGroupItem",qd=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=Tt(),c=i||l,u=eE(Hd,n),f=u.currentTabStopId===c,p=Zd(n),{onFocusableItemAdd:d,onFocusableItemRemove:x,currentTabStopId:m}=u;return _.useEffect(()=>{if(r)return d(),()=>x()},[r,d,x]),h.jsx(Ti.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:h.jsx(ke.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:be(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:be(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:be(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=oE(y,u.orientation,u.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")k.reverse();else if(g==="prev"||g==="next"){g==="prev"&&k.reverse();const S=k.indexOf(y.currentTarget);k=u.loop?iE(k,S+1):k.slice(S+1)}setTimeout(()=>Kd(k))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:m!=null}):s})})});qd.displayName=Hd;var nE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function oE(e,t,n){const r=rE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return nE[r]}function Kd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function iE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sE=Wd,aE=qd;function Ni(e,[t,n]){return Math.min(n,Math.max(t,e))}function lE(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var Cs="ScrollArea",[Gd]=Ft(Cs),[cE,mt]=Gd(Cs),Jd=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=_.useState(null),[c,u]=_.useState(null),[f,p]=_.useState(null),[d,x]=_.useState(null),[m,y]=_.useState(null),[g,b]=_.useState(0),[k,S]=_.useState(0),[C,T]=_.useState(!1),[z,P]=_.useState(!1),O=Oe(t,B=>l(B)),M=ho(o);return h.jsx(cE,{scope:n,type:r,dir:M,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:f,onContentChange:p,scrollbarX:d,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:T,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:z,onScrollbarYEnabledChange:P,onCornerWidthChange:b,onCornerHeightChange:S,children:h.jsx(ke.div,{dir:M,...s,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});Jd.displayName=Cs;var Yd="ScrollAreaViewport",Xd=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=mt(Yd,n),a=_.useRef(null),l=Oe(t,a,s.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("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}"},nonce:o}),h.jsx(ke.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Xd.displayName=Yd;var Ot="ScrollAreaScrollbar",Qd=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=mt(Ot,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return _.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?h.jsx(uE,{...r,ref:t,forceMount:n}):o.type==="scroll"?h.jsx(dE,{...r,ref:t,forceMount:n}):o.type==="auto"?h.jsx(ef,{...r,ref:t,forceMount:n}):o.type==="always"?h.jsx(Es,{...r,ref:t}):null});Qd.displayName=Ot;var uE=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=mt(Ot,e.__scopeScrollArea),[i,s]=_.useState(!1);return _.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),h.jsx(pt,{present:n||i,children:h.jsx(ef,{"data-state":i?"visible":"hidden",...r,ref:t})})}),dE=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=mt(Ot,e.__scopeScrollArea),i=e.orientation==="horizontal",s=So(()=>l("SCROLL_END"),100),[a,l]=lE("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 _.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),_.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let f=c[u];const p=()=>{const d=c[u];f!==d&&(l("SCROLL"),s()),f=d};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),h.jsx(pt,{present:n||a!=="hidden",children:h.jsx(Es,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:be(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),ef=_.forwardRef((e,t)=>{const n=mt(Ot,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=_.useState(!1),a=e.orientation==="horizontal",l=So(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Pn(n.viewport,l),Pn(n.content,l),h.jsx(pt,{present:r||i,children:h.jsx(Es,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Es=_.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=mt(Ot,e.__scopeScrollArea),i=_.useRef(null),s=_.useRef(0),[a,l]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=sf(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function f(p,d){return xE(p,s.current,a,d)}return n==="horizontal"?h.jsx(fE,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,d=jl(p,a,o.dir);i.current.style.transform=`translate3d(${d}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):n==="vertical"?h.jsx(hE,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,d=jl(p,a);i.current.style.transform=`translate3d(0, ${d}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),fE=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=mt(Ot,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=Oe(t,l,i.onScrollbarXChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(nf,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),lf(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:eo(s.paddingLeft),paddingEnd:eo(s.paddingRight)}})}})}),hE=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=mt(Ot,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=Oe(t,l,i.onScrollbarYChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(nf,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),lf(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:eo(s.paddingTop),paddingEnd:eo(s.paddingBottom)}})}})}),[pE,tf]=Gd(Ot),nf=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:f,...p}=e,d=mt(Ot,n),[x,m]=_.useState(null),y=Oe(t,O=>m(O)),g=_.useRef(null),b=_.useRef(""),k=d.viewport,S=r.content-r.viewport,C=Qe(u),T=Qe(l),z=So(f,10);function P(O){if(g.current){const M=O.clientX-g.current.left,B=O.clientY-g.current.top;c({x:M,y:B})}}return _.useEffect(()=>{const O=M=>{const B=M.target;x?.contains(B)&&C(M,S)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[k,x,S,C]),_.useEffect(T,[r,T]),Pn(x,z),Pn(d.content,z),h.jsx(pE,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Qe(i),onThumbPointerUp:Qe(s),onThumbPositionChange:T,onThumbPointerDown:Qe(a),children:h.jsx(ke.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:be(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),g.current=x.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",d.viewport&&(d.viewport.style.scrollBehavior="auto"),P(O))}),onPointerMove:be(e.onPointerMove,P),onPointerUp:be(e.onPointerUp,O=>{const M=O.target;M.hasPointerCapture(O.pointerId)&&M.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=b.current,d.viewport&&(d.viewport.style.scrollBehavior=""),g.current=null})})})}),Qr="ScrollAreaThumb",rf=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=tf(Qr,e.__scopeScrollArea);return h.jsx(pt,{present:n||o.hasThumb,children:h.jsx(mE,{ref:t,...r})})}),mE=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=mt(Qr,n),s=tf(Qr,n),{onThumbPositionChange:a}=s,l=Oe(t,f=>s.onThumbChange(f)),c=_.useRef(void 0),u=So(()=>{c.current&&(c.current(),c.current=void 0)},100);return _.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(u(),!c.current){const d=yE(f,a);c.current=d,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,u,a]),h.jsx(ke.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:be(e.onPointerDownCapture,f=>{const d=f.target.getBoundingClientRect(),x=f.clientX-d.left,m=f.clientY-d.top;s.onThumbPointerDown({x,y:m})}),onPointerUp:be(e.onPointerUp,s.onThumbPointerUp)})});rf.displayName=Qr;var Ts="ScrollAreaCorner",of=_.forwardRef((e,t)=>{const n=mt(Ts,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(gE,{...e,ref:t}):null});of.displayName=Ts;var gE=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=mt(Ts,n),[i,s]=_.useState(0),[a,l]=_.useState(0),c=!!(i&&a);return Pn(o.scrollbarX,()=>{const u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),Pn(o.scrollbarY,()=>{const u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),s(u)}),c?h.jsx(ke.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function eo(e){return e?parseInt(e,10):0}function sf(e,t){const n=e/t;return isNaN(n)?0:n}function ko(e){const t=sf(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function xE(e,t,n,r="ltr"){const o=ko(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return af([l,c],f)(e)}function jl(e,t,n="ltr"){const r=ko(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Ni(e,l);return af([0,s],[0,a])(c)}function af(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 lf(e,t){return e>0&&e<t}var yE=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function So(e,t){const n=Qe(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Pn(e,t){const n=Qe(t);qe(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var vE=Jd,bE=Xd,wE=of,_E=[" ","Enter","ArrowUp","ArrowDown"],kE=[" ","Enter"],sn="Select",[Co,Eo,SE]=Fu(sn),[Vn]=Ft(sn,[SE,_o]),To=_o(),[CE,Xt]=Vn(sn),[EE,TE]=Vn(sn),cf=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:d,form:x}=e,m=To(t),[y,g]=_.useState(null),[b,k]=_.useState(null),[S,C]=_.useState(!1),T=ho(c),[z,P]=nn({prop:r,defaultProp:o??!1,onChange:i,caller:sn}),[O,M]=nn({prop:s,defaultProp:a,onChange:l,caller:sn}),B=_.useRef(null),E=y?x||!!y.closest("form"):!0,[L,v]=_.useState(new Set),D=Array.from(L).map(K=>K.props.value).join(";");return h.jsx(Fd,{...m,children:h.jsxs(CE,{required:d,scope:t,trigger:y,onTriggerChange:g,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Tt(),value:O,onValueChange:M,open:z,onOpenChange:P,dir:T,triggerPointerDownPosRef:B,disabled:p,children:[h.jsx(Co.Provider,{scope:t,children:h.jsx(EE,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(K=>{v(Z=>new Set(Z).add(K))},[]),onNativeOptionRemove:_.useCallback(K=>{v(Z=>{const W=new Set(Z);return W.delete(K),W})},[]),children:n})}),E?h.jsxs(zf,{"aria-hidden":!0,required:d,tabIndex:-1,name:u,autoComplete:f,value:O,onChange:K=>M(K.target.value),disabled:p,form:x,children:[O===void 0?h.jsx("option",{value:""}):null,Array.from(L)]},D):null]})})};cf.displayName=sn;var uf="SelectTrigger",df=_.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=To(n),s=Xt(uf,n),a=s.disabled||r,l=Oe(t,s.onTriggerChange),c=Eo(n),u=_.useRef("touch"),[f,p,d]=Of(m=>{const y=c().filter(k=>!k.disabled),g=y.find(k=>k.value===s.value),b=Pf(y,m,g);b!==void 0&&s.onValueChange(b.value)}),x=m=>{a||(s.onOpenChange(!0),d()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return h.jsx($d,{asChild:!0,...i,children:h.jsx(ke.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":If(s.value)?"":void 0,...o,ref:l,onClick:be(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&x(m)}),onPointerDown:be(o.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:be(o.onKeyDown,m=>{const y=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(y&&m.key===" ")&&_E.includes(m.key)&&(x(),m.preventDefault())})})})});df.displayName=uf;var ff="SelectValue",hf=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Xt(ff,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=Oe(t,l.onValueNodeChange);return qe(()=>{c(u)},[c,u]),h.jsx(ke.span,{...a,ref:f,style:{pointerEvents:"none"},children:If(l.value)?h.jsx(h.Fragment,{children:s}):i})});hf.displayName=ff;var NE="SelectIcon",pf=_.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return h.jsx(ke.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});pf.displayName=NE;var AE="SelectPortal",mf=e=>h.jsx(mo,{asChild:!0,...e});mf.displayName=AE;var an="SelectContent",gf=_.forwardRef((e,t)=>{const n=Xt(an,e.__scopeSelect),[r,o]=_.useState();if(qe(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?ur.createPortal(h.jsx(xf,{scope:e.__scopeSelect,children:h.jsx(Co.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),i):null}return h.jsx(yf,{...e,ref:t})});gf.displayName=an;var xt=10,[xf,Qt]=Vn(an),jE="SelectContentImpl",zE=In("SelectContent.RemoveScroll"),yf=_.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:d,sticky:x,hideWhenDetached:m,avoidCollisions:y,...g}=e,b=Xt(an,n),[k,S]=_.useState(null),[C,T]=_.useState(null),z=Oe(t,X=>S(X)),[P,O]=_.useState(null),[M,B]=_.useState(null),E=Eo(n),[L,v]=_.useState(!1),D=_.useRef(!1);_.useEffect(()=>{if(k)return nd(k)},[k]),qu();const K=_.useCallback(X=>{const[ae,...de]=E().map(Ee=>Ee.ref.current),[me]=de.slice(-1),xe=document.activeElement;for(const Ee of X)if(Ee===xe||(Ee?.scrollIntoView({block:"nearest"}),Ee===ae&&C&&(C.scrollTop=0),Ee===me&&C&&(C.scrollTop=C.scrollHeight),Ee?.focus(),document.activeElement!==xe))return},[E,C]),Z=_.useCallback(()=>K([P,k]),[K,P,k]);_.useEffect(()=>{L&&Z()},[L,Z]);const{onOpenChange:W,triggerPointerDownPosRef:q}=b;_.useEffect(()=>{if(k){let X={x:0,y:0};const ae=me=>{X={x:Math.abs(Math.round(me.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(me.pageY)-(q.current?.y??0))}},de=me=>{X.x<=10&&X.y<=10?me.preventDefault():k.contains(me.target)||W(!1),document.removeEventListener("pointermove",ae),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",de,{capture:!0})}}},[k,W,q]),_.useEffect(()=>{const X=()=>W(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[W]);const[A,U]=Of(X=>{const ae=E().filter(xe=>!xe.disabled),de=ae.find(xe=>xe.ref.current===document.activeElement),me=Pf(ae,X,de);me&&setTimeout(()=>me.ref.current.focus())}),R=_.useCallback((X,ae,de)=>{const me=!D.current&&!de;(b.value!==void 0&&b.value===ae||me)&&(O(X),me&&(D.current=!0))},[b.value]),N=_.useCallback(()=>k?.focus(),[k]),J=_.useCallback((X,ae,de)=>{const me=!D.current&&!de;(b.value!==void 0&&b.value===ae||me)&&B(X)},[b.value]),Q=r==="popper"?Ai:vf,pe=Q===Ai?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:d,sticky:x,hideWhenDetached:m,avoidCollisions:y}:{};return h.jsx(xf,{scope:n,content:k,viewport:C,onViewportChange:T,itemRefCallback:R,selectedItem:P,onItemLeave:N,itemTextRefCallback:J,focusSelectedItem:Z,selectedItemText:M,position:r,isPositioned:L,searchRef:A,children:h.jsx(hs,{as:zE,allowPinchZoom:!0,children:h.jsx(fs,{asChild:!0,trapped:b.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:be(o,X=>{b.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:h.jsx(po,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:h.jsx(Q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:X=>X.preventDefault(),...g,...pe,onPlaced:()=>v(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:be(g.onKeyDown,X=>{const ae=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ae&&X.key.length===1&&U(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let me=E().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const xe=X.target,Ee=me.indexOf(xe);me=me.slice(Ee+1)}setTimeout(()=>K(me)),X.preventDefault()}})})})})})})});yf.displayName=jE;var IE="SelectItemAlignedPosition",vf=_.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Xt(an,n),s=Qt(an,n),[a,l]=_.useState(null),[c,u]=_.useState(null),f=Oe(t,z=>u(z)),p=Eo(n),d=_.useRef(!1),x=_.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:g,focusSelectedItem:b}=s,k=_.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&y&&g){const z=i.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),M=g.getBoundingClientRect();if(i.dir!=="rtl"){const xe=M.left-P.left,Ee=O.left-xe,Pe=z.left-Ee,w=z.width+Pe,Y=Math.max(w,P.width),H=window.innerWidth-xt,I=Ni(Ee,[xt,Math.max(xt,H-Y)]);a.style.minWidth=w+"px",a.style.left=I+"px"}else{const xe=P.right-M.right,Ee=window.innerWidth-O.right-xe,Pe=window.innerWidth-z.right-Ee,w=z.width+Pe,Y=Math.max(w,P.width),H=window.innerWidth-xt,I=Ni(Ee,[xt,Math.max(xt,H-Y)]);a.style.minWidth=w+"px",a.style.right=I+"px"}const B=p(),E=window.innerHeight-xt*2,L=m.scrollHeight,v=window.getComputedStyle(c),D=parseInt(v.borderTopWidth,10),K=parseInt(v.paddingTop,10),Z=parseInt(v.borderBottomWidth,10),W=parseInt(v.paddingBottom,10),q=D+K+L+W+Z,A=Math.min(y.offsetHeight*5,q),U=window.getComputedStyle(m),R=parseInt(U.paddingTop,10),N=parseInt(U.paddingBottom,10),J=z.top+z.height/2-xt,Q=E-J,pe=y.offsetHeight/2,X=y.offsetTop+pe,ae=D+K+X,de=q-ae;if(ae<=J){const xe=B.length>0&&y===B[B.length-1].ref.current;a.style.bottom="0px";const Ee=c.clientHeight-m.offsetTop-m.offsetHeight,Pe=Math.max(Q,pe+(xe?N:0)+Ee+Z),w=ae+Pe;a.style.height=w+"px"}else{const xe=B.length>0&&y===B[0].ref.current;a.style.top="0px";const Pe=Math.max(J,D+m.offsetTop+(xe?R:0)+pe)+de;a.style.height=Pe+"px",m.scrollTop=ae-J+m.offsetTop}a.style.margin=`${xt}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=E+"px",r?.(),requestAnimationFrame(()=>d.current=!0)}},[p,i.trigger,i.valueNode,a,c,m,y,g,i.dir,r]);qe(()=>k(),[k]);const[S,C]=_.useState();qe(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const T=_.useCallback(z=>{z&&x.current===!0&&(k(),b?.(),x.current=!1)},[k,b]);return h.jsx(PE,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:d,onScrollButtonChange:T,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:h.jsx(ke.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});vf.displayName=IE;var OE="SelectPopperPosition",Ai=_.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=xt,...i}=e,s=To(n);return h.jsx(Bd,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ai.displayName=OE;var[PE,Ns]=Vn(an,{}),ji="SelectViewport",bf=_.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Qt(ji,n),s=Ns(ji,n),a=Oe(t,i.onViewportChange),l=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Co.Slot,{scope:n,children:h.jsx(ke.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=s;if(p?.current&&f){const d=Math.abs(l.current-u.scrollTop);if(d>0){const x=window.innerHeight-xt*2,m=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),g=Math.max(m,y);if(g<x){const b=g+d,k=Math.min(x,b),S=b-k;f.style.height=k+"px",f.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});bf.displayName=ji;var wf="SelectGroup",[RE,DE]=Vn(wf),ME=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tt();return h.jsx(RE,{scope:n,id:o,children:h.jsx(ke.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ME.displayName=wf;var _f="SelectLabel",LE=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=DE(_f,n);return h.jsx(ke.div,{id:o.id,...r,ref:t})});LE.displayName=_f;var to="SelectItem",[FE,kf]=Vn(to),Sf=_.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Xt(to,n),l=Qt(to,n),c=a.value===r,[u,f]=_.useState(i??""),[p,d]=_.useState(!1),x=Oe(t,b=>l.itemRefCallback?.(b,r,o)),m=Tt(),y=_.useRef("touch"),g=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(FE,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:_.useCallback(b=>{f(k=>k||(b?.textContent??"").trim())},[]),children:h.jsx(Co.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:h.jsx(ke.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:x,onFocus:be(s.onFocus,()=>d(!0)),onBlur:be(s.onBlur,()=>d(!1)),onClick:be(s.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:be(s.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:be(s.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:be(s.onPointerMove,b=>{y.current=b.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:be(s.onKeyDown,b=>{l.searchRef?.current!==""&&b.key===" "||(kE.includes(b.key)&&g(),b.key===" "&&b.preventDefault())})})})})});Sf.displayName=to;var er="SelectItemText",Cf=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Xt(er,n),a=Qt(er,n),l=kf(er,n),c=TE(er,n),[u,f]=_.useState(null),p=Oe(t,g=>f(g),l.onItemTextChange,g=>a.itemTextRefCallback?.(g,l.value,l.disabled)),d=u?.textContent,x=_.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:d},l.value),[l.disabled,l.value,d]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return qe(()=>(m(x),()=>y(x)),[m,y,x]),h.jsxs(h.Fragment,{children:[h.jsx(ke.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ur.createPortal(i.children,s.valueNode):null]})});Cf.displayName=er;var Ef="SelectItemIndicator",Tf=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return kf(Ef,n).isSelected?h.jsx(ke.span,{"aria-hidden":!0,...r,ref:t}):null});Tf.displayName=Ef;var zi="SelectScrollUpButton",Nf=_.forwardRef((e,t)=>{const n=Qt(zi,e.__scopeSelect),r=Ns(zi,e.__scopeSelect),[o,i]=_.useState(!1),s=Oe(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?h.jsx(jf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Nf.displayName=zi;var Ii="SelectScrollDownButton",Af=_.forwardRef((e,t)=>{const n=Qt(Ii,e.__scopeSelect),r=Ns(Ii,e.__scopeSelect),[o,i]=_.useState(!1),s=Oe(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?h.jsx(jf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Af.displayName=Ii;var jf=_.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Qt("SelectScrollButton",n),s=_.useRef(null),a=Eo(n),l=_.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),qe(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),h.jsx(ke.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:be(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:be(o.onPointerLeave,()=>{l()})})}),$E="SelectSeparator",BE=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(ke.div,{"aria-hidden":!0,...r,ref:t})});BE.displayName=$E;var Oi="SelectArrow",UE=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=To(n),i=Xt(Oi,n),s=Qt(Oi,n);return i.open&&s.position==="popper"?h.jsx(Ud,{...o,...r,ref:t}):null});UE.displayName=Oi;var ZE="SelectBubbleInput",zf=_.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=_.useRef(null),i=Oe(r,o),s=AS(t);return _.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),h.jsx(ke.select,{...n,style:{...Mu,...n.style},ref:i,defaultValue:t})});zf.displayName=ZE;function If(e){return e===""||e===void 0}function Of(e){const t=Qe(e),n=_.useRef(""),r=_.useRef(0),o=_.useCallback(s=>{const a=n.current+s;t(a),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Pf(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=VE(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function VE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var WE=cf,HE=df,qE=hf,KE=pf,GE=mf,JE=gf,YE=bf,XE=Sf,QE=Cf,e3=Tf,t3=Nf,n3=Af,r3="Separator",zl="horizontal",o3=["horizontal","vertical"],Rf=_.forwardRef((e,t)=>{const{decorative:n,orientation:r=zl,...o}=e,i=i3(r)?r:zl,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return h.jsx(ke.div,{"data-orientation":i,...a,...o,ref:t})});Rf.displayName=r3;function i3(e){return o3.includes(e)}var s3=Rf,No="Tabs",[a3]=Ft(No,[Vd]),Df=Vd(),[l3,As]=a3(No),Mf=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ho(a),[f,p]=nn({prop:r,onChange:o,defaultProp:i??"",caller:No});return h.jsx(l3,{scope:n,baseId:Tt(),value:f,onValueChange:p,orientation:s,dir:u,activationMode:l,children:h.jsx(ke.div,{dir:u,"data-orientation":s,...c,ref:t})})});Mf.displayName=No;var Lf="TabsList",Ff=_.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=As(Lf,n),s=Df(n);return h.jsx(sE,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:h.jsx(ke.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Ff.displayName=Lf;var $f="TabsTrigger",Bf=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=As($f,n),a=Df(n),l=Vf(s.baseId,r),c=Wf(s.baseId,r),u=r===s.value;return h.jsx(aE,{asChild:!0,...a,focusable:!o,active:u,children:h.jsx(ke.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:be(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:be(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:be(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})})});Bf.displayName=$f;var Uf="TabsContent",Zf=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=As(Uf,n),l=Vf(a.baseId,r),c=Wf(a.baseId,r),u=r===a.value,f=_.useRef(u);return _.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),h.jsx(pt,{present:o||u,children:({present:p})=>h.jsx(ke.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&i})})});Zf.displayName=Uf;function Vf(e,t){return`${e}-trigger-${t}`}function Wf(e,t){return`${e}-content-${t}`}var c3=Mf,u3=Ff,d3=Bf,f3=Zf,[Ao]=Ft("Tooltip",[_o]),jo=_o(),Hf="TooltipProvider",h3=700,Pi="tooltip.open",[p3,js]=Ao(Hf),qf=e=>{const{__scopeTooltip:t,delayDuration:n=h3,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=_.useRef(!0),a=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(p3,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:_.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};qf.displayName=Hf;var lr="Tooltip",[m3,xr]=Ao(lr),Kf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=js(lr,e.__scopeTooltip),c=jo(t),[u,f]=_.useState(null),p=Tt(),d=_.useRef(0),x=s??l.disableHoverableContent,m=a??l.delayDuration,y=_.useRef(!1),[g,b]=nn({prop:r,defaultProp:o??!1,onChange:z=>{z?(l.onOpen(),document.dispatchEvent(new CustomEvent(Pi))):l.onClose(),i?.(z)},caller:lr}),k=_.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),S=_.useCallback(()=>{window.clearTimeout(d.current),d.current=0,y.current=!1,b(!0)},[b]),C=_.useCallback(()=>{window.clearTimeout(d.current),d.current=0,b(!1)},[b]),T=_.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{y.current=!0,b(!0),d.current=0},m)},[m,b]);return _.useEffect(()=>()=>{d.current&&(window.clearTimeout(d.current),d.current=0)},[]),h.jsx(Fd,{...c,children:h.jsx(m3,{scope:t,contentId:p,open:g,stateAttribute:k,trigger:u,onTriggerChange:f,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?T():S()},[l.isOpenDelayedRef,T,S]),onTriggerLeave:_.useCallback(()=>{x?C():(window.clearTimeout(d.current),d.current=0)},[C,x]),onOpen:S,onClose:C,disableHoverableContent:x,children:n})})};Kf.displayName=lr;var Ri="TooltipTrigger",Gf=_.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xr(Ri,n),i=js(Ri,n),s=jo(n),a=_.useRef(null),l=Oe(t,a,o.onTriggerChange),c=_.useRef(!1),u=_.useRef(!1),f=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),h.jsx($d,{asChild:!0,...s,children:h.jsx(ke.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:be(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:be(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:be(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:be(e.onBlur,o.onClose),onClick:be(e.onClick,o.onClose)})})});Gf.displayName=Ri;var zs="TooltipPortal",[g3,x3]=Ao(zs,{forceMount:void 0}),Jf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=xr(zs,t);return h.jsx(g3,{scope:t,forceMount:n,children:h.jsx(pt,{present:n||i.open,children:h.jsx(mo,{asChild:!0,container:o,children:r})})})};Jf.displayName=zs;var Rn="TooltipContent",Yf=_.forwardRef((e,t)=>{const n=x3(Rn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=xr(Rn,e.__scopeTooltip);return h.jsx(pt,{present:r||s.open,children:s.disableHoverableContent?h.jsx(Xf,{side:o,...i,ref:t}):h.jsx(y3,{side:o,...i,ref:t})})}),y3=_.forwardRef((e,t)=>{const n=xr(Rn,e.__scopeTooltip),r=js(Rn,e.__scopeTooltip),o=_.useRef(null),i=Oe(t,o),[s,a]=_.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,p=_.useCallback(()=>{a(null),f(!1)},[f]),d=_.useCallback((x,m)=>{const y=x.currentTarget,g={x:x.clientX,y:x.clientY},b=_3(g,y.getBoundingClientRect()),k=k3(g,b),S=S3(m.getBoundingClientRect()),C=E3([...k,...S]);a(C),f(!0)},[f]);return _.useEffect(()=>()=>p(),[p]),_.useEffect(()=>{if(l&&u){const x=y=>d(y,u),m=y=>d(y,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",m)}}},[l,u,d,p]),_.useEffect(()=>{if(s){const x=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},b=l?.contains(y)||u?.contains(y),k=!C3(g,s);b?p():k&&(p(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,s,c,p]),h.jsx(Xf,{...e,ref:i})}),[v3,b3]=Ao(lr,{isInside:!1}),w3=U_("TooltipContent"),Xf=_.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=xr(Rn,n),c=jo(n),{onClose:u}=l;return _.useEffect(()=>(document.addEventListener(Pi,u),()=>document.removeEventListener(Pi,u)),[u]),_.useEffect(()=>{if(l.trigger){const f=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),h.jsx(po,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:h.jsxs(Bd,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(w3,{children:r}),h.jsx(v3,{scope:n,isInside:!0,children:h.jsx(G_,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Yf.displayName=Rn;var Qf="TooltipArrow",eh=_.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=jo(n);return b3(Qf,n).isInside?null:h.jsx(Ud,{...o,...r,ref:t})});eh.displayName=Qf;function _3(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function k3(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function S3(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function C3(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,u=a.y,f=l.x,p=l.y;u>r!=p>r&&n<(f-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function E3(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),T3(t)}function T3(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var N3=qf,A3=Kf,j3=Gf,z3=Jf,I3=Yf,O3=eh;function Il({delayDuration:e=0,...t}){return h.jsx(N3,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function P3({...e}){return h.jsx(A3,{"data-slot":"tooltip",...e})}function R3({...e}){return h.jsx(j3,{"data-slot":"tooltip-trigger",...e})}function D3({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(z3,{children:h.jsxs(I3,{"data-slot":"tooltip-content",sideOffset:t,className:je("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,h.jsx(O3,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function th(e){if(e===null)return"null";if(Array.isArray(e))return"array";switch(typeof e){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"object";case"bigint":case"symbol":case"undefined":case"function":return"object"}}function no(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function M3(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function Is(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=M3(e,t);return[t,cr(n)]}):[]}function Ol(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const Pl=120;function L3({text:e}){const[t,n]=_.useState(!1);return e.length>Pl?h.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?h.jsx("span",{className:"cursor-pointer prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",onClick:o=>{o.stopPropagation(),n(!1)},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),n(!1))},role:"button",tabIndex:0,children:h.jsx(zn,{children:e})}):h.jsxs(P3,{delayDuration:300,children:[h.jsxs(R3,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[h.jsx("span",{children:e.slice(0,Pl)}),h.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),h.jsxs(D3,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):h.jsxs("span",{className:"text-emerald-400 break-all",children:['"',h.jsx("span",{className:"prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",children:h.jsx(zn,{children:e})}),'"']})}function nh({value:e}){if(e===null)return h.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return h.jsx(L3,{text:e});case"number":return h.jsx("span",{className:"text-amber-400",children:e});case"boolean":return h.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return h.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function Rl({value:e}){const[t,n]=_.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return h.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Copy JSON",children:t?h.jsx(dr,{className:"size-3 text-green-500"}):h.jsx(ao,{className:"size-3"})})}function F3({value:e}){const[t,n]=_.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return h.jsx("button",{type:"button",onClick:r,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:"Copy to clipboard",children:t?h.jsx(dr,{className:"size-3 text-green-500"}):h.jsx(ao,{className:"size-3 text-muted-foreground"})})}function $3(e){return no(e)?Is(e).some(([,t])=>no(t)):!1}function B3({allExpanded:e,onClick:t}){return h.jsx("button",{type:"button",onClick:t,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:e?"Collapse all":"Expand all",children:e?h.jsx(py,{className:"size-3.5 text-muted-foreground"}):h.jsx(fy,{className:"size-3.5 text-muted-foreground"})})}function rh({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=_.useState(n<r),[a,l]=_.useState(0),[c,u]=_.useState(null),[f,p]=_.useState(!1),d=no(t),x=th(t),m=x==="array"?"[":"{",y=x==="array"?"]":"}";function g(k){k.stopPropagation(),f?(s(!1),u(0),l(S=>S+1),p(!1)):(s(!0),u(Number.POSITIVE_INFINITY),l(S=>S+1),p(!0))}const b=c??r;return h.jsxs("div",{className:je(n>0&&"border-l border-border/50 ml-2"),children:[h.jsxs("div",{className:je("flex items-start gap-1 py-0.5 px-1 -ml-1 rounded-sm group/row",d&&"cursor-pointer hover:bg-muted/50"),onClick:d?()=>{i&&p(!1),s(!i)}:void 0,onKeyDown:d?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),s(!i))}:void 0,role:d?"button":void 0,tabIndex:d?0:void 0,children:[d?h.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:i?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"})}):h.jsx("span",{className:"w-4 shrink-0"}),h.jsx("span",{className:je("shrink-0",o?"text-muted-foreground":"text-cyan-400"),children:o?e:`"${e}"`}),h.jsx("span",{className:"text-muted-foreground shrink-0",children:d?"":":"}),d?h.jsxs("span",{className:"text-muted-foreground",children:[m,h.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",Ol(t)," ",Ol(t)===1?"item":"items"," ",y]})]}):h.jsx("span",{className:"min-w-0",children:h.jsx(nh,{value:t})}),d&&$3(t)&&h.jsx(B3,{allExpanded:f,onClick:g}),h.jsx(F3,{value:t})]}),d&&i&&h.jsxs("div",{className:"pl-4",children:[Is(t).map(([k,S])=>h.jsx(rh,{name:k,value:S,level:n+1,defaultExpandDepth:b,isArrayItem:x==="array"},k)),h.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:y})]},a)]})}function Os({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!no(e))return h.jsx(Il,{children:h.jsx("div",{className:je("font-mono text-xs leading-relaxed",n),children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(nh,{value:e}),r&&h.jsx(Rl,{value:e})]})})});const s=th(e)==="array";return h.jsx(Il,{children:h.jsxs("div",{className:je("font-mono text-xs leading-relaxed",n),children:[r&&h.jsx(Rl,{value:e}),Is(e).map(([a,l])=>h.jsx(rh,{name:a,value:l,level:0,defaultExpandDepth:t,isArrayItem:s},a))]})})}function Dl({text:e,defaultExpandDepth:t=2,className:n}){try{const r=JSON.parse(e);return h.jsx(Os,{data:cr(r),defaultExpandDepth:t,className:n})}catch{return h.jsx("pre",{className:je("font-mono text-xs whitespace-pre-wrap break-words",n),children:e})}}function cr(e){if(e==null)return null;switch(typeof e){case"string":return e;case"number":return e;case"boolean":return e;case"object":{if(Array.isArray(e))return e.map(n=>cr(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=cr(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function wn({className:e,orientation:t="horizontal",...n}){return h.jsx(c3,{"data-slot":"tabs","data-orientation":t,orientation:t,className:je("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const U3=Ki("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function _n({className:e,variant:t="default",...n}){return h.jsx(u3,{"data-slot":"tabs-list","data-variant":t,className:je(U3({variant:t}),e),...n})}function Ye({className:e,...t}){return h.jsx(d3,{"data-slot":"tabs-trigger",className:je("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Xe({className:e,...t}){return h.jsx(f3,{"data-slot":"tabs-content",className:je("flex-1 outline-none",e),...t})}const Z3=Ki("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function dt({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?$_:"span";return h.jsx(o,{"data-slot":"badge","data-variant":t,className:je(Z3({variant:t}),e),...r})}const V3="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='0%206.603%201192.672%201193.397'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m233.96%20800.215%20234.684-131.678%203.947-11.436-3.947-6.363h-11.436l-39.221-2.416-134.094-3.624-116.296-4.832-112.67-6.04-28.35-6.04-26.577-35.035%202.738-17.477%2023.84-16.027%2034.147%202.98%2075.463%205.155%20113.235%207.812%2082.147%204.832%20121.692%2012.644h19.329l2.738-7.812-6.604-4.832-5.154-4.832-117.182-79.41-126.845-83.92-66.443-48.321-35.92-24.484-18.12-22.953-7.813-50.093%2032.618-35.92%2043.812%202.98%2011.195%202.98%2044.375%2034.147%2094.792%2073.37%20123.786%2091.167%2018.12%2015.06%207.249-5.154.886-3.624-8.135-13.61-67.329-121.692-71.838-123.785-31.974-51.302-8.456-30.765c-2.98-12.645-5.154-23.275-5.154-36.242l37.127-50.416%2020.537-6.604%2049.53%206.604%2020.86%2018.121%2030.765%2070.39%2049.852%20110.818%2077.315%20150.684%2022.631%2044.698%2012.08%2041.396%204.51%2012.645h7.813v-7.248l6.362-84.886%2011.759-104.215%2011.436-134.094%203.946-37.772%2018.685-45.262%2037.127-24.482%2028.994%2013.852%2023.839%2034.148-3.303%2022.067-14.174%2092.134-27.785%20144.323-18.121%2096.644h10.55l12.08-12.08%2048.887-64.913%2082.147-102.685%2036.242-40.752%2042.282-45.02%2027.14-21.423h51.303l37.772%2056.135-16.913%2057.986-52.832%2067.007-43.812%2056.779-62.82%2084.563-39.22%2067.651%203.623%205.396%209.343-.886%20141.906-30.201%2076.671-13.852%2091.49-15.705%2041.396%2019.329%204.51%2019.65-16.269%2040.189-97.852%2024.16-114.764%2022.954-170.9%2040.43-2.093%201.53%202.416%202.98%2076.993%207.248%2032.94%201.771h80.617l150.12%2011.195%2039.222%2025.933%2023.517%2031.732-3.946%2024.16-60.403%2030.766-81.503-19.33-190.228-45.26-65.235-16.27h-9.02v5.397l54.362%2053.154%2099.624%2089.96%20124.752%20115.973%206.362%2028.671-16.027%2022.63-16.912-2.415-109.611-82.47-42.282-37.127-95.758-80.618h-6.363v8.456l22.067%2032.296%20116.537%20175.167%206.04%2053.719-8.456%2017.476-30.201%2010.55-33.181-6.04-68.215-95.758-70.39-107.84-56.778-96.644-6.926%203.947-33.503%20360.886-15.705%2018.443-36.243%2013.852-30.201-22.953-16.027-37.127%2016.027-73.37%2019.329-95.758%2015.704-76.107%2014.175-94.55%208.456-31.41-.563-2.094-6.927.886-71.275%2097.852-108.402%20146.497-85.772%2091.812-20.537%208.134-35.597-18.443%203.301-32.94%2019.893-29.315%20118.712-151.007%2071.597-93.583%2046.228-54.04-.322-7.813h-2.738l-315.302%20204.725-56.135%207.248-24.16-22.63%202.98-37.128%2011.435-12.08%2094.792-65.236-.322.323z'%20fill='%23d97757'/%3e%3c/svg%3e",W3="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='-1%20-.1%20949.1%20959.8'%20width='2474'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m925.8%20456.3c10.4%2023.2%2017%2048%2019.7%2073.3%202.6%2025.3%201.3%2050.9-4.1%2075.8-5.3%2024.9-14.5%2048.8-27.3%2070.8-8.4%2014.7-18.3%2028.5-29.7%2041.2-11.3%2012.6-23.9%2024-37.6%2034-13.8%2010-28.5%2018.4-44.1%2025.3-15.5%206.8-31.7%2012-48.3%2015.4-7.8%2024.2-19.4%2047.1-34.4%2067.7-14.9%2020.6-33%2038.7-53.6%2053.6-20.6%2015-43.4%2026.6-67.6%2034.4-24.2%207.9-49.5%2011.8-75%2011.8-16.9.1-33.9-1.7-50.5-5.1-16.5-3.5-32.7-8.8-48.2-15.7s-30.2-15.5-43.9-25.5c-13.6-10-26.2-21.5-37.4-34.2-25%205.4-50.6%206.7-75.9%204.1-25.3-2.7-50.1-9.3-73.4-19.7-23.2-10.3-44.7-24.3-63.6-41.4s-35-37.1-47.7-59.1c-8.5-14.7-15.5-30.2-20.8-46.3s-8.8-32.7-10.6-49.6c-1.8-16.8-1.7-33.8.1-50.7%201.8-16.8%205.5-33.4%2010.8-49.5-17-18.9-31-40.4-41.4-63.6-10.3-23.3-17-48-19.6-73.3-2.7-25.3-1.3-50.9%204-75.8s14.5-48.8%2027.3-70.8c8.4-14.7%2018.3-28.6%2029.6-41.2s24-24%2037.7-34%2028.5-18.5%2044-25.3c15.6-6.9%2031.8-12%2048.4-15.4%207.8-24.3%2019.4-47.1%2034.3-67.7%2015-20.6%2033.1-38.7%2053.7-53.7%2020.6-14.9%2043.4-26.5%2067.6-34.4%2024.2-7.8%2049.5-11.8%2075-11.7%2016.9-.1%2033.9%201.6%2050.5%205.1s32.8%208.7%2048.3%2015.6c15.5%207%2030.2%2015.5%2043.9%2025.5%2013.7%2010.1%2026.3%2021.5%2037.5%2034.2%2024.9-5.3%2050.5-6.6%2075.8-4s50%209.3%2073.3%2019.6c23.2%2010.4%2044.7%2024.3%2063.6%2041.4%2018.9%2017%2035%2036.9%2047.7%2059%208.5%2014.6%2015.5%2030.1%2020.8%2046.3%205.3%2016.1%208.9%2032.7%2010.6%2049.6%201.8%2016.9%201.8%2033.9-.1%2050.8-1.8%2016.9-5.5%2033.5-10.8%2049.6%2017.1%2018.9%2031%2040.3%2041.4%2063.6zm-333.2%20426.9c21.8-9%2041.6-22.3%2058.3-39s30-36.5%2039-58.4c9-21.8%2013.7-45.2%2013.7-68.8v-223q-.1-.3-.2-.7-.1-.3-.3-.6-.2-.3-.5-.5-.3-.3-.6-.4l-80.7-46.6v269.4c0%202.7-.4%205.5-1.1%208.1-.7%202.7-1.7%205.2-3.1%207.6s-3%204.6-5%206.5a32.1%2032.1%200%200%201%20-6.5%205l-191.1%20110.3c-1.6%201-4.3%202.4-5.7%203.2%207.9%206.7%2016.5%2012.6%2025.5%2017.8%209.1%205.2%2018.5%209.6%2028.3%2013.2%209.8%203.5%2019.9%206.2%2030.1%208%2010.3%201.8%2020.7%202.7%2031.1%202.7%2023.6%200%2047-4.7%2068.8-13.8zm-455.1-151.4c11.9%2020.5%2027.6%2038.3%2046.3%2052.7%2018.8%2014.4%2040.1%2024.9%2062.9%2031s46.6%207.7%2070%204.6%2045.9-10.7%2066.4-22.5l193.2-111.5.5-.5q.2-.2.3-.6.2-.3.3-.6v-94l-233.2%20134.9c-2.4%201.4-4.9%202.4-7.5%203.2-2.7.7-5.4%201-8.2%201-2.7%200-5.4-.3-8.1-1-2.6-.8-5.2-1.8-7.6-3.2l-191.1-110.4c-1.7-1-4.2-2.5-5.6-3.4-1.8%2010.3-2.7%2020.7-2.7%2031.1s1%2020.8%202.8%2031.1c1.8%2010.2%204.6%2020.3%208.1%2030.1%203.6%209.8%208%2019.2%2013.2%2028.2zm-50.2-417c-11.8%2020.5-19.4%2043.1-22.5%2066.5s-1.5%2047.1%204.6%2070c6.1%2022.8%2016.6%2044.1%2031%2062.9%2014.4%2018.7%2032.3%2034.4%2052.7%2046.2l193.1%20111.6q.3.1.7.2h.7q.4%200%20.7-.2.3-.1.6-.3l81-46.8-233.2-134.6c-2.3-1.4-4.5-3.1-6.5-5a32.1%2032.1%200%200%201%20-5-6.5c-1.3-2.4-2.4-4.9-3.1-7.6-.7-2.6-1.1-5.3-1-8.1v-227.1c-9.8%203.6-19.3%208-28.3%2013.2-9%205.3-17.5%2011.3-25.5%2018-7.9%206.7-15.3%2014.1-22%2022.1-6.7%207.9-12.6%2016.5-17.8%2025.5zm663.3%20154.4c2.4%201.4%204.6%203%206.6%205%201.9%201.9%203.6%204.1%205%206.5%201.3%202.4%202.4%205%203.1%207.6.6%202.7%201%205.4.9%208.2v227.1c32.1-11.8%2060.1-32.5%2080.8-59.7%2020.8-27.2%2033.3-59.7%2036.2-93.7s-3.9-68.2-19.7-98.5-39.9-55.5-69.5-72.5l-193.1-111.6q-.3-.1-.7-.2h-.7q-.3.1-.7.2-.3.1-.6.3l-80.6%2046.6%20233.2%20134.7zm80.5-121h-.1v.1zm-.1-.1c5.8-33.6%201.9-68.2-11.3-99.7-13.1-31.5-35-58.6-63-78.2-28-19.5-61-30.7-95.1-32.2-34.2-1.4-68%206.9-97.6%2023.9l-193.1%20111.5q-.3.2-.5.5l-.4.6q-.1.3-.2.7-.1.3-.1.7v93.2l233.2-134.7c2.4-1.4%205-2.4%207.6-3.2%202.7-.7%205.4-1%208.1-1%202.8%200%205.5.3%208.2%201%202.6.8%205.1%201.8%207.5%203.2l191.1%20110.4c1.7%201%204.2%202.4%205.6%203.3zm-505.3-103.2c0-2.7.4-5.4%201.1-8.1.7-2.6%201.7-5.2%203.1-7.6%201.4-2.3%203-4.5%205-6.5%201.9-1.9%204.1-3.6%206.5-4.9l191.1-110.3c1.8-1.1%204.3-2.5%205.7-3.2-26.2-21.9-58.2-35.9-92.1-40.2-33.9-4.4-68.3%201-99.2%2015.5-31%2014.5-57.2%2037.6-75.5%2066.4-18.3%2028.9-28%2062.3-28%2096.5v223q.1.4.2.7.1.3.3.6.2.3.5.6.2.2.6.4l80.7%2046.6zm43.8%20294.7%20103.9%2060%20103.9-60v-119.9l-103.8-60-103.9%2060z'/%3e%3c/svg%3e",H3="data:image/svg+xml,%3csvg%20fill='none'%20height='1320'%20viewBox='3.771%206.973%2023.993%2017.652'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m27.501%208.469c-.252-.123-.36.111-.508.23-.05.04-.093.09-.135.135-.368.395-.797.652-1.358.621-.821-.045-1.521.213-2.14.842-.132-.776-.57-1.238-1.235-1.535-.349-.155-.701-.309-.944-.645-.171-.238-.217-.504-.303-.765-.054-.159-.108-.32-.29-.348-.197-.031-.274.135-.352.273-.31.567-.43%201.192-.419%201.825.028%201.421.628%202.554%201.82%203.36.136.093.17.186.128.321-.081.278-.178.547-.264.824-.054.178-.135.217-.324.14a5.448%205.448%200%200%201%20-1.719-1.169c-.848-.82-1.614-1.726-2.57-2.435-.225-.166-.449-.32-.681-.467-.976-.95.128-1.729.383-1.82.267-.096.093-.428-.77-.424s-1.653.293-2.659.677a2.782%202.782%200%200%201%20-.46.135%209.554%209.554%200%200%200%20-2.853-.1c-1.866.21-3.356%201.092-4.452%202.6-1.315%201.81-1.625%203.87-1.246%206.018.399%202.261%201.552%204.136%203.326%205.601%201.837%201.518%203.955%202.262%206.37%202.12%201.466-.085%203.1-.282%204.942-1.842.465.23.952.322%201.762.392.623.059%201.223-.031%201.687-.127.728-.154.677-.828.414-.953-2.132-.994-1.665-.59-2.09-.916%201.084-1.285%202.717-2.619%203.356-6.94.05-.343.007-.558%200-.837-.004-.168.034-.235.228-.254a4.084%204.084%200%200%200%201.529-.47c1.382-.757%201.938-1.997%202.07-3.485.02-.227-.004-.463-.243-.582zm-12.041%2013.391c-2.067-1.627-3.07-2.162-3.483-2.138-.387.021-.318.465-.233.754.089.285.205.482.368.732.113.166.19.414-.112.598-.666.414-1.823-.139-1.878-.166-1.347-.793-2.473-1.842-3.267-3.276-.765-1.38-1.21-2.861-1.284-4.441-.02-.383.093-.518.472-.586a4.692%204.692%200%200%201%201.514-.04c2.109.31%203.905%201.255%205.41%202.749.86.853%201.51%201.871%202.18%202.865.711%201.057%201.478%202.063%202.454%202.887.343.289.619.51.881.672-.792.088-2.117.107-3.022-.61zm.99-6.38a.304.304%200%201%201%20.609%200c0%20.17-.136.304-.306.304a.3.3%200%200%201%20-.303-.305zm3.077%201.581c-.197.08-.394.15-.584.159a1.246%201.246%200%200%201%20-.79-.252c-.27-.227-.463-.354-.546-.752a1.752%201.752%200%200%201%20.016-.582c.07-.324-.008-.531-.235-.72-.187-.155-.422-.196-.682-.196a.551.551%200%200%201%20-.252-.078c-.108-.055-.197-.19-.112-.356.027-.053.159-.183.19-.207.352-.201.758-.135%201.134.016.349.142.611.404.99.773.388.448.457.573.678.906.174.264.333.534.441.842.066.192-.02.35-.248.448z'%20fill='%234d6bfe'/%3e%3c/svg%3e",q3="/assets/minimax-BPMzvuL-.jpeg",K3="/assets/alibaba-TTwafVwX.svg",G3="/assets/qwen-CONDcHqt.png",J3="/assets/zhipuai-BPNAnxo-.svg",Y3={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function X3(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(Y3))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const dn={width:24,height:24,objectFit:"contain"},Q3=tt.memo(({className:e})=>h.jsx("img",{src:V3,alt:"Anthropic",className:e,style:dn})),e5=tt.memo(({className:e})=>h.jsx("img",{src:W3,alt:"OpenAI",className:e,style:{...dn,background:"white",borderRadius:"4px"}})),t5=tt.memo(({className:e})=>h.jsx("img",{src:H3,alt:"DeepSeek",className:e,style:dn})),n5=tt.memo(({className:e})=>h.jsx("img",{src:q3,alt:"MiniMax",className:e,style:dn})),r5=tt.memo(({className:e})=>h.jsx("img",{src:K3,alt:"Alibaba",className:e,style:dn})),o5=tt.memo(({className:e})=>h.jsx("img",{src:G3,alt:"Qwen",className:e,style:dn})),i5=tt.memo(({className:e})=>h.jsx("img",{src:J3,alt:"ZhipuAI",className:e,style:dn}));function s5({provider:e,className:t}){switch(e){case"anthropic":return h.jsx(Q3,{className:t});case"openai":return h.jsx(e5,{className:t});case"deepseek":return h.jsx(t5,{className:t});case"minimax":return h.jsx(n5,{className:t});case"alibaba":return h.jsx(r5,{className:t});case"qwen":return h.jsx(o5,{className:t});case"zhipuai":return h.jsx(i5,{className:t});case"unknown":return null}}const a5={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function l5(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const Ml={success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",client_error:"bg-amber-500/15 text-amber-400 border-amber-500/25",server_error:"",pending:"bg-muted text-muted-foreground border-border"},c5=_.memo(function({log:t,parsedRequest:n,expanded:r,onToggle:o}){const i=Qc(t.responseStatus),s=t.inputTokens!==null||t.outputTokens!==null,a=n!==null?n.messages.length:null,l=n!==null&&n.tools!==void 0&&n.tools.length>0?n.tools.length:null;return h.jsxs("div",{role:"button",tabIndex:0,className:je("flex items-center gap-2.5 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none"),onClick:o,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())},children:[h.jsxs("span",{className:"text-blue-400/80 font-mono text-xs font-semibold tabular-nums shrink-0",children:["#",t.id]}),t.model!==null&&h.jsxs(h.Fragment,{children:[h.jsx(s5,{provider:X3(t.model),className:"size-4 shrink-0"}),h.jsx(dt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:t.model})]}),h.jsx(dt,{variant:"outline",className:je("text-[10px] px-1.5 py-0 h-5 font-mono",t.apiFormat==="openai"&&"border-blue-500/40 text-blue-400",t.apiFormat==="anthropic"&&"border-orange-500/40 text-orange-400",t.apiFormat==="unknown"&&"border-muted text-muted-foreground"),children:a5[t.apiFormat]??t.apiFormat}),i==="server_error"?h.jsx(dt,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:t.responseStatus}):i==="pending"?h.jsx(dt,{variant:"outline",className:je("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ml[i]),children:h.jsx(Rc,{className:"size-3 animate-spin"})}):h.jsx(dt,{variant:"outline",className:je("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ml[i]),children:t.responseStatus}),t.elapsedMs!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(Hi,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums",children:l5(t.elapsedMs)})]}),s&&h.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[h.jsx(fr,{className:"size-3 text-muted-foreground"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[h.jsxs("span",{className:t.inputTokens!==null?"text-blue-400":"text-muted-foreground",children:["IN ",t.inputTokens!==null?Ke(t.inputTokens):"—"]})," / ",h.jsxs("span",{className:t.outputTokens!==null?"text-amber-400":"text-muted-foreground",children:["OUT ",t.outputTokens!==null?Ke(t.outputTokens):"—"]})]})]}),t.cacheCreationInputTokens!==null&&t.cacheCreationInputTokens>0&&h.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:h.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ke(t.cacheCreationInputTokens)]})}),t.cacheReadInputTokens!==null&&t.cacheReadInputTokens>0&&h.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:h.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ke(t.cacheReadInputTokens)]})}),a!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(Dc,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums",children:a})]}),l!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[h.jsx(yv,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums",children:l})]}),t.origin!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`Origin: ${t.origin}`,children:[h.jsx(Ry,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",title:t.origin,children:t.origin})]}),t.userAgent!==null&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`User-Agent: ${t.userAgent}`,children:[h.jsx(fv,{className:"size-3"}),h.jsx("span",{className:"font-mono tabular-nums truncate max-w-[150px]",title:t.userAgent,children:t.userAgent})]}),(t.clientPid!==null||t.clientProjectFolder!==null)&&h.jsxs("span",{className:"flex items-center gap-1 text-purple-400/80 text-xs shrink-0",title:t.clientCwd!==null?`PID: ${t.clientPid??"?"} | CWD: ${t.clientCwd}`:`PID: ${t.clientPid??"?"}`,children:[h.jsx(zy,{className:"size-3"}),t.clientProjectFolder!==null?h.jsx("span",{className:"font-mono tabular-nums",children:t.clientProjectFolder}):h.jsxs("span",{className:"font-mono tabular-nums",children:["PID ",t.clientPid]})]}),t.streaming&&h.jsx(Jy,{className:"size-3 text-muted-foreground/60 shrink-0"}),h.jsx("span",{className:"flex-1 min-w-0"}),r?h.jsx(At,{className:"size-4 text-muted-foreground shrink-0"}):h.jsx(Wt,{className:"size-4 text-muted-foreground shrink-0"})]})});function oh({...e}){return h.jsx(_S,{"data-slot":"dialog",...e})}function u5({...e}){return h.jsx(kS,{"data-slot":"dialog-trigger",...e})}function d5({...e}){return h.jsx(SS,{"data-slot":"dialog-portal",...e})}function f5({className:e,...t}){return h.jsx(CS,{"data-slot":"dialog-overlay",className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function ih({className:e,children:t,...n}){return h.jsxs(d5,{children:[h.jsx(f5,{}),h.jsxs(ES,{"data-slot":"dialog-content",className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,h.jsxs(NS,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(bv,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function sh({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function ah({className:e,...t}){return h.jsx(TS,{"data-slot":"dialog-title",className:je("text-lg font-semibold leading-none tracking-tight",e),...t})}function lh({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return h.jsx(s3,{"data-slot":"separator",decorative:n,orientation:t,className:je("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Ps({...e}){return h.jsx(ck,{"data-slot":"collapsible",...e})}function Rs({...e}){return h.jsx(Uu,{"data-slot":"collapsible-trigger",...e})}function Ds({...e}){return h.jsx(Zu,{"data-slot":"collapsible-content",...e})}function ch({className:e,children:t,...n}){return h.jsxs(vE,{"data-slot":"scroll-area",className:je("relative",e),...n,children:[h.jsx(bE,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),h.jsx(h5,{}),h.jsx(wE,{})]})}function h5({className:e,orientation:t="vertical",...n}){return h.jsx(Qd,{"data-slot":"scroll-area-scrollbar",orientation:t,className:je("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:h.jsx(rf,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function p5(e){return h.jsx(h.Fragment,{})}function m5({text:e}){const[t,n]=_.useState(!1);return h.jsxs(Ps,{open:t,onOpenChange:n,children:[h.jsxs(Rs,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"}),h.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),h.jsx(Ds,{children:h.jsx("div",{className:"pl-4 pt-1",children:h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:h.jsx(zn,{children:e})})})})]})}function g5({text:e}){return e.includes("<system-reminder>")?h.jsx(m5,{text:e}):h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:h.jsx(zn,{children:e})})}function x5({thinking:e}){const[t,n]=_.useState(!1);return h.jsx(Ps,{open:t,onOpenChange:n,children:h.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[h.jsxs(Rs,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-purple-500/5 transition-colors rounded-r-sm group",children:[h.jsx(iy,{className:"size-3.5 text-purple-400 shrink-0"}),h.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),h.jsxs(dt,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[e.length.toLocaleString()," chars"]}),h.jsx("span",{className:"flex-1"}),t?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"})]}),h.jsx(Ds,{children:h.jsx("div",{className:"px-3 pb-2",children:h.jsx(ch,{className:"max-h-[60vh]",children:h.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function y5({name:e,input:t}){const[n,r]=_.useState(!1);return h.jsx(Ps,{open:n,onOpenChange:r,children:h.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[h.jsxs(Rs,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-blue-500/5 transition-colors rounded-r-sm group",children:[h.jsx(ov,{className:"size-3.5 text-blue-400 shrink-0"}),h.jsx(dt,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:e}),h.jsx("span",{className:"flex-1"}),n?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"})]}),h.jsx(Ds,{children:h.jsx("div",{className:"px-3 pb-2",children:h.jsx(ch,{className:"max-h-[60vh]",children:h.jsx(Os,{data:cr(t),defaultExpandDepth:2})})})})]})})}function v5({block:e}){switch(e.type){case"text":return h.jsx(g5,{text:e.text});case"thinking":return h.jsx(x5,{thinking:e.thinking});case"tool_use":return h.jsx(y5,{name:e.name,input:e.input});default:return p5()}}function b5({response:e}){return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(dt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&h.jsxs(dt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[h.jsx(Oc,{className:"size-2.5"}),e.stop_reason]}),h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[h.jsx(fr,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[Ke(e.usage.input_tokens)," in /"," ",Ke(e.usage.output_tokens)," out"]}),e.usage.cache_creation_input_tokens!==void 0&&e.usage.cache_creation_input_tokens>0&&h.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ke(e.usage.cache_creation_input_tokens)]}),e.usage.cache_read_input_tokens!==void 0&&e.usage.cache_read_input_tokens>0&&h.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ke(e.usage.cache_read_input_tokens)]})]})]}),h.jsx(lh,{className:"opacity-50"}),h.jsxs("div",{className:"space-y-2",children:[e.content.map((t,n)=>h.jsx(v5,{block:t},n)),e.content.length===0&&h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function w5({response:e}){const t=e.choices[0],n=t?.message;return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(dt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),t?.finish_reason!==null&&t?.finish_reason!==void 0&&h.jsxs(dt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[h.jsx(Oc,{className:"size-2.5"}),t.finish_reason]}),h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[h.jsx(fr,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[Ke(e.usage.prompt_tokens)," in /"," ",Ke(e.usage.completion_tokens)," out"]})]})]}),h.jsx(lh,{className:"opacity-50"}),h.jsxs("div",{className:"space-y-2",children:[n?.reasoning_content!==null&&n?.reasoning_content!==void 0&&n.reasoning_content.length>0&&h.jsxs("div",{className:"border border-purple-500/30 rounded-md p-3 bg-purple-500/5",children:[h.jsx("div",{className:"text-xs text-purple-400 font-mono mb-1",children:"thinking"}),h.jsx("div",{className:"text-sm text-purple-200 whitespace-pre-wrap",children:n.reasoning_content})]}),n?.content!==null&&n?.content!==void 0&&n.content.length>0&&h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:h.jsx(zn,{children:n.content})}),n?.function_call!==null&&n?.function_call!==void 0&&h.jsxs("div",{className:"border border-blue-500/30 rounded-md p-3 bg-blue-500/5",children:[h.jsx("div",{className:"text-xs text-blue-400 font-mono mb-1",children:"function_call"}),h.jsxs("div",{className:"font-mono text-xs",children:[h.jsx("span",{className:"text-blue-300",children:n.function_call.name}),h.jsxs("span",{className:"text-muted-foreground",children:["(",n.function_call.arguments,")"]})]})]}),(n?.content===null||n?.content===void 0||n.content.length===0)&&(n?.reasoning_content===null||n?.reasoning_content===void 0||n.reasoning_content.length===0)&&(n?.function_call===null||n?.function_call===void 0)&&h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function _5(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function k5(e,t){return _5(t)?h.jsx(w5,{response:t}):h.jsx(b5,{response:t})}function S5(e){switch(e){case"success":return"text-emerald-400";case"client_error":return"text-amber-400";case"server_error":return"text-red-400";case"pending":return"text-muted-foreground"}}function C5(e,t){try{const n=JSON.parse(e);if(t==="openai"){const o=Px(e);if(o)return o}const r=Nx.safeParse(n);return r.success?r.data:null}catch{return null}}function Xn({status:e}){const t=Qc(e),n=S5(t);return e===null?h.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):h.jsxs("span",{className:je("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&h.jsx(lv,{className:"size-3"}),e]})}function Ll({text:e}){return h.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:h.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:e})})}function E5({text:e}){return h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:h.jsx(zn,{children:e})})}function $r({responseText:e,responseStatus:t,streaming:n,inputTokens:r,outputTokens:o,cacheCreationInputTokens:i,cacheReadInputTokens:s,apiFormat:a,error:l}){if(e===null&&l===void 0)return h.jsxs("div",{className:"flex items-center gap-2 py-3",children:[h.jsx(Xn,{status:t}),h.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]});if(t!==null&&t>=400)return h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xn,{status:t}),h.jsx(Ll,{text:e??""}),l!=null&&h.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[h.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),h.jsx("div",{className:"text-muted-foreground font-mono",children:l})]})]});if(l!=null)return h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xn,{status:t}),h.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[h.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),h.jsx("div",{className:"text-muted-foreground font-mono",children:l})]}),e!==null&&h.jsx("div",{className:"mt-2",children:h.jsx(Ll,{text:e})})]});const u=e!==null?C5(e,a):null;return u!==null?h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xn,{status:t}),k5(a,u)]}):h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Xn,{status:t}),n&&(r!==null||o!==null)&&h.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[h.jsx(fr,{className:"size-3"}),h.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?Ke(r):"—"," in /"," ",o!==null?Ke(o):"—"," out"]}),i!=null&&i>0&&h.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ke(i)]}),s!=null&&s>0&&h.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ke(s)]})]})]}),h.jsx(E5,{text:e??""})]})}const T5=ce({success:yt(),error:re().optional(),responseStatus:ye().optional(),responseText:re().optional(),inputTokens:ye().optional(),outputTokens:ye().optional(),elapsedMs:ye().optional(),streaming:yt().optional()});function N5({log:e,open:t,onOpenChange:n}){const[r,o]=_.useState(()=>e.rawRequestBody??"{}"),[i,s]=_.useState(null),[a,l]=_.useState(!1),[c,u]=_.useState(null);async function f(){l(!0),u(null),s(null);try{const x=await(await fetch(`/api/logs/${e.id}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({modifiedBody:r})})).json(),m=T5.safeParse(x);if(!m.success){u("Invalid response from server"),l(!1);return}const y=m.data;s(y),y.success||u(y.error??"Replay failed")}catch(d){u(d instanceof Error?d.message:"Network error")}finally{l(!1)}}function p(){s(null),u(null),n(!1)}return h.jsx(oh,{open:t,onOpenChange:p,children:h.jsxs(ih,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[h.jsx(sh,{children:h.jsxs(ah,{className:"flex items-center gap-2",children:[h.jsx(Mc,{className:"size-4"}),"Replay Request #",e.id]})}),h.jsxs(wn,{defaultValue:"modified",children:[h.jsxs(_n,{children:[h.jsx(Ye,{value:"modified",children:"Modified Request"}),h.jsx(Ye,{value:"original",children:"Original Response"}),i&&h.jsx(Ye,{value:"replay",children:"Replay Response"})]}),h.jsxs(Xe,{value:"modified",className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Request Body (JSON)"}),h.jsx("textarea",{className:"w-full h-64 p-3 font-mono text-xs bg-muted rounded-md border border-input resize-none focus:outline-none focus:ring-2 focus:ring-ring",value:r,onChange:d=>o(d.target.value),spellCheck:!1})]}),c!==null&&c!==""&&h.jsx("div",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:c}),h.jsx("div",{className:"flex justify-end",children:h.jsx(ft,{onClick:()=>{f()},disabled:a,children:a?"Replaying...":"Replay"})}),i&&i.success&&h.jsxs(wn,{defaultValue:"parsed",children:[h.jsxs(_n,{children:[h.jsx(Ye,{value:"parsed",children:"Parsed Response"}),h.jsx(Ye,{value:"raw",children:"Raw Response"})]}),h.jsx(Xe,{value:"parsed",children:h.jsx($r,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),h.jsx(Xe,{value:"raw",children:h.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText??"No response"})})]})]}),h.jsx(Xe,{value:"original",children:e.responseText!==null?h.jsxs(wn,{defaultValue:"parsed",children:[h.jsxs(_n,{children:[h.jsx(Ye,{value:"parsed",children:"Parsed Response"}),h.jsx(Ye,{value:"raw",children:"Raw Response"})]}),h.jsx(Xe,{value:"parsed",children:h.jsx($r,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat})}),h.jsx(Xe,{value:"raw",children:h.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:e.responseText})})]}):h.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No original response"})}),i&&i.success&&h.jsx(Xe,{value:"replay",children:i.responseText!==null?h.jsxs(wn,{defaultValue:"parsed",children:[h.jsxs(_n,{children:[h.jsx(Ye,{value:"parsed",children:"Parsed Response"}),h.jsx(Ye,{value:"raw",children:"Raw Response"})]}),h.jsx(Xe,{value:"parsed",children:h.jsx($r,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),h.jsx(Xe,{value:"raw",children:h.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText})})]}):h.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No replay response"})})]})]})})}function A5({logId:e,truncated:t}){const[n,r]=_.useState(!1),[o,i]=_.useState({status:"idle"}),[s,a]=_.useState(new Set);_.useEffect(()=>{!n||o.status!=="idle"||(i({status:"loading"}),fetch(`/api/logs/${e}/chunks`).then(f=>f.ok?f.json():Promise.reject(new Error("Chunks not found"))).then(f=>{i({status:"success",chunks:f.chunks})}).catch(()=>{i({status:"error",message:"Chunk data unavailable"})}))},[n,e,o.status]);const l=_.useMemo(()=>{if(o.status!=="success")return[];const f=new Map;for(const p of o.chunks){const d=f.get(p.index);d?d.push(p):f.set(p.index,[p])}return Array.from(f.entries()).map(([p,d])=>({index:p,chunks:d})).sort((p,d)=>p.index-d.index)},[o]),c=f=>{a(p=>{const d=new Set(p);return d.has(f)?d.delete(f):d.add(f),d})};function u(){return o.status==="idle"||o.status==="loading"?h.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[h.jsx(Rc,{className:"size-3 animate-spin"}),h.jsx("span",{children:"Loading chunks..."})]}):o.status==="error"?h.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:o.message}):h.jsxs("div",{className:"p-2 space-y-1",children:[h.jsxs("div",{className:"text-[10px] text-muted-foreground font-mono mb-2",children:[l.length," index group",l.length!==1?"s":""," available"]}),l.map(f=>{const p=s.has(f.index);return h.jsxs("div",{className:"rounded border border-border bg-background",children:[h.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-2 py-1.5 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>c(f.index),children:[p?h.jsx(At,{className:"size-3 text-muted-foreground"}):h.jsx(Wt,{className:"size-3 text-muted-foreground"}),h.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",f.index,"] ",f.chunks[0]?.type??""]}),h.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[f.chunks.length," chunk",f.chunks.length!==1?"s":""]})]}),p&&h.jsx("div",{className:"px-2 pb-2 space-y-1",children:f.chunks.map(d=>h.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",d.timestamp,"ms"]}),h.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:d.type})]}),h.jsx(Os,{data:d,defaultExpandDepth:1,showCopy:!0})]},d.index))})]},f.index)})]})}return h.jsxs("div",{className:"space-y-1",children:[h.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>r(f=>!f),children:[n?h.jsx(At,{className:"size-3"}):h.jsx(Wt,{className:"size-3"}),h.jsx("span",{children:"Raw SSE Events"}),h.jsxs(dt,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[e,t===!0?"+":""]})]}),n===!0?h.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:u()}):null]})}function Fl({text:e,label:t,copied:n,onCopy:r}){return e===null?null:h.jsx("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1 rounded hover:bg-muted",children:n?h.jsxs(h.Fragment,{children:[h.jsx(dr,{className:"size-3 text-green-500"}),h.jsx("span",{className:"text-green-500",children:"Copied!"})]}):h.jsxs(h.Fragment,{children:[h.jsx(ao,{className:"size-3"}),h.jsx("span",{children:t})]})})}const uh=_.memo(function({log:t,viewMode:n="simple"}){const[r,o]=_.useState(!1),[i,s]=_.useState(!1),[a,l]=_.useState(!1),[c,u]=_.useState(!1),f=_.useMemo(()=>Mx(t.rawRequestBody),[t.rawRequestBody]);function p(x){x.stopPropagation(),t.rawRequestBody!==null&&window.navigator.clipboard.writeText(t.rawRequestBody).then(()=>{s(!0),setTimeout(()=>s(!1),2e3)})}function d(x){x.stopPropagation(),t.responseText!==null&&window.navigator.clipboard.writeText(t.responseText).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})}return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:je("border border-border rounded-lg mb-3 overflow-hidden"),children:[h.jsx(c5,{log:t,parsedRequest:f,expanded:r,onToggle:()=>o(!r)}),r&&h.jsx("div",{onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),children:h.jsxs(wn,{defaultValue:"request",children:[h.jsxs(_n,{className:"mx-4 mt-2",children:[n==="full"&&h.jsx(Ye,{value:"raw-headers",children:"Raw Headers"}),n==="full"&&h.jsx(Ye,{value:"headers",children:"Headers"}),h.jsx(Ye,{value:"request",children:"Request"}),n==="full"&&h.jsx(Ye,{value:"raw",children:"Raw Response"}),h.jsx(Ye,{value:"parsed",children:"Parsed Response"})]}),h.jsx(Xe,{value:"request",children:h.jsxs("div",{className:"px-4 py-3",children:[h.jsxs("div",{className:"flex justify-end gap-2 mb-2",children:[h.jsxs(ft,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:x=>{x.stopPropagation(),u(!0)},children:[h.jsx(Mc,{className:"size-3 mr-1"}),"Replay"]}),h.jsx(Fl,{text:t.rawRequestBody,label:"Copy Request",copied:i,onCopy:p})]}),t.rawRequestBody!==null?h.jsx(Dl,{text:t.rawRequestBody,defaultExpandDepth:1}):h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),n==="full"&&h.jsx(Xe,{value:"headers",children:h.jsx("div",{className:"px-4 py-3",children:t.headers&&Object.keys(t.headers).length>0?h.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(t.headers).sort(([x],[m])=>x.localeCompare(m)).map(([x,m])=>h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[x,":"]}),h.jsx("span",{className:"text-muted-foreground truncate",title:m,children:m})]},x))}):h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No headers captured"})})}),n==="full"&&h.jsx(Xe,{value:"raw-headers",children:h.jsx("div",{className:"px-4 py-3",children:t.rawHeaders&&Object.keys(t.rawHeaders).length>0?h.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(t.rawHeaders).sort(([x],[m])=>x.localeCompare(m)).map(([x,m])=>h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[x,":"]}),h.jsx("span",{className:"text-muted-foreground truncate",title:m,children:m})]},x))}):h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No raw headers captured"})})}),h.jsx(Xe,{value:"raw",children:h.jsxs("div",{className:"px-4 py-3 space-y-3",children:[t.error!==void 0&&t.error!==null&&h.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[h.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),h.jsx("div",{className:"text-muted-foreground font-mono",children:t.error})]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(Fl,{text:t.responseText,label:"Copy Response",copied:a,onCopy:d})}),t.responseText!==null?h.jsx(Dl,{text:t.responseText,defaultExpandDepth:1}):h.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No response"}),t.streaming===!0&&h.jsx(A5,{logId:t.id,truncated:t.streamingChunksPath!==null})]})}),h.jsx(Xe,{value:"parsed",children:h.jsx("div",{className:"px-4 py-3",children:h.jsx($r,{responseText:t.responseText,responseStatus:t.responseStatus,streaming:t.streaming,inputTokens:t.inputTokens,outputTokens:t.outputTokens,cacheCreationInputTokens:t.cacheCreationInputTokens,cacheReadInputTokens:t.cacheReadInputTokens,apiFormat:t.apiFormat,error:t.error})})})]})})]}),h.jsx(N5,{log:t,open:c,onOpenChange:u})]})});function j5(e){let t=0,n=0;for(const r of e)r.inputTokens!==null&&(t+=r.inputTokens),r.outputTokens!==null&&(n+=r.outputTokens);return{totalInputTokens:t,totalOutputTokens:n}}const z5=_.memo(function({group:t,viewMode:n="simple"}){const[r,o]=_.useState(!1),i=j5(t.logs),s=t.logs[0]?.timestamp??new Date().toISOString(),a=t.logs[t.logs.length-1]?.timestamp??new Date().toISOString(),l=t.conversationId.startsWith("PID:")||t.conversationId.includes("|")?t.conversationId:t.conversationId.length>24?t.conversationId.slice(0,12)+"…"+t.conversationId.slice(-12):t.conversationId;return h.jsxs("div",{className:"mb-4",children:[h.jsx(xb,{conversationId:l,startTime:s,endTime:a,totalCalls:t.logs.length,totalInputTokens:i.totalInputTokens,totalOutputTokens:i.totalOutputTokens,expanded:r,onToggle:()=>o(!r)}),r&&h.jsx("div",{className:"pl-4 border-l-2 border-muted ml-3",children:t.logs.map(c=>h.jsx(uh,{log:c,viewMode:n},c.id))})]})});function $l({...e}){return h.jsx(WE,{"data-slot":"select",...e})}function Bl({...e}){return h.jsx(qE,{"data-slot":"select-value",...e})}function Ul({className:e,size:t="default",children:n,...r}){return h.jsxs(HE,{"data-slot":"select-trigger","data-size":t,className:je("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(KE,{asChild:!0,children:h.jsx(At,{className:"size-4 opacity-50"})})]})}function Zl({className:e,children:t,position:n="popper",align:r="center",...o}){return h.jsx(GE,{children:h.jsxs(JE,{"data-slot":"select-content",className:je("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...o,children:[h.jsx(I5,{}),h.jsx(YE,{className:je("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),h.jsx(O5,{})]})})}function Rr({className:e,children:t,...n}){return h.jsxs(XE,{"data-slot":"select-item",className:je("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[h.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(e3,{children:h.jsx(dr,{className:"size-4"})})}),h.jsx(QE,{children:t})]})}function I5({className:e,...t}){return h.jsx(t3,{"data-slot":"select-scroll-up-button",className:je("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(uy,{className:"size-4"})})}function O5({className:e,...t}){return h.jsx(n3,{"data-slot":"select-scroll-down-button",className:je("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(At,{className:"size-4"})})}const P5={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function R5(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}function D5(e){return Object.prototype.hasOwnProperty.call(e,"success")}function M5(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function L5(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return h.jsx(Hi,{...t});case"network_unreachable":return h.jsx(pv,{...t});case"connection_refused":return h.jsx(gv,{...t});case"auth_failed":return h.jsx(Uy,{...t});case"rate_limited":return h.jsx(Oy,{...t});case"server_error":return h.jsx(ev,{...t});case"invalid_response":return h.jsx(vy,{...t});case"unknown":return h.jsx(ui,{...t});default:return h.jsx(ui,{...t})}}function Vl({result:e}){if(!D5(e))return M5(e)?h.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[h.jsx(Wy,{className:"size-3"}),h.jsx("span",{children:"Not configured"})]}):h.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[h.jsx(Lc,{className:"size-3 animate-spin"}),h.jsx("span",{children:"Testing..."})]});if(e.success)return h.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 shrink-0",children:[h.jsx(xy,{className:"size-3"}),h.jsx("span",{children:"Connected"})]});const t=e.error,n=t?.message??"Connection failed",r=t?.hint,o=t?.type??"unknown",i=r!==void 0?`${n} — ${r}`:n;return h.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600 shrink-0 max-w-[200px]",title:t?.details??i,children:[L5(o),h.jsx("span",{className:"truncate",children:n})]})}function F5({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,onEdit:o,onDelete:i,onTest:s}){const[a,l]=_.useState(!1),c=e.apiDocsUrl??Object.entries(P5).find(([u])=>e.name.toLowerCase().includes(u))?.[1];return h.jsxs("div",{className:"border rounded-lg p-4 flex flex-col gap-3 bg-card",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsx("div",{className:"flex items-center gap-2 min-w-0",children:h.jsx("span",{className:"font-medium truncate",children:e.model!==void 0&&e.model!==""?`${e.model} (${e.name})`:e.name})}),c!==void 0&&h.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1 text-xs",title:"View API documentation",children:[h.jsx(Cy,{className:"size-3"}),h.jsx("span",{className:"sr-only",children:"Docs"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded flex-1 truncate",children:a?e.apiKey:R5(e.apiKey)}),h.jsx("button",{type:"button",onClick:()=>l(u=>!u),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":a?"Hide API key":"Show API key",children:a?h.jsx(Ty,{className:"size-4"}):h.jsx(Ay,{className:"size-4"})})]}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[h.jsx("span",{className:"font-medium",children:"Anthropic:"})," ",h.jsx("span",{className:"truncate",children:e.anthropicBaseUrl})]}),t&&h.jsx(Vl,{result:t.anthropic.nonStreaming})]}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[h.jsx("span",{className:"font-medium",children:"OpenAI:"})," ",h.jsx("span",{className:"truncate",children:e.openaiBaseUrl})]}),t&&h.jsx(Vl,{result:t.openai.nonStreaming})]}),h.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[s!==void 0&&h.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[h.jsx(Lc,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),h.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>o(e),className:"text-xs h-7 gap-1",children:[h.jsx(qy,{className:"size-3"}),"Edit"]}),h.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>i(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",children:[h.jsx(sv,{className:"size-3"}),"Delete"]})]})]})}const $5={deepseek:{format:"openai",baseUrl:"https://api.deepseek.com"},minimax:{format:"anthropic",baseUrl:"https://api.minimaxi.com/anthropic"},alibaba:{format:"openai",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode"}},Wl=["MiniMax M2.7","MiniMax M2.7-highspeed","MiniMax M2.5","MiniMax M2.5-highspeed","MiniMax M2.1","MiniMax M2.1-highspeed","MiniMax M2"],Hl=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function B5({provider:e,onSubmit:t,onCancel:n}){const[r,o]=_.useState(e?.name??"Provider Name"),[i,s]=_.useState(e?.apiKey??""),[a,l]=_.useState(e?.model??""),[c,u]=_.useState(e?.format??"anthropic"),[f,p]=_.useState(e?.baseUrl??""),[d,x]=_.useState(e?.apiDocsUrl??""),[m,y]=_.useState({}),[g,b]=_.useState(!1),[k,S]=_.useState(!1),C=r.toLowerCase().includes("minimax"),T=r.toLowerCase().includes("alibaba");_.useEffect(()=>{e&&(o(e.name),s(e.apiKey),l(e.model??""),u(e.format??"anthropic"),p(e.baseUrl??""),x(e.apiDocsUrl??""),S(!1))},[e]),_.useEffect(()=>{const M=r.toLowerCase();for(const[B,E]of Object.entries($5))if(M.includes(B)){k||(u(E.format),p(E.baseUrl)),B==="minimax"&&!a&&l(Wl[0]??""),B==="alibaba"&&!a&&l(Hl[0]??"");break}},[r]);function z(){const M={};return r.trim()||(M.name="Name is required"),i.trim()||(M.apiKey="API key is required"),a.trim()||(M.model="Model is required"),f.trim()?P(f.trim())||(M.baseUrl="Invalid URL format"):M.baseUrl="Base URL is required",y(M),Object.keys(M).length===0}function P(M){try{return new URL(M),!0}catch{return!1}}function O(M){if(M.preventDefault(),!!z()){b(!0);try{t({name:r.trim(),apiKey:i.trim(),model:a.trim()||void 0,format:c,baseUrl:f.trim()||void 0,apiDocsUrl:d.trim()||void 0})}finally{b(!1)}}}return h.jsxs("form",{onSubmit:O,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-name",className:"text-sm font-medium",children:["Name ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx("input",{id:"provider-name",type:"text",value:r,onChange:M=>o(M.target.value),placeholder:"Model Name",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.name!==void 0&&h.jsx("p",{className:"text-xs text-destructive",children:m.name})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-apikey",className:"text-sm font-medium",children:["API Key ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx("input",{id:"provider-apikey",type:"password",value:i,onChange:M=>s(M.target.value),placeholder:"sk-ant-...",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.apiKey!==void 0&&h.jsx("p",{className:"text-xs text-destructive",children:m.apiKey})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-model",className:"text-sm font-medium",children:["Model ",h.jsx("span",{className:"text-destructive",children:"*"})]}),C||T?h.jsx("select",{id:"provider-model",value:a,onChange:M=>l(M.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:(C?Wl:Hl).map(M=>h.jsx("option",{value:M,children:M},M))}):h.jsx("input",{id:"provider-model",type:"text",value:a,onChange:M=>l(M.target.value),placeholder:"",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.model!==void 0&&h.jsx("p",{className:"text-xs text-destructive",children:m.model})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-format",className:"text-sm font-medium",children:["API Format ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs("select",{id:"provider-format",value:c,onChange:M=>u(M.target.value==="anthropic"?"anthropic":"openai"),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:[h.jsx("option",{value:"anthropic",children:"Anthropic (/v1/messages)"}),h.jsx("option",{value:"openai",children:"OpenAI (/v1/chat/completions)"})]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:c==="anthropic"?"Use Anthropic format for /v1/messages endpoint":"Use OpenAI format for /v1/chat/completions endpoint"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{htmlFor:"provider-base-url",className:"text-sm font-medium",children:["Base URL ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx("input",{id:"provider-base-url",type:"text",value:f,onChange:M=>{S(!0),p(M.target.value)},placeholder:c==="anthropic"?"https://api.anthropic.com":"https://api.openai.com/v1",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.baseUrl!==void 0&&h.jsx("p",{className:"text-xs text-destructive",children:m.baseUrl}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Base URL for the provider API."})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{htmlFor:"provider-api-docs-url",className:"text-sm font-medium",children:"API Docs URL"}),h.jsx("input",{id:"provider-api-docs-url",type:"text",value:d,onChange:M=>x(M.target.value),placeholder:"https://api.example.com/docs",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional API documentation URL. If not set, uses known provider docs."})]}),h.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[h.jsx(ft,{type:"button",variant:"outline",onClick:n,disabled:g,children:"Cancel"}),h.jsx(ft,{type:"submit",disabled:g,children:g?"Saving...":e?"Update Provider":"Add Provider"})]})]})}function U5({externalProviders:e,externalTestResults:t,externalTestingProviders:n,externalTestingTimeLeft:r,onProvidersMutate:o,onTestResultsChange:i,onTestingProvidersChange:s,onTestingTimeLeftChange:a}){const[l,c]=_.useState(!1),[u,f]=_.useState(),[p,d]=_.useState(null),[x,m]=_.useState({}),[y,g]=_.useState(new Set),[b,k]=_.useState({}),[S,C]=_.useState(null),[T,z]=_.useState(!1),P=e??[],O=t??x,M=n??y,B=r??b,E=a?(R,N)=>a(R,N):(R,N)=>{k(N===void 0?J=>{const Q={...J};return delete Q[R],Q}:J=>({...J,[R]:N}))};_.useEffect(()=>{(async()=>{try{const R=await fetch("/api/config/paths");if(R.ok){const N=await R.json();C(N.providerConfig)}}catch{}})()},[]);const L=30,v=_.useCallback(async R=>{const N={anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}};i?i(R,N):m(X=>({...X,[R]:N})),s?s(R,!0):g(X=>new Set(X).add(R));const J=new AbortController;let Q=L;E(R,Q);const pe=setInterval(()=>{Q--,E(R,Q),Q<=0&&(clearInterval(pe),J.abort())},1e3);try{const X=await fetch(`/api/providers/${R}/test`,{method:"POST",signal:J.signal});if(X.ok){const ae=await X.json();i?i(R,ae):m(de=>({...de,[R]:ae}))}else{const ae={anthropic:{nonStreaming:{success:!1,error:{message:`HTTP ${X.status}: ${X.statusText}`,type:"server_error"}},streaming:{notConfigured:!0}},openai:{nonStreaming:{success:!1,error:{message:`HTTP ${X.status}: ${X.statusText}`,type:"server_error"}},streaming:{notConfigured:!0}}};i?i(R,ae):m(de=>({...de,[R]:ae}))}}catch(X){if(X instanceof Error&&X.name==="AbortError"){const de={anthropic:{nonStreaming:{success:!1,error:{message:"Request timed out",type:"timeout"}},streaming:{notConfigured:!0}},openai:{nonStreaming:{success:!1,error:{message:"Request timed out",type:"timeout"}},streaming:{notConfigured:!0}}};i?i(R,de):m(me=>({...me,[R]:de}))}}finally{clearInterval(pe),E(R,void 0);try{s?s(R,!1):g(X=>{const ae=new Set(X);return ae.delete(R),ae})}catch{}}},[s,i,E]);function D(R){(async()=>{const N={name:R.name,apiKey:R.apiKey,model:R.model,format:R.format,anthropicBaseUrl:R.format==="anthropic"?R.baseUrl:void 0,openaiBaseUrl:R.format==="openai"?R.baseUrl:void 0},J=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(!J.ok){const pe=await J.json();d(pe.error??"Failed to add provider");return}const Q=await J.json();o?.(),c(!1),await v(Q.id)})()}function K(R){u&&(async()=>{const N={name:R.name,apiKey:R.apiKey,model:R.model,format:R.format,anthropicBaseUrl:R.format==="anthropic"?R.baseUrl:void 0,openaiBaseUrl:R.format==="openai"?R.baseUrl:void 0},J=await fetch(`/api/providers/${u.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(!J.ok){const pe=await J.json();d(pe.error??"Failed to update provider");return}const Q=await J.json();o?.(),f(void 0),await v(Q.id)})()}function Z(R){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{const N=await fetch(`/api/providers/${R}`,{method:"DELETE"});if(!N.ok){const J=await N.json();d(J.error??"Failed to delete provider");return}o?.()})()}const W=_.useRef(null);function q(R){const N="/api/providers/export";(async()=>{try{const J=await fetch(N);if(!J.ok){d("Failed to export providers");return}const Q=await J.blob(),pe=URL.createObjectURL(Q),X=document.createElement("a");X.href=pe,X.download=J.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(X),X.click(),document.body.removeChild(X),URL.revokeObjectURL(pe)}catch{d("Failed to export providers")}})()}function A(){W.current?.click()}function U(R){const N=R.target.files?.[0];N&&(async()=>{try{const J=await N.text(),Q=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}),X=ce({success:yt().optional(),imported:ye().optional(),message:re().optional(),errors:Be(re()).optional()}).parse(await Q.json());Q.ok&&X.imported!==void 0&&X.imported>0?(o?.(),d(null)):X.errors&&X.errors.length>0?d(X.errors.join("; ")):d(X.message??"Import failed")}catch{d("Failed to import providers")}R.target.value=""})()}return P.length===0?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading providers..."})}):l||u?h.jsxs("div",{className:"space-y-4",children:[h.jsx("div",{className:"flex items-center justify-between",children:h.jsx("h3",{className:"text-lg font-medium",children:u?"Edit Provider":"Add New Provider"})}),h.jsx(B5,{provider:u,onSubmit:u?K:D,onCancel:()=>{c(!1),f(void 0)}})]}):h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-background pb-2",children:[h.jsx("h3",{className:"text-lg font-medium",children:"Providers"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>q(),className:"gap-1 hover:bg-muted",children:[h.jsx(Pc,{className:"size-3"}),"Export"]}),h.jsxs(ft,{variant:"outline",size:"sm",onClick:A,className:"gap-1 hover:bg-muted",children:[h.jsx(uv,{className:"size-3"}),"Import"]}),h.jsx("input",{type:"file",ref:W,accept:".json",onChange:U,style:{display:"none"}}),h.jsxs(ft,{onClick:()=>c(!0),size:"sm",className:"gap-1",children:[h.jsx(fa,{className:"size-4"}),"Add Provider"]})]})]}),S!==null&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/30 rounded-md px-3 py-2",children:[h.jsx("span",{className:"shrink-0",children:"Config:"}),h.jsx("span",{className:"font-mono truncate",title:S,children:S}),h.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(S).then(()=>{z(!0),setTimeout(()=>z(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:T?h.jsx(dr,{className:"size-3 text-green-500"}):h.jsx(ao,{className:"size-3"})})]}),p!==null&&h.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive bg-destructive/10 rounded-md px-3 py-2",children:[h.jsx(ui,{className:"size-4 shrink-0"}),p]}),P.length===0?h.jsxs("div",{className:"text-center py-12 space-y-3",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured yet."}),h.jsxs(ft,{onClick:()=>c(!0),variant:"outline",size:"sm",children:[h.jsx(fa,{className:"size-4"}),"Add Your First Provider"]})]}):h.jsx("div",{className:"space-y-3",children:P.map(R=>h.jsx(F5,{provider:R,testResults:O[R.id],isTesting:M.has(R.id),testingTimeLeft:B[R.id],onEdit:N=>f(N),onDelete:Z,onTest:N=>{v(N)}},R.id))})]})}async function Z5(e){const n=await(await fetch(e)).json();return Array.isArray(n)?n:[]}function V5(){const e=ph("/api/providers",Z5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function W5(){const[e,t]=_.useState(!1),[n,r]=_.useState("providers"),{providers:o,mutate:i}=V5(),[s,a]=_.useState({}),[l,c]=_.useState(new Set),[u,f]=_.useState({}),p=_.useCallback((m,y)=>{a(g=>({...g,[m]:y}))},[]),d=_.useCallback((m,y)=>{c(g=>{const b=new Set(g);return y?b.add(m):b.delete(m),b})},[]),x=_.useCallback((m,y)=>{f(g=>{if(y===void 0){const b={...g};return delete b[m],b}return{...g,[m]:y}})},[]);return h.jsxs(oh,{open:e,onOpenChange:t,children:[h.jsx(u5,{asChild:!0,children:h.jsxs(ft,{variant:"ghost",size:"icon",className:"size-8",children:[h.jsx(nv,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Settings"})]})}),h.jsxs(ih,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[h.jsx(sh,{children:h.jsx(ah,{children:"Settings"})}),h.jsxs(wn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[h.jsx(_n,{children:h.jsx(Ye,{value:"providers",children:"Providers"})}),h.jsx("div",{className:"mt-4 overflow-y-auto flex-1",children:h.jsx(Xe,{value:"providers",children:h.jsx(U5,{externalProviders:o,externalTestResults:s,externalTestingProviders:l,externalTestingTimeLeft:u,onProvidersMutate:()=>{i()},onTestResultsChange:p,onTestingProvidersChange:d,onTestingTimeLeftChange:x})})})]})]})]})}function H5(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function q5(e){let t=0,n=0;for(const r of e)r.inputTokens!==null&&(t+=r.inputTokens),r.outputTokens!==null&&(n+=r.outputTokens);return{totalIn:t,totalOut:n}}function K5({command:e}){const[t,n]=_.useState(!1),r=_.useCallback(()=>{window.navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},[e]);return h.jsxs("div",{className:"inline-flex items-center gap-2 bg-muted rounded-md px-3 py-2",children:[h.jsx("pre",{className:"text-blue-500 font-mono text-sm m-0",children:e}),h.jsx("button",{type:"button",onClick:r,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 cursor-pointer","aria-label":"Copy command",children:t?h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M20 6 9 17l-5-5"})}):h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),h.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})]})}function G5({logs:e,sessions:t,models:n,selectedSession:r,selectedModel:o,onSessionChange:i,onModelChange:s,onClearAll:a,viewMode:l,onViewModeChange:c}){const{totalIn:u,totalOut:f}=q5(e),[p,d]=_.useState(!0),[x,m]=_.useState(!1),y=_.useCallback(async()=>{m(!0);try{await Ev(e)}finally{m(!1)}},[e]),g=_.useRef(null),b=_.useMemo(()=>vb(e),[e]),k=e.length>0&&p&&!(b.length===1&&b[0]?.logs.length===e.length),S=Xx({count:k?b.length:e.length,getScrollElement:()=>g.current,estimateSize:()=>150,measureElement:typeof window<"u"?C=>C.getBoundingClientRect().height:void 0,overscan:5});return h.jsxs("div",{className:"max-w-[1200px] mx-auto flex flex-col h-screen",style:{maxHeight:"100vh"},children:[h.jsxs("div",{className:"flex items-center gap-4 mb-4 px-6 pt-6",children:[h.jsx("h1",{className:"text-lg font-bold flex-1",children:"LLM Proxy Inspector"}),h.jsxs("span",{className:"text-muted-foreground text-xs font-mono",children:["v",Nv.version]}),h.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[h.jsx("button",{type:"button",onClick:()=>c("simple"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="simple"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Simple"}),h.jsx("button",{type:"button",onClick:()=>c("full"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="full"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Full"})]}),h.jsx(W5,{}),h.jsxs("span",{className:"text-muted-foreground text-xs font-mono",children:[e.length," request",e.length!==1?"s":"",u>0||f>0?` · ${u.toLocaleString()} in / ${f.toLocaleString()} out`:""]}),e.length>0&&h.jsx("button",{type:"button",onClick:()=>{y()},disabled:x,className:"text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-1",title:"Export all logs as JSON ZIP",children:x?h.jsx("span",{children:"Exporting..."}):h.jsxs(h.Fragment,{children:[h.jsx(Pc,{className:"size-3"}),h.jsx("span",{children:"Export All"})]})}),h.jsx("button",{type:"button",onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Clear all logs",children:"Clear All"})]}),h.jsxs("div",{className:"flex gap-3 px-6 mb-4",children:[h.jsxs($l,{value:r,onValueChange:i,children:[h.jsx(Ul,{className:"flex-1 max-w-[400px] text-xs",children:h.jsx(Bl,{placeholder:"All sessions"})}),h.jsxs(Zl,{children:[h.jsx(Rr,{value:"__all__",children:"All sessions"}),t.map(C=>h.jsx(Rr,{value:C,children:H5(C)},C))]})]}),h.jsxs($l,{value:o,onValueChange:s,children:[h.jsx(Ul,{className:"text-xs",children:h.jsx(Bl,{placeholder:"All models"})}),h.jsxs(Zl,{children:[h.jsx(Rr,{value:"__all__",children:"All models"}),n.map(C=>h.jsx(Rr,{value:C,children:C},C))]})]}),h.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[h.jsx("button",{type:"button",onClick:()=>d(!0),className:`px-2 py-1.5 cursor-pointer transition-colors ${p?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grouped view",children:h.jsx(My,{className:"size-4"})}),h.jsx("button",{type:"button",onClick:()=>d(!1),className:`px-2 py-1.5 cursor-pointer transition-colors ${p?"text-muted-foreground hover:bg-muted/50":"bg-muted text-foreground"}`,title:"Flat view",children:h.jsx(Fy,{className:"size-4"})})]})]}),h.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.length===0?h.jsxs("div",{className:"text-center text-muted-foreground py-16 space-y-4",children:[h.jsx("p",{className:"text-sm",children:"No requests captured yet."}),h.jsx("p",{className:"text-xs",children:"Route AI coding tools through the proxy:"}),h.jsx(K5,{command:"LLM_BASE_URL=http://localhost:25947/proxy <your-tool>"})]}):h.jsx("div",{ref:g,className:"overflow-y-auto h-full",children:h.jsx("div",{style:{height:`${S.getTotalSize()}px`,width:"100%",position:"relative"},children:S.getVirtualItems().map(C=>{if(k){const T=b[C.index];return T===void 0?null:h.jsx("div",{"data-index":C.index,ref:S.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${C.start}px)`},children:h.jsx(z5,{group:T,viewMode:l})},T.id)}else{const T=e[C.index];return T===void 0?null:h.jsx("div",{"data-index":C.index,ref:S.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${C.start}px)`},children:h.jsx(uh,{log:T,viewMode:l})},T.id)}})})})})]})}ce({logs:Be(ci),total:ye(),offset:ye(),limit:ye()});const J5=Jt([ce({type:Te("init"),logs:Be(ci)}),ce({type:Te("update"),log:ci})]);function Y5(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function X5(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function Q5(){const[e,t]=_.useState([]),[n,r]=_.useState([]),[o,i]=_.useState([]),[s,a]=_.useState("__all__"),[l,c]=_.useState("__all__"),[u,f]=_.useState("simple"),[p,d]=_.useState(null),x=_.useRef(null),m=_.useRef(null),y=_.useCallback(async()=>{try{const[k,S]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(k.ok&&S.ok){const C=await k.json(),T=await S.json(),z=Be(re()).safeParse(C),P=Be(re()).safeParse(T);z.success&&r(z.data),P.success&&i(P.data)}}catch{}},[]),g=_.useCallback(()=>{x.current&&x.current.close();const k=new URLSearchParams;s!=="__all__"&&k.set("sessionId",s),l!=="__all__"&&k.set("model",l);const S=new EventSource(`/api/logs/stream?${k}`);x.current=S,S.onmessage=C=>{try{const T=String(C.data),z=JSON.parse(T),P=J5.safeParse(z);if(!P.success){d("Failed to parse SSE data");return}const O=P.data;O.type==="init"?(t(O.logs),r(Y5(O.logs)),i(X5(O.logs)),d(null)):O.type==="update"&&(t(M=>{const B=s==="__all__"||O.log.sessionId===s,E=l==="__all__"||O.log.model===l;return!B||!E?M:M.findIndex(v=>v.id===O.log.id)>=0?M.map(v=>v.id===O.log.id?O.log:v):[...M,O.log]}),r(M=>{const B=O.log.sessionId;return B!=null&&B!==""?M.includes(B)?M:[...M,B]:M}),i(M=>{const B=O.log.model;return B!=null&&B!==""?M.includes(B)?M:[...M,B]:M}))}catch{d("Failed to parse SSE data")}},S.onerror=()=>{d("SSE connection lost, reconnecting..."),S.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(g,3e3)},y()},[s,l,y]);_.useEffect(()=>(g(),()=>{x.current&&(x.current.close(),x.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[g]);const b=_.useCallback(()=>{(async()=>{try{if(!(await fetch("/api/logs",{method:"DELETE"})).ok){d("Failed to clear logs");return}t([]),r([]),i([]),d(null)}catch(k){d(k instanceof Error?k.message:"Unknown error clearing logs")}})()},[]);return h.jsxs(h.Fragment,{children:[p!==null&&h.jsx("div",{className:"fixed top-4 right-4 bg-destructive text-destructive-foreground px-4 py-2 rounded-md text-sm z-50",children:p}),h.jsx(G5,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:c,onClearAll:b,viewMode:u,onViewModeChange:f})]})}const nT=Q5;export{nT as component};
|