@tonyclaw/llm-inspector 1.14.3 → 1.14.4

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.
@@ -1,105 +0,0 @@
1
- import{u as Oc,a as gp,r as b,b as xr,c as Cr,g as us,j as c,R as rt,d as Dc,e as xp}from"./main-BcEfx6FM.js";function X(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 u=s.prototype,d=Object.keys(u);for(let h=0;h<d.length;h++){const p=d[h];p in a||(a[p]=u[p].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const u=n?.Parent?new i:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const d of u._zod.deferred)d();return u}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 Tn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Mc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Lc={};function Gt(e){return Lc}function Fc(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 Ci(e,t){return typeof t=="bigint"?t.toString():t}function xo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ds(e){return e==null}function fs(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function yp(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 pa=Symbol("evaluating");function Ae(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==pa)return r===void 0&&(r=pa,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function fn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Qt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ma(e){return JSON.stringify(e)}function bp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $c="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const vp=xo(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Pn(e){if(fr(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(fr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Bc(e){return Pn(e)?{...e}:Array.isArray(e)?[...e]:e}const wp=new Set(["string","number","symbol"]);function On(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function en(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ye(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 kp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _p={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 Sp(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=Qt(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 fn(this,"shape",s),s},checks:[]});return en(e,i)}function Cp(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=Qt(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 fn(this,"shape",s),s},checks:[]});return en(e,i)}function Ep(e,t){if(!Pn(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=Qt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return fn(this,"shape",i),i}});return en(e,o)}function Np(e,t){if(!Pn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Qt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return fn(this,"shape",r),r}});return en(e,n)}function jp(e,t){const n=Qt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return fn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return en(e,n)}function Tp(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=Qt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)l[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return fn(this,"shape",l),l},checks:[]});return en(t,s)}function Ap(e,t,n){const r=Qt(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 fn(this,"shape",i),i}});return en(t,r)}function Cn(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 En(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Er(e){return typeof e=="string"?e:e?.message}function Jt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Er(e.inst?._zod.def?.error?.(e))??Er(t?.error?.(e))??Er(n.customError?.(e))??Er(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function hs(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function hr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Uc=(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,Ci,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zc=X("$ZodError",Uc),Vc=X("$ZodError",Uc,{Parent:Error});function zp(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 Ip(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 ps=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 Tn;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Jt(l,i,Gt())));throw $c(a,o?.callee),a}return s.value},ms=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=>Jt(l,i,Gt())));throw $c(a,o?.callee),a}return s.value},yo=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 Tn;return i.issues.length?{success:!1,error:new(e??Zc)(i.issues.map(s=>Jt(s,o,Gt())))}:{success:!0,data:i.value}},Rp=yo(Vc),bo=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=>Jt(s,o,Gt())))}:{success:!0,data:i.value}},Pp=bo(Vc),Op=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ps(e)(t,n,o)},Dp=e=>(t,n,r)=>ps(e)(t,n,r),Mp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ms(e)(t,n,o)},Lp=e=>async(t,n,r)=>ms(e)(t,n,r),Fp=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yo(e)(t,n,o)},$p=e=>(t,n,r)=>yo(e)(t,n,r),Bp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bo(e)(t,n,o)},Up=e=>async(t,n,r)=>bo(e)(t,n,r),Zp=/^[cC][^\s-]{8,}$/,Vp=/^[0-9a-z]+$/,Wp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Hp=/^[0-9a-vA-V]{20}$/,qp=/^[A-Za-z0-9]{27}$/,Kp=/^[a-zA-Z0-9_-]{21}$/,Gp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Jp=/^([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})$/,ga=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)$/,Yp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Qp(){return new RegExp(Xp,"u")}const em=/^(?:(?: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])$/,tm=/^(([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}|:))$/,nm=/^((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])$/,rm=/^(([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])$/,om=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wc=/^[A-Za-z0-9_-]*$/,im=/^\+[1-9]\d{6,14}$/,Hc="(?:(?:\\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])))",sm=new RegExp(`^${Hc}$`);function qc(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 am(e){return new RegExp(`^${qc(e)}$`)}function lm(e){const t=qc({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(`^${Hc}T(?:${r})$`)}const cm=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},um=/^-?\d+$/,Kc=/^-?\d+(?:\.\d+)?$/,dm=/^(?:true|false)$/i,fm=/^null$/i,hm=/^[^A-Z]*$/,pm=/^[^a-z]*$/,it=X("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Gc={number:"number",bigint:"bigint",object:"date"},Jc=X("$ZodCheckLessThan",(e,t)=>{it.init(e,t);const n=Gc[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})}}),Yc=X("$ZodCheckGreaterThan",(e,t)=>{it.init(e,t);const n=Gc[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})}}),mm=X("$ZodCheckMultipleOf",(e,t)=>{it.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):yp(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})}}),gm=X("$ZodCheckNumberFormat",(e,t)=>{it.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=_p[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=um)}),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})}}),xm=X("$ZodCheckMaxLength",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!ds(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=hs(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ym=X("$ZodCheckMinLength",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!ds(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=hs(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),bm=X("$ZodCheckLengthEquals",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!ds(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=hs(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})}}),vo=X("$ZodCheckStringFormat",(e,t)=>{var n,r;it.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=()=>{})}),vm=X("$ZodCheckRegex",(e,t)=>{vo.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})}}),wm=X("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=hm),vo.init(e,t)}),km=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pm),vo.init(e,t)}),_m=X("$ZodCheckIncludes",(e,t)=>{it.init(e,t);const n=On(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})}}),Sm=X("$ZodCheckStartsWith",(e,t)=>{it.init(e,t);const n=new RegExp(`^${On(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})}}),Cm=X("$ZodCheckEndsWith",(e,t)=>{it.init(e,t);const n=new RegExp(`.*${On(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})}}),Em=X("$ZodCheckOverwrite",(e,t)=>{it.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Nm{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
- `).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 jm={major:4,minor:3,patch:6},Le=X("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jm;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 u=Cn(s),d;for(const h of a){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(u)continue;const p=s.issues.length,f=h._zod.check(s);if(f instanceof Promise&&l?.async===!1)throw new Tn;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(u||(u=Cn(s,p)))});else{if(s.issues.length===p)continue;u||(u=Cn(s,p))}}return d?d.then(()=>s):s},i=(s,a,l)=>{if(Cn(s))return s.aborted=!0,s;const u=o(a,r,l);if(u instanceof Promise){if(l.async===!1)throw new Tn;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,s,a)):i(u,s,a)}const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new Tn;return l.then(u=>o(u,r,a))}return o(l,r,a)}}Ae(e,"~standard",()=>({validate:o=>{try{const i=Rp(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Pp(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),gs=X("$ZodString",(e,t)=>{Le.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??cm(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}}),$e=X("$ZodStringFormat",(e,t)=>{vo.init(e,t),gs.init(e,t)}),Tm=X("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Jp),$e.init(e,t)}),Am=X("$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=ga(r))}else t.pattern??(t.pattern=ga());$e.init(e,t)}),zm=X("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Yp),$e.init(e,t)}),Im=X("$ZodURL",(e,t)=>{$e.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})}}}),Rm=X("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Qp()),$e.init(e,t)}),Pm=X("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Kp),$e.init(e,t)}),Om=X("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zp),$e.init(e,t)}),Dm=X("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Vp),$e.init(e,t)}),Mm=X("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Wp),$e.init(e,t)}),Lm=X("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Hp),$e.init(e,t)}),Fm=X("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=qp),$e.init(e,t)}),$m=X("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=lm(t)),$e.init(e,t)}),Bm=X("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=sm),$e.init(e,t)}),Um=X("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=am(t)),$e.init(e,t)}),Zm=X("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Gp),$e.init(e,t)}),Vm=X("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=em),$e.init(e,t),e._zod.bag.format="ipv4"}),Wm=X("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tm),$e.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})}}}),Hm=X("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=nm),$e.init(e,t)}),qm=X("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rm),$e.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 Xc(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Km=X("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=om),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Xc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Gm(e){if(!Wc.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Xc(n)}const Jm=X("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Wc),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Gm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ym=X("$ZodE164",(e,t)=>{t.pattern??(t.pattern=im),$e.init(e,t)});function Xm(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 Qm=X("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=n=>{Xm(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Qc=X("$ZodNumber",(e,t)=>{Le.init(e,t),e._zod.pattern=e._zod.bag.pattern??Kc,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}}),eg=X("$ZodNumberFormat",(e,t)=>{gm.init(e,t),Qc.init(e,t)}),tg=X("$ZodBoolean",(e,t)=>{Le.init(e,t),e._zod.pattern=dm,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}}),ng=X("$ZodNull",(e,t)=>{Le.init(e,t),e._zod.pattern=fm,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}}),rg=X("$ZodUnknown",(e,t)=>{Le.init(e,t),e._zod.parse=n=>n}),og=X("$ZodNever",(e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function xa(e,t,n){e.issues.length&&t.issues.push(...En(n,e.issues)),t.value[n]=e.value}const ig=X("$ZodArray",(e,t)=>{Le.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(u=>xa(u,n,s))):xa(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Jr(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...En(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function eu(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=kp(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function tu(e,t,n,r,o,i){const s=[],a=o.keySet,l=o.catchall._zod,u=l.def.type,d=l.optout==="optional";for(const h in t){if(a.has(h))continue;if(u==="never"){s.push(h);continue}const p=l.run({value:t[h],issues:[]},r);p instanceof Promise?e.push(p.then(f=>Jr(f,n,h,t,d))):Jr(p,n,h,t,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const sg=X("$ZodObject",(e,t)=>{if(Le.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=xo(()=>eu(t));Ae(e._zod,"propValues",()=>{const a=t.shape,l={};for(const u in a){const d=a[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(const h of d.values)l[u].add(h)}}return l});const o=fr,i=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=r.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const d=[],h=s.shape;for(const p of s.keys){const f=h[p],x=f._zod.optout==="optional",m=f._zod.run({value:u[p],issues:[]},l);m instanceof Promise?d.push(m.then(y=>Jr(y,a,p,u,x))):Jr(m,a,p,u,x)}return i?tu(d,u,a,l,r.value,e):d.length?Promise.all(d).then(()=>a):a}}),ag=X("$ZodObjectJIT",(e,t)=>{sg.init(e,t);const n=e._zod.parse,r=xo(()=>eu(t)),o=p=>{const f=new Nm(["shape","payload","ctx"]),x=r.value,m=_=>{const S=ma(_);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};f.write("const input = payload.value;");const y=Object.create(null);let g=0;for(const _ of x.keys)y[_]=`key_${g++}`;f.write("const newResult = {};");for(const _ of x.keys){const S=y[_],E=ma(_),A=p[_]?._zod?.optout==="optional";f.write(`const ${S} = ${m(_)};`),A?f.write(`
4
- if (${S}.issues.length) {
5
- if (${E} in input) {
6
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
7
- ...iss,
8
- path: iss.path ? [${E}, ...iss.path] : [${E}]
9
- })));
10
- }
11
- }
12
-
13
- if (${S}.value === undefined) {
14
- if (${E} in input) {
15
- newResult[${E}] = undefined;
16
- }
17
- } else {
18
- newResult[${E}] = ${S}.value;
19
- }
20
-
21
- `):f.write(`
22
- if (${S}.issues.length) {
23
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
24
- ...iss,
25
- path: iss.path ? [${E}, ...iss.path] : [${E}]
26
- })));
27
- }
28
-
29
- if (${S}.value === undefined) {
30
- if (${E} in input) {
31
- newResult[${E}] = undefined;
32
- }
33
- } else {
34
- newResult[${E}] = ${S}.value;
35
- }
36
-
37
- `)}f.write("payload.value = newResult;"),f.write("return payload;");const w=f.compile();return(_,S)=>w(p,_,S)};let i;const s=fr,a=!Lc.jitless,u=a&&vp.value,d=t.catchall;let h;e._zod.parse=(p,f)=>{h??(h=r.value);const x=p.value;return s(x)?a&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=o(t.shape)),p=i(p,f),d?tu([],x,p,f,h,e):p):n(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),p)}});function ya(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=>!Cn(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=>Jt(s,r,Gt())))}),t)}const nu=X("$ZodUnion",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ae(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ae(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ae(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=>fs(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 u=l._zod.run({value:o.value,issues:[]},i);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(l=>ya(l,o,e,i)):ya(a,o,e,i)}}),lg=X("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,nu.init(e,t);const n=e._zod.parse;Ae(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 u of l)o[a].add(u)}}return o});const r=xo(()=>{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(!fr(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)}}),cg=X("$ZodIntersection",(e,t)=>{Le.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,u])=>ba(n,l,u)):ba(n,i,s)}});function Ei(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(Pn(e)&&Pn(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=Ei(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=Ei(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 ba(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}),Cn(e))return e;const s=Ei(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 ug=X("$ZodRecord",(e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Pn(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 u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const d=t.valueType._zod.run({value:o[u],issues:[]},r);d instanceof Promise?i.push(d.then(h=>{h.issues.length&&n.issues.push(...En(u,h.issues)),n.value[u]=h.value})):(d.issues.length&&n.issues.push(...En(u,d.issues)),n.value[u]=d.value)}let l;for(const u in o)a.has(u)||(l=l??[],l.push(u));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"&&Kc.test(a)&&l.issues.length){const h=t.keyType._zod.run({value:Number(a),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>Jt(h,r,Gt())),input:a,path:[a],inst:e});continue}const d=t.valueType._zod.run({value:o[a],issues:[]},r);d instanceof Promise?i.push(d.then(h=>{h.issues.length&&n.issues.push(...En(a,h.issues)),n.value[l.value]=h.value})):(d.issues.length&&n.issues.push(...En(a,d.issues)),n.value[l.value]=d.value)}}return i.length?Promise.all(i).then(()=>n):n}}),dg=X("$ZodEnum",(e,t)=>{Le.init(e,t);const n=Fc(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>wp.has(typeof o)).map(o=>typeof o=="string"?On(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}}),fg=X("$ZodLiteral",(e,t)=>{if(Le.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"?On(r):r?On(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}}),hg=X("$ZodTransform",(e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Mc(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 Tn;return n.value=o,n}});function va(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ru=X("$ZodOptional",(e,t)=>{Le.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${fs(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=>va(i,n.value)):va(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),pg=X("$ZodExactOptional",(e,t)=>{ru.init(e,t),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),mg=X("$ZodNullable",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${fs(n.source)}|null)$`):void 0}),Ae(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)}),gg=X("$ZodDefault",(e,t)=>{Le.init(e,t),e._zod.optin="optional",Ae(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=>wa(i,t)):wa(o,t)}});function wa(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const xg=X("$ZodPrefault",(e,t)=>{Le.init(e,t),e._zod.optin="optional",Ae(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))}),yg=X("$ZodNonOptional",(e,t)=>{Le.init(e,t),Ae(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=>ka(i,e)):ka(o,e)}});function ka(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 bg=X("$ZodCatch",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(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=>Jt(s,r,Gt()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Jt(i,r,Gt()))},input:n.value}),n.issues=[]),n)}}),vg=X("$ZodPipe",(e,t)=>{Le.init(e,t),Ae(e._zod,"values",()=>t.in._zod.values),Ae(e._zod,"optin",()=>t.in._zod.optin),Ae(e._zod,"optout",()=>t.out._zod.optout),Ae(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=>Nr(s,t.in,r)):Nr(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Nr(i,t.out,r)):Nr(o,t.out,r)}});function Nr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const wg=X("$ZodReadonly",(e,t)=>{Le.init(e,t),Ae(e._zod,"propValues",()=>t.innerType._zod.propValues),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"optin",()=>t.innerType?._zod?.optin),Ae(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(_a):_a(o)}});function _a(e){return e.value=Object.freeze(e.value),e}const kg=X("$ZodLazy",(e,t)=>{Le.init(e,t),Ae(e._zod,"innerType",()=>t.getter()),Ae(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ae(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ae(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ae(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),_g=X("$ZodCustom",(e,t)=>{it.init(e,t),Le.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=>Sa(i,n,r,e));Sa(o,n,r,e)}});function Sa(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(hr(o))}}var Ca;class Sg{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 Cg(){return new Sg}(Ca=globalThis).__zod_globalRegistry??(Ca.__zod_globalRegistry=Cg());const ar=globalThis.__zod_globalRegistry;function Eg(e,t){return new e({type:"string",...ye(t)})}function Ng(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(t)})}function Ea(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(t)})}function jg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(t)})}function Tg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(t)})}function Ag(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(t)})}function zg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(t)})}function Ig(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ye(t)})}function Rg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(t)})}function Pg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(t)})}function Og(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(t)})}function Dg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(t)})}function Mg(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(t)})}function Lg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ye(t)})}function Fg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(t)})}function $g(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(t)})}function Bg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(t)})}function Ug(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(t)})}function Zg(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(t)})}function Vg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ye(t)})}function Wg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(t)})}function Hg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ye(t)})}function qg(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(t)})}function Kg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(t)})}function Gg(e,t){return new e({type:"string",format:"date",check:"string_format",...ye(t)})}function Jg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ye(t)})}function Yg(e,t){return new e({type:"string",format:"duration",check:"string_format",...ye(t)})}function Xg(e,t){return new e({type:"number",checks:[],...ye(t)})}function Qg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(t)})}function ex(e,t){return new e({type:"boolean",...ye(t)})}function tx(e,t){return new e({type:"null",...ye(t)})}function nx(e){return new e({type:"unknown"})}function rx(e,t){return new e({type:"never",...ye(t)})}function Na(e,t){return new Jc({check:"less_than",...ye(t),value:e,inclusive:!1})}function Ko(e,t){return new Jc({check:"less_than",...ye(t),value:e,inclusive:!0})}function ja(e,t){return new Yc({check:"greater_than",...ye(t),value:e,inclusive:!1})}function Go(e,t){return new Yc({check:"greater_than",...ye(t),value:e,inclusive:!0})}function Ta(e,t){return new mm({check:"multiple_of",...ye(t),value:e})}function ou(e,t){return new xm({check:"max_length",...ye(t),maximum:e})}function Yr(e,t){return new ym({check:"min_length",...ye(t),minimum:e})}function iu(e,t){return new bm({check:"length_equals",...ye(t),length:e})}function ox(e,t){return new vm({check:"string_format",format:"regex",...ye(t),pattern:e})}function ix(e){return new wm({check:"string_format",format:"lowercase",...ye(e)})}function sx(e){return new km({check:"string_format",format:"uppercase",...ye(e)})}function ax(e,t){return new _m({check:"string_format",format:"includes",...ye(t),includes:e})}function lx(e,t){return new Sm({check:"string_format",format:"starts_with",...ye(t),prefix:e})}function cx(e,t){return new Cm({check:"string_format",format:"ends_with",...ye(t),suffix:e})}function Vn(e){return new Em({check:"overwrite",tx:e})}function ux(e){return Vn(t=>t.normalize(e))}function dx(){return Vn(e=>e.trim())}function fx(){return Vn(e=>e.toLowerCase())}function hx(){return Vn(e=>e.toUpperCase())}function px(){return Vn(e=>bp(e))}function mx(e,t,n){return new e({type:"array",element:t,...ye(n)})}function gx(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ye(n)})}function xx(e){const t=yx(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(hr(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(hr(o))}},e(n.value,n)));return t}function yx(e,t){const n=new it({check:"custom",...ye(t)});return n._zod.check=e,n}function su(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??ar,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 d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{const p=s.schema,f=t.processors[o.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);f(e,t,p,d)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),Ve(h,t,d),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Xe(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 au(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 h=e.external.registry.get(s[0])?.id,p=e.external.uri??(x=>x);if(h)return{ref:p(h)};const f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(s[1]===n)return{ref:"#"};const u=`#/${a}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);const d=a.schema;for(const h in d)delete d[h];d.$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
-
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 u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){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 lu(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,u={...l},d=a.ref;if(a.ref=null,d){r(d);const p=e.seen.get(d),f=p.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(f)):Object.assign(l,f),Object.assign(l,u),s._zod.parent===d)for(const m in l)m==="$ref"||m==="allOf"||m in u||delete l[m];if(f.$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 h=s._zod.parent;if(h&&h!==d){r(h);const p=e.seen.get(h);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(const f in l)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(l[f])===JSON.stringify(p.def[f])&&delete l[f]}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:Xr(t,"input",e.processors),output:Xr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Xe(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 Xe(r.element,n);if(r.type==="set")return Xe(r.valueType,n);if(r.type==="lazy")return Xe(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 Xe(r.innerType,n);if(r.type==="intersection")return Xe(r.left,n)||Xe(r.right,n);if(r.type==="record"||r.type==="map")return Xe(r.keyType,n)||Xe(r.valueType,n);if(r.type==="pipe")return Xe(r.in,n)||Xe(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Xe(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Xe(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Xe(o,n))return!0;return!!(r.rest&&Xe(r.rest,n))}return!1}const bx=(e,t={})=>n=>{const r=su({...n,processors:t});return Ve(e,r),au(r,e),lu(r,e)},Xr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=su({...o??{},target:i,io:t,processors:n});return Ve(e,s),au(s,e),lu(s,e)},vx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},wx=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=vx[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),l&&l.size>0){const d=[...l];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},kx=(e,t,n,r)=>{const o=n,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),typeof i=="number"&&(o.minimum=i,typeof d=="number"&&t.target!=="draft-04"&&(d>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof s=="number"&&(o.maximum=s,typeof u=="number"&&t.target!=="draft-04"&&(u<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},_x=(e,t,n,r)=>{n.type="boolean"},Sx=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Cx=(e,t,n,r)=>{n.not={}},Ex=(e,t,n,r)=>{},Nx=(e,t,n,r)=>{const o=e._zod.def,i=Fc(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},jx=(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},Tx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ax=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},zx=(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"]})},Ix=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const u in s)o.properties[u]=Ve(s[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(u=>{const d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.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)},Rx=(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},Px=(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=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l},Ox=(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 d=Ve(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of l)o.patternProperties[h.source]=d}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 u=s._zod.values;if(u){const d=[...u].filter(h=>typeof h=="string"||typeof h=="number");d.length>0&&(o.required=d)}},Dx=(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"}]},Mx=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Lx=(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))},Fx=(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)))},$x=(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},Bx=(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},Ux=(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},cu=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Zx=(e,t,n,r)=>{const o=e._zod.innerType;Ve(o,t,r);const i=t.seen.get(e);i.ref=o},Vx=X("ZodISODateTime",(e,t)=>{$m.init(e,t),Ue.init(e,t)});function Wx(e){return Kg(Vx,e)}const Hx=X("ZodISODate",(e,t)=>{Bm.init(e,t),Ue.init(e,t)});function qx(e){return Gg(Hx,e)}const Kx=X("ZodISOTime",(e,t)=>{Um.init(e,t),Ue.init(e,t)});function Gx(e){return Jg(Kx,e)}const Jx=X("ZodISODuration",(e,t)=>{Zm.init(e,t),Ue.init(e,t)});function Yx(e){return Yg(Jx,e)}const Xx=(e,t)=>{Zc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Ip(e,n)},flatten:{value:n=>zp(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ci,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ci,2)}},isEmpty:{get(){return e.issues.length===0}}})},mt=X("ZodError",Xx,{Parent:Error}),Qx=ps(mt),e0=ms(mt),t0=yo(mt),n0=bo(mt),r0=Op(mt),o0=Dp(mt),i0=Mp(mt),s0=Lp(mt),a0=Fp(mt),l0=$p(mt),c0=Bp(mt),u0=Up(mt),Fe=X("ZodType",(e,t)=>(Le.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Xr(e,"input"),output:Xr(e,"output")}}),e.toJSONSchema=bx(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Qt(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)=>en(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Qx(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>t0(e,n,r),e.parseAsync=async(n,r)=>e0(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>n0(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>r0(e,n,r),e.decode=(n,r)=>o0(e,n,r),e.encodeAsync=async(n,r)=>i0(e,n,r),e.decodeAsync=async(n,r)=>s0(e,n,r),e.safeEncode=(n,r)=>a0(e,n,r),e.safeDecode=(n,r)=>l0(e,n,r),e.safeEncodeAsync=async(n,r)=>c0(e,n,r),e.safeDecodeAsync=async(n,r)=>u0(e,n,r),e.refine=(n,r)=>e.check(sy(n,r)),e.superRefine=n=>e.check(ay(n)),e.overwrite=n=>e.check(Vn(n)),e.optional=()=>Ra(e),e.exactOptional=()=>W0(e),e.nullable=()=>Pa(e),e.nullish=()=>Ra(Pa(e)),e.nonoptional=n=>Y0(e,n),e.array=()=>Oe(e),e.or=n=>Zt([e,n]),e.and=n=>F0(e,n),e.transform=n=>Oa(e,Z0(n)),e.default=n=>K0(e,n),e.prefault=n=>J0(e,n),e.catch=n=>Q0(e,n),e.pipe=n=>Oa(e,n),e.readonly=()=>ny(e),e.describe=n=>{const r=e.clone();return ar.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return ar.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ar.get(e);const r=e.clone();return ar.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),uu=X("_ZodString",(e,t)=>{gs.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>wx(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(ox(...r)),e.includes=(...r)=>e.check(ax(...r)),e.startsWith=(...r)=>e.check(lx(...r)),e.endsWith=(...r)=>e.check(cx(...r)),e.min=(...r)=>e.check(Yr(...r)),e.max=(...r)=>e.check(ou(...r)),e.length=(...r)=>e.check(iu(...r)),e.nonempty=(...r)=>e.check(Yr(1,...r)),e.lowercase=r=>e.check(ix(r)),e.uppercase=r=>e.check(sx(r)),e.trim=()=>e.check(dx()),e.normalize=(...r)=>e.check(ux(...r)),e.toLowerCase=()=>e.check(fx()),e.toUpperCase=()=>e.check(hx()),e.slugify=()=>e.check(px())}),d0=X("ZodString",(e,t)=>{gs.init(e,t),uu.init(e,t),e.email=n=>e.check(Ng(f0,n)),e.url=n=>e.check(Ig(h0,n)),e.jwt=n=>e.check(qg(j0,n)),e.emoji=n=>e.check(Rg(p0,n)),e.guid=n=>e.check(Ea(Aa,n)),e.uuid=n=>e.check(jg(jr,n)),e.uuidv4=n=>e.check(Tg(jr,n)),e.uuidv6=n=>e.check(Ag(jr,n)),e.uuidv7=n=>e.check(zg(jr,n)),e.nanoid=n=>e.check(Pg(m0,n)),e.guid=n=>e.check(Ea(Aa,n)),e.cuid=n=>e.check(Og(g0,n)),e.cuid2=n=>e.check(Dg(x0,n)),e.ulid=n=>e.check(Mg(y0,n)),e.base64=n=>e.check(Vg(C0,n)),e.base64url=n=>e.check(Wg(E0,n)),e.xid=n=>e.check(Lg(b0,n)),e.ksuid=n=>e.check(Fg(v0,n)),e.ipv4=n=>e.check($g(w0,n)),e.ipv6=n=>e.check(Bg(k0,n)),e.cidrv4=n=>e.check(Ug(_0,n)),e.cidrv6=n=>e.check(Zg(S0,n)),e.e164=n=>e.check(Hg(N0,n)),e.datetime=n=>e.check(Wx(n)),e.date=n=>e.check(qx(n)),e.time=n=>e.check(Gx(n)),e.duration=n=>e.check(Yx(n))});function J(e){return Eg(d0,e)}const Ue=X("ZodStringFormat",(e,t)=>{$e.init(e,t),uu.init(e,t)}),f0=X("ZodEmail",(e,t)=>{zm.init(e,t),Ue.init(e,t)}),Aa=X("ZodGUID",(e,t)=>{Tm.init(e,t),Ue.init(e,t)}),jr=X("ZodUUID",(e,t)=>{Am.init(e,t),Ue.init(e,t)}),h0=X("ZodURL",(e,t)=>{Im.init(e,t),Ue.init(e,t)}),p0=X("ZodEmoji",(e,t)=>{Rm.init(e,t),Ue.init(e,t)}),m0=X("ZodNanoID",(e,t)=>{Pm.init(e,t),Ue.init(e,t)}),g0=X("ZodCUID",(e,t)=>{Om.init(e,t),Ue.init(e,t)}),x0=X("ZodCUID2",(e,t)=>{Dm.init(e,t),Ue.init(e,t)}),y0=X("ZodULID",(e,t)=>{Mm.init(e,t),Ue.init(e,t)}),b0=X("ZodXID",(e,t)=>{Lm.init(e,t),Ue.init(e,t)}),v0=X("ZodKSUID",(e,t)=>{Fm.init(e,t),Ue.init(e,t)}),w0=X("ZodIPv4",(e,t)=>{Vm.init(e,t),Ue.init(e,t)}),k0=X("ZodIPv6",(e,t)=>{Wm.init(e,t),Ue.init(e,t)}),_0=X("ZodCIDRv4",(e,t)=>{Hm.init(e,t),Ue.init(e,t)}),S0=X("ZodCIDRv6",(e,t)=>{qm.init(e,t),Ue.init(e,t)}),C0=X("ZodBase64",(e,t)=>{Km.init(e,t),Ue.init(e,t)}),E0=X("ZodBase64URL",(e,t)=>{Jm.init(e,t),Ue.init(e,t)}),N0=X("ZodE164",(e,t)=>{Ym.init(e,t),Ue.init(e,t)}),j0=X("ZodJWT",(e,t)=>{Qm.init(e,t),Ue.init(e,t)}),du=X("ZodNumber",(e,t)=>{Qc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>kx(e,r,o),e.gt=(r,o)=>e.check(ja(r,o)),e.gte=(r,o)=>e.check(Go(r,o)),e.min=(r,o)=>e.check(Go(r,o)),e.lt=(r,o)=>e.check(Na(r,o)),e.lte=(r,o)=>e.check(Ko(r,o)),e.max=(r,o)=>e.check(Ko(r,o)),e.int=r=>e.check(za(r)),e.safe=r=>e.check(za(r)),e.positive=r=>e.check(ja(0,r)),e.nonnegative=r=>e.check(Go(0,r)),e.negative=r=>e.check(Na(0,r)),e.nonpositive=r=>e.check(Ko(0,r)),e.multipleOf=(r,o)=>e.check(Ta(r,o)),e.step=(r,o)=>e.check(Ta(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 ve(e){return Xg(du,e)}const T0=X("ZodNumberFormat",(e,t)=>{eg.init(e,t),du.init(e,t)});function za(e){return Qg(T0,e)}const A0=X("ZodBoolean",(e,t)=>{tg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_x(e,n,r)});function tt(e){return ex(A0,e)}const z0=X("ZodNull",(e,t)=>{ng.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sx(e,n,r)});function Ni(e){return tx(z0,e)}const I0=X("ZodUnknown",(e,t)=>{rg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ex()});function Ia(){return nx(I0)}const R0=X("ZodNever",(e,t)=>{og.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cx(e,n,r)});function P0(e){return rx(R0,e)}const O0=X("ZodArray",(e,t)=>{ig.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zx(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Yr(n,r)),e.nonempty=n=>e.check(Yr(1,n)),e.max=(n,r)=>e.check(ou(n,r)),e.length=(n,r)=>e.check(iu(n,r)),e.unwrap=()=>e.element});function Oe(e,t){return mx(O0,e,t)}const D0=X("ZodObject",(e,t)=>{ag.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ix(e,n,r,o),Ae(e,"shape",()=>t.shape),e.keyof=()=>wt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ia()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ia()}),e.strict=()=>e.clone({...e._zod.def,catchall:P0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Ep(e,n),e.safeExtend=n=>Np(e,n),e.merge=n=>jp(e,n),e.pick=n=>Sp(e,n),e.omit=n=>Cp(e,n),e.partial=(...n)=>Tp(hu,e,n[0]),e.required=(...n)=>Ap(pu,e,n[0])});function se(e,t){const n={type:"object",shape:e??{},...ye(t)};return new D0(n)}const fu=X("ZodUnion",(e,t)=>{nu.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rx(e,n,r,o),e.options=t.options});function Zt(e,t){return new fu({type:"union",options:e,...ye(t)})}const M0=X("ZodDiscriminatedUnion",(e,t)=>{fu.init(e,t),lg.init(e,t)});function hn(e,t,n){return new M0({type:"union",options:t,discriminator:e,...ye(n)})}const L0=X("ZodIntersection",(e,t)=>{cg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Px(e,n,r,o)});function F0(e,t){return new L0({type:"intersection",left:e,right:t})}const $0=X("ZodRecord",(e,t)=>{ug.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ox(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function $t(e,t,n){return new $0({type:"record",keyType:e,valueType:t,...ye(n)})}const ji=X("ZodEnum",(e,t)=>{dg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Nx(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 ji({...t,checks:[],...ye(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 ji({...t,checks:[],...ye(o),entries:i})}});function wt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ji({type:"enum",entries:n,...ye(t)})}const B0=X("ZodLiteral",(e,t)=>{fg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jx(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 Ce(e,t){return new B0({type:"literal",values:Array.isArray(e)?e:[e],...ye(t)})}const U0=X("ZodTransform",(e,t)=>{hg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ax(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Mc(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(hr(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(hr(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function Z0(e){return new U0({type:"transform",transform:e})}const hu=X("ZodOptional",(e,t)=>{ru.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cu(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ra(e){return new hu({type:"optional",innerType:e})}const V0=X("ZodExactOptional",(e,t)=>{pg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cu(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function W0(e){return new V0({type:"optional",innerType:e})}const H0=X("ZodNullable",(e,t)=>{mg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Pa(e){return new H0({type:"nullable",innerType:e})}const q0=X("ZodDefault",(e,t)=>{gg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function K0(e,t){return new q0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Bc(t)}})}const G0=X("ZodPrefault",(e,t)=>{xg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function J0(e,t){return new G0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Bc(t)}})}const pu=X("ZodNonOptional",(e,t)=>{yg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Y0(e,t){return new pu({type:"nonoptional",innerType:e,...ye(t)})}const X0=X("ZodCatch",(e,t)=>{bg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$x(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Q0(e,t){return new X0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ey=X("ZodPipe",(e,t)=>{vg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bx(e,n,r,o),e.in=t.in,e.out=t.out});function Oa(e,t){return new ey({type:"pipe",in:e,out:t})}const ty=X("ZodReadonly",(e,t)=>{wg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ux(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ny(e){return new ty({type:"readonly",innerType:e})}const ry=X("ZodLazy",(e,t)=>{kg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zx(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function oy(e){return new ry({type:"lazy",getter:e})}const iy=X("ZodCustom",(e,t)=>{_g.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tx(e,n)});function sy(e,t={}){return gx(iy,e,t)}function ay(e){return xx(e)}const Dn=oy(()=>Zt([J(),ve(),tt(),Ni(),Oe(Dn),$t(J(),Dn)])),xs=se({type:J(),ttl:J().optional(),scope:J().optional()}),ys=se({type:Ce("text"),text:J(),cache_control:xs.optional()}),mu=se({type:Ce("thinking"),thinking:J(),signature:J().optional()}),ly=se({type:Ce("think"),thinking:J(),signature:J().optional()}),cy=se({type:Ce("base64"),media_type:J(),data:J()}),gu=se({type:Ce("image"),source:cy}),xu=se({type:Ce("tool_use"),id:J(),name:J(),input:$t(J(),Dn)}),uy=hn("type",[ys,gu]),dy=se({type:Ce("tool_result"),tool_use_id:J().optional(),content:Zt([J(),Oe(uy)]),is_error:tt().optional()}),fy=hn("type",[ys,mu,gu,xu,dy]),hy=Zt([J(),Oe(fy)]),py=se({role:wt(["user","assistant"]),content:hy}),my=se({type:Ce("text"),text:J(),cache_control:xs.optional()}),gy=se({type:J(),properties:$t(J(),$t(J(),Dn)).optional(),required:Oe(J()).optional(),additionalProperties:tt().optional(),$schema:J().optional()}),xy=se({name:J(),description:J().optional(),input_schema:gy.optional(),cache_control:xs.optional()}),yy=hn("type",[se({type:Ce("enabled"),budget_tokens:ve()}),se({type:Ce("disabled")}),se({type:Ce("adaptive")})]),by=se({model:J(),messages:Oe(py),system:Oe(my).optional(),tools:Oe(xy).optional(),max_tokens:ve().optional(),temperature:ve().optional(),stream:tt().optional(),thinking:yy.optional(),metadata:se({user_id:J().optional()}).optional()}),bs=hn("type",[ys,mu,ly,xu]),vy=se({input_tokens:ve().nullable().optional(),output_tokens:ve().nullable().optional(),cache_creation_input_tokens:ve().nullable().optional(),cache_read_input_tokens:ve().nullable().optional()}).passthrough(),wy=se({id:J(),type:Ce("message"),model:J(),role:Ce("assistant"),content:Oe(bs),stop_reason:J().nullable(),stop_sequence:J().nullable().optional(),usage:vy}).passthrough(),ky=se({type:Ce("message_start"),message:se({id:J(),type:Ce("message"),model:J(),role:Ce("assistant"),content:Oe(bs),stop_reason:Ni(),stop_sequence:Ni(),usage:se({input_tokens:ve(),cache_creation_input_tokens:ve().optional(),cache_read_input_tokens:ve().optional()}).passthrough()})}),_y=se({type:Ce("content_block_start"),index:ve(),content_block:bs}),Sy=hn("type",[se({type:Ce("text_delta"),text:J()}),se({type:Ce("input_json_delta"),partial_json:J()}),se({type:Ce("thinking_delta"),thinking:J()}),se({type:Ce("signature_delta"),signature:J()})]),Cy=se({type:Ce("content_block_delta"),index:ve(),delta:Sy}),Ey=se({type:Ce("content_block_stop"),index:ve()}),Ny=se({type:Ce("message_delta"),delta:se({stop_reason:J().nullable(),stop_sequence:J().nullable().optional()}),usage:se({output_tokens:ve(),input_tokens:ve().optional(),cache_creation_input_tokens:ve().optional(),cache_read_input_tokens:ve().optional()}).passthrough()}),jy=se({type:Ce("message_stop")}),Ty=se({type:Ce("ping")}),Ay=se({type:Ce("error"),error:se({type:J(),message:J()})});hn("type",[ky,_y,Cy,Ey,Ny,jy,Ty,Ay]);const zy=by,Iy=wy,Ry=Zt([J(),Oe(hn("type",[se({type:Ce("text"),text:J()}),se({type:Ce("image_url"),image_url:se({url:J(),detail:J().optional()})})]))]),yu=se({role:wt(["system","user","assistant","tool"]),content:Ry,name:J().optional(),reasoning_content:J().optional(),thinking:J().optional(),think:J().optional()}),Py=se({name:J(),arguments:J()}),bu=se({index:ve().optional(),id:J().optional(),type:Ce("function").optional(),function:se({name:J().optional(),arguments:J().optional()})});yu.extend({content:Zt([J(),Oe(se({type:Ce("text"),text:J()}))]).optional(),function_call:Py.optional(),tool_calls:Oe(bu).optional()});const Oy=se({type:Ce("function"),function:se({name:J(),description:J().optional(),parameters:$t(J(),Dn)})});se({model:J(),messages:Oe(yu),temperature:ve().optional(),max_tokens:ve().optional(),stream:tt().optional(),tools:Oe(Oy).optional(),tool_choice:Zt([se({type:Ce("auto")}),se({type:Ce("none")}),se({type:Ce("function"),function:se({name:J()})})]).optional(),user:J().optional()});const vu=se({role:wt(["assistant"]).optional(),content:J().nullable().optional(),reasoning_content:J().nullable().optional(),thinking:J().nullable().optional(),think:J().nullable().optional(),function_call:se({name:J().optional(),arguments:J().optional()}).nullable().optional(),tool_calls:Oe(se({index:ve(),id:J().optional(),type:Ce("function").optional(),function:se({name:J().optional(),arguments:J().optional()})})).nullable().optional()}),Dy=se({index:ve(),message:se({role:wt(["assistant"]),content:J().nullable(),reasoning_content:J().optional(),thinking:J().optional(),think:J().optional(),function_call:se({name:J(),arguments:J()}).nullable().optional(),tool_calls:Oe(bu).optional()}).optional(),delta:vu.optional(),finish_reason:J().nullable()}),My=se({id:J(),object:Ce("chat.completion"),created:ve(),model:J(),choices:Oe(Dy),usage:se({prompt_tokens:ve().nullable().optional(),completion_tokens:ve().nullable().optional(),total_tokens:ve().nullable().optional()}).passthrough(),service_tier:J().nullable().optional(),system_fingerprint:J().nullable().optional()}).passthrough();se({id:J(),object:Ce("chat.completion.chunk"),created:ve(),model:J(),choices:Oe(se({index:ve(),delta:vu,finish_reason:J().nullable().optional()})),usage:se({prompt_tokens:ve().nullable().optional(),completion_tokens:ve().nullable().optional(),total_tokens:ve().nullable().optional()}).passthrough().nullable().optional()}).passthrough();function Ly(e){try{const t=JSON.parse(e),n=My.safeParse(t);return n.success?n.data:null}catch{return null}}const wu=se({index:ve(),timestamp:ve(),type:J(),data:Dn}),Fy=se({chunks:Oe(wu),truncated:tt().optional().default(!1)}),Ti=se({id:ve(),timestamp:J(),method:J(),path:J(),model:J().nullable(),sessionId:J().nullable(),rawRequestBody:J().nullable(),responseStatus:ve().nullable(),responseText:J().nullable(),inputTokens:ve().nullable(),outputTokens:ve().nullable(),cacheCreationInputTokens:ve().nullable(),cacheReadInputTokens:ve().nullable(),elapsedMs:ve().nullable(),streaming:tt(),userAgent:J().nullable(),origin:J().nullable(),rawHeaders:$t(J(),J()).optional(),headers:$t(J(),J()).optional(),apiFormat:wt(["anthropic","openai","unknown"]).default("unknown"),isTest:tt().optional().default(!1),providerName:J().nullable().optional(),clientPort:ve().nullable().optional(),clientPid:ve().nullable().optional(),clientCwd:J().nullable().optional(),clientProjectFolder:J().nullable().optional(),streamingChunks:Fy.optional(),streamingChunksPath:J().nullable().optional(),error:J().nullable().optional()});se({model:J()});se({model:J().optional(),metadata:se({user_id:J().optional()}).passthrough().optional()});function Ai(e){if(e===null)return null;try{const t=JSON.parse(e),n=zy.safeParse(t);return n.success?n.data:null}catch{return null}}const $y=se({error:J()});async function Sn(e,t){const n=await e.json();return t.parse(n)}async function Zr(e,t){try{const n=await e.json(),r=$y.safeParse(n);return r.success?r.data.error:t}catch{return t}}async function vs(e,t,n,r){const o=await fetch(e,n);if(!o.ok){const i=r?.(o)??`Request failed with status ${o.status}`;throw new Error(await Zr(o,i))}return Sn(o,t)}const ku=se({stripClaudeCodeBillingHeader:tt()}),zi="/api/config";async function By(e){return vs(e,ku,void 0,t=>`Failed to fetch ${e}: ${t.status}`)}async function Uy(e){return vs(zi,ku,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)},t=>`PATCH failed with status ${t.status}`)}function _u(){const e=Oc(zi,By,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=gp(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=async o=>{await t(zi,Uy({stripClaudeCodeBillingHeader:o}),{optimisticData:{stripClaudeCodeBillingHeader:o},rollbackOnError:!0,revalidate:!1})};return{strip:n,isLoading:e.isLoading,isError:e.error!==void 0,setStrip:r}}function Zy(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 u=o[l];if(!u){const d=t[l*2];u=o[l]={index:l,key:n(l),start:d,size:t[l*2+1],end:d+t[l*2+1],lane:0}}return u}}if(i==="length")return e}return Reflect.get(o,i,s)}})}function xn(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){const a=e();return(a.length!==r.length||a.some((u,d)=>r[d]!==u))&&(r=a,o=t(...a),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1),o}return s.updateDeps=a=>{r=a},s}function Da(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Ma=(e,t)=>Math.abs(e-t)<1.01,Vy=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let Qn;const La=()=>{if(Qn!==void 0)return Qn;if(typeof navigator>"u")return Qn=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Qn=!0;const e=navigator.maxTouchPoints;return Qn=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Fa=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Wy=e=>e,Hy=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},qy=(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(Fa(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){o({width:u.inlineSize,height:u.blockSize});return}}o(Fa(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Qr={passive:!0},Ky=typeof window>"u"?!0:"onscrollend"in window,Gy=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&Ky;let s=0;const a=i?null:Vy(o,()=>t(s,!1),e.options.isScrollingResetDelay),l=h=>()=>{s=n(r),a?.(),t(s,h)},u=l(!0),d=l(!1);return r.addEventListener("scroll",u,Qr),i&&r.addEventListener("scrollend",d,Qr),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",d)}},Jy=(e,t)=>Gy(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),Yy=(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"]},Xy=(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})},Qy=Xy;class eb{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[u,d]of this.elementsCache)if(d===a){this.elementsCache.delete(u);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:Wy,rangeExtractor:Hy,onChange:()=>{},measureElement:Yy,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 u in n){const d=n[u];d!==void 0&&(i[u]=d)}const s=this.options;let a=null,l=null;if(s!==void 0&&s.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const u=s.count,d=i.count,h=this.getMeasurements(),p=u>0?((r=h[0])==null?void 0:r.key)??s.getItemKey(0):null,f=u>0?((o=h[u-1])==null?void 0:o.key)??s.getItemKey(u-1):null;if(d!==u||u>0&&d>0&&(i.getItemKey(0)!==p||i.getItemKey(d-1)!==f)){const y=u>0?this.getVirtualItemForOffset(this.getScrollOffset())??h[0]:null;y&&(a=[y.key,this.getScrollOffset()-y.start]);const g=i.followOnAppend===!0?"auto":i.followOnAppend||null;g&&d>u&&this.isAtEnd(s.scrollEndThreshold)&&(u===0||i.getItemKey(d-1)!==f)&&(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=xn(()=>(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,Qr),i.addEventListener("touchend",a,Qr),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:u}=this.options;let d=0;for(;d<l&&u(d)!==i;)d++;const h=d<l?this.getMeasurements()[d]:void 0;if(h){const p=h.start+s-this.getScrollOffset();Ma(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=xn(()=>[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=xn(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l},u)=>{const d=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 h=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 _=new Float64Array(m);y&&h>0&&_.set(y.subarray(0,h*2)),y=_,this._flatMeasurements=y}let g;if(h===0)g=r+o;else{const _=h-1;g=y[_*2]+y[_*2+1]+x}for(let _=h;_<n;_++){const S=i(_),E=d.get(S),C=typeof E=="number"?E:this.options.estimateSize(_);y[_*2]=g,y[_*2+1]=C,g+=C+x}const w=Zy(n,y,i);return this.measurementsCache=w,w}const p=this.measurementsCache.slice(0,h),f=new Array(a).fill(void 0);for(let x=0;x<h;x++){const m=p[x];m&&(f[m.lane]=x)}for(let x=h;x<n;x++){const m=i(x),y=this.laneAssignments.get(x);let g,w;const _=l==="estimate"||d.has(m);if(y!==void 0&&this.options.lanes>1){g=y;const A=f[g],I=A!==void 0?p[A]:void 0;w=I?I.end+this.options.gap:r+o}else{const A=this.options.lanes===1?p[x-1]:this.getFurthestMeasurement(p,x);w=A?A.end+this.options.gap:r+o,g=A?A.lane:x%this.options.lanes,this.options.lanes>1&&_&&this.laneAssignments.set(x,g)}const S=d.get(m),E=typeof S=="number"?S:this.options.estimateSize(x),C=w+E;p[x]={index:x,start:w,size:E,end:C,key:m,lane:g},f[g]=x}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=xn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?tb({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=xn(()=>{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 u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(n),a=u[n*2],s=u[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;l=p.key,a=p.start,s=p.size}const d=this.itemSizeCache.get(l)??s,h=r-d;if(h!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,f=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},h,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()-f):x&&this.applyScrollAdjustment(h),this.notify(!1)}},this.getVirtualItems=xn(()=>[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=Su(0,r.length-1,i?a=>o[a*2]:a=>Da(r[a]).start,n);return Da(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&&Ma(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()),u=this.scrollState.behavior==="smooth"&&l>a;this.scrollState.lastTargetOffset=o,u||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const Su=(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 tb({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const i=e.length-1,s=o?d=>o[d*2]:d=>e[d].start,a=o?d=>o[d*2]+o[d*2+1]:d=>e[d].end;if(e.length<=r)return{startIndex:0,endIndex:i};let l=Su(0,i,s,n),u=l;if(r===1)for(;u<i&&a(u)<n+t;)u++;else if(r>1){const d=Array(r).fill(0);for(;u<i&&d.some(p=>p<n+t);){const p=e[u];d[p.lane]=p.end,u++}const h=Array(r).fill(n+t);for(;l>=0&&h.some(p=>p>=n);){const p=e[l];h[p.lane]=p.start,l--}l=Math.max(0,l-l%r),u=Math.min(i,u+(r-1-u%r))}return{startIndex:l,endIndex:u}}const $a=typeof document<"u"?b.useLayoutEffect:b.useEffect;function nb({useFlushSync:e=!0,...t}){const n=b.useReducer(i=>i+1,0)[1],r={...t,onChange:(i,s)=>{var a;e&&s?xr.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,s)}},[o]=b.useState(()=>new eb(r));return o.setOptions(r),$a(()=>o._didMount(),[]),$a(()=>o._willUpdate()),o}function Cu(e){return nb({observeElementRect:qy,observeElementOffset:Jy,scrollToFn:Qy,...e})}const Eu=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const rb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ob=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Ba=e=>{const t=ob(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ib={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 sb=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const ab=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>b.createElement("svg",{ref:l,...ib,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Eu("lucide",o),...!i&&!sb(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,d])=>b.createElement(u,d)),...Array.isArray(i)?i:[i]]));const we=(e,t)=>{const n=b.forwardRef(({className:r,...o},i)=>b.createElement(ab,{ref:i,iconNode:t,className:Eu(`lucide-${rb(Ba(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Ba(e),n};const lb=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],cb=we("arrow-down",lb);const ub=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],db=we("arrow-up",ub);const fb=[["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"}]],hb=we("brain",fb);const pb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vt=we("check",pb);const mb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],pt=we("chevron-down",mb);const gb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],kt=we("chevron-right",gb);const xb=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yb=we("chevron-up",xb);const bb=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],vb=we("chevrons-down",bb);const wb=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],kb=we("chevrons-up",wb);const _b=[["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"}]],Ii=we("circle-alert",_b);const Sb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Cb=we("circle-check-big",Sb);const Eb=[["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"}]],Nb=we("circle-question-mark",Eb);const jb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Nu=we("circle-stop",jb);const Tb=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],wo=we("clock",Tb);const Ab=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],ju=we("columns-2",Ab);const zb=[["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"}]],pn=we("copy",zb);const Ib=[["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"}]],Tu=we("download",Ib);const Rb=[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]],Pb=we("equal",Rb);const Ob=[["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"}]],Db=we("external-link",Ob);const Mb=[["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"}]],ws=we("eye-off",Mb);const Lb=[["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"}]],ks=we("eye",Lb);const Fb=[["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"}]],$b=we("file-terminal",Fb);const Bb=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ub=we("gauge",Bb);const Zb=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]],Au=we("git-compare-arrows",Zb);const Vb=[["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"}]],Wb=we("globe",Vb);const Hb=[["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"}]],qb=we("layout-grid",Hb);const Kb=[["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"}]],Gb=we("list",Kb);const Jb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zu=we("loader-circle",Jb);const Yb=[["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"}]],Xb=we("lock",Yb);const Qb=[["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"}]],Iu=we("message-square",Qb);const ev=[["path",{d:"M5 12h14",key:"1ays0h"}]],_s=we("minus",ev);const tv=[["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"}]],Ss=we("pencil",tv);const nv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],eo=we("plus",nv);const rv=[["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"}]],ov=we("radio",rv);const iv=[["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"}]],Ru=we("rotate-ccw",iv);const sv=[["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"}]],Pu=we("rotate-cw",sv);const av=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],Ou=we("rows-3",av);const lv=[["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"}]],cv=we("server",lv);const uv=[["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"}]],dv=we("settings",uv);const fv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Du=we("terminal",fv);const hv=[["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"}]],pv=we("trash-2",hv);const mv=[["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"}]],gv=we("triangle-alert",mv);const xv=[["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"}]],yv=we("upload",xv);const bv=[["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"}]],vv=we("user",bv);const wv=[["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"}]],kv=we("wifi-off",wv);const _v=[["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"}]],Sv=we("wifi",_v);const Cv=[["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"}]],Ev=we("wrench",Cv);const Nv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Cs=we("x",Nv);const jv=[["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"}]],yr=we("zap",jv);function Tr(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 Jo={exports:{}};var Ua;function Tv(){return Ua||(Ua=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,i){function s(u,d){if(!o[u]){if(!r[u]){var h=typeof Tr=="function"&&Tr;if(!d&&h)return h(u,!0);if(a)return a(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var f=o[u]={exports:{}};r[u][0].call(f.exports,function(x){var m=r[u][1][x];return s(m||x)},f,f.exports,n,r,o,i)}return o[u].exports}for(var a=typeof Tr=="function"&&Tr,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 u,d,h,p,f,x,m,y=[],g=0,w=l.length,_=w,S=i.getTypeOf(l)!=="string";g<l.length;)_=w-g,h=S?(u=l[g++],d=g<w?l[g++]:0,g<w?l[g++]:0):(u=l.charCodeAt(g++),d=g<w?l.charCodeAt(g++):0,g<w?l.charCodeAt(g++):0),p=u>>2,f=(3&u)<<4|d>>4,x=1<_?(15&d)<<2|h>>6:64,m=2<_?63&h:64,y.push(a.charAt(p)+a.charAt(f)+a.charAt(x)+a.charAt(m));return y.join("")},o.decode=function(l){var u,d,h,p,f,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 w,_=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&_--,l.charAt(l.length-2)===a.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(w=s.uint8array?new Uint8Array(0|_):new Array(0|_);m<l.length;)u=a.indexOf(l.charAt(m++))<<2|(p=a.indexOf(l.charAt(m++)))>>4,d=(15&p)<<4|(f=a.indexOf(l.charAt(m++)))>>2,h=(3&f)<<6|(x=a.indexOf(l.charAt(m++))),w[y++]=u,f!==64&&(w[y++]=d),x!==64&&(w[y++]=h);return w}},{"./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 u(d,h,p,f,x){this.compressedSize=d,this.uncompressedSize=h,this.crc32=p,this.compression=f,this.compressedContent=x}u.prototype={getContentWorker:function(){var d=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return d.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},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)}},u.createWorkerFrom=function(d,h,p){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},r.exports=u},{"./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=[],u=0;u<256;u++){a=u;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(u,d,h,p){var f=s,x=p+h;u^=-1;for(var m=p;m<x;m++)u=u>>>8^f[255&(u^d[m])];return-1^u})(0|l,a,a.length,0):(function(u,d,h,p){var f=s,x=p+h;u^=-1;for(var m=p;m<x;m++)u=u>>>8^f[255&(u^d.charCodeAt(m))];return-1^u})(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"),u=i?"uint8array":"array";function d(h,p){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,h.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},o.compressWorker=function(h){return new d("Deflate",h)},o.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(f,x){var m,y="";for(m=0;m<x;m++)y+=String.fromCharCode(255&f),f>>>=8;return y}function s(f,x,m,y,g,w){var _,S,E=f.file,C=f.compression,A=w!==u.utf8encode,I=a.transformTo("string",w(E.name)),P=a.transformTo("string",u.utf8encode(E.name)),M=E.comment,B=a.transformTo("string",w(M)),N=a.transformTo("string",u.utf8encode(M)),D=P.length!==E.name.length,k=N.length!==M.length,O="",Y="",Z="",H=E.dir,G=E.date,j={crc32:0,compressedSize:0,uncompressedSize:0};x&&!m||(j.crc32=f.crc32,j.compressedSize=f.compressedSize,j.uncompressedSize=f.uncompressedSize);var L=0;x&&(L|=8),A||!D&&!k||(L|=2048);var F=0,T=0;H&&(F|=16),g==="UNIX"?(T=798,F|=(function(K,ue){var Q=K;return K||(Q=ue?16893:33204),(65535&Q)<<16})(E.unixPermissions,H)):(T=20,F|=(function(K){return 63&(K||0)})(E.dosPermissions)),_=G.getUTCHours(),_<<=6,_|=G.getUTCMinutes(),_<<=5,_|=G.getUTCSeconds()/2,S=G.getUTCFullYear()-1980,S<<=4,S|=G.getUTCMonth()+1,S<<=5,S|=G.getUTCDate(),D&&(Y=i(1,1)+i(d(I),4)+P,O+="up"+i(Y.length,2)+Y),k&&(Z=i(1,1)+i(d(B),4)+N,O+="uc"+i(Z.length,2)+Z);var ee="";return ee+=`
40
- \0`,ee+=i(L,2),ee+=C.magic,ee+=i(_,2),ee+=i(S,2),ee+=i(j.crc32,4),ee+=i(j.compressedSize,4),ee+=i(j.uncompressedSize,4),ee+=i(I.length,2),ee+=i(O.length,2),{fileRecord:h.LOCAL_FILE_HEADER+ee+I+O,dirRecord:h.CENTRAL_FILE_HEADER+i(T,2)+ee+i(B.length,2)+"\0\0\0\0"+i(F,4)+i(y,4)+I+O+B}}var a=n("../utils"),l=n("../stream/GenericWorker"),u=n("../utf8"),d=n("../crc32"),h=n("../signature");function p(f,x,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=f,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(f){var x=f.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:m?(x+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var x=this.streamFiles&&!f.file.dir;if(x){var m=s(f,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(f){this.accumulate=!1;var x=this.streamFiles&&!f.file.dir,m=s(f,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),x)this.push({data:(function(y){return h.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)})(f),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 f=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var m=this.bytesWritten-f,y=(function(g,w,_,S,E){var C=a.transformTo("string",E(S));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(w,4)+i(_,4)+i(C.length,2)+C})(this.dirRecords.length,m,f,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(f){this._sources.push(f);var x=this;return f.on("data",function(m){x.processChunk(m)}),f.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),f.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(f){var x=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var m=0;m<x.length;m++)try{x[m].error(f)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,x=0;x<f.length;x++)f[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,u){var d=new s(l.streamFiles,u,l.platform,l.encodeFileName),h=0;try{a.forEach(function(p,f){h++;var x=(function(w,_){var S=w||_,E=i[S];if(!E)throw new Error(S+" is not a valid compression method !");return E})(f.options.compression,l.compression),m=f.options.compressionOptions||l.compressionOptions||{},y=f.dir,g=f.date;f._compressWorker(x,m).withStreamInfo("file",{name:p,dir:y,date:g,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(d)}),d.entriesCount=h}catch(p){d.error(p)}return d}},{"../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"),u=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function h(p){return new s.Promise(function(f,x){var m=p.decompressed.getContentWorker().pipe(new u);m.on("error",function(y){x(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}r.exports=function(p,f){var x=this;return f=i.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.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,f.optimizedBinaryString,f.base64).then(function(m){var y=new l(f);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],g=m.files;if(f.checkCRC32)for(var w=0;w<g.length;w++)y.push(h(g[w]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,w=0;w<g.length;w++){var _=g[w],S=_.fileNameStr,E=i.resolve(_.fileNameStr);x.file(E,_.decompressed,{binary:!0,optimizedBinaryString:!0,date:_.date,dir:_.dir,comment:_.fileCommentStr.length?_.fileCommentStr:null,unixPermissions:_.unixPermissions,dosPermissions:_.dosPermissions,createFolders:f.createFolders}),_.dir||(x.file(E).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,u){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(u)}i.inherits(a,s),a.prototype._bindStream=function(l){var u=this;(this._stream=l).pause(),l.on("data",function(d){u.push({data:d,meta:{percent:0}})}).on("error",function(d){u.isPaused?this.generatedError=d:u.error(d)}).on("end",function(){u.isPaused?u._upstreamEnded=!0:u.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,u){i.call(this,l),this._helper=a;var d=this;a.on("data",function(h,p){d.push(h)||d._helper.pause(),u&&u(p)}).on("error",function(h){d.emit("error",h)}).on("end",function(){d.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(E,C,A){var I,P=a.getTypeOf(C),M=a.extend(A||{},d);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&&(E=g(E)),M.createFolders&&(I=y(E))&&w.call(this,I,!0);var B=P==="string"&&M.binary===!1&&M.base64===!1;A&&A.binary!==void 0||(M.binary=!B),(C instanceof h&&C.uncompressedSize===0||M.dir||!C||C.length===0)&&(M.base64=!1,M.binary=!0,C="",M.compression="STORE",P="string");var N=null;N=C instanceof h||C instanceof l?C:x.isNode&&x.isStream(C)?new m(E,C):a.prepareContent(E,C,M.binary,M.optimizedBinaryString,M.base64);var D=new p(E,N,M);this.files[E]=D}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),u=n("./stream/StreamHelper"),d=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),f=n("./generate"),x=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(E){E.slice(-1)==="/"&&(E=E.substring(0,E.length-1));var C=E.lastIndexOf("/");return 0<C?E.substring(0,C):""},g=function(E){return E.slice(-1)!=="/"&&(E+="/"),E},w=function(E,C){return C=C!==void 0?C:d.createFolders,E=g(E),this.files[E]||i.call(this,E,null,{dir:!0,createFolders:C}),this.files[E]};function _(E){return Object.prototype.toString.call(E)==="[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(E){var C,A,I;for(C in this.files)I=this.files[C],(A=C.slice(this.root.length,C.length))&&C.slice(0,this.root.length)===this.root&&E(A,I)},filter:function(E){var C=[];return this.forEach(function(A,I){E(A,I)&&C.push(I)}),C},file:function(E,C,A){if(arguments.length!==1)return E=this.root+E,i.call(this,E,C,A),this;if(_(E)){var I=E;return this.filter(function(M,B){return!B.dir&&I.test(M)})}var P=this.files[this.root+E];return P&&!P.dir?P:null},folder:function(E){if(!E)return this;if(_(E))return this.filter(function(P,M){return M.dir&&E.test(P)});var C=this.root+E,A=w.call(this,C),I=this.clone();return I.root=A.name,I},remove:function(E){E=this.root+E;var C=this.files[E];if(C||(E.slice(-1)!=="/"&&(E+="/"),C=this.files[E]),C&&!C.dir)delete this.files[E];else for(var A=this.filter(function(P,M){return M.name.slice(0,E.length)===E}),I=0;I<A.length;I++)delete this.files[A[I].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(E){var C,A={};try{if((A=a.extend(E||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=A.type.toLowerCase(),A.compression=A.compression.toUpperCase(),A.type==="binarystring"&&(A.type="string"),!A.type)throw new Error("No output type specified.");a.checkSupport(A.type),A.platform!=="darwin"&&A.platform!=="freebsd"&&A.platform!=="linux"&&A.platform!=="sunos"||(A.platform="UNIX"),A.platform==="win32"&&(A.platform="DOS");var I=A.comment||this.comment||"";C=f.generateWorker(this,A,I)}catch(P){(C=new l("error")).error(P)}return new u(C,A.type||"string",A.mimeType)},generateAsync:function(E,C){return this.generateInternalStream(E).accumulate(C)},generateNodeStream:function(E,C){return(E=E||{}).type||(E.type="nodebuffer"),this.generateInternalStream(E).toNodejsStream(C)}};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),u=a.charCodeAt(1),d=a.charCodeAt(2),h=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===u&&this.data[p+2]===d&&this.data[p+3]===h)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),u=a.charCodeAt(1),d=a.charCodeAt(2),h=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&u===p[1]&&d===p[2]&&h===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,u=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},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"),u=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(h){var p=i.getTypeOf(h);return i.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new u(h):s.uint8array?new d(i.transformTo("uint8array",h)):new a(i.transformTo("array",h)):new l(h)}},{"../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 u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+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 u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=i.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}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,u=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,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,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"),u=n("../support"),d=n("../external"),h=null;if(u.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,m){return new d.Promise(function(y,g){var w=[],_=x._internalType,S=x._outputType,E=x._mimeType;x.on("data",function(C,A){w.push(C),m&&m(A)}).on("error",function(C){w=[],g(C)}).on("end",function(){try{var C=(function(A,I,P){switch(A){case"blob":return i.newBlob(i.transformTo("arraybuffer",I),P);case"base64":return l.encode(I);default:return i.transformTo(A,I)}})(S,(function(A,I){var P,M=0,B=null,N=0;for(P=0;P<I.length;P++)N+=I[P].length;switch(A){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(B=new Uint8Array(N),P=0;P<I.length;P++)B.set(I[P],M),M+=I[P].length;return B;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+A+"'")}})(_,w),E);y(C)}catch(A){g(A)}w=[]}).resume()})}function f(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(w){this._worker=new a("error"),this._worker.error(w)}}f.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 h(this,{objectMode:this._outputType!=="nodebuffer"},x)}},r.exports=f},{"../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"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}o.utf8encode=function(f){return s.nodebuffer?a.newBufferFrom(f,"utf-8"):(function(x){var m,y,g,w,_,S=x.length,E=0;for(w=0;w<S;w++)(64512&(y=x.charCodeAt(w)))==55296&&w+1<S&&(64512&(g=x.charCodeAt(w+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),w++),E+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(E):new Array(E),w=_=0;_<E;w++)(64512&(y=x.charCodeAt(w)))==55296&&w+1<S&&(64512&(g=x.charCodeAt(w+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),w++),y<128?m[_++]=y:(y<2048?m[_++]=192|y>>>6:(y<65536?m[_++]=224|y>>>12:(m[_++]=240|y>>>18,m[_++]=128|y>>>12&63),m[_++]=128|y>>>6&63),m[_++]=128|63&y);return m})(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):(function(x){var m,y,g,w,_=x.length,S=new Array(2*_);for(m=y=0;m<_;)if((g=x[m++])<128)S[y++]=g;else if(4<(w=u[g]))S[y++]=65533,m+=w-1;else{for(g&=w===2?31:w===3?15:7;1<w&&m<_;)g=g<<6|63&x[m++],w--;1<w?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)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(h,l),h.prototype.processChunk=function(f){var x=i.transformTo(s.uint8array?"uint8array":"array",f.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(w,_){var S;for((_=_||w.length)>w.length&&(_=w.length),S=_-1;0<=S&&(192&w[S])==128;)S--;return S<0||S===0?_:S+u[w[S]]>_?S:_})(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:f.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=h,i.inherits(p,l),p.prototype.processChunk=function(f){this.push({data:o.utf8encode(f.data),meta:f.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 u(m){return m}function d(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 h={stringifyByChunk:function(m,y,g){var w=[],_=0,S=m.length;if(S<=g)return String.fromCharCode.apply(null,m);for(;_<S;)y==="array"||y==="nodebuffer"?w.push(String.fromCharCode.apply(null,m.slice(_,Math.min(_+g,S)))):w.push(String.fromCharCode.apply(null,m.subarray(_,Math.min(_+g,S)))),_+=g;return w.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),w=!0;if(g==="uint8array"?w=h.applyCanBeUsed.uint8array:g==="nodebuffer"&&(w=h.applyCanBeUsed.nodebuffer),w)for(;1<y;)try{return h.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(m)}function f(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}o.applyFromCharCode=p;var x={};x.string={string:u,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return x.string.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:function(m){return d(m,a.allocBuffer(m.length))}},x.array={string:p,array:u,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 f(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:u,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},x.uint8array={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:u,nodebuffer:function(m){return a.newBufferFrom(m)}},x.nodebuffer={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return x.nodebuffer.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:u},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=[],w=0;w<y.length;w++){var _=y[w];_==="."||_===""&&w!==0&&w!==y.length-1||(_===".."?g.pop():g.push(_))}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,w="";for(g=0;g<(m||"").length;g++)w+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return w},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,w,_){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(E,C){var A=new FileReader;A.onload=function(I){E(I.target.result)},A.onerror=function(I){C(I.target.error)},A.readAsArrayBuffer(S)}):S}).then(function(S){var E=o.getTypeOf(S);return E?(E==="arraybuffer"?S=o.transformTo("uint8array",S):E==="string"&&(_?S=s.decode(S):g&&w!==!0&&(S=(function(C){return d(C,i.uint8array?new Uint8Array(C.length):new Array(C.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"),u=n("./support");function d(h){this.files=[],this.loadOptions=h}d.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){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(h)+")")}},isSignature:function(h,p){var f=this.reader.index;this.reader.setIndex(h);var x=this.reader.readString(4)===p;return this.reader.setIndex(f),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 h=this.reader.readData(this.zipCommentLength),p=u.uint8array?"uint8array":"array",f=s.transformTo(p,h);this.zipComment=this.loadOptions.decodeFileName(f)},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 h,p,f,x=this.zip64EndOfCentralSize-44;0<x;)h=this.reader.readInt(2),p=this.reader.readInt(4),f=this.reader.readData(p),this.zip64ExtensibleData[h]={id:h,length:p,value:f}},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 h,p;for(h=0;h<this.files.length;h++)p=this.files[h],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(h=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(h);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 h=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(h<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(h);var p=h;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,(h=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(h),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 f=this.centralDirOffset+this.centralDirSize;this.zip64&&(f+=20,f+=12+this.zip64EndOfCentralSize);var x=p-f;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(h){this.reader=i(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./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"),u=n("./utf8"),d=n("./compressions"),h=n("./support");function p(f,x){this.options=f,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var x,m;if(f.skip(22),this.fileNameLength=f.readInt(2),m=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.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 d)if(Object.prototype.hasOwnProperty.call(d,g)&&d[g].magic===y)return d[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,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var x=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(x),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var x,m,y,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)x=f.readInt(2),m=f.readInt(2),y=f.readData(m),this.extraFields[x]={id:x,length:m,value:y};f.setIndex(g)},handleUTF8:function(){var f=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=u.utf8decode(this.fileName),this.fileCommentStr=u.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var m=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var x=i(f.value);return x.readInt(1)!==1||l(this.fileName)!==x.readInt(4)?null:u.utf8decode(x.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var x=i(f.value);return x.readInt(1)!==1||l(this.fileComment)!==x.readInt(4)?null:u.utf8decode(x.readData(f.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"),u=n("./compressedObject"),d=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 w=!this._dataBinary;w&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!w&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(_){(m=new d("error")).error(_)}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 u&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),u.createWorkerFrom(y,x,m)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<h.length;f++)i.prototype[h[f]]=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 u=0,d=new l(x),h=i.document.createTextNode("");d.observe(h,{characterData:!0}),s=function(){h.data=u=++u%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 f=[];function x(){var m,y;a=!0;for(var g=f.length;g;){for(y=f,f=[],m=-1;++m<g;)y[m]();g=f.length}a=!1}r.exports=function(m){f.push(m)!==1||a||s()}}).call(this,typeof Cr<"u"?Cr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],u=["FULFILLED"],d=["PENDING"];function h(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,g!==s&&m(this,g)}function p(g,w,_){this.promise=g,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof _=="function"&&(this.onRejected=_,this.callRejected=this.otherCallRejected)}function f(g,w,_){i(function(){var S;try{S=w(_)}catch(E){return a.reject(g,E)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function x(g){var w=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof w=="function")return function(){w.apply(g,arguments)}}function m(g,w){var _=!1;function S(A){_||(_=!0,a.reject(g,A))}function E(A){_||(_=!0,a.resolve(g,A))}var C=y(function(){w(E,S)});C.status==="error"&&S(C.value)}function y(g,w){var _={};try{_.value=g(w),_.status="success"}catch(S){_.status="error",_.value=S}return _}(r.exports=h).prototype.finally=function(g){if(typeof g!="function")return this;var w=this.constructor;return this.then(function(_){return w.resolve(g()).then(function(){return _})},function(_){return w.resolve(g()).then(function(){throw _})})},h.prototype.catch=function(g){return this.then(null,g)},h.prototype.then=function(g,w){if(typeof g!="function"&&this.state===u||typeof w!="function"&&this.state===l)return this;var _=new this.constructor(s);return this.state!==d?f(_,this.state===u?g:w,this.outcome):this.queue.push(new p(_,g,w)),_},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){f(this.promise,this.onFulfilled,g)},p.prototype.callRejected=function(g){a.reject(this.promise,g)},p.prototype.otherCallRejected=function(g){f(this.promise,this.onRejected,g)},a.resolve=function(g,w){var _=y(x,w);if(_.status==="error")return a.reject(g,_.value);var S=_.value;if(S)m(g,S);else{g.state=u,g.outcome=w;for(var E=-1,C=g.queue.length;++E<C;)g.queue[E].callFulfilled(w)}return g},a.reject=function(g,w){g.state=l,g.outcome=w;for(var _=-1,S=g.queue.length;++_<S;)g.queue[_].callRejected(w);return g},h.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},h.reject=function(g){var w=new this(s);return a.reject(w,g)},h.all=function(g){var w=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=g.length,S=!1;if(!_)return this.resolve([]);for(var E=new Array(_),C=0,A=-1,I=new this(s);++A<_;)P(g[A],A);return I;function P(M,B){w.resolve(M).then(function(N){E[B]=N,++C!==_||S||(S=!0,a.resolve(I,E))},function(N){S||(S=!0,a.reject(I,N))})}},h.race=function(g){var w=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=g.length,S=!1;if(!_)return this.resolve([]);for(var E=-1,C=new this(s);++E<_;)A=g[E],w.resolve(A).then(function(I){S||(S=!0,a.resolve(C,I))},function(I){S||(S=!0,a.reject(C,I))});var A;return C}},{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"),u=n("./zlib/zstream"),d=Object.prototype.toString,h=0,p=-1,f=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:f,to:""},g||{});var w=this.options;w.raw&&0<w.windowBits?w.windowBits=-w.windowBits:w.gzip&&0<w.windowBits&&w.windowBits<16&&(w.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var _=i.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(_!==h)throw new Error(l[_]);if(w.header&&i.deflateSetHeader(this.strm,w.header),w.dictionary){var S;if(S=typeof w.dictionary=="string"?a.string2buf(w.dictionary):d.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(_=i.deflateSetDictionary(this.strm,S))!==h)throw new Error(l[_]);this._dict_set=!0}}function y(g,w){var _=new m(w);if(_.push(g,!0),_.err)throw _.msg||l[_.err];return _.result}m.prototype.push=function(g,w){var _,S,E=this.strm,C=this.options.chunkSize;if(this.ended)return!1;S=w===~~w?w:w===!0?4:0,typeof g=="string"?E.input=a.string2buf(g):d.call(g)==="[object ArrayBuffer]"?E.input=new Uint8Array(g):E.input=g,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new s.Buf8(C),E.next_out=0,E.avail_out=C),(_=i.deflate(E,S))!==1&&_!==h)return this.onEnd(_),!(this.ended=!0);E.avail_out!==0&&(E.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(E.output,E.next_out))):this.onData(s.shrinkBuf(E.output,E.next_out)))}while((0<E.avail_in||E.avail_out===0)&&_!==1);return S===4?(_=i.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===h):S!==2||(this.onEnd(h),!(E.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===h&&(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,w){return(w=w||{}).raw=!0,y(g,w)},o.gzip=function(g,w){return(w=w||{}).gzip=!0,y(g,w)}},{"./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"),u=n("./zlib/messages"),d=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function f(m){if(!(this instanceof f))return new f(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 d,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,y.windowBits);if(g!==l.Z_OK)throw new Error(u[g]);this.header=new h,i.inflateGetHeader(this.strm,this.header)}function x(m,y){var g=new f(y);if(g.push(m,!0),g.err)throw g.msg||u[g.err];return g.result}f.prototype.push=function(m,y){var g,w,_,S,E,C,A=this.strm,I=this.options.chunkSize,P=this.options.dictionary,M=!1;if(this.ended)return!1;w=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?A.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?A.input=new Uint8Array(m):A.input=m,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new s.Buf8(I),A.next_out=0,A.avail_out=I),(g=i.inflate(A,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&P&&(C=typeof P=="string"?a.string2buf(P):p.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,g=i.inflateSetDictionary(this.strm,C)),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);A.next_out&&(A.avail_out!==0&&g!==l.Z_STREAM_END&&(A.avail_in!==0||w!==l.Z_FINISH&&w!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(_=a.utf8border(A.output,A.next_out),S=A.next_out-_,E=a.buf2string(A.output,_),A.next_out=S,A.avail_out=I-S,S&&s.arraySet(A.output,A.output,_,S,0),this.onData(E)):this.onData(s.shrinkBuf(A.output,A.next_out)))),A.avail_in===0&&A.avail_out===0&&(M=!0)}while((0<A.avail_in||A.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(w=l.Z_FINISH),w===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):w!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(A.avail_out=0))},f.prototype.onData=function(m){this.chunks.push(m)},f.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=f,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 u=Array.prototype.slice.call(arguments,1);u.length;){var d=u.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var h in d)d.hasOwnProperty(h)&&(l[h]=d[h])}}return l},o.shrinkBuf=function(l,u){return l.length===u?l:l.subarray?l.subarray(0,u):(l.length=u,l)};var s={arraySet:function(l,u,d,h,p){if(u.subarray&&l.subarray)l.set(u.subarray(d,d+h),p);else for(var f=0;f<h;f++)l[p+f]=u[d+f]},flattenChunks:function(l){var u,d,h,p,f,x;for(u=h=0,d=l.length;u<d;u++)h+=l[u].length;for(x=new Uint8Array(h),u=p=0,d=l.length;u<d;u++)f=l[u],x.set(f,p),p+=f.length;return x}},a={arraySet:function(l,u,d,h,p){for(var f=0;f<h;f++)l[p+f]=u[d+f]},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),u=0;u<256;u++)l[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function d(h,p){if(p<65537&&(h.subarray&&a||!h.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(h,p));for(var f="",x=0;x<p;x++)f+=String.fromCharCode(h[x]);return f}l[254]=l[254]=1,o.string2buf=function(h){var p,f,x,m,y,g=h.length,w=0;for(m=0;m<g;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(x-56320),m++),w+=f<128?1:f<2048?2:f<65536?3:4;for(p=new i.Buf8(w),m=y=0;y<w;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(x-56320),m++),f<128?p[y++]=f:(f<2048?p[y++]=192|f>>>6:(f<65536?p[y++]=224|f>>>12:(p[y++]=240|f>>>18,p[y++]=128|f>>>12&63),p[y++]=128|f>>>6&63),p[y++]=128|63&f);return p},o.buf2binstring=function(h){return d(h,h.length)},o.binstring2buf=function(h){for(var p=new i.Buf8(h.length),f=0,x=p.length;f<x;f++)p[f]=h.charCodeAt(f);return p},o.buf2string=function(h,p){var f,x,m,y,g=p||h.length,w=new Array(2*g);for(f=x=0;f<g;)if((m=h[f++])<128)w[x++]=m;else if(4<(y=l[m]))w[x++]=65533,f+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&f<g;)m=m<<6|63&h[f++],y--;1<y?w[x++]=65533:m<65536?w[x++]=m:(m-=65536,w[x++]=55296|m>>10&1023,w[x++]=56320|1023&m)}return d(w,x)},o.utf8border=function(h,p){var f;for((p=p||h.length)>h.length&&(p=h.length),f=p-1;0<=f&&(192&h[f])==128;)f--;return f<0||f===0?p:f+l[h[f]]>p?f:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(i,s,a,l){for(var u=65535&i|0,d=i>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3<a?2e3:a;d=d+(u=u+s[l++]|0)|0,--h;);u%=65521,d%=65521}return u|d<<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 u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,u){var d=i,h=u+l;s^=-1;for(var p=u;p<h;p++)s=s>>>8^d[255&(s^a[p])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),u=n("./crc32"),d=n("./messages"),h=0,p=4,f=0,x=-2,m=-1,y=4,g=2,w=8,_=9,S=286,E=30,C=19,A=2*S+1,I=15,P=3,M=258,B=M+P+1,N=42,D=113,k=1,O=2,Y=3,Z=4;function H(v,q){return v.msg=d[q],q}function G(v){return(v<<1)-(4<v?9:0)}function j(v){for(var q=v.length;0<=--q;)v[q]=0}function L(v){var q=v.state,V=q.pending;V>v.avail_out&&(V=v.avail_out),V!==0&&(s.arraySet(v.output,q.pending_buf,q.pending_out,V,v.next_out),v.next_out+=V,q.pending_out+=V,v.total_out+=V,v.avail_out-=V,q.pending-=V,q.pending===0&&(q.pending_out=0))}function F(v,q){a._tr_flush_block(v,0<=v.block_start?v.block_start:-1,v.strstart-v.block_start,q),v.block_start=v.strstart,L(v.strm)}function T(v,q){v.pending_buf[v.pending++]=q}function ee(v,q){v.pending_buf[v.pending++]=q>>>8&255,v.pending_buf[v.pending++]=255&q}function K(v,q){var V,R,z=v.max_chain_length,$=v.strstart,te=v.prev_length,re=v.nice_match,W=v.strstart>v.w_size-B?v.strstart-(v.w_size-B):0,ie=v.window,he=v.w_mask,ae=v.prev,U=v.strstart+M,ne=ie[$+te-1],de=ie[$+te];v.prev_length>=v.good_match&&(z>>=2),re>v.lookahead&&(re=v.lookahead);do if(ie[(V=q)+te]===de&&ie[V+te-1]===ne&&ie[V]===ie[$]&&ie[++V]===ie[$+1]){$+=2,V++;do;while(ie[++$]===ie[++V]&&ie[++$]===ie[++V]&&ie[++$]===ie[++V]&&ie[++$]===ie[++V]&&ie[++$]===ie[++V]&&ie[++$]===ie[++V]&&ie[++$]===ie[++V]&&ie[++$]===ie[++V]&&$<U);if(R=M-(U-$),$=U-M,te<R){if(v.match_start=q,re<=(te=R))break;ne=ie[$+te-1],de=ie[$+te]}}while((q=ae[q&he])>W&&--z!=0);return te<=v.lookahead?te:v.lookahead}function ue(v){var q,V,R,z,$,te,re,W,ie,he,ae=v.w_size;do{if(z=v.window_size-v.lookahead-v.strstart,v.strstart>=ae+(ae-B)){for(s.arraySet(v.window,v.window,ae,ae,0),v.match_start-=ae,v.strstart-=ae,v.block_start-=ae,q=V=v.hash_size;R=v.head[--q],v.head[q]=ae<=R?R-ae:0,--V;);for(q=V=ae;R=v.prev[--q],v.prev[q]=ae<=R?R-ae:0,--V;);z+=ae}if(v.strm.avail_in===0)break;if(te=v.strm,re=v.window,W=v.strstart+v.lookahead,ie=z,he=void 0,he=te.avail_in,ie<he&&(he=ie),V=he===0?0:(te.avail_in-=he,s.arraySet(re,te.input,te.next_in,he,W),te.state.wrap===1?te.adler=l(te.adler,re,he,W):te.state.wrap===2&&(te.adler=u(te.adler,re,he,W)),te.next_in+=he,te.total_in+=he,he),v.lookahead+=V,v.lookahead+v.insert>=P)for($=v.strstart-v.insert,v.ins_h=v.window[$],v.ins_h=(v.ins_h<<v.hash_shift^v.window[$+1])&v.hash_mask;v.insert&&(v.ins_h=(v.ins_h<<v.hash_shift^v.window[$+P-1])&v.hash_mask,v.prev[$&v.w_mask]=v.head[v.ins_h],v.head[v.ins_h]=$,$++,v.insert--,!(v.lookahead+v.insert<P)););}while(v.lookahead<B&&v.strm.avail_in!==0)}function Q(v,q){for(var V,R;;){if(v.lookahead<B){if(ue(v),v.lookahead<B&&q===h)return k;if(v.lookahead===0)break}if(V=0,v.lookahead>=P&&(v.ins_h=(v.ins_h<<v.hash_shift^v.window[v.strstart+P-1])&v.hash_mask,V=v.prev[v.strstart&v.w_mask]=v.head[v.ins_h],v.head[v.ins_h]=v.strstart),V!==0&&v.strstart-V<=v.w_size-B&&(v.match_length=K(v,V)),v.match_length>=P)if(R=a._tr_tally(v,v.strstart-v.match_start,v.match_length-P),v.lookahead-=v.match_length,v.match_length<=v.max_lazy_match&&v.lookahead>=P){for(v.match_length--;v.strstart++,v.ins_h=(v.ins_h<<v.hash_shift^v.window[v.strstart+P-1])&v.hash_mask,V=v.prev[v.strstart&v.w_mask]=v.head[v.ins_h],v.head[v.ins_h]=v.strstart,--v.match_length!=0;);v.strstart++}else v.strstart+=v.match_length,v.match_length=0,v.ins_h=v.window[v.strstart],v.ins_h=(v.ins_h<<v.hash_shift^v.window[v.strstart+1])&v.hash_mask;else R=a._tr_tally(v,0,v.window[v.strstart]),v.lookahead--,v.strstart++;if(R&&(F(v,!1),v.strm.avail_out===0))return k}return v.insert=v.strstart<P-1?v.strstart:P-1,q===p?(F(v,!0),v.strm.avail_out===0?Y:Z):v.last_lit&&(F(v,!1),v.strm.avail_out===0)?k:O}function ce(v,q){for(var V,R,z;;){if(v.lookahead<B){if(ue(v),v.lookahead<B&&q===h)return k;if(v.lookahead===0)break}if(V=0,v.lookahead>=P&&(v.ins_h=(v.ins_h<<v.hash_shift^v.window[v.strstart+P-1])&v.hash_mask,V=v.prev[v.strstart&v.w_mask]=v.head[v.ins_h],v.head[v.ins_h]=v.strstart),v.prev_length=v.match_length,v.prev_match=v.match_start,v.match_length=P-1,V!==0&&v.prev_length<v.max_lazy_match&&v.strstart-V<=v.w_size-B&&(v.match_length=K(v,V),v.match_length<=5&&(v.strategy===1||v.match_length===P&&4096<v.strstart-v.match_start)&&(v.match_length=P-1)),v.prev_length>=P&&v.match_length<=v.prev_length){for(z=v.strstart+v.lookahead-P,R=a._tr_tally(v,v.strstart-1-v.prev_match,v.prev_length-P),v.lookahead-=v.prev_length-1,v.prev_length-=2;++v.strstart<=z&&(v.ins_h=(v.ins_h<<v.hash_shift^v.window[v.strstart+P-1])&v.hash_mask,V=v.prev[v.strstart&v.w_mask]=v.head[v.ins_h],v.head[v.ins_h]=v.strstart),--v.prev_length!=0;);if(v.match_available=0,v.match_length=P-1,v.strstart++,R&&(F(v,!1),v.strm.avail_out===0))return k}else if(v.match_available){if((R=a._tr_tally(v,0,v.window[v.strstart-1]))&&F(v,!1),v.strstart++,v.lookahead--,v.strm.avail_out===0)return k}else v.match_available=1,v.strstart++,v.lookahead--}return v.match_available&&(R=a._tr_tally(v,0,v.window[v.strstart-1]),v.match_available=0),v.insert=v.strstart<P-1?v.strstart:P-1,q===p?(F(v,!0),v.strm.avail_out===0?Y:Z):v.last_lit&&(F(v,!1),v.strm.avail_out===0)?k:O}function fe(v,q,V,R,z){this.good_length=v,this.max_lazy=q,this.nice_length=V,this.max_chain=R,this.func=z}function xe(){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=w,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*A),this.dyn_dtree=new s.Buf16(2*(2*E+1)),this.bl_tree=new s.Buf16(2*(2*C+1)),j(this.dyn_ltree),j(this.dyn_dtree),j(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(I+1),this.heap=new s.Buf16(2*S+1),j(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),j(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 be(v){var q;return v&&v.state?(v.total_in=v.total_out=0,v.data_type=g,(q=v.state).pending=0,q.pending_out=0,q.wrap<0&&(q.wrap=-q.wrap),q.status=q.wrap?N:D,v.adler=q.wrap===2?0:1,q.last_flush=h,a._tr_init(q),f):H(v,x)}function je(v){var q=be(v);return q===f&&(function(V){V.window_size=2*V.w_size,j(V.head),V.max_lazy_match=i[V.level].max_lazy,V.good_match=i[V.level].good_length,V.nice_match=i[V.level].nice_length,V.max_chain_length=i[V.level].max_chain,V.strstart=0,V.block_start=0,V.lookahead=0,V.insert=0,V.match_length=V.prev_length=P-1,V.match_available=0,V.ins_h=0})(v.state),q}function le(v,q,V,R,z,$){if(!v)return x;var te=1;if(q===m&&(q=6),R<0?(te=0,R=-R):15<R&&(te=2,R-=16),z<1||_<z||V!==w||R<8||15<R||q<0||9<q||$<0||y<$)return H(v,x);R===8&&(R=9);var re=new xe;return(v.state=re).strm=v,re.wrap=te,re.gzhead=null,re.w_bits=R,re.w_size=1<<re.w_bits,re.w_mask=re.w_size-1,re.hash_bits=z+7,re.hash_size=1<<re.hash_bits,re.hash_mask=re.hash_size-1,re.hash_shift=~~((re.hash_bits+P-1)/P),re.window=new s.Buf8(2*re.w_size),re.head=new s.Buf16(re.hash_size),re.prev=new s.Buf16(re.w_size),re.lit_bufsize=1<<z+6,re.pending_buf_size=4*re.lit_bufsize,re.pending_buf=new s.Buf8(re.pending_buf_size),re.d_buf=1*re.lit_bufsize,re.l_buf=3*re.lit_bufsize,re.level=q,re.strategy=$,re.method=V,je(v)}i=[new fe(0,0,0,0,function(v,q){var V=65535;for(V>v.pending_buf_size-5&&(V=v.pending_buf_size-5);;){if(v.lookahead<=1){if(ue(v),v.lookahead===0&&q===h)return k;if(v.lookahead===0)break}v.strstart+=v.lookahead,v.lookahead=0;var R=v.block_start+V;if((v.strstart===0||v.strstart>=R)&&(v.lookahead=v.strstart-R,v.strstart=R,F(v,!1),v.strm.avail_out===0)||v.strstart-v.block_start>=v.w_size-B&&(F(v,!1),v.strm.avail_out===0))return k}return v.insert=0,q===p?(F(v,!0),v.strm.avail_out===0?Y:Z):(v.strstart>v.block_start&&(F(v,!1),v.strm.avail_out),k)}),new fe(4,4,8,4,Q),new fe(4,5,16,8,Q),new fe(4,6,32,32,Q),new fe(4,4,16,16,ce),new fe(8,16,32,32,ce),new fe(8,16,128,128,ce),new fe(8,32,128,256,ce),new fe(32,128,258,1024,ce),new fe(32,258,258,4096,ce)],o.deflateInit=function(v,q){return le(v,q,w,15,8,0)},o.deflateInit2=le,o.deflateReset=je,o.deflateResetKeep=be,o.deflateSetHeader=function(v,q){return v&&v.state?v.state.wrap!==2?x:(v.state.gzhead=q,f):x},o.deflate=function(v,q){var V,R,z,$;if(!v||!v.state||5<q||q<0)return v?H(v,x):x;if(R=v.state,!v.output||!v.input&&v.avail_in!==0||R.status===666&&q!==p)return H(v,v.avail_out===0?-5:x);if(R.strm=v,V=R.last_flush,R.last_flush=q,R.status===N)if(R.wrap===2)v.adler=0,T(R,31),T(R,139),T(R,8),R.gzhead?(T(R,(R.gzhead.text?1:0)+(R.gzhead.hcrc?2:0)+(R.gzhead.extra?4:0)+(R.gzhead.name?8:0)+(R.gzhead.comment?16:0)),T(R,255&R.gzhead.time),T(R,R.gzhead.time>>8&255),T(R,R.gzhead.time>>16&255),T(R,R.gzhead.time>>24&255),T(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),T(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(T(R,255&R.gzhead.extra.length),T(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(v.adler=u(v.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(T(R,0),T(R,0),T(R,0),T(R,0),T(R,0),T(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),T(R,3),R.status=D);else{var te=w+(R.w_bits-8<<4)<<8;te|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(te|=32),te+=31-te%31,R.status=D,ee(R,te),R.strstart!==0&&(ee(R,v.adler>>>16),ee(R,65535&v.adler)),v.adler=1}if(R.status===69)if(R.gzhead.extra){for(z=R.pending;R.gzindex<(65535&R.gzhead.extra.length)&&(R.pending!==R.pending_buf_size||(R.gzhead.hcrc&&R.pending>z&&(v.adler=u(v.adler,R.pending_buf,R.pending-z,z)),L(v),z=R.pending,R.pending!==R.pending_buf_size));)T(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>z&&(v.adler=u(v.adler,R.pending_buf,R.pending-z,z)),R.gzindex===R.gzhead.extra.length&&(R.gzindex=0,R.status=73)}else R.status=73;if(R.status===73)if(R.gzhead.name){z=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>z&&(v.adler=u(v.adler,R.pending_buf,R.pending-z,z)),L(v),z=R.pending,R.pending===R.pending_buf_size)){$=1;break}$=R.gzindex<R.gzhead.name.length?255&R.gzhead.name.charCodeAt(R.gzindex++):0,T(R,$)}while($!==0);R.gzhead.hcrc&&R.pending>z&&(v.adler=u(v.adler,R.pending_buf,R.pending-z,z)),$===0&&(R.gzindex=0,R.status=91)}else R.status=91;if(R.status===91)if(R.gzhead.comment){z=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>z&&(v.adler=u(v.adler,R.pending_buf,R.pending-z,z)),L(v),z=R.pending,R.pending===R.pending_buf_size)){$=1;break}$=R.gzindex<R.gzhead.comment.length?255&R.gzhead.comment.charCodeAt(R.gzindex++):0,T(R,$)}while($!==0);R.gzhead.hcrc&&R.pending>z&&(v.adler=u(v.adler,R.pending_buf,R.pending-z,z)),$===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&L(v),R.pending+2<=R.pending_buf_size&&(T(R,255&v.adler),T(R,v.adler>>8&255),v.adler=0,R.status=D)):R.status=D),R.pending!==0){if(L(v),v.avail_out===0)return R.last_flush=-1,f}else if(v.avail_in===0&&G(q)<=G(V)&&q!==p)return H(v,-5);if(R.status===666&&v.avail_in!==0)return H(v,-5);if(v.avail_in!==0||R.lookahead!==0||q!==h&&R.status!==666){var re=R.strategy===2?(function(W,ie){for(var he;;){if(W.lookahead===0&&(ue(W),W.lookahead===0)){if(ie===h)return k;break}if(W.match_length=0,he=a._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++,he&&(F(W,!1),W.strm.avail_out===0))return k}return W.insert=0,ie===p?(F(W,!0),W.strm.avail_out===0?Y:Z):W.last_lit&&(F(W,!1),W.strm.avail_out===0)?k:O})(R,q):R.strategy===3?(function(W,ie){for(var he,ae,U,ne,de=W.window;;){if(W.lookahead<=M){if(ue(W),W.lookahead<=M&&ie===h)return k;if(W.lookahead===0)break}if(W.match_length=0,W.lookahead>=P&&0<W.strstart&&(ae=de[U=W.strstart-1])===de[++U]&&ae===de[++U]&&ae===de[++U]){ne=W.strstart+M;do;while(ae===de[++U]&&ae===de[++U]&&ae===de[++U]&&ae===de[++U]&&ae===de[++U]&&ae===de[++U]&&ae===de[++U]&&ae===de[++U]&&U<ne);W.match_length=M-(ne-U),W.match_length>W.lookahead&&(W.match_length=W.lookahead)}if(W.match_length>=P?(he=a._tr_tally(W,1,W.match_length-P),W.lookahead-=W.match_length,W.strstart+=W.match_length,W.match_length=0):(he=a._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++),he&&(F(W,!1),W.strm.avail_out===0))return k}return W.insert=0,ie===p?(F(W,!0),W.strm.avail_out===0?Y:Z):W.last_lit&&(F(W,!1),W.strm.avail_out===0)?k:O})(R,q):i[R.level].func(R,q);if(re!==Y&&re!==Z||(R.status=666),re===k||re===Y)return v.avail_out===0&&(R.last_flush=-1),f;if(re===O&&(q===1?a._tr_align(R):q!==5&&(a._tr_stored_block(R,0,0,!1),q===3&&(j(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),L(v),v.avail_out===0))return R.last_flush=-1,f}return q!==p?f:R.wrap<=0?1:(R.wrap===2?(T(R,255&v.adler),T(R,v.adler>>8&255),T(R,v.adler>>16&255),T(R,v.adler>>24&255),T(R,255&v.total_in),T(R,v.total_in>>8&255),T(R,v.total_in>>16&255),T(R,v.total_in>>24&255)):(ee(R,v.adler>>>16),ee(R,65535&v.adler)),L(v),0<R.wrap&&(R.wrap=-R.wrap),R.pending!==0?f:1)},o.deflateEnd=function(v){var q;return v&&v.state?(q=v.state.status)!==N&&q!==69&&q!==73&&q!==91&&q!==103&&q!==D&&q!==666?H(v,x):(v.state=null,q===D?H(v,-3):f):x},o.deflateSetDictionary=function(v,q){var V,R,z,$,te,re,W,ie,he=q.length;if(!v||!v.state||($=(V=v.state).wrap)===2||$===1&&V.status!==N||V.lookahead)return x;for($===1&&(v.adler=l(v.adler,q,he,0)),V.wrap=0,he>=V.w_size&&($===0&&(j(V.head),V.strstart=0,V.block_start=0,V.insert=0),ie=new s.Buf8(V.w_size),s.arraySet(ie,q,he-V.w_size,V.w_size,0),q=ie,he=V.w_size),te=v.avail_in,re=v.next_in,W=v.input,v.avail_in=he,v.next_in=0,v.input=q,ue(V);V.lookahead>=P;){for(R=V.strstart,z=V.lookahead-(P-1);V.ins_h=(V.ins_h<<V.hash_shift^V.window[R+P-1])&V.hash_mask,V.prev[R&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=R,R++,--z;);V.strstart=R,V.lookahead=P-1,ue(V)}return V.strstart+=V.lookahead,V.block_start=V.strstart,V.insert=V.lookahead,V.lookahead=0,V.match_length=V.prev_length=P-1,V.match_available=0,v.next_in=re,v.input=W,v.avail_in=te,V.wrap=$,f},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,u,d,h,p,f,x,m,y,g,w,_,S,E,C,A,I,P,M,B,N,D,k,O;a=i.state,l=i.next_in,k=i.input,u=l+(i.avail_in-5),d=i.next_out,O=i.output,h=d-(s-i.avail_out),p=d+(i.avail_out-257),f=a.dmax,x=a.wsize,m=a.whave,y=a.wnext,g=a.window,w=a.hold,_=a.bits,S=a.lencode,E=a.distcode,C=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;e:do{_<15&&(w+=k[l++]<<_,_+=8,w+=k[l++]<<_,_+=8),I=S[w&C];t:for(;;){if(w>>>=P=I>>>24,_-=P,(P=I>>>16&255)===0)O[d++]=65535&I;else{if(!(16&P)){if((64&P)==0){I=S[(65535&I)+(w&(1<<P)-1)];continue t}if(32&P){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}M=65535&I,(P&=15)&&(_<P&&(w+=k[l++]<<_,_+=8),M+=w&(1<<P)-1,w>>>=P,_-=P),_<15&&(w+=k[l++]<<_,_+=8,w+=k[l++]<<_,_+=8),I=E[w&A];n:for(;;){if(w>>>=P=I>>>24,_-=P,!(16&(P=I>>>16&255))){if((64&P)==0){I=E[(65535&I)+(w&(1<<P)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(B=65535&I,_<(P&=15)&&(w+=k[l++]<<_,(_+=8)<P&&(w+=k[l++]<<_,_+=8)),f<(B+=w&(1<<P)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(w>>>=P,_-=P,(P=d-h)<B){if(m<(P=B-P)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(D=g,(N=0)===y){if(N+=x-P,P<M){for(M-=P;O[d++]=g[N++],--P;);N=d-B,D=O}}else if(y<P){if(N+=x+y-P,(P-=y)<M){for(M-=P;O[d++]=g[N++],--P;);if(N=0,y<M){for(M-=P=y;O[d++]=g[N++],--P;);N=d-B,D=O}}}else if(N+=y-P,P<M){for(M-=P;O[d++]=g[N++],--P;);N=d-B,D=O}for(;2<M;)O[d++]=D[N++],O[d++]=D[N++],O[d++]=D[N++],M-=3;M&&(O[d++]=D[N++],1<M&&(O[d++]=D[N++]))}else{for(N=d-B;O[d++]=O[N++],O[d++]=O[N++],O[d++]=O[N++],2<(M-=3););M&&(O[d++]=O[N++],1<M&&(O[d++]=O[N++]))}break}}break}}while(l<u&&d<p);l-=M=_>>3,w&=(1<<(_-=M<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l<u?u-l+5:5-(l-u),i.avail_out=d<p?p-d+257:257-(d-p),a.hold=w,a.bits=_}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),u=n("./inftrees"),d=1,h=2,p=0,f=-2,x=1,m=852,y=592;function g(N){return(N>>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function w(){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 _(N){var D;return N&&N.state?(D=N.state,N.total_in=N.total_out=D.total=0,N.msg="",D.wrap&&(N.adler=1&D.wrap),D.mode=x,D.last=0,D.havedict=0,D.dmax=32768,D.head=null,D.hold=0,D.bits=0,D.lencode=D.lendyn=new i.Buf32(m),D.distcode=D.distdyn=new i.Buf32(y),D.sane=1,D.back=-1,p):f}function S(N){var D;return N&&N.state?((D=N.state).wsize=0,D.whave=0,D.wnext=0,_(N)):f}function E(N,D){var k,O;return N&&N.state?(O=N.state,D<0?(k=0,D=-D):(k=1+(D>>4),D<48&&(D&=15)),D&&(D<8||15<D)?f:(O.window!==null&&O.wbits!==D&&(O.window=null),O.wrap=k,O.wbits=D,S(N))):f}function C(N,D){var k,O;return N?(O=new w,(N.state=O).window=null,(k=E(N,D))!==p&&(N.state=null),k):f}var A,I,P=!0;function M(N){if(P){var D;for(A=new i.Buf32(512),I=new i.Buf32(32),D=0;D<144;)N.lens[D++]=8;for(;D<256;)N.lens[D++]=9;for(;D<280;)N.lens[D++]=7;for(;D<288;)N.lens[D++]=8;for(u(d,N.lens,0,288,A,0,N.work,{bits:9}),D=0;D<32;)N.lens[D++]=5;u(h,N.lens,0,32,I,0,N.work,{bits:5}),P=!1}N.lencode=A,N.lenbits=9,N.distcode=I,N.distbits=5}function B(N,D,k,O){var Y,Z=N.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new i.Buf8(Z.wsize)),O>=Z.wsize?(i.arraySet(Z.window,D,k-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize):(O<(Y=Z.wsize-Z.wnext)&&(Y=O),i.arraySet(Z.window,D,k-O,Y,Z.wnext),(O-=Y)?(i.arraySet(Z.window,D,k-O,O,0),Z.wnext=O,Z.whave=Z.wsize):(Z.wnext+=Y,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=Y))),0}o.inflateReset=S,o.inflateReset2=E,o.inflateResetKeep=_,o.inflateInit=function(N){return C(N,15)},o.inflateInit2=C,o.inflate=function(N,D){var k,O,Y,Z,H,G,j,L,F,T,ee,K,ue,Q,ce,fe,xe,be,je,le,v,q,V,R,z=0,$=new i.Buf8(4),te=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!N||!N.state||!N.output||!N.input&&N.avail_in!==0)return f;(k=N.state).mode===12&&(k.mode=13),H=N.next_out,Y=N.output,j=N.avail_out,Z=N.next_in,O=N.input,G=N.avail_in,L=k.hold,F=k.bits,T=G,ee=j,q=p;e:for(;;)switch(k.mode){case x:if(k.wrap===0){k.mode=13;break}for(;F<16;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if(2&k.wrap&&L===35615){$[k.check=0]=255&L,$[1]=L>>>8&255,k.check=a(k.check,$,2,0),F=L=0,k.mode=2;break}if(k.flags=0,k.head&&(k.head.done=!1),!(1&k.wrap)||(((255&L)<<8)+(L>>8))%31){N.msg="incorrect header check",k.mode=30;break}if((15&L)!=8){N.msg="unknown compression method",k.mode=30;break}if(F-=4,v=8+(15&(L>>>=4)),k.wbits===0)k.wbits=v;else if(v>k.wbits){N.msg="invalid window size",k.mode=30;break}k.dmax=1<<v,N.adler=k.check=1,k.mode=512&L?10:12,F=L=0;break;case 2:for(;F<16;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if(k.flags=L,(255&k.flags)!=8){N.msg="unknown compression method",k.mode=30;break}if(57344&k.flags){N.msg="unknown header flags set",k.mode=30;break}k.head&&(k.head.text=L>>8&1),512&k.flags&&($[0]=255&L,$[1]=L>>>8&255,k.check=a(k.check,$,2,0)),F=L=0,k.mode=3;case 3:for(;F<32;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}k.head&&(k.head.time=L),512&k.flags&&($[0]=255&L,$[1]=L>>>8&255,$[2]=L>>>16&255,$[3]=L>>>24&255,k.check=a(k.check,$,4,0)),F=L=0,k.mode=4;case 4:for(;F<16;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}k.head&&(k.head.xflags=255&L,k.head.os=L>>8),512&k.flags&&($[0]=255&L,$[1]=L>>>8&255,k.check=a(k.check,$,2,0)),F=L=0,k.mode=5;case 5:if(1024&k.flags){for(;F<16;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}k.length=L,k.head&&(k.head.extra_len=L),512&k.flags&&($[0]=255&L,$[1]=L>>>8&255,k.check=a(k.check,$,2,0)),F=L=0}else k.head&&(k.head.extra=null);k.mode=6;case 6:if(1024&k.flags&&(G<(K=k.length)&&(K=G),K&&(k.head&&(v=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Array(k.head.extra_len)),i.arraySet(k.head.extra,O,Z,K,v)),512&k.flags&&(k.check=a(k.check,O,K,Z)),G-=K,Z+=K,k.length-=K),k.length))break e;k.length=0,k.mode=7;case 7:if(2048&k.flags){if(G===0)break e;for(K=0;v=O[Z+K++],k.head&&v&&k.length<65536&&(k.head.name+=String.fromCharCode(v)),v&&K<G;);if(512&k.flags&&(k.check=a(k.check,O,K,Z)),G-=K,Z+=K,v)break e}else k.head&&(k.head.name=null);k.length=0,k.mode=8;case 8:if(4096&k.flags){if(G===0)break e;for(K=0;v=O[Z+K++],k.head&&v&&k.length<65536&&(k.head.comment+=String.fromCharCode(v)),v&&K<G;);if(512&k.flags&&(k.check=a(k.check,O,K,Z)),G-=K,Z+=K,v)break e}else k.head&&(k.head.comment=null);k.mode=9;case 9:if(512&k.flags){for(;F<16;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if(L!==(65535&k.check)){N.msg="header crc mismatch",k.mode=30;break}F=L=0}k.head&&(k.head.hcrc=k.flags>>9&1,k.head.done=!0),N.adler=k.check=0,k.mode=12;break;case 10:for(;F<32;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}N.adler=k.check=g(L),F=L=0,k.mode=11;case 11:if(k.havedict===0)return N.next_out=H,N.avail_out=j,N.next_in=Z,N.avail_in=G,k.hold=L,k.bits=F,2;N.adler=k.check=1,k.mode=12;case 12:if(D===5||D===6)break e;case 13:if(k.last){L>>>=7&F,F-=7&F,k.mode=27;break}for(;F<3;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}switch(k.last=1&L,F-=1,3&(L>>>=1)){case 0:k.mode=14;break;case 1:if(M(k),k.mode=20,D!==6)break;L>>>=2,F-=2;break e;case 2:k.mode=17;break;case 3:N.msg="invalid block type",k.mode=30}L>>>=2,F-=2;break;case 14:for(L>>>=7&F,F-=7&F;F<32;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if((65535&L)!=(L>>>16^65535)){N.msg="invalid stored block lengths",k.mode=30;break}if(k.length=65535&L,F=L=0,k.mode=15,D===6)break e;case 15:k.mode=16;case 16:if(K=k.length){if(G<K&&(K=G),j<K&&(K=j),K===0)break e;i.arraySet(Y,O,Z,K,H),G-=K,Z+=K,j-=K,H+=K,k.length-=K;break}k.mode=12;break;case 17:for(;F<14;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if(k.nlen=257+(31&L),L>>>=5,F-=5,k.ndist=1+(31&L),L>>>=5,F-=5,k.ncode=4+(15&L),L>>>=4,F-=4,286<k.nlen||30<k.ndist){N.msg="too many length or distance symbols",k.mode=30;break}k.have=0,k.mode=18;case 18:for(;k.have<k.ncode;){for(;F<3;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}k.lens[te[k.have++]]=7&L,L>>>=3,F-=3}for(;k.have<19;)k.lens[te[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,V={bits:k.lenbits},q=u(0,k.lens,0,19,k.lencode,0,k.work,V),k.lenbits=V.bits,q){N.msg="invalid code lengths set",k.mode=30;break}k.have=0,k.mode=19;case 19:for(;k.have<k.nlen+k.ndist;){for(;fe=(z=k.lencode[L&(1<<k.lenbits)-1])>>>16&255,xe=65535&z,!((ce=z>>>24)<=F);){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if(xe<16)L>>>=ce,F-=ce,k.lens[k.have++]=xe;else{if(xe===16){for(R=ce+2;F<R;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if(L>>>=ce,F-=ce,k.have===0){N.msg="invalid bit length repeat",k.mode=30;break}v=k.lens[k.have-1],K=3+(3&L),L>>>=2,F-=2}else if(xe===17){for(R=ce+3;F<R;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}F-=ce,v=0,K=3+(7&(L>>>=ce)),L>>>=3,F-=3}else{for(R=ce+7;F<R;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}F-=ce,v=0,K=11+(127&(L>>>=ce)),L>>>=7,F-=7}if(k.have+K>k.nlen+k.ndist){N.msg="invalid bit length repeat",k.mode=30;break}for(;K--;)k.lens[k.have++]=v}}if(k.mode===30)break;if(k.lens[256]===0){N.msg="invalid code -- missing end-of-block",k.mode=30;break}if(k.lenbits=9,V={bits:k.lenbits},q=u(d,k.lens,0,k.nlen,k.lencode,0,k.work,V),k.lenbits=V.bits,q){N.msg="invalid literal/lengths set",k.mode=30;break}if(k.distbits=6,k.distcode=k.distdyn,V={bits:k.distbits},q=u(h,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,V),k.distbits=V.bits,q){N.msg="invalid distances set",k.mode=30;break}if(k.mode=20,D===6)break e;case 20:k.mode=21;case 21:if(6<=G&&258<=j){N.next_out=H,N.avail_out=j,N.next_in=Z,N.avail_in=G,k.hold=L,k.bits=F,l(N,ee),H=N.next_out,Y=N.output,j=N.avail_out,Z=N.next_in,O=N.input,G=N.avail_in,L=k.hold,F=k.bits,k.mode===12&&(k.back=-1);break}for(k.back=0;fe=(z=k.lencode[L&(1<<k.lenbits)-1])>>>16&255,xe=65535&z,!((ce=z>>>24)<=F);){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if(fe&&(240&fe)==0){for(be=ce,je=fe,le=xe;fe=(z=k.lencode[le+((L&(1<<be+je)-1)>>be)])>>>16&255,xe=65535&z,!(be+(ce=z>>>24)<=F);){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}L>>>=be,F-=be,k.back+=be}if(L>>>=ce,F-=ce,k.back+=ce,k.length=xe,fe===0){k.mode=26;break}if(32&fe){k.back=-1,k.mode=12;break}if(64&fe){N.msg="invalid literal/length code",k.mode=30;break}k.extra=15&fe,k.mode=22;case 22:if(k.extra){for(R=k.extra;F<R;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}k.length+=L&(1<<k.extra)-1,L>>>=k.extra,F-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=23;case 23:for(;fe=(z=k.distcode[L&(1<<k.distbits)-1])>>>16&255,xe=65535&z,!((ce=z>>>24)<=F);){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if((240&fe)==0){for(be=ce,je=fe,le=xe;fe=(z=k.distcode[le+((L&(1<<be+je)-1)>>be)])>>>16&255,xe=65535&z,!(be+(ce=z>>>24)<=F);){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}L>>>=be,F-=be,k.back+=be}if(L>>>=ce,F-=ce,k.back+=ce,64&fe){N.msg="invalid distance code",k.mode=30;break}k.offset=xe,k.extra=15&fe,k.mode=24;case 24:if(k.extra){for(R=k.extra;F<R;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}k.offset+=L&(1<<k.extra)-1,L>>>=k.extra,F-=k.extra,k.back+=k.extra}if(k.offset>k.dmax){N.msg="invalid distance too far back",k.mode=30;break}k.mode=25;case 25:if(j===0)break e;if(K=ee-j,k.offset>K){if((K=k.offset-K)>k.whave&&k.sane){N.msg="invalid distance too far back",k.mode=30;break}ue=K>k.wnext?(K-=k.wnext,k.wsize-K):k.wnext-K,K>k.length&&(K=k.length),Q=k.window}else Q=Y,ue=H-k.offset,K=k.length;for(j<K&&(K=j),j-=K,k.length-=K;Y[H++]=Q[ue++],--K;);k.length===0&&(k.mode=21);break;case 26:if(j===0)break e;Y[H++]=k.length,j--,k.mode=21;break;case 27:if(k.wrap){for(;F<32;){if(G===0)break e;G--,L|=O[Z++]<<F,F+=8}if(ee-=j,N.total_out+=ee,k.total+=ee,ee&&(N.adler=k.check=k.flags?a(k.check,Y,ee,H-ee):s(k.check,Y,ee,H-ee)),ee=j,(k.flags?L:g(L))!==k.check){N.msg="incorrect data check",k.mode=30;break}F=L=0}k.mode=28;case 28:if(k.wrap&&k.flags){for(;F<32;){if(G===0)break e;G--,L+=O[Z++]<<F,F+=8}if(L!==(4294967295&k.total)){N.msg="incorrect length check",k.mode=30;break}F=L=0}k.mode=29;case 29:q=1;break e;case 30:q=-3;break e;case 31:return-4;default:return f}return N.next_out=H,N.avail_out=j,N.next_in=Z,N.avail_in=G,k.hold=L,k.bits=F,(k.wsize||ee!==N.avail_out&&k.mode<30&&(k.mode<27||D!==4))&&B(N,N.output,N.next_out,ee-N.avail_out)?(k.mode=31,-4):(T-=N.avail_in,ee-=N.avail_out,N.total_in+=T,N.total_out+=ee,k.total+=ee,k.wrap&&ee&&(N.adler=k.check=k.flags?a(k.check,Y,ee,N.next_out-ee):s(k.check,Y,ee,N.next_out-ee)),N.data_type=k.bits+(k.last?64:0)+(k.mode===12?128:0)+(k.mode===20||k.mode===15?256:0),(T==0&&ee===0||D===4)&&q===p&&(q=-5),q)},o.inflateEnd=function(N){if(!N||!N.state)return f;var D=N.state;return D.window&&(D.window=null),N.state=null,p},o.inflateGetHeader=function(N,D){var k;return N&&N.state?(2&(k=N.state).wrap)==0?f:((k.head=D).done=!1,p):f},o.inflateSetDictionary=function(N,D){var k,O=D.length;return N&&N.state?(k=N.state).wrap!==0&&k.mode!==11?f:k.mode===11&&s(1,D,O,0)!==k.check?-3:B(N,D,O,O)?(k.mode=31,-4):(k.havedict=1,p):f},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],u=[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(d,h,p,f,x,m,y,g){var w,_,S,E,C,A,I,P,M,B=g.bits,N=0,D=0,k=0,O=0,Y=0,Z=0,H=0,G=0,j=0,L=0,F=null,T=0,ee=new i.Buf16(16),K=new i.Buf16(16),ue=null,Q=0;for(N=0;N<=15;N++)ee[N]=0;for(D=0;D<f;D++)ee[h[p+D]]++;for(Y=B,O=15;1<=O&&ee[O]===0;O--);if(O<Y&&(Y=O),O===0)return x[m++]=20971520,x[m++]=20971520,g.bits=1,0;for(k=1;k<O&&ee[k]===0;k++);for(Y<k&&(Y=k),N=G=1;N<=15;N++)if(G<<=1,(G-=ee[N])<0)return-1;if(0<G&&(d===0||O!==1))return-1;for(K[1]=0,N=1;N<15;N++)K[N+1]=K[N]+ee[N];for(D=0;D<f;D++)h[p+D]!==0&&(y[K[h[p+D]]++]=D);if(A=d===0?(F=ue=y,19):d===1?(F=s,T-=257,ue=a,Q-=257,256):(F=l,ue=u,-1),N=k,C=m,H=D=L=0,S=-1,E=(j=1<<(Z=Y))-1,d===1&&852<j||d===2&&592<j)return 1;for(;;){for(I=N-H,M=y[D]<A?(P=0,y[D]):y[D]>A?(P=ue[Q+y[D]],F[T+y[D]]):(P=96,0),w=1<<N-H,k=_=1<<Z;x[C+(L>>H)+(_-=w)]=I<<24|P<<16|M|0,_!==0;);for(w=1<<N-1;L&w;)w>>=1;if(w!==0?(L&=w-1,L+=w):L=0,D++,--ee[N]==0){if(N===O)break;N=h[p+y[D]]}if(Y<N&&(L&E)!==S){for(H===0&&(H=Y),C+=k,G=1<<(Z=N-H);Z+H<O&&!((G-=ee[Z+H])<=0);)Z++,G<<=1;if(j+=1<<Z,d===1&&852<j||d===2&&592<j)return 1;x[S=L&E]=Y<<24|Z<<16|C-m|0}}return L!==0&&(x[C+L]=N-H<<24|64<<16|0),g.bits=Y,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(z){for(var $=z.length;0<=--$;)z[$]=0}var u=0,d=29,h=256,p=h+1+d,f=30,x=19,m=2*p+1,y=15,g=16,w=7,_=256,S=16,E=17,C=18,A=[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],I=[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],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 N=new Array(2*f);l(N);var D=new Array(512);l(D);var k=new Array(256);l(k);var O=new Array(d);l(O);var Y,Z,H,G=new Array(f);function j(z,$,te,re,W){this.static_tree=z,this.extra_bits=$,this.extra_base=te,this.elems=re,this.max_length=W,this.has_stree=z&&z.length}function L(z,$){this.dyn_tree=z,this.max_code=0,this.stat_desc=$}function F(z){return z<256?D[z]:D[256+(z>>>7)]}function T(z,$){z.pending_buf[z.pending++]=255&$,z.pending_buf[z.pending++]=$>>>8&255}function ee(z,$,te){z.bi_valid>g-te?(z.bi_buf|=$<<z.bi_valid&65535,T(z,z.bi_buf),z.bi_buf=$>>g-z.bi_valid,z.bi_valid+=te-g):(z.bi_buf|=$<<z.bi_valid&65535,z.bi_valid+=te)}function K(z,$,te){ee(z,te[2*$],te[2*$+1])}function ue(z,$){for(var te=0;te|=1&z,z>>>=1,te<<=1,0<--$;);return te>>>1}function Q(z,$,te){var re,W,ie=new Array(y+1),he=0;for(re=1;re<=y;re++)ie[re]=he=he+te[re-1]<<1;for(W=0;W<=$;W++){var ae=z[2*W+1];ae!==0&&(z[2*W]=ue(ie[ae]++,ae))}}function ce(z){var $;for($=0;$<p;$++)z.dyn_ltree[2*$]=0;for($=0;$<f;$++)z.dyn_dtree[2*$]=0;for($=0;$<x;$++)z.bl_tree[2*$]=0;z.dyn_ltree[2*_]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function fe(z){8<z.bi_valid?T(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function xe(z,$,te,re){var W=2*$,ie=2*te;return z[W]<z[ie]||z[W]===z[ie]&&re[$]<=re[te]}function be(z,$,te){for(var re=z.heap[te],W=te<<1;W<=z.heap_len&&(W<z.heap_len&&xe($,z.heap[W+1],z.heap[W],z.depth)&&W++,!xe($,re,z.heap[W],z.depth));)z.heap[te]=z.heap[W],te=W,W<<=1;z.heap[te]=re}function je(z,$,te){var re,W,ie,he,ae=0;if(z.last_lit!==0)for(;re=z.pending_buf[z.d_buf+2*ae]<<8|z.pending_buf[z.d_buf+2*ae+1],W=z.pending_buf[z.l_buf+ae],ae++,re===0?K(z,W,$):(K(z,(ie=k[W])+h+1,$),(he=A[ie])!==0&&ee(z,W-=O[ie],he),K(z,ie=F(--re),te),(he=I[ie])!==0&&ee(z,re-=G[ie],he)),ae<z.last_lit;);K(z,_,$)}function le(z,$){var te,re,W,ie=$.dyn_tree,he=$.stat_desc.static_tree,ae=$.stat_desc.has_stree,U=$.stat_desc.elems,ne=-1;for(z.heap_len=0,z.heap_max=m,te=0;te<U;te++)ie[2*te]!==0?(z.heap[++z.heap_len]=ne=te,z.depth[te]=0):ie[2*te+1]=0;for(;z.heap_len<2;)ie[2*(W=z.heap[++z.heap_len]=ne<2?++ne:0)]=1,z.depth[W]=0,z.opt_len--,ae&&(z.static_len-=he[2*W+1]);for($.max_code=ne,te=z.heap_len>>1;1<=te;te--)be(z,ie,te);for(W=U;te=z.heap[1],z.heap[1]=z.heap[z.heap_len--],be(z,ie,1),re=z.heap[1],z.heap[--z.heap_max]=te,z.heap[--z.heap_max]=re,ie[2*W]=ie[2*te]+ie[2*re],z.depth[W]=(z.depth[te]>=z.depth[re]?z.depth[te]:z.depth[re])+1,ie[2*te+1]=ie[2*re+1]=W,z.heap[1]=W++,be(z,ie,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(de,ke){var ze,Ze,at,Ie,Et,Mt,Be=ke.dyn_tree,Lt=ke.max_code,yt=ke.stat_desc.static_tree,pp=ke.stat_desc.has_stree,mp=ke.stat_desc.extra_bits,ha=ke.stat_desc.extra_base,Xn=ke.stat_desc.max_length,Sr=0;for(Ie=0;Ie<=y;Ie++)de.bl_count[Ie]=0;for(Be[2*de.heap[de.heap_max]+1]=0,ze=de.heap_max+1;ze<m;ze++)Xn<(Ie=Be[2*Be[2*(Ze=de.heap[ze])+1]+1]+1)&&(Ie=Xn,Sr++),Be[2*Ze+1]=Ie,Lt<Ze||(de.bl_count[Ie]++,Et=0,ha<=Ze&&(Et=mp[Ze-ha]),Mt=Be[2*Ze],de.opt_len+=Mt*(Ie+Et),pp&&(de.static_len+=Mt*(yt[2*Ze+1]+Et)));if(Sr!==0){do{for(Ie=Xn-1;de.bl_count[Ie]===0;)Ie--;de.bl_count[Ie]--,de.bl_count[Ie+1]+=2,de.bl_count[Xn]--,Sr-=2}while(0<Sr);for(Ie=Xn;Ie!==0;Ie--)for(Ze=de.bl_count[Ie];Ze!==0;)Lt<(at=de.heap[--ze])||(Be[2*at+1]!==Ie&&(de.opt_len+=(Ie-Be[2*at+1])*Be[2*at],Be[2*at+1]=Ie),Ze--)}})(z,$),Q(ie,ne,z.bl_count)}function v(z,$,te){var re,W,ie=-1,he=$[1],ae=0,U=7,ne=4;for(he===0&&(U=138,ne=3),$[2*(te+1)+1]=65535,re=0;re<=te;re++)W=he,he=$[2*(re+1)+1],++ae<U&&W===he||(ae<ne?z.bl_tree[2*W]+=ae:W!==0?(W!==ie&&z.bl_tree[2*W]++,z.bl_tree[2*S]++):ae<=10?z.bl_tree[2*E]++:z.bl_tree[2*C]++,ie=W,ne=(ae=0)===he?(U=138,3):W===he?(U=6,3):(U=7,4))}function q(z,$,te){var re,W,ie=-1,he=$[1],ae=0,U=7,ne=4;for(he===0&&(U=138,ne=3),re=0;re<=te;re++)if(W=he,he=$[2*(re+1)+1],!(++ae<U&&W===he)){if(ae<ne)for(;K(z,W,z.bl_tree),--ae!=0;);else W!==0?(W!==ie&&(K(z,W,z.bl_tree),ae--),K(z,S,z.bl_tree),ee(z,ae-3,2)):ae<=10?(K(z,E,z.bl_tree),ee(z,ae-3,3)):(K(z,C,z.bl_tree),ee(z,ae-11,7));ie=W,ne=(ae=0)===he?(U=138,3):W===he?(U=6,3):(U=7,4)}}l(G);var V=!1;function R(z,$,te,re){ee(z,(u<<1)+(re?1:0),3),(function(W,ie,he,ae){fe(W),T(W,he),T(W,~he),i.arraySet(W.pending_buf,W.window,ie,he,W.pending),W.pending+=he})(z,$,te)}o._tr_init=function(z){V||((function(){var $,te,re,W,ie,he=new Array(y+1);for(W=re=0;W<d-1;W++)for(O[W]=re,$=0;$<1<<A[W];$++)k[re++]=W;for(k[re-1]=W,W=ie=0;W<16;W++)for(G[W]=ie,$=0;$<1<<I[W];$++)D[ie++]=W;for(ie>>=7;W<f;W++)for(G[W]=ie<<7,$=0;$<1<<I[W]-7;$++)D[256+ie++]=W;for(te=0;te<=y;te++)he[te]=0;for($=0;$<=143;)B[2*$+1]=8,$++,he[8]++;for(;$<=255;)B[2*$+1]=9,$++,he[9]++;for(;$<=279;)B[2*$+1]=7,$++,he[7]++;for(;$<=287;)B[2*$+1]=8,$++,he[8]++;for(Q(B,p+1,he),$=0;$<f;$++)N[2*$+1]=5,N[2*$]=ue($,5);Y=new j(B,A,h+1,p,y),Z=new j(N,I,0,f,y),H=new j(new Array(0),P,0,x,w)})(),V=!0),z.l_desc=new L(z.dyn_ltree,Y),z.d_desc=new L(z.dyn_dtree,Z),z.bl_desc=new L(z.bl_tree,H),z.bi_buf=0,z.bi_valid=0,ce(z)},o._tr_stored_block=R,o._tr_flush_block=function(z,$,te,re){var W,ie,he=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(ae){var U,ne=4093624447;for(U=0;U<=31;U++,ne>>>=1)if(1&ne&&ae.dyn_ltree[2*U]!==0)return s;if(ae.dyn_ltree[18]!==0||ae.dyn_ltree[20]!==0||ae.dyn_ltree[26]!==0)return a;for(U=32;U<h;U++)if(ae.dyn_ltree[2*U]!==0)return a;return s})(z)),le(z,z.l_desc),le(z,z.d_desc),he=(function(ae){var U;for(v(ae,ae.dyn_ltree,ae.l_desc.max_code),v(ae,ae.dyn_dtree,ae.d_desc.max_code),le(ae,ae.bl_desc),U=x-1;3<=U&&ae.bl_tree[2*M[U]+1]===0;U--);return ae.opt_len+=3*(U+1)+5+5+4,U})(z),W=z.opt_len+3+7>>>3,(ie=z.static_len+3+7>>>3)<=W&&(W=ie)):W=ie=te+5,te+4<=W&&$!==-1?R(z,$,te,re):z.strategy===4||ie===W?(ee(z,2+(re?1:0),3),je(z,B,N)):(ee(z,4+(re?1:0),3),(function(ae,U,ne,de){var ke;for(ee(ae,U-257,5),ee(ae,ne-1,5),ee(ae,de-4,4),ke=0;ke<de;ke++)ee(ae,ae.bl_tree[2*M[ke]+1],3);q(ae,ae.dyn_ltree,U-1),q(ae,ae.dyn_dtree,ne-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,he+1),je(z,z.dyn_ltree,z.dyn_dtree)),ce(z),re&&fe(z)},o._tr_tally=function(z,$,te){return z.pending_buf[z.d_buf+2*z.last_lit]=$>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&$,z.pending_buf[z.l_buf+z.last_lit]=255&te,z.last_lit++,$===0?z.dyn_ltree[2*te]++:(z.matches++,$--,z.dyn_ltree[2*(k[te]+h+1)]++,z.dyn_dtree[2*F($)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){ee(z,2,3),K(z,_,B),(function($){$.bi_valid===16?(T($,$.bi_buf),$.bi_buf=0,$.bi_valid=0):8<=$.bi_valid&&($.pending_buf[$.pending++]=255&$.bi_buf,$.bi_buf>>=8,$.bi_valid-=8)})(z)}},{"../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,u,d,h,p=1,f={},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(){w(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,E=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=E,S}})()?(h="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",_,!1):s.attachEvent("onmessage",_),function(S){s.postMessage(h+S,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){w(S.data)},function(S){d.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(S){var E=m.createElement("script");E.onreadystatechange=function(){w(S),E.onreadystatechange=null,u.removeChild(E),E=null},u.appendChild(E)}):function(S){setTimeout(w,0,S)},y.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var E=new Array(arguments.length-1),C=0;C<E.length;C++)E[C]=arguments[C+1];var A={callback:S,args:E};return f[p]=A,l(p),p++},y.clearImmediate=g}function g(S){delete f[S]}function w(S){if(x)setTimeout(w,0,S);else{var E=f[S];if(E){x=!0;try{(function(C){var A=C.callback,I=C.args;switch(I.length){case 0:A();break;case 1:A(I[0]);break;case 2:A(I[0],I[1]);break;case 3:A(I[0],I[1],I[2]);break;default:A.apply(a,I)}})(E)}finally{g(S),x=!1}}}}function _(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(h)===0&&w(+S.data.slice(h.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof Cr<"u"?Cr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Jo)),Jo.exports}var Av=Tv();const zv=us(Av);async function Iv(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 Rv(e){const t=new zv;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 Iv(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 Pv="1.14.3",Ov={version:Pv};function Mu(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=Mu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Mu(e))&&(r&&(r+=" "),r+=t);return r}const Dv=(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},Mv=(e,t)=>({classGroupId:e,validator:t}),Fu=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),to="-",Za=[],Lv="arbitrary..",Fv=e=>{const t=Bv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return $v(s);const a=s.split(to),l=a[0]===""&&a.length>1?1:0;return $u(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],u=n[s];return l?u?Dv(u,l):l:u||Za}return n[s]||Za}}},$u=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const u=$u(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(to):e.slice(t).join(to),l=s.length;for(let u=0;u<l;u++){const d=s[u];if(d.validator(a))return d.classGroupId}},$v=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?Lv+r:void 0})(),Bv=e=>{const{theme:t,classGroups:n}=e;return Uv(n,t)},Uv=(e,t)=>{const n=Fu();for(const r in e){const o=e[r];Es(o,n,r,t)}return n},Es=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Zv(s,t,n,r)}},Zv=(e,t,n,r)=>{if(typeof e=="string"){Vv(e,t,n);return}if(typeof e=="function"){Wv(e,t,n,r);return}Hv(e,t,n,r)},Vv=(e,t,n)=>{const r=e===""?t:Bu(t,e);r.classGroupId=n},Wv=(e,t,n,r)=>{if(qv(e)){Es(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Mv(n,e))},Hv=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];Es(l,Bu(t,a),n,r)}},Bu=(e,t)=>{let n=e;const r=t.split(to),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=Fu(),n.nextPart.set(s,a)),n=a}return n},qv=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Kv=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)}}},Ri="!",Va=":",Gv=[],Wa=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Jv=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,u;const d=o.length;for(let m=0;m<d;m++){const y=o[m];if(s===0&&a===0){if(y===Va){i.push(o.slice(l,m)),l=m+1;continue}if(y==="/"){u=m;continue}}y==="["?s++:y==="]"?s--:y==="("?a++:y===")"&&a--}const h=i.length===0?o:o.slice(l);let p=h,f=!1;h.endsWith(Ri)?(p=h.slice(0,-1),f=!0):h.startsWith(Ri)&&(p=h.slice(1),f=!0);const x=u&&u>l?u-l:void 0;return Wa(i,f,p,x)};if(t){const o=t+Va,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):Wa(Gv,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Yv=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}},Xv=e=>({cache:Kv(e.cacheSize),parseClassName:Jv(e),sortModifiers:Yv(e),...Fv(e)}),Qv=/\s+/,e1=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Qv);let l="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:h,modifiers:p,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:m}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let y=!!m,g=r(y?x.substring(0,m):x);if(!g){if(!y){l=d+(l.length>0?" "+l:l);continue}if(g=r(x),!g){l=d+(l.length>0?" "+l:l);continue}y=!1}const w=p.length===0?"":p.length===1?p[0]:i(p).join(":"),_=f?w+Ri:w,S=_+g;if(s.indexOf(S)>-1)continue;s.push(S);const E=o(g,y);for(let C=0;C<E.length;++C){const A=E[C];s.push(_+A)}l=d+(l.length>0?" "+l:l)}return l},t1=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Uu(n))&&(o&&(o+=" "),o+=r);return o},Uu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Uu(e[r]))&&(n&&(n+=" "),n+=t);return n},n1=(e,...t)=>{let n,r,o,i;const s=l=>{const u=t.reduce((d,h)=>h(d),e());return n=Xv(u),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const u=r(l);if(u)return u;const d=e1(l,n);return o(l,d),d};return i=s,(...l)=>i(t1(...l))},r1=[],He=e=>{const t=n=>n[e]||r1;return t.isThemeGetter=!0,t},Zu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,o1=/^\d+\/\d+$/,i1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s1=/\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$/,a1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,l1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yn=e=>o1.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),Ht=e=>!!e&&Number.isInteger(Number(e)),Yo=e=>e.endsWith("%")&&Te(e.slice(0,-1)),Ft=e=>i1.test(e),u1=()=>!0,d1=e=>s1.test(e)&&!a1.test(e),Wu=()=>!1,f1=e=>l1.test(e),h1=e=>c1.test(e),p1=e=>!pe(e)&&!me(e),m1=e=>Wn(e,Ku,Wu),pe=e=>Zu.test(e),on=e=>Wn(e,Gu,d1),Xo=e=>Wn(e,v1,Te),Ha=e=>Wn(e,Hu,Wu),g1=e=>Wn(e,qu,h1),Ar=e=>Wn(e,Ju,f1),me=e=>Vu.test(e),er=e=>Hn(e,Gu),x1=e=>Hn(e,w1),qa=e=>Hn(e,Hu),y1=e=>Hn(e,Ku),b1=e=>Hn(e,qu),zr=e=>Hn(e,Ju,!0),Wn=(e,t,n)=>{const r=Zu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Hn=(e,t,n=!1)=>{const r=Vu.exec(e);return r?r[1]?t(r[1]):n:!1},Hu=e=>e==="position"||e==="percentage",qu=e=>e==="image"||e==="url",Ku=e=>e==="length"||e==="size"||e==="bg-size",Gu=e=>e==="length",v1=e=>e==="number",w1=e=>e==="family-name",Ju=e=>e==="shadow",k1=()=>{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"),u=He("radius"),d=He("shadow"),h=He("inset-shadow"),p=He("text-shadow"),f=He("drop-shadow"),x=He("blur"),m=He("perspective"),y=He("aspect"),g=He("ease"),w=He("animate"),_=()=>["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"],E=()=>[...S(),me,pe],C=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],I=()=>[me,pe,l],P=()=>[yn,"full","auto",...I()],M=()=>[Ht,"none","subgrid",me,pe],B=()=>["auto",{span:["full",Ht,me,pe]},Ht,me,pe],N=()=>[Ht,"auto",me,pe],D=()=>["auto","min","max","fr",me,pe],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...I()],Z=()=>[yn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],H=()=>[e,me,pe],G=()=>[...S(),qa,Ha,{position:[me,pe]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",y1,m1,{size:[me,pe]}],F=()=>[Yo,er,on],T=()=>["","none","full",u,me,pe],ee=()=>["",Te,er,on],K=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Te,Yo,qa,Ha],ce=()=>["","none",x,me,pe],fe=()=>["none",Te,me,pe],xe=()=>["none",Te,me,pe],be=()=>[Te,me,pe],je=()=>[yn,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ft],breakpoint:[Ft],color:[u1],container:[Ft],"drop-shadow":[Ft],ease:["in","out","in-out"],font:[p1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ft],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ft],shadow:[Ft],spacing:["px",Te],text:[Ft],"text-shadow":[Ft],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yn,pe,me,y]}],container:["container"],columns:[{columns:[Te,pe,me,a]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:E()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],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:[Ht,"auto",me,pe]}],basis:[{basis:[yn,"full","auto",a,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,yn,"auto","initial","none",pe]}],grow:[{grow:["",Te,me,pe]}],shrink:[{shrink:["",Te,me,pe]}],order:[{order:[Ht,"first","last","none",me,pe]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...O(),"baseline"]}],"place-self":[{"place-self":["auto",...O()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"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,er,on]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,me,Xo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yo,pe]}],"font-family":[{font:[x1,pe,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,me,pe]}],"line-clamp":[{"line-clamp":[Te,"none",me,Xo]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",me,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",me,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",me,on]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Te,"auto",me,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me,pe]}],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",me,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ht,me,pe],radial:["",me,pe],conic:[Ht,me,pe]},b1,g1]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,me,pe]}],"outline-w":[{outline:["",Te,er,on]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",d,zr,Ar]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,zr,Ar]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Te,on]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",p,zr,Ar]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Te,me,pe]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[me,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",me,pe]}],filter:[{filter:["","none",me,pe]}],blur:[{blur:ce()}],brightness:[{brightness:[Te,me,pe]}],contrast:[{contrast:[Te,me,pe]}],"drop-shadow":[{"drop-shadow":["","none",f,zr,Ar]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Te,me,pe]}],"hue-rotate":[{"hue-rotate":[Te,me,pe]}],invert:[{invert:["",Te,me,pe]}],saturate:[{saturate:[Te,me,pe]}],sepia:[{sepia:["",Te,me,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",me,pe]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Te,me,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Te,me,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,me,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,me,pe]}],"backdrop-invert":[{"backdrop-invert":["",Te,me,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Te,me,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Te,me,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,me,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",me,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",me,pe]}],ease:[{ease:["linear","initial",g,me,pe]}],delay:[{delay:[Te,me,pe]}],animate:[{animate:["none",w,me,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,me,pe]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[me,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",me,pe]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",me,pe]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Te,er,on,Xo]}],stroke:[{stroke:["none",...H()]}],"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"]}},_1=n1(k1);function ge(...e){return _1(Lu(e))}function qe(e){return e>=1048576?(e/1048576).toFixed(1).replace(/\.0$/,"")+"M":e>=1024?(e/1024).toFixed(1).replace(/\.0$/,"")+"K":e.toString()}function Yu(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const Ka=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ga=Lu,Ns=(e,t)=>n=>{var r;if(t?.variants==null)return Ga(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n?.[u],h=i?.[u];if(d===null)return null;const p=Ka(d)||Ka(h);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[h,p]=d;return p===void 0||(u[h]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:p,...f}=d;return Object.entries(f).every(x=>{let[m,y]=x;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...u,h,p]:u},[]);return Ga(e,s,l,n?.class,n?.className)};function Ja(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xu(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Ja(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():Ja(e[o],null)}}}}function Pe(...e){return b.useCallback(Xu(...e),e)}function Mn(e){const t=C1(e),n=b.forwardRef((r,o)=>{const{children:i,...s}=r,a=b.Children.toArray(i),l=a.find(N1);if(l){const u=l.props.children,d=a.map(h=>h===l?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,d):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var S1=Mn("Slot");function C1(e){const t=b.forwardRef((n,r)=>{const{children:o,...i}=n;if(b.isValidElement(o)){const s=T1(o),a=j1(i,o.props);return o.type!==b.Fragment&&(a.ref=r?Xu(r,s):s),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qu=Symbol("radix.slottable");function E1(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Qu,t}function N1(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qu}function j1(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 T1(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 A1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=A1.reduce((e,t)=>{const n=Mn(`Primitive.${t}`),r=b.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function z1(e,t){e&&xr.flushSync(()=>e.dispatchEvent(t))}var ed=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"}),I1="VisuallyHidden",td=b.forwardRef((e,t)=>c.jsx(Ee.span,{...e,ref:t,style:{...ed,...e.style}}));td.displayName=I1;var R1=td;function P1(e,t){const n=b.createContext(t),r=i=>{const{children:s,...a}=i,l=b.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=b.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 Wt(e,t=[]){let n=[];function r(i,s){const a=b.createContext(s),l=n.length;n=[...n,s];const u=h=>{const{scope:p,children:f,...x}=h,m=p?.[e]?.[l]||a,y=b.useMemo(()=>x,Object.values(x));return c.jsx(m.Provider,{value:y,children:f})};u.displayName=i+"Provider";function d(h,p){const f=p?.[e]?.[l]||a,x=b.useContext(f);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(s=>b.createContext(s));return function(a){const l=a?.[e]||i;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,O1(o,...t)]}function O1(...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:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function nd(e){const t=e+"CollectionProvider",[n,r]=Wt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:g}=m,w=rt.useRef(null),_=rt.useRef(new Map).current;return c.jsx(o,{scope:y,itemMap:_,collectionRef:w,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=Mn(a),u=rt.forwardRef((m,y)=>{const{scope:g,children:w}=m,_=i(a,g),S=Pe(y,_.collectionRef);return c.jsx(l,{ref:S,children:w})});u.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",p=Mn(d),f=rt.forwardRef((m,y)=>{const{scope:g,children:w,..._}=m,S=rt.useRef(null),E=Pe(y,S),C=i(d,g);return rt.useEffect(()=>(C.itemMap.set(S,{ref:S,..._}),()=>{C.itemMap.delete(S)})),c.jsx(p,{[h]:"",ref:E,children:w})});f.displayName=d;function x(m){const y=i(e+"CollectionConsumer",m);return rt.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const _=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((C,A)=>_.indexOf(C.ref.current)-_.indexOf(A.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:u,ItemSlot:f},x,r]}function _e(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Ke=globalThis?.document?b.useLayoutEffect:()=>{},D1=Dc[" useInsertionEffect ".trim().toString()]||Ke;function an({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=M1({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=b.useRef(e!==void 0);b.useEffect(()=>{const h=d.current;h!==a&&console.warn(`${r} is changing from ${h?"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.`),d.current=a},[a,r])}const u=b.useCallback(d=>{if(a){const h=L1(d)?d(e):d;h!==e&&s.current?.(h)}else i(d)},[a,e,i,s]);return[l,u]}function M1({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),o=b.useRef(n),i=b.useRef(t);return D1(()=>{i.current=t},[t]),b.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function L1(e){return typeof e=="function"}function F1(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var gt=e=>{const{present:t,children:n}=e,r=$1(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),i=Pe(r.ref,B1(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:i}):null};gt.displayName="Presence";function $1(e){const[t,n]=b.useState(),r=b.useRef(null),o=b.useRef(e),i=b.useRef("none"),s=e?"mounted":"unmounted",[a,l]=F1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Ir(r.current);i.current=a==="mounted"?u:"none"},[a]),Ke(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,f=Ir(u);e?l("MOUNT"):f==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ke(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=f=>{const m=Ir(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=f=>{f.target===t&&(i.current=Ir(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ir(e){return e?.animationName||"none"}function B1(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 U1=Dc[" useId ".trim().toString()]||(()=>{}),Z1=0;function zt(e){const[t,n]=b.useState(U1());return Ke(()=>{n(r=>r??String(Z1++))},[e]),e||(t?`radix-${t}`:"")}var ko="Collapsible",[V1]=Wt(ko),[W1,js]=V1(ko),rd=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,u]=an({prop:r,defaultProp:o??!1,onChange:s,caller:ko});return c.jsx(W1,{scope:n,disabled:i,contentId:zt(),open:l,onOpenToggle:b.useCallback(()=>u(d=>!d),[u]),children:c.jsx(Ee.div,{"data-state":As(l),"data-disabled":i?"":void 0,...a,ref:t})})});rd.displayName=ko;var od="CollapsibleTrigger",id=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=js(od,n);return c.jsx(Ee.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":As(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:_e(e.onClick,o.onOpenToggle)})});id.displayName=od;var Ts="CollapsibleContent",sd=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=js(Ts,e.__scopeCollapsible);return c.jsx(gt,{present:n||o.open,children:({present:i})=>c.jsx(H1,{...r,ref:t,present:i})})});sd.displayName=Ts;var H1=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=js(Ts,n),[a,l]=b.useState(r),u=b.useRef(null),d=Pe(t,u),h=b.useRef(0),p=h.current,f=b.useRef(0),x=f.current,m=s.open||a,y=b.useRef(m),g=b.useRef(void 0);return b.useEffect(()=>{const w=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(w)},[]),Ke(()=>{const w=u.current;if(w){g.current=g.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const _=w.getBoundingClientRect();h.current=_.height,f.current=_.width,y.current||(w.style.transitionDuration=g.current.transitionDuration,w.style.animationName=g.current.animationName),l(r)}},[s.open,r]),c.jsx(Ee.div,{"data-state":As(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:d,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 As(e){return e?"open":"closed"}var q1=rd,K1=b.createContext(void 0);function _o(e){const t=b.useContext(K1);return e||t||"ltr"}function Qe(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function G1(e,t=globalThis?.document){const n=Qe(e);b.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 J1="DismissableLayer",Pi="dismissableLayer.update",Y1="dismissableLayer.pointerDownOutside",X1="dismissableLayer.focusOutside",Ya,ad=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),So=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=b.useContext(ad),[d,h]=b.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=b.useState({}),x=Pe(t,A=>h(A)),m=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),w=d?m.indexOf(d):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=g,E=tw(A=>{const I=A.target,P=[...u.branches].some(M=>M.contains(I));!S||P||(o?.(A),s?.(A),A.defaultPrevented||a?.())},p),C=nw(A=>{const I=A.target;[...u.branches].some(M=>M.contains(I))||(i?.(A),s?.(A),A.defaultPrevented||a?.())},p);return G1(A=>{w===u.layers.size-1&&(r?.(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},p),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ya=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Xa(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Ya)}},[d,p,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Xa())},[d,u]),b.useEffect(()=>{const A=()=>f({});return document.addEventListener(Pi,A),()=>document.removeEventListener(Pi,A)},[]),c.jsx(Ee.div,{...l,ref:x,style:{pointerEvents:_?S?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,C.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,E.onPointerDownCapture)})});So.displayName=J1;var Q1="DismissableLayerBranch",ew=b.forwardRef((e,t)=>{const n=b.useContext(ad),r=b.useRef(null),o=Pe(t,r);return b.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(Ee.div,{...e,ref:o})});ew.displayName=Q1;function tw(e,t=globalThis?.document){const n=Qe(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){ld(Y1,n,u,{discrete:!0})};const u={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 nw(e,t=globalThis?.document){const n=Qe(e),r=b.useRef(!1);return b.useEffect(()=>{const o=i=>{i.target&&!r.current&&ld(X1,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 Xa(){const e=new CustomEvent(Pi);document.dispatchEvent(e)}function ld(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?z1(o,i):o.dispatchEvent(i)}var Qo="focusScope.autoFocusOnMount",ei="focusScope.autoFocusOnUnmount",Qa={bubbles:!1,cancelable:!0},rw="FocusScope",zs=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=b.useState(null),u=Qe(o),d=Qe(i),h=b.useRef(null),p=Pe(t,m=>l(m)),f=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let m=function(_){if(f.paused||!a)return;const S=_.target;a.contains(S)?h.current=S:Kt(h.current,{select:!0})},y=function(_){if(f.paused||!a)return;const S=_.relatedTarget;S!==null&&(a.contains(S)||Kt(h.current,{select:!0}))},g=function(_){if(document.activeElement===document.body)for(const E of _)E.removedNodes.length>0&&Kt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const w=new MutationObserver(g);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),w.disconnect()}}},[r,a,f.paused]),b.useEffect(()=>{if(a){tl.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Qo,Qa);a.addEventListener(Qo,u),a.dispatchEvent(g),g.defaultPrevented||(ow(cw(cd(a)),{select:!0}),document.activeElement===m&&Kt(a))}return()=>{a.removeEventListener(Qo,u),setTimeout(()=>{const g=new CustomEvent(ei,Qa);a.addEventListener(ei,d),a.dispatchEvent(g),g.defaultPrevented||Kt(m??document.body,{select:!0}),a.removeEventListener(ei,d),tl.remove(f)},0)}}},[a,u,d,f]);const x=b.useCallback(m=>{if(!n&&!r||f.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const w=m.currentTarget,[_,S]=iw(w);_&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Kt(_,{select:!0})):m.shiftKey&&g===_&&(m.preventDefault(),n&&Kt(S,{select:!0})):g===w&&m.preventDefault()}},[n,r,f.paused]);return c.jsx(Ee.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});zs.displayName=rw;function ow(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Kt(r,{select:t}),document.activeElement!==n)return}function iw(e){const t=cd(e),n=el(t,e),r=el(t.reverse(),e);return[n,r]}function cd(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 el(e,t){for(const n of e)if(!sw(n,{upTo:t}))return n}function sw(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 aw(e){return e instanceof HTMLInputElement&&"select"in e}function Kt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aw(e)&&t&&e.select()}}var tl=lw();function lw(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=nl(e,t),e.unshift(t)},remove(t){e=nl(e,t),e[0]?.resume()}}}function nl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function cw(e){return e.filter(t=>t.tagName!=="A")}var uw="Portal",Co=b.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=b.useState(!1);Ke(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?xp.createPortal(c.jsx(Ee.div,{...r,ref:t}),s):null});Co.displayName=uw;var ti=0;function ud(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rl()),document.body.insertAdjacentElement("beforeend",e[1]??rl()),ti++,()=>{ti===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ti--}},[])}function rl(){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 jt=function(){return jt=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},jt.apply(this,arguments)};function dd(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 dw(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 Vr="right-scroll-bar-position",Wr="width-before-scroll-bar",fw="with-scroll-bars-hidden",hw="--removed-body-scroll-bar-size";function ni(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pw(e,t){var n=b.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 mw=typeof window<"u"?b.useLayoutEffect:b.useEffect,ol=new WeakMap;function gw(e,t){var n=pw(null,function(r){return e.forEach(function(o){return ni(o,r)})});return mw(function(){var r=ol.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||ni(a,null)}),i.forEach(function(a){o.has(a)||ni(a,s)})}ol.set(n,e)},[e]),n}function xw(e){return e}function yw(e,t){t===void 0&&(t=xw);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 d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function bw(e){e===void 0&&(e={});var t=yw(null);return t.options=jt({async:!0,ssr:!1},e),t}var fd=function(e){var t=e.sideCar,n=dd(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 b.createElement(r,jt({},n))};fd.isSideCarExport=!0;function vw(e,t){return e.useMedium(t),fd}var hd=bw(),ri=function(){},Eo=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:ri,onWheelCapture:ri,onTouchMoveCapture:ri}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,p=e.sideCar,f=e.noRelative,x=e.noIsolation,m=e.inert,y=e.allowPinchZoom,g=e.as,w=g===void 0?"div":g,_=e.gapMode,S=dd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,C=gw([n,t]),A=jt(jt({},S),o);return b.createElement(b.Fragment,null,d&&b.createElement(E,{sideCar:hd,removeScrollBar:u,shards:h,noRelative:f,noIsolation:x,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:_}),s?b.cloneElement(b.Children.only(a),jt(jt({},A),{ref:C})):b.createElement(w,jt({},A,{className:l,ref:C}),a))});Eo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Eo.classNames={fullWidth:Wr,zeroRight:Vr};var ww=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function kw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ww();return t&&e.setAttribute("nonce",t),e}function _w(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Sw(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Cw=function(){var e=0,t=null;return{add:function(n){e==0&&(t=kw())&&(_w(t,n),Sw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ew=function(){var e=Cw();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pd=function(){var e=Ew(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Nw={left:0,top:0,right:0,gap:0},oi=function(e){return parseInt(e||"",10)||0},jw=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[oi(n),oi(r),oi(o)]},Tw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Nw;var t=jw(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])}},Aw=pd(),An="data-scroll-locked",zw=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
41
- .`.concat(fw,` {
42
- overflow: hidden `).concat(r,`;
43
- padding-right: `).concat(a,"px ").concat(r,`;
44
- }
45
- body[`).concat(An,`] {
46
- overflow: hidden `).concat(r,`;
47
- overscroll-behavior: contain;
48
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
49
- padding-left: `.concat(o,`px;
50
- padding-top: `).concat(i,`px;
51
- padding-right: `).concat(s,`px;
52
- margin-left:0;
53
- margin-top:0;
54
- margin-right: `).concat(a,"px ").concat(r,`;
55
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
56
- }
57
-
58
- .`).concat(Vr,` {
59
- right: `).concat(a,"px ").concat(r,`;
60
- }
61
-
62
- .`).concat(Wr,` {
63
- margin-right: `).concat(a,"px ").concat(r,`;
64
- }
65
-
66
- .`).concat(Vr," .").concat(Vr,` {
67
- right: 0 `).concat(r,`;
68
- }
69
-
70
- .`).concat(Wr," .").concat(Wr,` {
71
- margin-right: 0 `).concat(r,`;
72
- }
73
-
74
- body[`).concat(An,`] {
75
- `).concat(hw,": ").concat(a,`px;
76
- }
77
- `)},il=function(){var e=parseInt(document.body.getAttribute(An)||"0",10);return isFinite(e)?e:0},Iw=function(){b.useEffect(function(){return document.body.setAttribute(An,(il()+1).toString()),function(){var e=il()-1;e<=0?document.body.removeAttribute(An):document.body.setAttribute(An,e.toString())}},[])},Rw=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Iw();var i=b.useMemo(function(){return Tw(o)},[o]);return b.createElement(Aw,{styles:zw(i,!t,o,n?"":"!important")})},Oi=!1;if(typeof window<"u")try{var Rr=Object.defineProperty({},"passive",{get:function(){return Oi=!0,!0}});window.addEventListener("test",Rr,Rr),window.removeEventListener("test",Rr,Rr)}catch{Oi=!1}var bn=Oi?{passive:!1}:!1,Pw=function(e){return e.tagName==="TEXTAREA"},md=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Pw(e)&&n[t]==="visible")},Ow=function(e){return md(e,"overflowY")},Dw=function(e){return md(e,"overflowX")},sl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=gd(e,r);if(o){var i=xd(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Mw=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Lw=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gd=function(e,t){return e==="v"?Ow(t):Dw(t)},xd=function(e,t){return e==="v"?Mw(t):Lw(t)},Fw=function(e,t){return e==="h"&&t==="rtl"?-1:1},$w=function(e,t,n,r,o){var i=Fw(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,h=0,p=0;do{if(!a)break;var f=xd(e,a),x=f[0],m=f[1],y=f[2],g=m-y-i*x;(x||g)&&gd(e,a)&&(h+=g,p+=x);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(h)<1||!d&&Math.abs(p)<1)&&(u=!0),u},Pr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},al=function(e){return[e.deltaX,e.deltaY]},ll=function(e){return e&&"current"in e?e.current:e},Bw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Uw=function(e){return`
78
- .block-interactivity-`.concat(e,` {pointer-events: none;}
79
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
80
- `)},Zw=0,vn=[];function Vw(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),o=b.useState(Zw++)[0],i=b.useState(pd)[0],s=b.useRef(e);b.useEffect(function(){s.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=dw([e.lockRef.current],(e.shards||[]).map(ll),!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=b.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=Pr(m),w=n.current,_="deltaX"in m?m.deltaX:w[0]-g[0],S="deltaY"in m?m.deltaY:w[1]-g[1],E,C=m.target,A=Math.abs(_)>Math.abs(S)?"h":"v";if("touches"in m&&A==="h"&&C.type==="range")return!1;var I=window.getSelection(),P=I&&I.anchorNode,M=P?P===C||P.contains(C):!1;if(M)return!1;var B=sl(A,C);if(!B)return!0;if(B?E=A:(E=A==="v"?"h":"v",B=sl(A,C)),!B)return!1;if(!r.current&&"changedTouches"in m&&(_||S)&&(r.current=E),!E)return!0;var N=r.current||E;return $w(N,y,m,N==="h"?_:S)},[]),l=b.useCallback(function(m){var y=m;if(!(!vn.length||vn[vn.length-1]!==i)){var g="deltaY"in y?al(y):Pr(y),w=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&Bw(E.delta,g)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var _=(s.current.shards||[]).map(ll).filter(Boolean).filter(function(E){return E.contains(y.target)}),S=_.length>0?a(y,_[0]):!s.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),u=b.useCallback(function(m,y,g,w){var _={name:m,delta:y,target:g,should:w,shadowParent:Ww(g)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(S){return S!==_})},1)},[]),d=b.useCallback(function(m){n.current=Pr(m),r.current=void 0},[]),h=b.useCallback(function(m){u(m.type,al(m),m.target,a(m,e.lockRef.current))},[]),p=b.useCallback(function(m){u(m.type,Pr(m),m.target,a(m,e.lockRef.current))},[]);b.useEffect(function(){return vn.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,bn),document.addEventListener("touchmove",l,bn),document.addEventListener("touchstart",d,bn),function(){vn=vn.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,bn),document.removeEventListener("touchmove",l,bn),document.removeEventListener("touchstart",d,bn)}},[]);var f=e.removeScrollBar,x=e.inert;return b.createElement(b.Fragment,null,x?b.createElement(i,{styles:Uw(o)}):null,f?b.createElement(Rw,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ww(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hw=vw(hd,Vw);var Is=b.forwardRef(function(e,t){return b.createElement(Eo,jt({},e,{ref:t,sideCar:Hw}))});Is.classNames=Eo.classNames;var qw=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wn=new WeakMap,Or=new WeakMap,Dr={},ii=0,yd=function(e){return e&&(e.host||yd(e.parentNode))},Kw=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=yd(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})},Gw=function(e,t,n,r){var o=Kw(t,Array.isArray(e)?e:[e]);Dr[n]||(Dr[n]=new WeakMap);var i=Dr[n],s=[],a=new Set,l=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))d(p);else try{var f=p.getAttribute(r),x=f!==null&&f!=="false",m=(wn.get(p)||0)+1,y=(i.get(p)||0)+1;wn.set(p,m),i.set(p,y),s.push(p),m===1&&x&&Or.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 d(t),a.clear(),ii++,function(){s.forEach(function(h){var p=wn.get(h)-1,f=i.get(h)-1;wn.set(h,p),i.set(h,f),p||(Or.has(h)||h.removeAttribute(r),Or.delete(h)),f||h.removeAttribute(n)}),ii--,ii||(wn=new WeakMap,wn=new WeakMap,Or=new WeakMap,Dr={})}},bd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=qw(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Gw(r,o,n,"aria-hidden")):function(){return null}},No="Dialog",[vd]=Wt(No),[Jw,Ct]=vd(No),wd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=b.useRef(null),l=b.useRef(null),[u,d]=an({prop:r,defaultProp:o??!1,onChange:i,caller:No});return c.jsx(Jw,{scope:t,triggerRef:a,contentRef:l,contentId:zt(),titleId:zt(),descriptionId:zt(),open:u,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),modal:s,children:n})};wd.displayName=No;var kd="DialogTrigger",_d=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(kd,n),i=Pe(t,o.triggerRef);return c.jsx(Ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Os(o.open),...r,ref:i,onClick:_e(e.onClick,o.onOpenToggle)})});_d.displayName=kd;var Rs="DialogPortal",[Yw,Sd]=vd(Rs,{forceMount:void 0}),Cd=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Ct(Rs,t);return c.jsx(Yw,{scope:t,forceMount:n,children:b.Children.map(r,s=>c.jsx(gt,{present:n||i.open,children:c.jsx(Co,{asChild:!0,container:o,children:s})}))})};Cd.displayName=Rs;var no="DialogOverlay",Ed=b.forwardRef((e,t)=>{const n=Sd(no,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ct(no,e.__scopeDialog);return i.modal?c.jsx(gt,{present:r||i.open,children:c.jsx(Qw,{...o,ref:t})}):null});Ed.displayName=no;var Xw=Mn("DialogOverlay.RemoveScroll"),Qw=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(no,n);return c.jsx(Is,{as:Xw,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(Ee.div,{"data-state":Os(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ln="DialogContent",Nd=b.forwardRef((e,t)=>{const n=Sd(ln,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ct(ln,e.__scopeDialog);return c.jsx(gt,{present:r||i.open,children:i.modal?c.jsx(e2,{...o,ref:t}):c.jsx(t2,{...o,ref:t})})});Nd.displayName=ln;var e2=b.forwardRef((e,t)=>{const n=Ct(ln,e.__scopeDialog),r=b.useRef(null),o=Pe(t,n.contentRef,r);return b.useEffect(()=>{const i=r.current;if(i)return bd(i)},[]),c.jsx(jd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault())})}),t2=b.forwardRef((e,t)=>{const n=Ct(ln,e.__scopeDialog),r=b.useRef(!1),o=b.useRef(!1);return c.jsx(jd,{...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()}})}),jd=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Ct(ln,n),l=b.useRef(null),u=Pe(t,l);return ud(),c.jsxs(c.Fragment,{children:[c.jsx(zs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:c.jsx(So,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Os(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(r2,{titleId:a.titleId}),c.jsx(i2,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Ps="DialogTitle",Td=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(Ps,n);return c.jsx(Ee.h2,{id:o.titleId,...r,ref:t})});Td.displayName=Ps;var Ad="DialogDescription",n2=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(Ad,n);return c.jsx(Ee.p,{id:o.descriptionId,...r,ref:t})});n2.displayName=Ad;var zd="DialogClose",Id=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(zd,n);return c.jsx(Ee.button,{type:"button",...r,ref:t,onClick:_e(e.onClick,()=>o.onOpenChange(!1))})});Id.displayName=zd;function Os(e){return e?"open":"closed"}var Rd="DialogTitleWarning",[rT,Pd]=P1(Rd,{contentName:ln,titleName:Ps,docsSlug:"dialog"}),r2=({titleId:e})=>{const t=Pd(Rd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
81
-
82
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
83
-
84
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},o2="DialogDescriptionWarning",i2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Pd(o2).contentName}}.`;return b.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},s2=wd,a2=_d,l2=Cd,c2=Ed,u2=Nd,d2=Td,f2=Id;function h2(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function p2(e){const[t,n]=b.useState(void 0);return Ke(()=>{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,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.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 m2=["top","right","bottom","left"],Yt=Math.min,ct=Math.max,ro=Math.round,Mr=Math.floor,It=e=>({x:e,y:e}),g2={left:"right",right:"left",bottom:"top",top:"bottom"},x2={start:"end",end:"start"};function Di(e,t,n){return ct(e,Yt(t,n))}function Bt(e,t){return typeof e=="function"?e(t):e}function Ut(e){return e.split("-")[0]}function qn(e){return e.split("-")[1]}function Ds(e){return e==="x"?"y":"x"}function Ms(e){return e==="y"?"height":"width"}const y2=new Set(["top","bottom"]);function At(e){return y2.has(Ut(e))?"y":"x"}function Ls(e){return Ds(At(e))}function b2(e,t,n){n===void 0&&(n=!1);const r=qn(e),o=Ls(e),i=Ms(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=oo(s)),[s,oo(s)]}function v2(e){const t=oo(e);return[Mi(e),t,Mi(t)]}function Mi(e){return e.replace(/start|end/g,t=>x2[t])}const cl=["left","right"],ul=["right","left"],w2=["top","bottom"],k2=["bottom","top"];function _2(e,t,n){switch(e){case"top":case"bottom":return n?t?ul:cl:t?cl:ul;case"left":case"right":return t?w2:k2;default:return[]}}function S2(e,t,n,r){const o=qn(e);let i=_2(Ut(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Mi)))),i}function oo(e){return e.replace(/left|right|bottom|top/g,t=>g2[t])}function C2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Od(e){return typeof e!="number"?C2(e):{top:e,right:e,bottom:e,left:e}}function io(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 dl(e,t,n){let{reference:r,floating:o}=e;const i=At(t),s=Ls(t),a=Ms(s),l=Ut(t),u=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:d,y:r.y-o.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-o.width,y:h};break;default:f={x:r.x,y:r.y}}switch(qn(t)){case"start":f[s]-=p*(n&&u?-1:1);break;case"end":f[s]+=p*(n&&u?-1:1);break}return f}async function E2(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=Bt(t,e),x=Od(f),y=a[p?h==="floating"?"reference":"floating":h],g=io(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:u,rootBoundary:d,strategy:l})),w=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},E=io(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:_,strategy:l}):w);return{top:(g.top-E.top+x.top)/S.y,bottom:(E.bottom-g.bottom+x.bottom)/S.y,left:(g.left-E.left+x.left)/S.x,right:(E.right-g.right+x.right)/S.x}}const N2=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 u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=dl(u,r,l),p=r,f={},x=0;for(let y=0;y<a.length;y++){var m;const{name:g,fn:w}=a[y],{x:_,y:S,data:E,reset:C}=await w({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:E2},elements:{reference:e,floating:t}});d=_??d,h=S??h,f={...f,[g]:{...f[g],...E}},C&&x<=50&&(x++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(u=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:h}=dl(u,p,l)),y=-1)}return{x:d,y:h,placement:p,strategy:o,middlewareData:f}},j2=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:u,padding:d=0}=Bt(e,t)||{};if(u==null)return{};const h=Od(d),p={x:n,y:r},f=Ls(o),x=Ms(f),m=await s.getDimensions(u),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",_=y?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[f]-p[f]-i.floating[x],E=p[f]-i.reference[f],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let A=C?C[_]:0;(!A||!await(s.isElement==null?void 0:s.isElement(C)))&&(A=a.floating[_]||i.floating[x]);const I=S/2-E/2,P=A/2-m[x]/2-1,M=Yt(h[g],P),B=Yt(h[w],P),N=M,D=A-m[x]-B,k=A/2-m[x]/2+I,O=Di(N,k,D),Y=!l.arrow&&qn(o)!=null&&k!==O&&i.reference[x]/2-(k<N?M:B)-m[x]/2<0,Z=Y?k<N?k-N:k-D:0;return{[f]:p[f]+Z,data:{[f]:O,centerOffset:k-O-Z,...Y&&{alignmentOffset:Z}},reset:Y}}}),T2=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:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...y}=Bt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Ut(o),w=At(a),_=Ut(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(_||!m?[oo(a)]:v2(a)),C=x!=="none";!p&&C&&E.push(...S2(a,m,x,S));const A=[a,...E],I=await l.detectOverflow(t,y),P=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(I[g]),h){const k=b2(o,s,S);P.push(I[k[0]],I[k[1]])}if(M=[...M,{placement:o,overflows:P}],!P.every(k=>k<=0)){var B,N;const k=(((B=i.flip)==null?void 0:B.index)||0)+1,O=A[k];if(O&&(!(h==="alignment"?w!==At(O):!1)||M.every(H=>At(H.placement)===w?H.overflows[0]>0:!0)))return{data:{index:k,overflows:M},reset:{placement:O}};let Y=(N=M.filter(Z=>Z.overflows[0]<=0).sort((Z,H)=>Z.overflows[1]-H.overflows[1])[0])==null?void 0:N.placement;if(!Y)switch(f){case"bestFit":{var D;const Z=(D=M.filter(H=>{if(C){const G=At(H.placement);return G===w||G==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(G=>G>0).reduce((G,j)=>G+j,0)]).sort((H,G)=>H[1]-G[1])[0])==null?void 0:D[0];Z&&(Y=Z);break}case"initialPlacement":Y=a;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};function fl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hl(e){return m2.some(t=>e[t]>=0)}const A2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Bt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=fl(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hl(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=fl(s,n.floating);return{data:{escapedOffsets:a,escaped:hl(a)}}}default:return{}}}}},Dd=new Set(["left","top"]);async function z2(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ut(n),a=qn(n),l=At(n)==="y",u=Dd.has(s)?-1:1,d=i&&l?-1:1,h=Bt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(f=a==="end"?x*-1:x),l?{x:f*d,y:p*u}:{x:p*u,y:f*d}}const I2=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 z2(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}}}}},R2=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:w,y:_}=g;return{x:w,y:_}}},...u}=Bt(e,t),d={x:n,y:r},h=await i.detectOverflow(t,u),p=At(Ut(o)),f=Ds(p);let x=d[f],m=d[p];if(s){const g=f==="y"?"top":"left",w=f==="y"?"bottom":"right",_=x+h[g],S=x-h[w];x=Di(_,x,S)}if(a){const g=p==="y"?"top":"left",w=p==="y"?"bottom":"right",_=m+h[g],S=m-h[w];m=Di(_,m,S)}const y=l.fn({...t,[f]:x,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:s,[p]:a}}}}}},P2=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:u=!0}=Bt(e,t),d={x:n,y:r},h=At(o),p=Ds(h);let f=d[p],x=d[h];const m=Bt(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const _=p==="y"?"height":"width",S=i.reference[p]-i.floating[_]+y.mainAxis,E=i.reference[p]+i.reference[_]-y.mainAxis;f<S?f=S:f>E&&(f=E)}if(u){var g,w;const _=p==="y"?"width":"height",S=Dd.has(Ut(o)),E=i.reference[h]-i.floating[_]+(S&&((g=s.offset)==null?void 0:g[h])||0)+(S?0:y.crossAxis),C=i.reference[h]+i.reference[_]+(S?0:((w=s.offset)==null?void 0:w[h])||0)-(S?y.crossAxis:0);x<E?x=E:x>C&&(x=C)}return{[p]:f,[h]:x}}}},O2=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=()=>{},...u}=Bt(e,t),d=await s.detectOverflow(t,u),h=Ut(o),p=qn(o),f=At(o)==="y",{width:x,height:m}=i.floating;let y,g;h==="top"||h==="bottom"?(y=h,g=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,y=p==="end"?"top":"bottom");const w=m-d.top-d.bottom,_=x-d.left-d.right,S=Yt(m-d[y],w),E=Yt(x-d[g],_),C=!t.middlewareData.shift;let A=S,I=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=w),C&&!p){const M=ct(d.left,0),B=ct(d.right,0),N=ct(d.top,0),D=ct(d.bottom,0);f?I=x-2*(M!==0||B!==0?M+B:ct(d.left,d.right)):A=m-2*(N!==0||D!==0?N+D:ct(d.top,d.bottom))}await l({...t,availableWidth:I,availableHeight:A});const P=await s.getDimensions(a.floating);return x!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function jo(){return typeof window<"u"}function Kn(e){return Md(e)?(e.nodeName||"").toLowerCase():"#document"}function dt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ot(e){var t;return(t=(Md(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Md(e){return jo()?e instanceof Node||e instanceof dt(e).Node:!1}function _t(e){return jo()?e instanceof Element||e instanceof dt(e).Element:!1}function Rt(e){return jo()?e instanceof HTMLElement||e instanceof dt(e).HTMLElement:!1}function pl(e){return!jo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dt(e).ShadowRoot}const D2=new Set(["inline","contents"]);function br(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=St(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!D2.has(o)}const M2=new Set(["table","td","th"]);function L2(e){return M2.has(Kn(e))}const F2=[":popover-open",":modal"];function To(e){return F2.some(t=>{try{return e.matches(t)}catch{return!1}})}const $2=["transform","translate","scale","rotate","perspective"],B2=["transform","translate","scale","rotate","perspective","filter"],U2=["paint","layout","strict","content"];function Fs(e){const t=$s(),n=_t(e)?St(e):e;return $2.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)||B2.some(r=>(n.willChange||"").includes(r))||U2.some(r=>(n.contain||"").includes(r))}function Z2(e){let t=Xt(e);for(;Rt(t)&&!Ln(t);){if(Fs(t))return t;if(To(t))return null;t=Xt(t)}return null}function $s(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const V2=new Set(["html","body","#document"]);function Ln(e){return V2.has(Kn(e))}function St(e){return dt(e).getComputedStyle(e)}function Ao(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xt(e){if(Kn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pl(e)&&e.host||Ot(e);return pl(t)?t.host:t}function Ld(e){const t=Xt(e);return Ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&br(t)?t:Ld(t)}function pr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ld(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=dt(o);if(i){const a=Li(s);return t.concat(s,s.visualViewport||[],br(o)?o:[],a&&n?pr(a):[])}return t.concat(o,pr(o,[],n))}function Li(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fd(e){const t=St(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Rt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ro(n)!==i||ro(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Bs(e){return _t(e)?e:e.contextElement}function zn(e){const t=Bs(e);if(!Rt(t))return It(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Fd(t);let s=(i?ro(n.width):n.width)/r,a=(i?ro(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const W2=It(0);function $d(e){const t=dt(e);return!$s()||!t.visualViewport?W2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function H2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==dt(e)?!1:t}function cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Bs(e);let s=It(1);t&&(r?_t(r)&&(s=zn(r)):s=zn(e));const a=H2(i,n,r)?$d(i):It(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,h=o.height/s.y;if(i){const p=dt(i),f=r&&_t(r)?dt(r):r;let x=p,m=Li(x);for(;m&&r&&f!==x;){const y=zn(m),g=m.getBoundingClientRect(),w=St(m),_=g.left+(m.clientLeft+parseFloat(w.paddingLeft))*y.x,S=g.top+(m.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=_,u+=S,x=dt(m),m=Li(x)}}return io({width:d,height:h,x:l,y:u})}function zo(e,t){const n=Ao(e).scrollLeft;return t?t.left+n:cn(Ot(e)).left+n}function Bd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-zo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function q2(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ot(r),a=t?To(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=It(1);const d=It(0),h=Rt(r);if((h||!h&&!i)&&((Kn(r)!=="body"||br(s))&&(l=Ao(r)),Rt(r))){const f=cn(r);u=zn(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const p=s&&!h&&!i?Bd(s,l):It(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function K2(e){return Array.from(e.getClientRects())}function G2(e){const t=Ot(e),n=Ao(e),r=e.ownerDocument.body,o=ct(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ct(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+zo(e);const a=-n.scrollTop;return St(r).direction==="rtl"&&(s+=ct(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ml=25;function J2(e,t){const n=dt(e),r=Ot(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const d=$s();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=zo(r);if(u<=0){const d=r.ownerDocument,h=d.body,p=getComputedStyle(h),f=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-f);x<=ml&&(i-=x)}else u<=ml&&(i+=u);return{width:i,height:s,x:a,y:l}}const Y2=new Set(["absolute","fixed"]);function X2(e,t){const n=cn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Rt(e)?zn(e):It(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function gl(e,t,n){let r;if(t==="viewport")r=J2(e,n);else if(t==="document")r=G2(Ot(e));else if(_t(t))r=X2(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 io(r)}function Ud(e,t){const n=Xt(e);return n===t||!_t(n)||Ln(n)?!1:St(n).position==="fixed"||Ud(n,t)}function Q2(e,t){const n=t.get(e);if(n)return n;let r=pr(e,[],!1).filter(a=>_t(a)&&Kn(a)!=="body"),o=null;const i=St(e).position==="fixed";let s=i?Xt(e):e;for(;_t(s)&&!Ln(s);){const a=St(s),l=Fs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&Y2.has(o.position)||br(s)&&!l&&Ud(e,s))?r=r.filter(d=>d!==s):o=a,s=Xt(s)}return t.set(e,r),r}function ek(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?To(t)?[]:Q2(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const h=gl(t,d,o);return u.top=ct(h.top,u.top),u.right=Yt(h.right,u.right),u.bottom=Yt(h.bottom,u.bottom),u.left=ct(h.left,u.left),u},gl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function tk(e){const{width:t,height:n}=Fd(e);return{width:t,height:n}}function nk(e,t,n){const r=Rt(t),o=Ot(t),i=n==="fixed",s=cn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=It(0);function u(){l.x=zo(o)}if(r||!r&&!i)if((Kn(t)!=="body"||br(o))&&(a=Ao(t)),r){const f=cn(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&u();i&&!r&&o&&u();const d=o&&!r&&!i?Bd(o,a):It(0),h=s.left+a.scrollLeft-l.x-d.x,p=s.top+a.scrollTop-l.y-d.y;return{x:h,y:p,width:s.width,height:s.height}}function si(e){return St(e).position==="static"}function xl(e,t){if(!Rt(e)||St(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ot(e)===n&&(n=n.ownerDocument.body),n}function Zd(e,t){const n=dt(e);if(To(e))return n;if(!Rt(e)){let o=Xt(e);for(;o&&!Ln(o);){if(_t(o)&&!si(o))return o;o=Xt(o)}return n}let r=xl(e,t);for(;r&&L2(r)&&si(r);)r=xl(r,t);return r&&Ln(r)&&si(r)&&!Fs(r)?n:r||Z2(e)||n}const rk=async function(e){const t=this.getOffsetParent||Zd,n=this.getDimensions,r=await n(e.floating);return{reference:nk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ok(e){return St(e).direction==="rtl"}const ik={convertOffsetParentRelativeRectToViewportRelativeRect:q2,getDocumentElement:Ot,getClippingRect:ek,getOffsetParent:Zd,getElementRects:rk,getClientRects:K2,getDimensions:tk,getScale:zn,isElement:_t,isRTL:ok};function Vd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sk(e,t){let n=null,r;const o=Ot(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 u=e.getBoundingClientRect(),{left:d,top:h,width:p,height:f}=u;if(a||t(),!p||!f)return;const x=Mr(h),m=Mr(o.clientWidth-(d+p)),y=Mr(o.clientHeight-(h+f)),g=Mr(d),_={rootMargin:-x+"px "+-m+"px "+-y+"px "+-g+"px",threshold:ct(0,Yt(1,l))||1};let S=!0;function E(C){const A=C[0].intersectionRatio;if(A!==l){if(!S)return s();A?s(!1,A):r=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!Vd(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(E,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,_)}n.observe(e)}return s(!0),i}function ak(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,u=Bs(e),d=o||i?[...u?pr(u):[],...pr(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const h=u&&a?sk(u,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=f)==null||_.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let x,m=l?cn(e):null;l&&y();function y(){const g=cn(e);m&&!Vd(m,g)&&n(),m=g,x=requestAnimationFrame(y)}return n(),()=>{var g;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(x)}}const lk=I2,ck=R2,uk=T2,dk=O2,fk=A2,yl=j2,hk=P2,pk=(e,t,n)=>{const r=new Map,o={platform:ik,...n},i={...o.platform,_c:r};return N2(e,t,{...o,platform:i})};var mk=typeof document<"u",gk=function(){},Hr=mk?b.useLayoutEffect:gk;function so(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(!so(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)&&!so(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Wd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bl(e,t){const n=Wd(e);return Math.round(t*n)/n}function ai(e){const t=b.useRef(e);return Hr(()=>{t.current=e}),t}function xk(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:u}=e,[d,h]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=b.useState(r);so(p,r)||f(r);const[x,m]=b.useState(null),[y,g]=b.useState(null),w=b.useCallback(H=>{H!==C.current&&(C.current=H,m(H))},[]),_=b.useCallback(H=>{H!==A.current&&(A.current=H,g(H))},[]),S=i||x,E=s||y,C=b.useRef(null),A=b.useRef(null),I=b.useRef(d),P=l!=null,M=ai(l),B=ai(o),N=ai(u),D=b.useCallback(()=>{if(!C.current||!A.current)return;const H={placement:t,strategy:n,middleware:p};B.current&&(H.platform=B.current),pk(C.current,A.current,H).then(G=>{const j={...G,isPositioned:N.current!==!1};k.current&&!so(I.current,j)&&(I.current=j,xr.flushSync(()=>{h(j)}))})},[p,t,n,B,N]);Hr(()=>{u===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(H=>({...H,isPositioned:!1})))},[u]);const k=b.useRef(!1);Hr(()=>(k.current=!0,()=>{k.current=!1}),[]),Hr(()=>{if(S&&(C.current=S),E&&(A.current=E),S&&E){if(M.current)return M.current(S,E,D);D()}},[S,E,D,M,P]);const O=b.useMemo(()=>({reference:C,floating:A,setReference:w,setFloating:_}),[w,_]),Y=b.useMemo(()=>({reference:S,floating:E}),[S,E]),Z=b.useMemo(()=>{const H={position:n,left:0,top:0};if(!Y.floating)return H;const G=bl(Y.floating,d.x),j=bl(Y.floating,d.y);return a?{...H,transform:"translate("+G+"px, "+j+"px)",...Wd(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:j}},[n,a,Y.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:D,refs:O,elements:Y,floatingStyles:Z}),[d,D,O,Y,Z])}const yk=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?yl({element:r.current,padding:o}).fn(n):{}:r?yl({element:r,padding:o}).fn(n):{}}}},bk=(e,t)=>({...lk(e),options:[e,t]}),vk=(e,t)=>({...ck(e),options:[e,t]}),wk=(e,t)=>({...hk(e),options:[e,t]}),kk=(e,t)=>({...uk(e),options:[e,t]}),_k=(e,t)=>({...dk(e),options:[e,t]}),Sk=(e,t)=>({...fk(e),options:[e,t]}),Ck=(e,t)=>({...yk(e),options:[e,t]});var Ek="Arrow",Hd=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return c.jsx(Ee.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Hd.displayName=Ek;var Nk=Hd,Us="Popper",[qd,Io]=Wt(Us),[jk,Kd]=qd(Us),Gd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return c.jsx(jk,{scope:t,anchor:r,onAnchorChange:o,children:n})};Gd.displayName=Us;var Jd="PopperAnchor",Yd=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Kd(Jd,n),s=b.useRef(null),a=Pe(t,s),l=b.useRef(null);return b.useEffect(()=>{const u=l.current;l.current=r?.current||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:c.jsx(Ee.div,{...o,ref:a})});Yd.displayName=Jd;var Zs="PopperContent",[Tk,Ak]=qd(Zs),Xd=b.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:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:x,...m}=e,y=Kd(Zs,n),[g,w]=b.useState(null),_=Pe(t,Q=>w(Q)),[S,E]=b.useState(null),C=p2(S),A=C?.width??0,I=C?.height??0,P=r+(i!=="center"?"-"+i:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(u)?u:[u],N=B.length>0,D={padding:M,boundary:B.filter(Ik),altBoundary:N},{refs:k,floatingStyles:O,placement:Y,isPositioned:Z,middlewareData:H}=xk({strategy:"fixed",placement:P,whileElementsMounted:(...Q)=>ak(...Q,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[bk({mainAxis:o+I,alignmentAxis:s}),l&&vk({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?wk():void 0,...D}),l&&kk({...D}),_k({...D,apply:({elements:Q,rects:ce,availableWidth:fe,availableHeight:xe})=>{const{width:be,height:je}=ce.reference,le=Q.floating.style;le.setProperty("--radix-popper-available-width",`${fe}px`),le.setProperty("--radix-popper-available-height",`${xe}px`),le.setProperty("--radix-popper-anchor-width",`${be}px`),le.setProperty("--radix-popper-anchor-height",`${je}px`)}}),S&&Ck({element:S,padding:a}),Rk({arrowWidth:A,arrowHeight:I}),p&&Sk({strategy:"referenceHidden",...D})]}),[G,j]=tf(Y),L=Qe(x);Ke(()=>{Z&&L?.()},[Z,L]);const F=H.arrow?.x,T=H.arrow?.y,ee=H.arrow?.centerOffset!==0,[K,ue]=b.useState();return Ke(()=>{g&&ue(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:Z?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Tk,{scope:n,placedSide:G,onArrowChange:E,arrowX:F,arrowY:T,shouldHideArrow:ee,children:c.jsx(Ee.div,{"data-side":G,"data-align":j,...m,ref:_,style:{...m.style,animation:Z?void 0:"none"}})})})});Xd.displayName=Zs;var Qd="PopperArrow",zk={top:"bottom",right:"left",bottom:"top",left:"right"},ef=b.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Ak(Qd,r),s=zk[i.placedSide];return c.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:c.jsx(Nk,{...o,ref:n,style:{...o.style,display:"block"}})})});ef.displayName=Qd;function Ik(e){return e!==null}var Rk=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,[u,d]=tf(n),h={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+l/2;let x="",m="";return u==="bottom"?(x=s?h:`${p}px`,m=`${-l}px`):u==="top"?(x=s?h:`${p}px`,m=`${r.floating.height+l}px`):u==="right"?(x=`${-l}px`,m=s?h:`${f}px`):u==="left"&&(x=`${r.floating.width+l}px`,m=s?h:`${f}px`),{data:{x,y:m}}}});function tf(e){const[t,n="center"]=e.split("-");return[t,n]}var nf=Gd,rf=Yd,of=Xd,sf=ef,li="rovingFocusGroup.onEntryFocus",Pk={bubbles:!1,cancelable:!0},vr="RovingFocusGroup",[Fi,af,Ok]=nd(vr),[Dk,lf]=Wt(vr,[Ok]),[Mk,Lk]=Dk(vr),cf=b.forwardRef((e,t)=>c.jsx(Fi.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Fi.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Fk,{...e,ref:t})})}));cf.displayName=vr;var Fk=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,p=b.useRef(null),f=Pe(t,p),x=_o(i),[m,y]=an({prop:s,defaultProp:a??null,onChange:l,caller:vr}),[g,w]=b.useState(!1),_=Qe(u),S=af(n),E=b.useRef(!1),[C,A]=b.useState(0);return b.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(li,_),()=>I.removeEventListener(li,_)},[_]),c.jsx(Mk,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:b.useCallback(I=>y(I),[y]),onItemShiftTab:b.useCallback(()=>w(!0),[]),onFocusableItemAdd:b.useCallback(()=>A(I=>I+1),[]),onFocusableItemRemove:b.useCallback(()=>A(I=>I-1),[]),children:c.jsx(Ee.div,{tabIndex:g||C===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{E.current=!0}),onFocus:_e(e.onFocus,I=>{const P=!E.current;if(I.target===I.currentTarget&&P&&!g){const M=new CustomEvent(li,Pk);if(I.currentTarget.dispatchEvent(M),!M.defaultPrevented){const B=S().filter(Y=>Y.focusable),N=B.find(Y=>Y.active),D=B.find(Y=>Y.id===m),O=[N,D,...B].filter(Boolean).map(Y=>Y.ref.current);ff(O,d)}}E.current=!1}),onBlur:_e(e.onBlur,()=>w(!1))})})}),uf="RovingFocusGroupItem",df=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=zt(),u=i||l,d=Lk(uf,n),h=d.currentTabStopId===u,p=af(n),{onFocusableItemAdd:f,onFocusableItemRemove:x,currentTabStopId:m}=d;return b.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),c.jsx(Fi.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:c.jsx(Ee.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:_e(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:_e(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:_e(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=Uk(y,d.orientation,d.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let _=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")_.reverse();else if(g==="prev"||g==="next"){g==="prev"&&_.reverse();const S=_.indexOf(y.currentTarget);_=d.loop?Zk(_,S+1):_.slice(S+1)}setTimeout(()=>ff(_))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:m!=null}):s})})});df.displayName=uf;var $k={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Uk(e,t,n){const r=Bk(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $k[r]}function ff(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Zk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Vk=cf,Wk=df;function $i(e,[t,n]){return Math.min(n,Math.max(t,e))}function Hk(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Vs="ScrollArea",[hf]=Wt(Vs),[qk,xt]=hf(Vs),pf=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=b.useState(null),[u,d]=b.useState(null),[h,p]=b.useState(null),[f,x]=b.useState(null),[m,y]=b.useState(null),[g,w]=b.useState(0),[_,S]=b.useState(0),[E,C]=b.useState(!1),[A,I]=b.useState(!1),P=Pe(t,B=>l(B)),M=_o(o);return c.jsx(qk,{scope:n,type:r,dir:M,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:x,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:A,onScrollbarYEnabledChange:I,onCornerWidthChange:w,onCornerHeightChange:S,children:c.jsx(Ee.div,{dir:M,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});pf.displayName=Vs;var mf="ScrollAreaViewport",gf=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=xt(mf,n),a=b.useRef(null),l=Pe(t,a,s.onViewportChange);return c.jsxs(c.Fragment,{children:[c.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}),c.jsx(Ee.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});gf.displayName=mf;var Dt="ScrollAreaScrollbar",xf=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xt(Dt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return b.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?c.jsx(Kk,{...r,ref:t,forceMount:n}):o.type==="scroll"?c.jsx(Gk,{...r,ref:t,forceMount:n}):o.type==="auto"?c.jsx(yf,{...r,ref:t,forceMount:n}):o.type==="always"?c.jsx(Ws,{...r,ref:t}):null});xf.displayName=Dt;var Kk=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xt(Dt,e.__scopeScrollArea),[i,s]=b.useState(!1);return b.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),c.jsx(gt,{present:n||i,children:c.jsx(yf,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Gk=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xt(Dt,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Po(()=>l("SCROLL_END"),100),[a,l]=Hk("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 b.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,l]),b.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let h=u[d];const p=()=>{const f=u[d];h!==f&&(l("SCROLL"),s()),h=f};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),c.jsx(gt,{present:n||a!=="hidden",children:c.jsx(Ws,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:_e(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:_e(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),yf=b.forwardRef((e,t)=>{const n=xt(Dt,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=b.useState(!1),a=e.orientation==="horizontal",l=Po(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?u:d)}},10);return Fn(n.viewport,l),Fn(n.content,l),c.jsx(gt,{present:r||i,children:c.jsx(Ws,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Ws=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=xt(Dt,e.__scopeScrollArea),i=b.useRef(null),s=b.useRef(0),[a,l]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=_f(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,f){return t_(p,s.current,a,f)}return n==="horizontal"?c.jsx(Jk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,f=vl(p,a,o.dir);i.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=h(p,o.dir))}}):n==="vertical"?c.jsx(Yk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,f=vl(p,a);i.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=h(p))}}):null}),Jk=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=xt(Dt,e.__scopeScrollArea),[s,a]=b.useState(),l=b.useRef(null),u=Pe(t,l,i.onScrollbarXChange);return b.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(vf,{"data-orientation":"horizontal",...o,ref:u,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":Ro(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),Cf(p,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:lo(s.paddingLeft),paddingEnd:lo(s.paddingRight)}})}})}),Yk=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=xt(Dt,e.__scopeScrollArea),[s,a]=b.useState(),l=b.useRef(null),u=Pe(t,l,i.onScrollbarYChange);return b.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(vf,{"data-orientation":"vertical",...o,ref:u,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":Ro(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),Cf(p,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:lo(s.paddingTop),paddingEnd:lo(s.paddingBottom)}})}})}),[Xk,bf]=hf(Dt),vf=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:h,...p}=e,f=xt(Dt,n),[x,m]=b.useState(null),y=Pe(t,P=>m(P)),g=b.useRef(null),w=b.useRef(""),_=f.viewport,S=r.content-r.viewport,E=Qe(d),C=Qe(l),A=Po(h,10);function I(P){if(g.current){const M=P.clientX-g.current.left,B=P.clientY-g.current.top;u({x:M,y:B})}}return b.useEffect(()=>{const P=M=>{const B=M.target;x?.contains(B)&&E(M,S)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[_,x,S,E]),b.useEffect(C,[r,C]),Fn(x,A),Fn(f.content,A),c.jsx(Xk,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Qe(i),onThumbPointerUp:Qe(s),onThumbPositionChange:C,onThumbPointerDown:Qe(a),children:c.jsx(Ee.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:_e(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),g.current=x.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),I(P))}),onPointerMove:_e(e.onPointerMove,I),onPointerUp:_e(e.onPointerUp,P=>{const M=P.target;M.hasPointerCapture(P.pointerId)&&M.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=w.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),ao="ScrollAreaThumb",wf=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=bf(ao,e.__scopeScrollArea);return c.jsx(gt,{present:n||o.hasThumb,children:c.jsx(Qk,{ref:t,...r})})}),Qk=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=xt(ao,n),s=bf(ao,n),{onThumbPositionChange:a}=s,l=Pe(t,h=>s.onThumbChange(h)),u=b.useRef(void 0),d=Po(()=>{u.current&&(u.current(),u.current=void 0)},100);return b.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(d(),!u.current){const f=n_(h,a);u.current=f,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,d,a]),c.jsx(Ee.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:_e(e.onPointerDownCapture,h=>{const f=h.target.getBoundingClientRect(),x=h.clientX-f.left,m=h.clientY-f.top;s.onThumbPointerDown({x,y:m})}),onPointerUp:_e(e.onPointerUp,s.onThumbPointerUp)})});wf.displayName=ao;var Hs="ScrollAreaCorner",kf=b.forwardRef((e,t)=>{const n=xt(Hs,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(e_,{...e,ref:t}):null});kf.displayName=Hs;var e_=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=xt(Hs,n),[i,s]=b.useState(0),[a,l]=b.useState(0),u=!!(i&&a);return Fn(o.scrollbarX,()=>{const d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),Fn(o.scrollbarY,()=>{const d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?c.jsx(Ee.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 lo(e){return e?parseInt(e,10):0}function _f(e,t){const n=e/t;return isNaN(n)?0:n}function Ro(e){const t=_f(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function t_(e,t,n,r="ltr"){const o=Ro(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return Sf([l,u],h)(e)}function vl(e,t,n="ltr"){const r=Ro(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],u=$i(e,l);return Sf([0,s],[0,a])(u)}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 Cf(e,t){return e>0&&e<t}var n_=(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 Po(e,t){const n=Qe(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Fn(e,t){const n=Qe(t);Ke(()=>{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 r_=pf,o_=gf,i_=kf,s_=[" ","Enter","ArrowUp","ArrowDown"],a_=[" ","Enter"],un="Select",[Oo,Do,l_]=nd(un),[Gn]=Wt(un,[l_,Io]),Mo=Io(),[c_,tn]=Gn(un),[u_,d_]=Gn(un),Ef=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:h,disabled:p,required:f,form:x}=e,m=Mo(t),[y,g]=b.useState(null),[w,_]=b.useState(null),[S,E]=b.useState(!1),C=_o(u),[A,I]=an({prop:r,defaultProp:o??!1,onChange:i,caller:un}),[P,M]=an({prop:s,defaultProp:a,onChange:l,caller:un}),B=b.useRef(null),N=y?x||!!y.closest("form"):!0,[D,k]=b.useState(new Set),O=Array.from(D).map(Y=>Y.props.value).join(";");return c.jsx(nf,{...m,children:c.jsxs(c_,{required:f,scope:t,trigger:y,onTriggerChange:g,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:zt(),value:P,onValueChange:M,open:A,onOpenChange:I,dir:C,triggerPointerDownPosRef:B,disabled:p,children:[c.jsx(Oo.Provider,{scope:t,children:c.jsx(u_,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(Y=>{k(Z=>new Set(Z).add(Y))},[]),onNativeOptionRemove:b.useCallback(Y=>{k(Z=>{const H=new Set(Z);return H.delete(Y),H})},[]),children:n})}),N?c.jsxs(Kf,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:h,value:P,onChange:Y=>M(Y.target.value),disabled:p,form:x,children:[P===void 0?c.jsx("option",{value:""}):null,Array.from(D)]},O):null]})})};Ef.displayName=un;var Nf="SelectTrigger",jf=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Mo(n),s=tn(Nf,n),a=s.disabled||r,l=Pe(t,s.onTriggerChange),u=Do(n),d=b.useRef("touch"),[h,p,f]=Jf(m=>{const y=u().filter(_=>!_.disabled),g=y.find(_=>_.value===s.value),w=Yf(y,m,g);w!==void 0&&s.onValueChange(w.value)}),x=m=>{a||(s.onOpenChange(!0),f()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(rf,{asChild:!0,...i,children:c.jsx(Ee.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":Gf(s.value)?"":void 0,...o,ref:l,onClick:_e(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&x(m)}),onPointerDown:_e(o.onPointerDown,m=>{d.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:_e(o.onKeyDown,m=>{const y=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(y&&m.key===" ")&&s_.includes(m.key)&&(x(),m.preventDefault())})})})});jf.displayName=Nf;var Tf="SelectValue",Af=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=tn(Tf,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,h=Pe(t,l.onValueNodeChange);return Ke(()=>{u(d)},[u,d]),c.jsx(Ee.span,{...a,ref:h,style:{pointerEvents:"none"},children:Gf(l.value)?c.jsx(c.Fragment,{children:s}):i})});Af.displayName=Tf;var f_="SelectIcon",zf=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(Ee.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});zf.displayName=f_;var h_="SelectPortal",If=e=>c.jsx(Co,{asChild:!0,...e});If.displayName=h_;var dn="SelectContent",Rf=b.forwardRef((e,t)=>{const n=tn(dn,e.__scopeSelect),[r,o]=b.useState();if(Ke(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?xr.createPortal(c.jsx(Pf,{scope:e.__scopeSelect,children:c.jsx(Oo.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(Of,{...e,ref:t})});Rf.displayName=dn;var bt=10,[Pf,nn]=Gn(dn),p_="SelectContentImpl",m_=Mn("SelectContent.RemoveScroll"),Of=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:x,hideWhenDetached:m,avoidCollisions:y,...g}=e,w=tn(dn,n),[_,S]=b.useState(null),[E,C]=b.useState(null),A=Pe(t,Q=>S(Q)),[I,P]=b.useState(null),[M,B]=b.useState(null),N=Do(n),[D,k]=b.useState(!1),O=b.useRef(!1);b.useEffect(()=>{if(_)return bd(_)},[_]),ud();const Y=b.useCallback(Q=>{const[ce,...fe]=N().map(je=>je.ref.current),[xe]=fe.slice(-1),be=document.activeElement;for(const je of Q)if(je===be||(je?.scrollIntoView({block:"nearest"}),je===ce&&E&&(E.scrollTop=0),je===xe&&E&&(E.scrollTop=E.scrollHeight),je?.focus(),document.activeElement!==be))return},[N,E]),Z=b.useCallback(()=>Y([I,_]),[Y,I,_]);b.useEffect(()=>{D&&Z()},[D,Z]);const{onOpenChange:H,triggerPointerDownPosRef:G}=w;b.useEffect(()=>{if(_){let Q={x:0,y:0};const ce=xe=>{Q={x:Math.abs(Math.round(xe.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(G.current?.y??0))}},fe=xe=>{Q.x<=10&&Q.y<=10?xe.preventDefault():_.contains(xe.target)||H(!1),document.removeEventListener("pointermove",ce),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",fe,{capture:!0})}}},[_,H,G]),b.useEffect(()=>{const Q=()=>H(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[H]);const[j,L]=Jf(Q=>{const ce=N().filter(be=>!be.disabled),fe=ce.find(be=>be.ref.current===document.activeElement),xe=Yf(ce,Q,fe);xe&&setTimeout(()=>xe.ref.current.focus())}),F=b.useCallback((Q,ce,fe)=>{const xe=!O.current&&!fe;(w.value!==void 0&&w.value===ce||xe)&&(P(Q),xe&&(O.current=!0))},[w.value]),T=b.useCallback(()=>_?.focus(),[_]),ee=b.useCallback((Q,ce,fe)=>{const xe=!O.current&&!fe;(w.value!==void 0&&w.value===ce||xe)&&B(Q)},[w.value]),K=r==="popper"?Bi:Df,ue=K===Bi?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:x,hideWhenDetached:m,avoidCollisions:y}:{};return c.jsx(Pf,{scope:n,content:_,viewport:E,onViewportChange:C,itemRefCallback:F,selectedItem:I,onItemLeave:T,itemTextRefCallback:ee,focusSelectedItem:Z,selectedItemText:M,position:r,isPositioned:D,searchRef:j,children:c.jsx(Is,{as:m_,allowPinchZoom:!0,children:c.jsx(zs,{asChild:!0,trapped:w.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:_e(o,Q=>{w.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:c.jsx(So,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:c.jsx(K,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Q=>Q.preventDefault(),...g,...ue,onPlaced:()=>k(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:_e(g.onKeyDown,Q=>{const ce=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ce&&Q.key.length===1&&L(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let xe=N().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const be=Q.target,je=xe.indexOf(be);xe=xe.slice(je+1)}setTimeout(()=>Y(xe)),Q.preventDefault()}})})})})})})});Of.displayName=p_;var g_="SelectItemAlignedPosition",Df=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tn(dn,n),s=nn(dn,n),[a,l]=b.useState(null),[u,d]=b.useState(null),h=Pe(t,A=>d(A)),p=Do(n),f=b.useRef(!1),x=b.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:g,focusSelectedItem:w}=s,_=b.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&y&&g){const A=i.trigger.getBoundingClientRect(),I=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),M=g.getBoundingClientRect();if(i.dir!=="rtl"){const be=M.left-I.left,je=P.left-be,le=A.left-je,v=A.width+le,q=Math.max(v,I.width),V=window.innerWidth-bt,R=$i(je,[bt,Math.max(bt,V-q)]);a.style.minWidth=v+"px",a.style.left=R+"px"}else{const be=I.right-M.right,je=window.innerWidth-P.right-be,le=window.innerWidth-A.right-je,v=A.width+le,q=Math.max(v,I.width),V=window.innerWidth-bt,R=$i(je,[bt,Math.max(bt,V-q)]);a.style.minWidth=v+"px",a.style.right=R+"px"}const B=p(),N=window.innerHeight-bt*2,D=m.scrollHeight,k=window.getComputedStyle(u),O=parseInt(k.borderTopWidth,10),Y=parseInt(k.paddingTop,10),Z=parseInt(k.borderBottomWidth,10),H=parseInt(k.paddingBottom,10),G=O+Y+D+H+Z,j=Math.min(y.offsetHeight*5,G),L=window.getComputedStyle(m),F=parseInt(L.paddingTop,10),T=parseInt(L.paddingBottom,10),ee=A.top+A.height/2-bt,K=N-ee,ue=y.offsetHeight/2,Q=y.offsetTop+ue,ce=O+Y+Q,fe=G-ce;if(ce<=ee){const be=B.length>0&&y===B[B.length-1].ref.current;a.style.bottom="0px";const je=u.clientHeight-m.offsetTop-m.offsetHeight,le=Math.max(K,ue+(be?T:0)+je+Z),v=ce+le;a.style.height=v+"px"}else{const be=B.length>0&&y===B[0].ref.current;a.style.top="0px";const le=Math.max(ee,O+m.offsetTop+(be?F:0)+ue)+fe;a.style.height=le+"px",m.scrollTop=ce-ee+m.offsetTop}a.style.margin=`${bt}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=N+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[p,i.trigger,i.valueNode,a,u,m,y,g,i.dir,r]);Ke(()=>_(),[_]);const[S,E]=b.useState();Ke(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const C=b.useCallback(A=>{A&&x.current===!0&&(_(),w?.(),x.current=!1)},[_,w]);return c.jsx(y_,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(Ee.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Df.displayName=g_;var x_="SelectPopperPosition",Bi=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=bt,...i}=e,s=Mo(n);return c.jsx(of,{...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)"}})});Bi.displayName=x_;var[y_,qs]=Gn(dn,{}),Ui="SelectViewport",Mf=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=nn(Ui,n),s=qs(Ui,n),a=Pe(t,i.onViewportChange),l=b.useRef(0);return c.jsxs(c.Fragment,{children:[c.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}),c.jsx(Oo.Slot,{scope:n,children:c.jsx(Ee.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:_e(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=s;if(p?.current&&h){const f=Math.abs(l.current-d.scrollTop);if(f>0){const x=window.innerHeight-bt*2,m=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),g=Math.max(m,y);if(g<x){const w=g+f,_=Math.min(x,w),S=w-_;h.style.height=_+"px",h.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Mf.displayName=Ui;var Lf="SelectGroup",[b_,v_]=Gn(Lf),w_=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=zt();return c.jsx(b_,{scope:n,id:o,children:c.jsx(Ee.div,{role:"group","aria-labelledby":o,...r,ref:t})})});w_.displayName=Lf;var Ff="SelectLabel",k_=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=v_(Ff,n);return c.jsx(Ee.div,{id:o.id,...r,ref:t})});k_.displayName=Ff;var co="SelectItem",[__,$f]=Gn(co),Bf=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=tn(co,n),l=nn(co,n),u=a.value===r,[d,h]=b.useState(i??""),[p,f]=b.useState(!1),x=Pe(t,w=>l.itemRefCallback?.(w,r,o)),m=zt(),y=b.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 c.jsx(__,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:b.useCallback(w=>{h(_=>_||(w?.textContent??"").trim())},[]),children:c.jsx(Oo.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:c.jsx(Ee.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:x,onFocus:_e(s.onFocus,()=>f(!0)),onBlur:_e(s.onBlur,()=>f(!1)),onClick:_e(s.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:_e(s.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:_e(s.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:_e(s.onPointerMove,w=>{y.current=w.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(s.onPointerLeave,w=>{w.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:_e(s.onKeyDown,w=>{l.searchRef?.current!==""&&w.key===" "||(a_.includes(w.key)&&g(),w.key===" "&&w.preventDefault())})})})})});Bf.displayName=co;var lr="SelectItemText",Uf=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=tn(lr,n),a=nn(lr,n),l=$f(lr,n),u=d_(lr,n),[d,h]=b.useState(null),p=Pe(t,g=>h(g),l.onItemTextChange,g=>a.itemTextRefCallback?.(g,l.value,l.disabled)),f=d?.textContent,x=b.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=u;return Ke(()=>(m(x),()=>y(x)),[m,y,x]),c.jsxs(c.Fragment,{children:[c.jsx(Ee.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?xr.createPortal(i.children,s.valueNode):null]})});Uf.displayName=lr;var Zf="SelectItemIndicator",Vf=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return $f(Zf,n).isSelected?c.jsx(Ee.span,{"aria-hidden":!0,...r,ref:t}):null});Vf.displayName=Zf;var Zi="SelectScrollUpButton",Wf=b.forwardRef((e,t)=>{const n=nn(Zi,e.__scopeSelect),r=qs(Zi,e.__scopeSelect),[o,i]=b.useState(!1),s=Pe(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(qf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Wf.displayName=Zi;var Vi="SelectScrollDownButton",Hf=b.forwardRef((e,t)=>{const n=nn(Vi,e.__scopeSelect),r=qs(Vi,e.__scopeSelect),[o,i]=b.useState(!1),s=Pe(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;i(d)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(qf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Hf.displayName=Vi;var qf=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nn("SelectScrollButton",n),s=b.useRef(null),a=Do(n),l=b.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return b.useEffect(()=>()=>l(),[l]),Ke(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(Ee.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:_e(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:_e(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:_e(o.onPointerLeave,()=>{l()})})}),S_="SelectSeparator",C_=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ee.div,{"aria-hidden":!0,...r,ref:t})});C_.displayName=S_;var Wi="SelectArrow",E_=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Mo(n),i=tn(Wi,n),s=nn(Wi,n);return i.open&&s.position==="popper"?c.jsx(sf,{...o,...r,ref:t}):null});E_.displayName=Wi;var N_="SelectBubbleInput",Kf=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=b.useRef(null),i=Pe(r,o),s=h2(t);return b.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&d){const h=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(h)}},[s,t]),c.jsx(Ee.select,{...n,style:{...ed,...n.style},ref:i,defaultValue:t})});Kf.displayName=N_;function Gf(e){return e===""||e===void 0}function Jf(e){const t=Qe(e),n=b.useRef(""),r=b.useRef(0),o=b.useCallback(s=>{const a=n.current+s;t(a),(function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Yf(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=j_(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function j_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var T_=Ef,A_=jf,z_=Af,I_=zf,R_=If,P_=Rf,O_=Mf,D_=Bf,M_=Uf,L_=Vf,F_=Wf,$_=Hf,B_="Separator",wl="horizontal",U_=["horizontal","vertical"],Xf=b.forwardRef((e,t)=>{const{decorative:n,orientation:r=wl,...o}=e,i=Z_(r)?r:wl,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return c.jsx(Ee.div,{"data-orientation":i,...a,...o,ref:t})});Xf.displayName=B_;function Z_(e){return U_.includes(e)}var V_=Xf,Lo="Tabs",[W_]=Wt(Lo,[lf]),Qf=lf(),[H_,Ks]=W_(Lo),eh=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=_o(a),[h,p]=an({prop:r,onChange:o,defaultProp:i??"",caller:Lo});return c.jsx(H_,{scope:n,baseId:zt(),value:h,onValueChange:p,orientation:s,dir:d,activationMode:l,children:c.jsx(Ee.div,{dir:d,"data-orientation":s,...u,ref:t})})});eh.displayName=Lo;var th="TabsList",nh=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Ks(th,n),s=Qf(n);return c.jsx(Vk,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:c.jsx(Ee.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});nh.displayName=th;var rh="TabsTrigger",oh=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Ks(rh,n),a=Qf(n),l=ah(s.baseId,r),u=lh(s.baseId,r),d=r===s.value;return c.jsx(Wk,{asChild:!0,...a,focusable:!o,active:d,children:c.jsx(Ee.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:_e(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:_e(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:_e(e.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!o&&h&&s.onValueChange(r)})})})});oh.displayName=rh;var ih="TabsContent",sh=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Ks(ih,n),l=ah(a.baseId,r),u=lh(a.baseId,r),d=r===a.value,h=b.useRef(d);return b.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(gt,{present:o||d,children:({present:p})=>c.jsx(Ee.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&i})})});sh.displayName=ih;function ah(e,t){return`${e}-trigger-${t}`}function lh(e,t){return`${e}-content-${t}`}var q_=eh,K_=nh,G_=oh,J_=sh,[Fo]=Wt("Tooltip",[Io]),$o=Io(),ch="TooltipProvider",Y_=700,Hi="tooltip.open",[X_,Gs]=Fo(ch),uh=e=>{const{__scopeTooltip:t,delayDuration:n=Y_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=b.useRef(!0),a=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(X_,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};uh.displayName=ch;var mr="Tooltip",[Q_,wr]=Fo(mr),dh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Gs(mr,e.__scopeTooltip),u=$o(t),[d,h]=b.useState(null),p=zt(),f=b.useRef(0),x=s??l.disableHoverableContent,m=a??l.delayDuration,y=b.useRef(!1),[g,w]=an({prop:r,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(Hi))):l.onClose(),i?.(A)},caller:mr}),_=b.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),S=b.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y.current=!1,w(!0)},[w]),E=b.useCallback(()=>{window.clearTimeout(f.current),f.current=0,w(!1)},[w]),C=b.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{y.current=!0,w(!0),f.current=0},m)},[m,w]);return b.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(nf,{...u,children:c.jsx(Q_,{scope:t,contentId:p,open:g,stateAttribute:_,trigger:d,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{l.isOpenDelayedRef.current?C():S()},[l.isOpenDelayedRef,C,S]),onTriggerLeave:b.useCallback(()=>{x?E():(window.clearTimeout(f.current),f.current=0)},[E,x]),onOpen:S,onClose:E,disableHoverableContent:x,children:n})})};dh.displayName=mr;var qi="TooltipTrigger",fh=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=wr(qi,n),i=Gs(qi,n),s=$o(n),a=b.useRef(null),l=Pe(t,a,o.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),h=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(rf,{asChild:!0,...s,children:c.jsx(Ee.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:_e(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:_e(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:_e(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:_e(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:_e(e.onBlur,o.onClose),onClick:_e(e.onClick,o.onClose)})})});fh.displayName=qi;var Js="TooltipPortal",[eS,tS]=Fo(Js,{forceMount:void 0}),hh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=wr(Js,t);return c.jsx(eS,{scope:t,forceMount:n,children:c.jsx(gt,{present:n||i.open,children:c.jsx(Co,{asChild:!0,container:o,children:r})})})};hh.displayName=Js;var $n="TooltipContent",ph=b.forwardRef((e,t)=>{const n=tS($n,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=wr($n,e.__scopeTooltip);return c.jsx(gt,{present:r||s.open,children:s.disableHoverableContent?c.jsx(mh,{side:o,...i,ref:t}):c.jsx(nS,{side:o,...i,ref:t})})}),nS=b.forwardRef((e,t)=>{const n=wr($n,e.__scopeTooltip),r=Gs($n,e.__scopeTooltip),o=b.useRef(null),i=Pe(t,o),[s,a]=b.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:h}=r,p=b.useCallback(()=>{a(null),h(!1)},[h]),f=b.useCallback((x,m)=>{const y=x.currentTarget,g={x:x.clientX,y:x.clientY},w=sS(g,y.getBoundingClientRect()),_=aS(g,w),S=lS(m.getBoundingClientRect()),E=uS([..._,...S]);a(E),h(!0)},[h]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(l&&d){const x=y=>f(y,d),m=y=>f(y,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",m)}}},[l,d,f,p]),b.useEffect(()=>{if(s){const x=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},w=l?.contains(y)||d?.contains(y),_=!cS(g,s);w?p():_&&(p(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,s,u,p]),c.jsx(mh,{...e,ref:i})}),[rS,oS]=Fo(mr,{isInside:!1}),iS=E1("TooltipContent"),mh=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=wr($n,n),u=$o(n),{onClose:d}=l;return b.useEffect(()=>(document.addEventListener(Hi,d),()=>document.removeEventListener(Hi,d)),[d]),b.useEffect(()=>{if(l.trigger){const h=p=>{p.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),c.jsx(So,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:c.jsxs(of,{"data-state":l.stateAttribute,...u,...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:[c.jsx(iS,{children:r}),c.jsx(rS,{scope:n,isInside:!0,children:c.jsx(R1,{id:l.contentId,role:"tooltip",children:o||r})})]})})});ph.displayName=$n;var gh="TooltipArrow",xh=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=$o(n);return oS(gh,n).isInside?null:c.jsx(sf,{...o,...r,ref:t})});xh.displayName=gh;function sS(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 aS(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 lS(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 cS(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],u=a.x,d=a.y,h=l.x,p=l.y;d>r!=p>r&&n<(h-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function uS(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),dS(t)}function dS(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 fS=uh,hS=dh,pS=fh,mS=hh,gS=ph,xS=xh;const yS=Ns("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 et({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?S1:"span";return c.jsx(o,{"data-slot":"badge","data-variant":t,className:ge(yS({variant:t}),e),...r})}const bS={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function kl(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function vS({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:i,apiFormat:s,expanded:a,onToggle:l,hideApiFormat:u=!1}){return c.jsxs("div",{role:"button",tabIndex:0,className:ge("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:l,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l())},children:[a?c.jsx(pt,{className:"size-4 text-muted-foreground shrink-0"}):c.jsx(kt,{className:"size-4 text-muted-foreground shrink-0"}),c.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}),!u&&c.jsx(et,{variant:"outline",className:ge("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",s==="openai"&&"border-blue-500/40 text-blue-400",s==="anthropic"&&"border-orange-500/40 text-orange-400",s==="unknown"&&"border-muted text-muted-foreground"),children:bS[s]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(wo,{className:"size-3"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[kl(t)," - ",kl(n)]})]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(Iu,{className:"size-3"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),c.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[c.jsx(yr,{className:"size-3 text-muted-foreground"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[c.jsx("span",{className:"text-blue-400",children:qe(o)})," / ",c.jsx("span",{className:"text-amber-400",children:qe(i)})]})]}),c.jsx("span",{className:"flex-1 min-w-0"})]})}function wS(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function kS(e){let t=!1,n=!1;for(const r of e)if(r.apiFormat==="anthropic"?t=!0:r.apiFormat==="openai"&&(n=!0),t&&n)return!0;return!1}function Bn(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 _S(e){const t=new Map;for(const r of e){const o=Bn(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 SS="x-anthropic-billing-header:";function CS(e){return e.trimStart().toLowerCase().startsWith(SS)}function _l(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function ES(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.prototype.hasOwnProperty.call(e,"system")}function NS(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=_l(e,"type"),n=_l(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:CS(n)}function jS(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!ES(t))return{body:e,removed:0};const n=t.system;if(!Array.isArray(n)||n.length===0)return{body:e,removed:0};const r=[];let o=0;for(const i of n){if(NS(i)){o+=1;continue}r.push(i)}return o===0?{body:e,removed:0}:(r.length===0?delete t.system:t.system=r,{body:JSON.stringify(t),removed:o})}const TS=Ns("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 ht({className:e,variant:t,size:n,...r}){return c.jsx("button",{"data-slot":"button",className:ge(TS({variant:t,size:n,className:e})),...r})}function AS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const zS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RS={};function Sl(e,t){return(RS.jsx?IS:zS).test(e)}const PS=/[ \t\n\f\r]/g;function OS(e){return typeof e=="object"?e.type==="text"?Cl(e.value):!1:Cl(e)}function Cl(e){return e.replace(PS,"")===""}class kr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}kr.prototype.normal={};kr.prototype.property={};kr.prototype.space=void 0;function yh(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new kr(n,r,t)}function Ki(e){return e.toLowerCase()}class st{constructor(t,n){this.attribute=n,this.property=t}}st.prototype.attribute="";st.prototype.booleanish=!1;st.prototype.boolean=!1;st.prototype.commaOrSpaceSeparated=!1;st.prototype.commaSeparated=!1;st.prototype.defined=!1;st.prototype.mustUseProperty=!1;st.prototype.number=!1;st.prototype.overloadedBoolean=!1;st.prototype.property="";st.prototype.spaceSeparated=!1;st.prototype.space=void 0;let DS=0;const Ne=mn(),We=mn(),Gi=mn(),oe=mn(),De=mn(),In=mn(),lt=mn();function mn(){return 2**++DS}const Ji=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ne,booleanish:We,commaOrSpaceSeparated:lt,commaSeparated:In,number:oe,overloadedBoolean:Gi,spaceSeparated:De},Symbol.toStringTag,{value:"Module"})),ci=Object.keys(Ji);class Ys extends st{constructor(t,n,r,o){let i=-1;if(super(t,n),El(this,"space",o),typeof r=="number")for(;++i<ci.length;){const s=ci[i];El(this,ci[i],(r&Ji[s])===Ji[s])}}}Ys.prototype.defined=!0;function El(e,t,n){n&&(e[t]=n)}function Jn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Ys(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Ki(r)]=r,n[Ki(i.attribute)]=r}return new kr(t,n,e.space)}const bh=Jn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:De,ariaCurrent:null,ariaDescribedBy:De,ariaDetails:null,ariaDisabled:We,ariaDropEffect:De,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:De,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:De,ariaLevel:oe,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:De,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:De,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 vh(e,t){return t in e?e[t]:t}function wh(e,t){return vh(e,t.toLowerCase())}const MS=Jn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:In,acceptCharset:De,accessKey:De,action:null,allow:null,allowFullScreen:Ne,allowPaymentRequest:Ne,allowUserMedia:Ne,alt:null,as:null,async:Ne,autoCapitalize:null,autoComplete:De,autoFocus:Ne,autoPlay:Ne,blocking:De,capture:null,charSet:null,checked:Ne,cite:null,className:De,cols:oe,colSpan:null,content:null,contentEditable:We,controls:Ne,controlsList:De,coords:oe|In,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ne,defer:Ne,dir:null,dirName:null,disabled:Ne,download:Gi,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ne,formTarget:null,headers:De,height:oe,hidden:Gi,high:oe,href:null,hrefLang:null,htmlFor:De,httpEquiv:De,id:null,imageSizes:null,imageSrcSet:null,inert:Ne,inputMode:null,integrity:null,is:null,isMap:Ne,itemId:null,itemProp:De,itemRef:De,itemScope:Ne,itemType:De,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ne,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:Ne,muted:Ne,name:null,nonce:null,noModule:Ne,noValidate:Ne,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:Ne,optimum:oe,pattern:null,ping:De,placeholder:null,playsInline:Ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ne,referrerPolicy:null,rel:De,required:Ne,reversed:Ne,rows:oe,rowSpan:oe,sandbox:De,scope:null,scoped:Ne,seamless:Ne,selected:Ne,shadowRootClonable:Ne,shadowRootDelegatesFocus:Ne,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:Ne,useMap:null,value:We,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:De,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:Ne,declare:Ne,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:Ne,noHref:Ne,noShade:Ne,noWrap:Ne,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:Ne,disableRemotePlayback:Ne,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:wh}),LS=Jn({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:lt,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:De,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:Ne,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:In,g2:In,glyphName:In,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:lt,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:De,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lt,rev:lt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lt,requiredFeatures:lt,requiredFonts:lt,requiredFormats:lt,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:lt,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:lt,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:lt,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:vh}),kh=Jn({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()}}),_h=Jn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wh}),Sh=Jn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),FS={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"},$S=/[A-Z]/g,Nl=/-[a-z]/g,BS=/^data[-\w.:]+$/i;function US(e,t){const n=Ki(t);let r=t,o=st;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&BS.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Nl,VS);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Nl.test(i)){let s=i.replace($S,ZS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Ys}return new o(r,t)}function ZS(e){return"-"+e.toLowerCase()}function VS(e){return e.charAt(1).toUpperCase()}const WS=yh([bh,MS,kh,_h,Sh],"html"),Xs=yh([bh,LS,kh,_h,Sh],"svg");function HS(e){return e.join(" ").trim()}var kn={},ui,jl;function qS(){if(jl)return ui;jl=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=`
85
- `,u="/",d="*",h="",p="comment",f="declaration";function x(y,g){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];g=g||{};var w=1,_=1;function S(k){var O=k.match(t);O&&(w+=O.length);var Y=k.lastIndexOf(l);_=~Y?k.length-Y:_+k.length}function E(){var k={line:w,column:_};return function(O){return O.position=new C(k),P(),O}}function C(k){this.start=k,this.end={line:w,column:_},this.source=g.source}C.prototype.content=y;function A(k){var O=new Error(g.source+":"+w+":"+_+": "+k);if(O.reason=k,O.filename=g.source,O.line=w,O.column=_,O.source=y,!g.silent)throw O}function I(k){var O=k.exec(y);if(O){var Y=O[0];return S(Y),y=y.slice(Y.length),O}}function P(){I(n)}function M(k){var O;for(k=k||[];O=B();)O!==!1&&k.push(O);return k}function B(){var k=E();if(!(u!=y.charAt(0)||d!=y.charAt(1))){for(var O=2;h!=y.charAt(O)&&(d!=y.charAt(O)||u!=y.charAt(O+1));)++O;if(O+=2,h===y.charAt(O-1))return A("End of comment missing");var Y=y.slice(2,O-2);return _+=2,S(Y),y=y.slice(O),_+=2,k({type:p,comment:Y})}}function N(){var k=E(),O=I(r);if(O){if(B(),!I(o))return A("property missing ':'");var Y=I(i),Z=k({type:f,property:m(O[0].replace(e,h)),value:Y?m(Y[0].replace(e,h)):h});return I(s),Z}}function D(){var k=[];M(k);for(var O;O=N();)O!==!1&&(k.push(O),M(k));return k}return P(),D()}function m(y){return y?y.replace(a,h):h}return ui=x,ui}var Tl;function KS(){if(Tl)return kn;Tl=1;var e=kn&&kn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(kn,"__esModule",{value:!0}),kn.default=n;const t=e(qS());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:u,value:d}=l;a?o(u,d,l):d&&(i=i||{},i[u]=d)}),i}return kn}var tr={},Al;function GS(){if(Al)return tr;Al=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(u){return!u||n.test(u)||e.test(u)},s=function(u,d){return d.toUpperCase()},a=function(u,d){return"".concat(d,"-")},l=function(u,d){return d===void 0&&(d={}),i(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(o,a):u=u.replace(r,a),u.replace(t,s))};return tr.camelCase=l,tr}var nr,zl;function JS(){if(zl)return nr;zl=1;var e=nr&&nr.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(KS()),n=GS();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,nr=r,nr}var YS=JS();const XS=us(YS),Ch=Eh("end"),Qs=Eh("start");function Eh(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 QS(e){const t=Qs(e),n=Ch(e);if(t&&n)return{start:t,end:n}}function cr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Il(e.position):"start"in e||"end"in e?Il(e):"line"in e||"column"in e?Yi(e):""}function Yi(e){return Rl(e&&e.line)+":"+Rl(e&&e.column)}function Il(e){return Yi(e&&e.start)+"-"+Yi(e&&e.end)}function Rl(e){return e&&typeof e=="number"?e:1}class Ye 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=cr(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}}Ye.prototype.file="";Ye.prototype.name="";Ye.prototype.reason="";Ye.prototype.message="";Ye.prototype.stack="";Ye.prototype.column=void 0;Ye.prototype.line=void 0;Ye.prototype.ancestors=void 0;Ye.prototype.cause=void 0;Ye.prototype.fatal=void 0;Ye.prototype.place=void 0;Ye.prototype.ruleId=void 0;Ye.prototype.source=void 0;const ea={}.hasOwnProperty,eC=new Map,tC=/[A-Z]/g,nC=new Set(["table","tbody","thead","tfoot","tr"]),rC=new Set(["td","th"]),Nh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function oC(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=fC(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=dC(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"?Xs:WS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=jh(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function jh(e,t,n){if(t.type==="element")return iC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return sC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lC(e,t,n);if(t.type==="mdxjsEsm")return aC(e,t);if(t.type==="root")return cC(e,t,n);if(t.type==="text")return uC(e,t)}function iC(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Xs,e.schema=o),e.ancestors.push(t);const i=Ah(e,t.tagName,!1),s=hC(e,t);let a=na(e,t);return nC.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!OS(l):!0})),Th(e,s,i,t),ta(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function sC(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)}gr(e,t.position)}function aC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);gr(e,t.position)}function lC(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Xs,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Ah(e,t.name,!0),s=pC(e,t),a=na(e,t);return Th(e,s,i,t),ta(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function cC(e,t,n){const r={};return ta(r,na(e,t)),e.create(t,e.Fragment,r,n)}function uC(e,t){return t.value}function Th(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ta(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dC(e,t,n){return r;function r(o,i,s,a){const u=Array.isArray(s.children)?n:t;return a?u(i,s,a):u(i,s)}}function fC(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=Qs(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 hC(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&ea.call(t.properties,o)){const i=mC(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&rC.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 pC(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 gr(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 gr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function na(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:eC;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 u=o.get(l)||0;s=l+"-"+u,o.set(l,u+1)}}const a=jh(e,i,s);a!==void 0&&n.push(a)}return n}function mC(e,t,n){const r=US(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?AS(n):HS(n)),r.property==="style"){let o=typeof n=="object"?n:gC(e,String(n));return e.stylePropertyNameCase==="css"&&(o=xC(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?FS[r.property]||r.property:r.attribute,n]}}function gC(e,t){try{return XS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Ye("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=Nh+"#cannot-parse-style-attribute",o}}function Ah(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=Sl(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=Sl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return ea.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);gr(e)}function gr(e,t){const n=new Ye("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=Nh+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xC(e){const t={};let n;for(n in e)ea.call(e,n)&&(t[yC(n)]=e[n]);return t}function yC(e){let t=e.replace(tC,bC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function bC(e){return"-"+e.toLowerCase()}const di={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"]},vC={};function wC(e,t){const n=vC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return zh(e,r,o)}function zh(e,t,n){if(kC(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 Pl(e.children,t,n)}return Array.isArray(e)?Pl(e,t,n):""}function Pl(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=zh(e[o],t,n);return r.join("")}function kC(e){return!!(e&&typeof e=="object")}const Ol=document.createElement("i");function ra(e){const t="&"+e+";";Ol.innerHTML=t;const n=Ol.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Pt(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 ft(e,t){return e.length>0?(Pt(e,e.length,0,t),e):t}const Dl={}.hasOwnProperty;function _C(e){const t={};let n=-1;for(;++n<e.length;)SC(t,e[n]);return t}function SC(e,t){let n;for(n in t){const o=(Dl.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Dl.call(o,s)||(o[s]=[]);const a=i[s];CC(o[s],Array.isArray(a)?a:a?[a]:[])}}}function CC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Pt(e,0,0,r)}function Ih(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 Rn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tt=rn(/[A-Za-z]/),ut=rn(/[\dA-Za-z]/),EC=rn(/[#-'*+\--9=?A-Z^-~]/);function Xi(e){return e!==null&&(e<32||e===127)}const Qi=rn(/\d/),NC=rn(/[\dA-Fa-f]/),jC=rn(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function ot(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}const TC=rn(new RegExp("\\p{P}|\\p{S}","u")),AC=rn(/\s/);function rn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&ut(e.charCodeAt(n+1))&&ut(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 Me(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Re(l)?(e.enter(n),a(l)):t(l)}function a(l){return Re(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const zC={tokenize:IC};function IC(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"),Me(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 Se(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const RC={tokenize:PC},Ml={tokenize:OC};function PC(e){const t=this,n=[];let r=0,o,i,s;return a;function a(_){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(_)}return u(_)}function l(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&w();const S=t.events.length;let E=S,C;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){C=t.events[E][1].end;break}g(r);let A=S;for(;A<t.events.length;)t.events[A][1].end={...C},A++;return Pt(t.events,E+1,0,t.events.slice(S)),t.events.length=A,u(_)}return a(_)}function u(_){if(r===n.length){if(!o)return p(_);if(o.currentConstruct&&o.currentConstruct.concrete)return x(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ml,d,h)(_)}function d(_){return o&&w(),g(r),p(_)}function h(_){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(_)}function p(_){return t.containerState={},e.attempt(Ml,f,x)(_)}function f(_){return r++,n.push([t.currentConstruct,t.containerState]),p(_)}function x(_){if(_===null){o&&w(),g(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(_)}function m(_){if(_===null){y(e.exit("chunkFlow"),!0),g(0),e.consume(_);return}return Se(_)?(e.consume(_),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(_),m)}function y(_,S){const E=t.sliceStream(_);if(S&&E.push(null),_.previous=i,i&&(i.next=_),i=_,o.defineSkip(_.start),o.write(E),t.parser.lazy[_.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<s&&(!o.events[C][1].end||o.events[C][1].end.offset>s))return;const A=t.events.length;let I=A,P,M;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(P){M=t.events[I][1].end;break}P=!0}for(g(r),C=A;C<t.events.length;)t.events[C][1].end={...M},C++;Pt(t.events,I+1,0,t.events.slice(A)),t.events.length=C}}function g(_){let S=n.length;for(;S-- >_;){const E=n[S];t.containerState=E[1],E[0].exit.call(t,e)}n.length=_}function w(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function OC(e,t,n){return Me(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ll(e){if(e===null||ot(e)||AC(e))return 1;if(TC(e))return 2}function oa(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 es={name:"attention",resolveAll:DC,tokenize:MC};function DC(e,t){let n=-1,r,o,i,s,a,l,u,d;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 h={...e[r][1].end},p={...e[n][1].start};Fl(h,-l),Fl(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,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},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ft(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ft(u,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=ft(u,oa(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ft(u,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ft(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Pt(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Ll(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 u=e.exit("attentionSequence"),d=Ll(l),h=!d||d===2&&o||n.includes(l),p=!o||o===2&&d||n.includes(r);return u._open=!!(i===42?h:h&&(o||!p)),u._close=!!(i===42?p:p&&(d||!h)),t(l)}}function Fl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const LC={name:"autolink",tokenize:FC};function FC(e,t,n){let r=0;return o;function o(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(f){return Tt(f)?(e.consume(f),s):f===64?n(f):u(f)}function s(f){return f===43||f===45||f===46||ut(f)?(r=1,a(f)):u(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||ut(f))&&r++<32?(e.consume(f),a):(r=0,u(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Xi(f)?n(f):(e.consume(f),l)}function u(f){return f===64?(e.consume(f),d):EC(f)?(e.consume(f),u):n(f)}function d(f){return ut(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||ut(f))&&r++<63){const x=f===45?p:h;return e.consume(f),x}return n(f)}}const Bo={partial:!0,tokenize:$C};function $C(e,t,n){return r;function r(i){return Re(i)?Me(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||Se(i)?t(i):n(i)}}const Rh={continuation:{tokenize:UC},exit:ZC,name:"blockQuote",tokenize:BC};function BC(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 Re(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function UC(e,t,n){const r=this;return o;function o(s){return Re(s)?Me(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Rh,t,n)(s)}}function ZC(e){e.exit("blockQuote")}const Ph={name:"characterEscape",tokenize:VC};function VC(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 jC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Oh={name:"characterReference",tokenize:WC};function WC(e,t,n){const r=this;let o=0,i,s;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=ut,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=NC,d):(e.enter("characterReferenceValue"),i=7,s=Qi,d(h))}function d(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return s===ut&&!ra(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&o++<i?(e.consume(h),d):n(h)}}const $l={partial:!0,tokenize:qC},Bl={concrete:!0,name:"codeFenced",tokenize:HC};function HC(e,t,n){const r=this,o={partial:!0,tokenize:E};let i=0,s=0,a;return l;function l(C){return u(C)}function u(C){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===a?(s++,e.consume(C),d):s<3?n(C):(e.exit("codeFencedFenceSequence"),Re(C)?Me(e,h,"whitespace")(C):h(C))}function h(C){return C===null||Se(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check($l,m,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||Se(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(C)):Re(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Me(e,f,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),p)}function f(C){return C===null||Se(C)?h(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===null||Se(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(C)):C===96&&C===a?n(C):(e.consume(C),x)}function m(C){return e.attempt(o,S,y)(C)}function y(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),g}function g(C){return i>0&&Re(C)?Me(e,w,"linePrefix",i+1)(C):w(C)}function w(C){return C===null||Se(C)?e.check($l,m,S)(C):(e.enter("codeFlowValue"),_(C))}function _(C){return C===null||Se(C)?(e.exit("codeFlowValue"),w(C)):(e.consume(C),_)}function S(C){return e.exit("codeFenced"),t(C)}function E(C,A,I){let P=0;return M;function M(O){return C.enter("lineEnding"),C.consume(O),C.exit("lineEnding"),B}function B(O){return C.enter("codeFencedFence"),Re(O)?Me(C,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):N(O)}function N(O){return O===a?(C.enter("codeFencedFenceSequence"),D(O)):I(O)}function D(O){return O===a?(P++,C.consume(O),D):P>=s?(C.exit("codeFencedFenceSequence"),Re(O)?Me(C,k,"whitespace")(O):k(O)):I(O)}function k(O){return O===null||Se(O)?(C.exit("codeFencedFence"),A(O)):I(O)}}}function qC(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 fi={name:"codeIndented",tokenize:GC},KC={partial:!0,tokenize:JC};function GC(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),Me(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):Se(u)?e.attempt(KC,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||Se(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function JC(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):Se(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):Me(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):Se(s)?o(s):n(s)}}const YC={name:"codeText",previous:QC,resolve:XC,tokenize:eE};function XC(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 QC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function eE(e,t,n){let r=0,o,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(i=e.enter("codeTextSequence"),o=0,d(h)):Se(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Se(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",u(h))}}class tE{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&&rr(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),rr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),rr(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);rr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);rr(this.left,n.reverse())}}}function rr(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 Dh(e){const t={};let n=-1,r,o,i,s,a,l,u;const d=new tE(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.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,nE(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(d.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={...d.get(o)[1].start},a=d.slice(o,n),a.unshift(r),d.splice(o,n-o+1,a))}}return Pt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function nE(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=[],u={};let d,h,p=-1,f=n,x=0,m=0;const y=[m];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),h&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(m=p+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),p=y.length;p--;){const g=a.slice(y[p],y[p+1]),w=i.pop();l.push([w,w+g.length-1]),e.splice(w,2,g)}for(l.reverse(),p=-1;++p<l.length;)u[x+l[p][0]]=x+l[p][1],x+=l[p][1]-l[p][0]-1;return u}const rE={resolve:iE,tokenize:sE},oE={partial:!0,tokenize:aE};function iE(e){return Dh(e),e}function sE(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):Se(a)?e.check(oE,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 aE(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Me(e,i,"linePrefix")}function i(s){if(s===null||Se(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 Mh(e,t,n,r,o,i,s,a,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return h;function h(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||Xi(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"}),f(g))}function f(g){return g===62?(e.exit("chunkString"),e.exit(a),p(g)):g===null||g===60||Se(g)?n(g):(e.consume(g),g===92?x:f)}function x(g){return g===60||g===62||g===92?(e.consume(g),f):f(g)}function m(g){return!d&&(g===null||g===41||ot(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):d<u&&g===40?(e.consume(g),d++,m):g===41?(e.consume(g),d--,m):g===null||g===32||g===40||Xi(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 Lh(e,t,n,r,o,i){const s=this;let a=0,l;return u;function u(f){return e.enter(r),e.enter(o),e.consume(f),e.exit(o),e.enter(i),d}function d(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(i),e.enter(o),e.consume(f),e.exit(o),e.exit(r),t):Se(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||Se(f)||a++>999?(e.exit("chunkString"),d(f)):(e.consume(f),l||(l=!Re(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,h):h(f)}}function Fh(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),u(p))}function u(p){return p===s?(e.exit(i),l(s)):p===null?n(p):Se(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Me(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===s||p===null||Se(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?h:d)}function h(p){return p===s||p===92?(e.consume(p),d):d(p)}}function ur(e,t){let n;return r;function r(o){return Se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Re(o)?Me(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const lE={name:"definition",tokenize:uE},cE={partial:!0,tokenize:dE};function uE(e,t,n){const r=this;let o;return i;function i(f){return e.enter("definition"),s(f)}function s(f){return Lh.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return o=Rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return ot(f)?ur(e,u)(f):u(f)}function u(f){return Mh(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(cE,h,h)(f)}function h(f){return Re(f)?Me(e,p,"whitespace")(f):p(f)}function p(f){return f===null||Se(f)?(e.exit("definition"),r.parser.defined.push(o),t(f)):n(f)}}function dE(e,t,n){return r;function r(a){return ot(a)?ur(e,o)(a):n(a)}function o(a){return Fh(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Re(a)?Me(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Se(a)?t(a):n(a)}}const fE={name:"hardBreakEscape",tokenize:hE};function hE(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Se(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const pE={name:"headingAtx",resolve:mE,tokenize:gE};function mE(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"},Pt(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function gE(e,t,n){let r=0;return o;function o(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||ot(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Se(d)?(e.exit("atxHeading"),t(d)):Re(d)?Me(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||ot(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const xE=["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"],Ul=["pre","script","style","textarea"],yE={concrete:!0,name:"htmlFlow",resolveTo:wE,tokenize:kE},bE={partial:!0,tokenize:SE},vE={partial:!0,tokenize:_E};function wE(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 kE(e,t,n){const r=this;let o,i,s,a,l;return u;function u(T){return d(T)}function d(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),p):T===47?(e.consume(T),i=!0,m):T===63?(e.consume(T),o=3,r.interrupt?t:j):Tt(T)?(e.consume(T),s=String.fromCharCode(T),y):n(T)}function p(T){return T===45?(e.consume(T),o=2,f):T===91?(e.consume(T),o=5,a=0,x):Tt(T)?(e.consume(T),o=4,r.interrupt?t:j):n(T)}function f(T){return T===45?(e.consume(T),r.interrupt?t:j):n(T)}function x(T){const ee="CDATA[";return T===ee.charCodeAt(a++)?(e.consume(T),a===ee.length?r.interrupt?t:N:x):n(T)}function m(T){return Tt(T)?(e.consume(T),s=String.fromCharCode(T),y):n(T)}function y(T){if(T===null||T===47||T===62||ot(T)){const ee=T===47,K=s.toLowerCase();return!ee&&!i&&Ul.includes(K)?(o=1,r.interrupt?t(T):N(T)):xE.includes(s.toLowerCase())?(o=6,ee?(e.consume(T),g):r.interrupt?t(T):N(T)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):i?w(T):_(T))}return T===45||ut(T)?(e.consume(T),s+=String.fromCharCode(T),y):n(T)}function g(T){return T===62?(e.consume(T),r.interrupt?t:N):n(T)}function w(T){return Re(T)?(e.consume(T),w):M(T)}function _(T){return T===47?(e.consume(T),M):T===58||T===95||Tt(T)?(e.consume(T),S):Re(T)?(e.consume(T),_):M(T)}function S(T){return T===45||T===46||T===58||T===95||ut(T)?(e.consume(T),S):E(T)}function E(T){return T===61?(e.consume(T),C):Re(T)?(e.consume(T),E):_(T)}function C(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,A):Re(T)?(e.consume(T),C):I(T)}function A(T){return T===l?(e.consume(T),l=null,P):T===null||Se(T)?n(T):(e.consume(T),A)}function I(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||ot(T)?E(T):(e.consume(T),I)}function P(T){return T===47||T===62||Re(T)?_(T):n(T)}function M(T){return T===62?(e.consume(T),B):n(T)}function B(T){return T===null||Se(T)?N(T):Re(T)?(e.consume(T),B):n(T)}function N(T){return T===45&&o===2?(e.consume(T),Y):T===60&&o===1?(e.consume(T),Z):T===62&&o===4?(e.consume(T),L):T===63&&o===3?(e.consume(T),j):T===93&&o===5?(e.consume(T),G):Se(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(bE,F,D)(T)):T===null||Se(T)?(e.exit("htmlFlowData"),D(T)):(e.consume(T),N)}function D(T){return e.check(vE,k,F)(T)}function k(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),O}function O(T){return T===null||Se(T)?D(T):(e.enter("htmlFlowData"),N(T))}function Y(T){return T===45?(e.consume(T),j):N(T)}function Z(T){return T===47?(e.consume(T),s="",H):N(T)}function H(T){if(T===62){const ee=s.toLowerCase();return Ul.includes(ee)?(e.consume(T),L):N(T)}return Tt(T)&&s.length<8?(e.consume(T),s+=String.fromCharCode(T),H):N(T)}function G(T){return T===93?(e.consume(T),j):N(T)}function j(T){return T===62?(e.consume(T),L):T===45&&o===2?(e.consume(T),j):N(T)}function L(T){return T===null||Se(T)?(e.exit("htmlFlowData"),F(T)):(e.consume(T),L)}function F(T){return e.exit("htmlFlow"),t(T)}}function _E(e,t,n){const r=this;return o;function o(s){return Se(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 SE(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Bo,t,n)}}const CE={name:"htmlText",tokenize:EE};function EE(e,t,n){const r=this;let o,i,s;return a;function a(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),l}function l(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),E):j===63?(e.consume(j),_):Tt(j)?(e.consume(j),I):n(j)}function u(j){return j===45?(e.consume(j),d):j===91?(e.consume(j),i=0,x):Tt(j)?(e.consume(j),w):n(j)}function d(j){return j===45?(e.consume(j),f):n(j)}function h(j){return j===null?n(j):j===45?(e.consume(j),p):Se(j)?(s=h,Z(j)):(e.consume(j),h)}function p(j){return j===45?(e.consume(j),f):h(j)}function f(j){return j===62?Y(j):j===45?p(j):h(j)}function x(j){const L="CDATA[";return j===L.charCodeAt(i++)?(e.consume(j),i===L.length?m:x):n(j)}function m(j){return j===null?n(j):j===93?(e.consume(j),y):Se(j)?(s=m,Z(j)):(e.consume(j),m)}function y(j){return j===93?(e.consume(j),g):m(j)}function g(j){return j===62?Y(j):j===93?(e.consume(j),g):m(j)}function w(j){return j===null||j===62?Y(j):Se(j)?(s=w,Z(j)):(e.consume(j),w)}function _(j){return j===null?n(j):j===63?(e.consume(j),S):Se(j)?(s=_,Z(j)):(e.consume(j),_)}function S(j){return j===62?Y(j):_(j)}function E(j){return Tt(j)?(e.consume(j),C):n(j)}function C(j){return j===45||ut(j)?(e.consume(j),C):A(j)}function A(j){return Se(j)?(s=A,Z(j)):Re(j)?(e.consume(j),A):Y(j)}function I(j){return j===45||ut(j)?(e.consume(j),I):j===47||j===62||ot(j)?P(j):n(j)}function P(j){return j===47?(e.consume(j),Y):j===58||j===95||Tt(j)?(e.consume(j),M):Se(j)?(s=P,Z(j)):Re(j)?(e.consume(j),P):Y(j)}function M(j){return j===45||j===46||j===58||j===95||ut(j)?(e.consume(j),M):B(j)}function B(j){return j===61?(e.consume(j),N):Se(j)?(s=B,Z(j)):Re(j)?(e.consume(j),B):P(j)}function N(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,D):Se(j)?(s=N,Z(j)):Re(j)?(e.consume(j),N):(e.consume(j),k)}function D(j){return j===o?(e.consume(j),o=void 0,O):j===null?n(j):Se(j)?(s=D,Z(j)):(e.consume(j),D)}function k(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||ot(j)?P(j):(e.consume(j),k)}function O(j){return j===47||j===62||ot(j)?P(j):n(j)}function Y(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function Z(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),H}function H(j){return Re(j)?Me(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):G(j)}function G(j){return e.enter("htmlTextData"),s(j)}}const ia={name:"labelEnd",resolveAll:AE,resolveTo:zE,tokenize:IE},NE={tokenize:RE},jE={tokenize:PE},TE={tokenize:OE};function AE(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&&Pt(e,0,e.length,n),e}function zE(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}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=ft(a,e.slice(i+1,i+r+3)),a=ft(a,[["enter",d,t]]),a=ft(a,oa(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=ft(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=ft(a,e.slice(s+1)),a=ft(a,[["exit",l,t]]),Pt(e,i,e.length,a),e}function IE(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?h(p):(s=r.parser.defined.includes(Rn(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(NE,d,s?d:h)(p):p===91?e.attempt(jE,d,s?u:h)(p):s?d(p):h(p)}function u(p){return e.attempt(TE,d,h)(p)}function d(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function RE(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return ot(h)?ur(e,i)(h):i(h)}function i(h){return h===41?d(h):Mh(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return ot(h)?ur(e,l)(h):d(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?Fh(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return ot(h)?ur(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function PE(e,t,n){const r=this;return o;function o(a){return Lh.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function OE(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 DE={name:"labelStartImage",resolveAll:ia.resolveAll,tokenize:ME};function ME(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 LE={name:"labelStartLink",resolveAll:ia.resolveAll,tokenize:FE};function FE(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 hi={name:"lineEnding",tokenize:$E};function $E(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Me(e,t,"linePrefix")}}const qr={name:"thematicBreak",tokenize:BE};function BE(e,t,n){let r=0,o;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return o=u,a(u)}function a(u){return u===o?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||Se(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===o?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Re(u)?Me(e,a,"whitespace")(u):a(u))}}const nt={continuation:{tokenize:WE},exit:qE,name:"list",tokenize:VE},UE={partial:!0,tokenize:KE},ZE={partial:!0,tokenize:HE};function VE(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(f){const x=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Qi(f)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(qr,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Qi(f)&&++s<10?(e.consume(f),l):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Bo,r.interrupt?n:d,e.attempt(UE,p,h))}function d(f){return r.containerState.initialBlankLine=!0,i++,p(f)}function h(f){return Re(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function WE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bo,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Me(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Re(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(ZE,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Me(e,e.attempt(nt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function HE(e,t,n){const r=this;return Me(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 qE(e){e.exit(this.containerState.type)}function KE(e,t,n){const r=this;return Me(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!Re(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Zl={name:"setextUnderline",resolveTo:GE,tokenize:JE};function GE(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 JE(e,t,n){const r=this;let o;return i;function i(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===o?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Re(u)?Me(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Se(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const YE={tokenize:XE};function XE(e){const t=this,n=e.attempt(Bo,r,e.attempt(this.parser.constructs.flowInitial,o,Me(e,e.attempt(this.parser.constructs.flow,o,e.attempt(rE,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 QE={resolveAll:Bh()},eN=$h("string"),tN=$h("text");function $h(e){return{resolveAll:Bh(e==="text"?nN: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(d){return u(d)?i(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const h=o[d];let p=-1;if(h)for(;++p<h.length;){const f=h[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Bh(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 nN(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 u=o[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={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={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const rN={42:nt,43:nt,45:nt,48:nt,49:nt,50:nt,51:nt,52:nt,53:nt,54:nt,55:nt,56:nt,57:nt,62:Rh},oN={91:lE},iN={[-2]:fi,[-1]:fi,32:fi},sN={35:pE,42:qr,45:[Zl,qr],60:yE,61:Zl,95:qr,96:Bl,126:Bl},aN={38:Oh,92:Ph},lN={[-5]:hi,[-4]:hi,[-3]:hi,33:DE,38:Oh,42:es,60:[LC,CE],91:LE,92:[fE,Ph],93:ia,95:es,96:YC},cN={null:[es,QE]},uN={null:[42,95]},dN={null:[]},fN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:uN,contentInitial:oN,disable:dN,document:rN,flow:sN,flowInitial:iN,insideSpan:cN,string:aN,text:lN},Symbol.toStringTag,{value:"Module"}));function hN(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:A(E),check:A(C),consume:w,enter:_,exit:S,interrupt:A(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:f,write:h};let d=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function h(B){return s=ft(s,B),y(),s[s.length-1]!==null?[]:(I(t,0),u.events=oa(i,u.events,u),u.events)}function p(B,N){return mN(f(B),N)}function f(B){return pN(s,B)}function x(){const{_bufferIndex:B,_index:N,line:D,column:k,offset:O}=r;return{_bufferIndex:B,_index:N,line:D,column:k,offset:O}}function m(B){o[B.line]=B.column,M()}function y(){let B;for(;r._index<s.length;){const N=s[r._index];if(typeof N=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<N.length;)g(N.charCodeAt(r._bufferIndex));else g(N)}}function g(B){d=d(B)}function w(B){Se(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++)),u.previous=B}function _(B,N){const D=N||{};return D.type=B,D.start=x(),u.events.push(["enter",D,u]),a.push(D),D}function S(B){const N=a.pop();return N.end=x(),u.events.push(["exit",N,u]),N}function E(B,N){I(B,N.from)}function C(B,N){N.restore()}function A(B,N){return D;function D(k,O,Y){let Z,H,G,j;return Array.isArray(k)?F(k):"tokenize"in k?F([k]):L(k);function L(ue){return Q;function Q(ce){const fe=ce!==null&&ue[ce],xe=ce!==null&&ue.null,be=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(xe)?xe:xe?[xe]:[]];return F(be)(ce)}}function F(ue){return Z=ue,H=0,ue.length===0?Y:T(ue[H])}function T(ue){return Q;function Q(ce){return j=P(),G=ue,ue.partial||(u.currentConstruct=ue),ue.name&&u.parser.constructs.disable.null.includes(ue.name)?K():ue.tokenize.call(N?Object.assign(Object.create(u),N):u,l,ee,K)(ce)}}function ee(ue){return B(G,j),O}function K(ue){return j.restore(),++H<Z.length?T(Z[H]):Y}}}function I(B,N){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&Pt(u.events,N,u.events.length-N,B.resolve(u.events.slice(N),u)),B.resolveTo&&(u.events=B.resolveTo(u.events,u))}function P(){const B=x(),N=u.previous,D=u.currentConstruct,k=u.events.length,O=Array.from(a);return{from:k,restore:Y};function Y(){r=B,u.previous=N,u.currentConstruct=D,u.events.length=k,a=O,M()}}function M(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function pN(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 mN(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=`
86
- `;break}case-3:{s=`\r
87
- `;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 gN(e){const r={constructs:_C([fN,...(e||{}).extensions||[]]),content:o(zC),defined:[],document:o(RC),flow:o(YE),lazy:{},string:o(eN),text:o(tN)};return r;function o(i){return s;function s(a){return hN(r,i,a)}}}function xN(e){for(;!Dh(e););return e}const Vl=/[\0\t\n\r]/g;function yN(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let u,d,h,p,f;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(Vl.lastIndex=h,u=Vl.exec(i),p=u&&u.index!==void 0?u.index:i.length,f=i.charCodeAt(p),!u){t=i.slice(h);break}if(f===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(i.slice(h,p)),e+=p-h),f){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const bN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function vN(e){return e.replace(bN,wN)}function wN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Ih(n.slice(i?2:1),i?16:10)}return ra(n)||e}const Uh={}.hasOwnProperty;function kN(e,t,n){return typeof t!="string"&&(n=t,t=void 0),_N(n)(xN(gN(n).document().write(yN()(e,t,!0))))}function _N(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i($),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(q),blockQuote:i(xe),characterEscape:P,characterReference:P,codeFenced:i(be),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(be,s),codeText:i(je,s),codeTextData:P,data:P,codeFlowValue:P,definition:i(le),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(v),hardBreakEscape:i(V),hardBreakTrailing:i(V),htmlFlow:i(R,s),htmlFlowData:P,htmlText:i(R,s),htmlTextData:P,image:i(z),label:s,link:i($),listItem:i(re),listItemValue:p,listOrdered:i(te,h),listUnordered:i(te),paragraph:i(W),reference:T,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(q),strong:i(ie),thematicBreak:i(ae)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:fe,autolinkProtocol:ce,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:ue,characterReference:Q,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:l(g),codeText:l(O),codeTextData:M,data:M,definition:l(),definitionDestinationString:S,definitionLabelString:w,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(D),htmlFlowData:M,htmlText:l(k),htmlTextData:M,image:l(Z),label:G,labelText:H,lineEnding:B,link:l(Y),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:j,resourceTitleString:L,resource:F,setextHeading:l(I),setextHeadingLineSequence:A,setextHeadingText:C,strong:l(),thematicBreak:l()}};Zh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let ne={type:"root",children:[]};const de={stack:[ne],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},ke=[];let ze=-1;for(;++ze<U.length;)if(U[ze][1].type==="listOrdered"||U[ze][1].type==="listUnordered")if(U[ze][0]==="enter")ke.push(ze);else{const Ze=ke.pop();ze=o(U,Ze,ze)}for(ze=-1;++ze<U.length;){const Ze=t[U[ze][0]];Uh.call(Ze,U[ze][1].type)&&Ze[U[ze][1].type].call(Object.assign({sliceSerialize:U[ze][2].sliceSerialize},de),U[ze][1])}if(de.tokenStack.length>0){const Ze=de.tokenStack[de.tokenStack.length-1];(Ze[1]||Wl).call(de,void 0,Ze[0])}for(ne.position={start:qt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:qt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<t.transforms.length;)ne=t.transforms[ze](ne)||ne;return ne}function o(U,ne,de){let ke=ne-1,ze=-1,Ze=!1,at,Ie,Et,Mt;for(;++ke<=de;){const Be=U[ke];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?ze++:ze--,Mt=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(at&&!Mt&&!ze&&!Et&&(Et=ke),Mt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Mt=void 0}if(!ze&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||ze===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(at){let Lt=ke;for(Ie=void 0;Lt--;){const yt=U[Lt];if(yt[1].type==="lineEnding"||yt[1].type==="lineEndingBlank"){if(yt[0]==="exit")continue;Ie&&(U[Ie][1].type="lineEndingBlank",Ze=!0),yt[1].type="lineEnding",Ie=Lt}else if(!(yt[1].type==="linePrefix"||yt[1].type==="blockQuotePrefix"||yt[1].type==="blockQuotePrefixWhitespace"||yt[1].type==="blockQuoteMarker"||yt[1].type==="listItemIndent"))break}Et&&(!Ie||Et<Ie)&&(at._spread=!0),at.end=Object.assign({},Ie?U[Ie][1].start:Be[1].end),U.splice(Ie||ke,0,["exit",at,Be[2]]),ke++,de++}if(Be[1].type==="listItemPrefix"){const Lt={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};at=Lt,U.splice(ke,0,["enter",Lt,Be[2]]),ke++,de++,Et=void 0,Mt=!0}}}return U[ne][1]._spread=Ze,de}function i(U,ne){return de;function de(ke){a.call(this,U(ke),ke),ne&&ne.call(this,ke)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(U,ne,de){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([ne,de||void 0]),U.position={start:qt(ne.start),end:void 0}}function l(U){return ne;function ne(de){U&&U.call(this,de),u.call(this,de)}}function u(U,ne){const de=this.stack.pop(),ke=this.tokenStack.pop();if(ke)ke[0].type!==U.type&&(ne?ne.call(this,U,ke[0]):(ke[1]||Wl).call(this,U,ke[0]));else throw new Error("Cannot close `"+U.type+"` ("+cr({start:U.start,end:U.end})+"): it’s not open");de.position.end=qt(U.end)}function d(){return wC(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(U){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function f(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=U}function x(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=U}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.value=U.replace(/(\r?\n|\r)$/g,"")}function w(U){const ne=this.resume(),de=this.stack[this.stack.length-1];de.label=ne,de.identifier=Rn(this.sliceSerialize(U)).toLowerCase()}function _(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.title=U}function S(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.url=U}function E(U){const ne=this.stack[this.stack.length-1];if(!ne.depth){const de=this.sliceSerialize(U).length;ne.depth=de}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function A(U){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const de=this.stack[this.stack.length-1].children;let ke=de[de.length-1];(!ke||ke.type!=="text")&&(ke=he(),ke.position={start:qt(U.start),end:void 0},de.push(ke)),this.stack.push(ke)}function M(U){const ne=this.stack.pop();ne.value+=this.sliceSerialize(U),ne.position.end=qt(U.end)}function B(U){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const de=ne.children[ne.children.length-1];de.position.end=qt(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(P.call(this,U),M.call(this,U))}function N(){this.data.atHardBreak=!0}function D(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.value=U}function k(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.value=U}function O(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.value=U}function Y(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ne,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function Z(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ne,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function H(U){const ne=this.sliceSerialize(U),de=this.stack[this.stack.length-2];de.label=vN(ne),de.identifier=Rn(ne).toLowerCase()}function G(){const U=this.stack[this.stack.length-1],ne=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){const ke=U.children;de.children=ke}else de.alt=ne}function j(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.url=U}function L(){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.title=U}function F(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ee(U){const ne=this.resume(),de=this.stack[this.stack.length-1];de.label=ne,de.identifier=Rn(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function K(U){this.data.characterReferenceType=U.type}function ue(U){const ne=this.sliceSerialize(U),de=this.data.characterReferenceType;let ke;de?(ke=Ih(ne,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ke=ra(ne);const ze=this.stack[this.stack.length-1];ze.value+=ke}function Q(U){const ne=this.stack.pop();ne.position.end=qt(U.end)}function ce(U){M.call(this,U);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(U)}function fe(U){M.call(this,U);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(U)}function xe(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function je(){return{type:"inlineCode",value:""}}function le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function v(){return{type:"emphasis",children:[]}}function q(){return{type:"heading",depth:0,children:[]}}function V(){return{type:"break"}}function R(){return{type:"html",value:""}}function z(){return{type:"image",title:null,url:"",alt:null}}function $(){return{type:"link",title:null,url:"",children:[]}}function te(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function re(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function W(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function he(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function qt(e){return{line:e.line,column:e.column,offset:e.offset}}function Zh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Zh(e,r):SN(e,r)}}function SN(e,t){let n;for(n in t)if(Uh.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 Wl(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+cr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+cr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+cr({start:t.start,end:t.end})+") is still open")}function CN(e){const t=this;t.parser=n;function n(r){return kN(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function EN(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 NN(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
88
- `}]}function jN(e,t){const n=t.value?t.value+`
89
- `:"",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 TN(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AN(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zN(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Yn(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 u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function IN(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 RN(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Vh(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 PN(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Vh(e,t);const o={src:Yn(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 ON(e,t){const n={src:Yn(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 DN(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 MN(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Vh(e,t);const o={href:Yn(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 LN(e,t){const n={href:Yn(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 FN(e,t,n){const r=e.all(t),o=n?$N(n):Wh(t),i={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.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 d=r[a];(o||a!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
90
- `}),d.type==="element"&&d.tagName==="p"&&!o?s.push(...d.children):s.push(d)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
91
- `});const u={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,u),e.applyData(t,u)}function $N(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=Wh(n[r])}return t}function Wh(e){const t=e.spread;return t??e.children.length>1}function BN(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 UN(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZN(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function VN(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WN(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=Qs(t.children[1]),l=Ch(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 HN(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 u=[];for(;++l<a;){const h=t.children[l],p={},f=s?s[l]:void 0;f&&(p.align=f);let x={type:"element",tagName:i,properties:p,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),u.push(x)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function qN(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Hl=9,ql=32;function KN(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Kl(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Kl(t.slice(o),o>0,!1)),i.join("")}function Kl(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Hl||i===ql;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Hl||i===ql;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function GN(e,t){const n={type:"text",value:KN(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function JN(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const YN={blockquote:EN,break:NN,code:jN,delete:TN,emphasis:AN,footnoteReference:zN,heading:IN,html:RN,imageReference:PN,image:ON,inlineCode:DN,linkReference:MN,link:LN,listItem:FN,list:BN,paragraph:UN,root:ZN,strong:VN,table:WN,tableCell:qN,tableRow:HN,text:GN,thematicBreak:JN,toml:Lr,yaml:Lr,definition:Lr,footnoteDefinition:Lr};function Lr(){}const Hh=-1,Uo=0,dr=1,uo=2,sa=3,aa=4,la=5,ca=6,qh=7,Kh=8,Gl=typeof self=="object"?self:globalThis,XN=(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 Uo:case Hh:return n(s,o);case dr:{const a=n([],o);for(const l of s)a.push(r(l));return a}case uo:{const a=n({},o);for(const[l,u]of s)a[r(l)]=r(u);return a}case sa:return n(new Date(s),o);case aa:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case la:{const a=n(new Map,o);for(const[l,u]of s)a.set(r(l),r(u));return a}case ca:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case qh:{const{name:a,message:l}=s;return n(new Gl[a](l),o)}case Kh: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 Gl[i](s),o)};return r},Jl=e=>XN(new Map,e)(0),_n="",{toString:QN}={},{keys:ej}=Object,or=e=>{const t=typeof e;if(t!=="object"||!e)return[Uo,t];const n=QN.call(e).slice(8,-1);switch(n){case"Array":return[dr,_n];case"Object":return[uo,_n];case"Date":return[sa,_n];case"RegExp":return[aa,_n];case"Map":return[la,_n];case"Set":return[ca,_n];case"DataView":return[dr,n]}return n.includes("Array")?[dr,n]:n.includes("Error")?[qh,n]:[uo,n]},Fr=([e,t])=>e===Uo&&(t==="function"||t==="symbol"),tj=(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]=or(s);switch(a){case Uo:{let d=s;switch(l){case"bigint":a=Kh,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return o([Hh],s)}return o([a,d],s)}case dr:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),o([l,[...p]],s)}const d=[],h=o([a,d],s);for(const p of s)d.push(i(p));return h}case uo:{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 d=[],h=o([a,d],s);for(const p of ej(s))(e||!Fr(or(s[p])))&&d.push([i(p),i(s[p])]);return h}case sa:return o([a,s.toISOString()],s);case aa:{const{source:d,flags:h}=s;return o([a,{source:d,flags:h}],s)}case la:{const d=[],h=o([a,d],s);for(const[p,f]of s)(e||!(Fr(or(p))||Fr(or(f))))&&d.push([i(p),i(f)]);return h}case ca:{const d=[],h=o([a,d],s);for(const p of s)(e||!Fr(or(p)))&&d.push(i(p));return h}}const{message:u}=s;return o([a,{name:l,message:u}],s)};return i},Yl=(e,{json:t,lossy:n}={})=>{const r=[];return tj(!(t||n),!!t,new Map,r)(e),r},fo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Jl(Yl(e,t)):structuredClone(e):(e,t)=>Jl(Yl(e,t));function nj(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 rj(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function oj(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nj,r=e.options.footnoteBackLabel||rj,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 u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),h=String(u.identifier).toUpperCase(),p=Yn(h.toLowerCase());let f=0;const x=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++f<=m;){x.length>0&&x.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,f);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const w=y.children[y.children.length-1];w&&w.type==="text"?w.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...x)}else d.push(...x);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(u,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...fo(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
92
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
93
- `}]}}const Gh=(function(e){if(e==null)return lj;if(typeof e=="function")return Zo(e);if(typeof e=="object")return Array.isArray(e)?ij(e):sj(e);if(typeof e=="string")return aj(e);throw new Error("Expected function, string, or object as test")});function ij(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Gh(e[n]);return Zo(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function sj(e){const t=e;return Zo(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function aj(e){return Zo(t);function t(n){return n&&n.type===e}}function Zo(e){return t;function t(n,r,o){return!!(cj(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function lj(){return!0}function cj(e){return e!==null&&typeof e=="object"&&"type"in e}const Jh=[],uj=!0,Xl=!1,dj="skip";function fj(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=Gh(o),s=r?-1:1;a(e,void 0,[])();function a(l,u,d){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return p;function p(){let f=Jh,x,m,y;if((!t||i(l,u,d[d.length-1]||void 0))&&(f=hj(n(l,d)),f[0]===Xl))return f;if("children"in l&&l.children){const g=l;if(g.children&&f[0]!==dj)for(m=(r?g.children.length:-1)+s,y=d.concat(g);m>-1&&m<g.children.length;){const w=g.children[m];if(x=a(w,m,y)(),x[0]===Xl)return x;m=typeof x[1]=="number"?x[1]:m+s}}return f}}}function hj(e){return Array.isArray(e)?e:typeof e=="number"?[uj,e]:e==null?Jh:[e]}function Yh(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),fj(e,i,a,o);function a(l,u){const d=u[u.length-1],h=d?d.children.indexOf(l):void 0;return s(l,h,d)}}const ts={}.hasOwnProperty,pj={};function mj(e,t){const n=t||pj,r=new Map,o=new Map,i=new Map,s={...YN,...n.handlers},a={all:u,applyData:xj,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:gj,wrap:bj};return Yh(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:o,p=String(d.identifier).toUpperCase();h.has(p)||h.set(p,d)}}),a;function l(d,h){const p=d.type,f=a.handlers[p];if(ts.call(a.handlers,p)&&f)return f(a,d,h);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in d){const{children:m,...y}=d,g=fo(y);return g.children=a.all(d),g}return fo(d)}return(a.options.unknownHandler||yj)(a,d,h)}function u(d){const h=[];if("children"in d){const p=d.children;let f=-1;for(;++f<p.length;){const x=a.one(p[f],d);if(x){if(f&&p[f-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Ql(x.value)),!Array.isArray(x)&&x.type==="element")){const m=x.children[0];m&&m.type==="text"&&(m.value=Ql(m.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function gj(e,t){e.position&&(t.position=QS(e))}function xj(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,fo(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function yj(e,t){const n=t.data||{},r="value"in t&&!(ts.call(n,"hProperties")||ts.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 bj(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
94
- `});++r<e.length;)r&&n.push({type:"text",value:`
95
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
96
- `}),n}function Ql(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ec(e,t){const n=mj(e,t),r=n.one(e,void 0),o=oj(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
97
- `},o),i}function vj(e,t){return e&&"run"in e?async function(n,r){const o=ec(n,{file:r,...t});await e.run(o,r)}:function(n,r){return ec(n,{file:r,...e||t})}}function tc(e){if(e)throw e}var pi,nc;function wj(){if(nc)return pi;nc=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},i=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var d=e.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!h)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},s=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},a=function(u,d){if(d==="__proto__")if(e.call(u,d)){if(r)return r(u,d).value}else return;return u[d]};return pi=function l(){var u,d,h,p,f,x,m=arguments[0],y=1,g=arguments.length,w=!1;for(typeof m=="boolean"&&(w=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<g;++y)if(u=arguments[y],u!=null)for(d in u)h=a(m,d),p=a(u,d),m!==p&&(w&&p&&(i(p)||(f=o(p)))?(f?(f=!1,x=h&&o(h)?h:[]):x=h&&i(h)?h:{},s(m,{name:d,newValue:l(w,x,p)})):typeof p<"u"&&s(m,{name:d,newValue:p}));return m},pi}var kj=wj();const mi=us(kj);function ns(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 _j(){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,...u){const d=e[++i];let h=-1;if(l){s(l);return}for(;++h<o.length;)(u[h]===null||u[h]===void 0)&&(u[h]=o[h]);o=u,d?Sj(d,a)(...u):s(null,...u)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function Sj(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(u){const d=u;if(a&&n)throw d;return o(d)}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 Nt={basename:Cj,dirname:Ej,extname:Nj,join:jj,sep:"/"};function Cj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');_r(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 Ej(e){if(_r(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 Nj(e){_r(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 jj(...e){let t=-1,n;for(;++t<e.length;)_r(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Tj(n)}function Tj(e){_r(e);const t=e.codePointAt(0)===47;let n=Aj(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Aj(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 _r(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zj={cwd:Ij};function Ij(){return"/"}function rs(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Rj(e){if(typeof e=="string")e=new URL(e);else if(!rs(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 Pj(e)}function Pj(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 gi=["history","path","basename","stem","extname","dirname"];class Xh{constructor(t){let n;t?rs(t)?n={path:t}:typeof t=="string"||Oj(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":zj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<gi.length;){const i=gi[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)gi.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Nt.basename(this.path):void 0}set basename(t){yi(t,"basename"),xi(t,"basename"),this.path=Nt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Nt.dirname(this.path):void 0}set dirname(t){rc(this.basename,"dirname"),this.path=Nt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Nt.extname(this.path):void 0}set extname(t){if(xi(t,"extname"),rc(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=Nt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){rs(t)&&(t=Rj(t)),yi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Nt.basename(this.path,this.extname):void 0}set stem(t){yi(t,"stem"),xi(t,"stem"),this.path=Nt.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 Ye(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 xi(e,t){if(e&&e.includes(Nt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Nt.sep+"`")}function yi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Oj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Dj=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),Mj={}.hasOwnProperty;class ua extends Dj{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=_j()}copy(){const t=new ua;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(mi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wi("data",this.frozen),this.namespace[t]=n,this):Mj.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wi("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=$r(t),r=this.parser||this.Parser;return bi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),bi("process",this.parser||this.Parser),vi("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=$r(t),l=r.parse(a);r.run(l,a,function(d,h,p){if(d||!h||!p)return u(d);const f=h,x=r.stringify(f,p);$j(x)?p.value=x:p.result=x,u(d,p)});function u(d,h){d||!h?s(d):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),bi("processSync",this.parser||this.Parser),vi("processSync",this.compiler||this.Compiler),this.process(t,o),ic("processSync","process",n),r;function o(i,s){n=!0,tc(i),r=s}}run(t,n,r){oc(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=$r(n);o.run(t,l,u);function u(d,h,p){const f=h||t;d?a(d):s?s(f):r(void 0,f,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),ic("runSync","run",r),o;function i(s,a){tc(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=$r(n),o=this.compiler||this.Compiler;return vi("stringify",o),oc(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(wi("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(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;l(d,h)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(o.settings=mi(!0,o.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[f,...x]=d;const m=r[p][1];ns(m)&&ns(f)&&(f=mi(!0,m,f)),r[p]=[u,f,...x]}}}}const Lj=new ua().freeze();function bi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function vi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wi(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 oc(e){if(!ns(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ic(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $r(e){return Fj(e)?e:new Xh(e)}function Fj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $j(e){return typeof e=="string"||Bj(e)}function Bj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Uj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sc=[],ac={allowDangerousHtml:!0},Zj=/^(https?|ircs?|mailto|xmpp)$/i,Vj=[{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 Un(e){const t=Wj(e),n=Hj(e);return qj(t.runSync(t.parse(n),n),e)}function Wj(e){const t=e.rehypePlugins||sc,n=e.remarkPlugins||sc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ac}:ac;return Lj().use(CN).use(n).use(vj,r).use(t)}function Hj(e){const t=e.children||"",n=new Xh;return typeof t=="string"&&(n.value=t),n}function qj(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||Kj;for(const d of Vj)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Uj+d.id,void 0);return Yh(e,u),oC(e,{Fragment:c.Fragment,components:o,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,h,p){if(d.type==="raw"&&p&&typeof h=="number")return s?p.children.splice(h,1):p.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let f;for(f in di)if(Object.hasOwn(di,f)&&Object.hasOwn(d.properties,f)){const x=d.properties[f],m=di[f];(m===null||m.includes(d.tagName))&&(d.properties[f]=l(String(x||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!f&&r&&typeof h=="number"&&(f=!r(d,h,p)),f&&p&&typeof h=="number")return a&&d.children?p.children.splice(h,1,...d.children):p.children.splice(h,1),h}}}function Kj(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||Zj.test(e.slice(0,t))?e:""}function lc({delayDuration:e=0,...t}){return c.jsx(fS,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Gj({...e}){return c.jsx(hS,{"data-slot":"tooltip",...e})}function Jj({...e}){return c.jsx(pS,{"data-slot":"tooltip-trigger",...e})}function Yj({className:e,sideOffset:t=0,children:n,...r}){return c.jsx(mS,{children:c.jsxs(gS,{"data-slot":"tooltip-content",sideOffset:t,className:ge("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,c.jsx(xS,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Qh(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 ho(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function Xj(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function da(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=Xj(e,t);return[t,Zn(n)]}):[]}function cc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const uc=120;function Qj({text:e}){const[t,n]=b.useState(!1);return e.length>uc?c.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?c.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:c.jsx(Un,{children:e})}):c.jsxs(Gj,{delayDuration:300,children:[c.jsxs(Jj,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[c.jsx("span",{children:e.slice(0,uc)}),c.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),c.jsxs(Yj,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):c.jsxs("span",{className:"text-emerald-400 break-all",children:['"',c.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:c.jsx(Un,{children:e})}),'"']})}function ep({value:e}){if(e===null)return c.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return c.jsx(Qj,{text:e});case"number":return c.jsx("span",{className:"text-amber-400",children:e});case"boolean":return c.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return c.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function dc({value:e}){const[t,n]=b.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return c.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?c.jsx(Vt,{className:"size-3 text-green-500"}):c.jsx(pn,{className:"size-3"})})}function e3({value:e}){const[t,n]=b.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return c.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?c.jsx(Vt,{className:"size-3 text-green-500"}):c.jsx(pn,{className:"size-3 text-muted-foreground"})})}function t3(e){return ho(e)?da(e).some(([,t])=>ho(t)):!1}function n3({allExpanded:e,onClick:t}){return c.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?c.jsx(kb,{className:"size-3.5 text-muted-foreground"}):c.jsx(vb,{className:"size-3.5 text-muted-foreground"})})}function tp({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=b.useState(n<r),[a,l]=b.useState(0),[u,d]=b.useState(null),[h,p]=b.useState(!1),f=ho(t),x=Qh(t),m=x==="array"?"[":"{",y=x==="array"?"]":"}";function g(_){_.stopPropagation(),h?(s(!1),d(0),l(S=>S+1),p(!1)):(s(!0),d(Number.POSITIVE_INFINITY),l(S=>S+1),p(!0))}const w=u??r;return c.jsxs("div",{className:ge(n>0&&"border-l border-border/50 ml-2"),children:[c.jsxs("div",{className:ge("flex items-start gap-1 py-0.5 px-1 -ml-1 rounded-sm group/row",f&&"cursor-pointer hover:bg-muted/50"),onClick:f?()=>{i&&p(!1),s(!i)}:void 0,onKeyDown:f?_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),s(!i))}:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,children:[f?c.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:i?c.jsx(pt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})}):c.jsx("span",{className:"w-4 shrink-0"}),c.jsx("span",{className:ge("shrink-0",o?"text-muted-foreground":"text-cyan-400"),children:o?e:`"${e}"`}),c.jsx("span",{className:"text-muted-foreground shrink-0",children:f?"":":"}),f?c.jsxs("span",{className:"text-muted-foreground",children:[m,c.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",cc(t)," ",cc(t)===1?"item":"items"," ",y]})]}):c.jsx("span",{className:"min-w-0",children:c.jsx(ep,{value:t})}),f&&t3(t)&&c.jsx(n3,{allExpanded:h,onClick:g}),c.jsx(e3,{value:t})]}),f&&i&&c.jsxs("div",{className:"pl-4",children:[da(t).map(([_,S])=>c.jsx(tp,{name:_,value:S,level:n+1,defaultExpandDepth:w,isArrayItem:x==="array"},_)),c.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:y})]},a)]})}function Vo({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!ho(e))return c.jsx(lc,{children:c.jsx("div",{className:ge("font-mono text-xs leading-relaxed",n),children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(ep,{value:e}),r&&c.jsx(dc,{value:e})]})})});const s=Qh(e)==="array";return c.jsx(lc,{children:c.jsxs("div",{className:ge("font-mono text-xs leading-relaxed",n),children:[r&&c.jsx(dc,{value:e}),da(e).map(([a,l])=>c.jsx(tp,{name:a,value:l,level:0,defaultExpandDepth:t,isArrayItem:s},a))]})})}function sn({text:e,defaultExpandDepth:t=2,className:n}){try{const r=JSON.parse(e);return c.jsx(Vo,{data:Zn(r),defaultExpandDepth:t,className:n})}catch{return c.jsx("pre",{className:ge("font-mono text-xs whitespace-pre-wrap break-words",n),children:e})}}function Zn(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=>Zn(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=Zn(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function Nn({className:e,orientation:t="horizontal",...n}){return c.jsx(q_,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ge("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const r3=Ns("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 jn({className:e,variant:t="default",...n}){return c.jsx(K_,{"data-slot":"tabs-list","data-variant":t,className:ge(r3({variant:t}),e),...n})}function Ge({className:e,...t}){return c.jsx(G_,{"data-slot":"tabs-trigger",className:ge("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 Je({className:e,...t}){return c.jsx(J_,{"data-slot":"tabs-content",className:ge("flex-1 outline-none",e),...t})}class np{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const i=this.castInput(t,r),s=this.castInput(n,r),a=this.removeEmpty(this.tokenize(i,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(a,l,r,o)}diffWithOptionsObj(t,n,r,o){var i;const s=w=>{if(w=this.postProcess(w,r),o){setTimeout(function(){o(w)},0);return}else return w},a=n.length,l=t.length;let u=1,d=a+l;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const h=(i=r.timeout)!==null&&i!==void 0?i:1/0,p=Date.now()+h,f=[{oldPos:-1,lastComponent:void 0}];let x=this.extractCommon(f[0],n,t,0,r);if(f[0].oldPos+1>=l&&x+1>=a)return s(this.buildValues(f[0].lastComponent,n,t));let m=-1/0,y=1/0;const g=()=>{for(let w=Math.max(m,-u);w<=Math.min(y,u);w+=2){let _;const S=f[w-1],E=f[w+1];S&&(f[w-1]=void 0);let C=!1;if(E){const I=E.oldPos-w;C=E&&0<=I&&I<a}const A=S&&S.oldPos+1<l;if(!C&&!A){f[w]=void 0;continue}if(!A||C&&S.oldPos<E.oldPos?_=this.addToPath(E,!0,!1,0,r):_=this.addToPath(S,!1,!0,1,r),x=this.extractCommon(_,n,t,w,r),_.oldPos+1>=l&&x+1>=a)return s(this.buildValues(_.lastComponent,n,t))||!0;f[w]=_,_.oldPos+1>=l&&(y=Math.min(y,w-1)),x+1>=a&&(m=Math.max(m,w+1))}u++};if(o)(function w(){setTimeout(function(){if(u>d||Date.now()>p)return o(void 0);g()||w()},0)})();else for(;u<=d&&Date.now()<=p;){const w=g();if(w)return w}}addToPath(t,n,r,o,i){const s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,o,i){const s=n.length,a=r.length;let l=t.oldPos,u=l-o,d=0;for(;u+1<s&&l+1<a&&this.equals(r[l+1],n[u+1],i);)u++,l++,d++,i.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!i.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let i;for(;t;)o.push(t),i=t.previousComponent,delete t.previousComponent,t=i;o.reverse();const s=o.length;let a=0,l=0,u=0;for(;a<s;a++){const d=o[a];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let h=n.slice(l,l+d.count);h=h.map(function(p,f){const x=r[u+f];return x.length>p.length?x:p}),d.value=this.join(h)}else d.value=this.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}}return o}}class o3 extends np{constructor(){super(...arguments),this.tokenize=op}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
98
- `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
99
- `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
100
- `)&&(t=t.slice(0,-1)),n.endsWith(`
101
- `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const i3=new o3;function rp(e,t,n){return i3.diff(e,t,n)}function op(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
102
- `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let o=0;o<r.length;o++){const i=r[o];o%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}class s3 extends np{constructor(){super(...arguments),this.tokenize=op}get useLongestToken(){return!0}castInput(t,n){const{undefinedReplacement:r,stringifyReplacer:o=(i,s)=>typeof s>"u"?r:s}=n;return typeof t=="string"?t:JSON.stringify(os(t,null,null,o),null," ")}equals(t,n,r){return super.equals(t.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),r)}}const a3=new s3;function l3(e,t,n){return a3.diff(e,t,n)}function os(e,t,n,r,o){t=t||[],n=n||[],r&&(e=r(o===void 0?"":o,e));let i;for(i=0;i<t.length;i+=1)if(t[i]===e)return n[i];let s;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),s=new Array(e.length),n.push(s),i=0;i<e.length;i+=1)s[i]=os(e[i],t,n,r,String(i));return t.pop(),n.pop(),s}if(e&&e.toJSON&&(e=e.toJSON()),typeof e=="object"&&e!==null){t.push(e),s={},n.push(s);const a=[];let l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&a.push(l);for(a.sort(),i=0;i<a.length;i+=1)l=a[i],s[l]=os(e[l],t,n,r,l);t.pop(),n.pop()}else s=e;return s}function fc(e){return e===void 0?[]:Object.entries(e).map(t=>[t[0].toLowerCase(),t[1]]).sort(([t],[n])=>t.localeCompare(n))}function hc([e,t]){return`${e}: ${t}`}function is(e){const t=[];let n=0,r=0;for(const o of e){const i=o.value.split(`
103
- `);i.length>0&&i[i.length-1]===""&&i.pop();for(const s of i)o.added?(r+=1,t.push({kind:"added",text:s,oldLineNumber:null,newLineNumber:r})):o.removed?(n+=1,t.push({kind:"removed",text:s,oldLineNumber:n,newLineNumber:null})):(n+=1,r+=1,t.push({kind:"context",text:s,oldLineNumber:n,newLineNumber:r}))}return t}function c3(e,t){const n=fc(e).map(hc).join(`
104
- `),r=fc(t).map(hc).join(`
105
- `);if(n===r)return{lines:[],isEmpty:!0};const o=rp(n,r);return{lines:is(o),isEmpty:!1}}function pc(e){try{const t=JSON.parse(e);return t===null||typeof t=="string"||typeof t=="object"?t:null}catch{return null}}function u3(e,t){const n=e??"",r=t??"";if(n===r)return{lines:[],isEmpty:!0};const o=pc(n),i=pc(r);if(o!==null&&i!==null){const a=l3(o,i)??[];if(a.length===1){const l=a[0];if(l!==void 0&&!l.added&&!l.removed)return{lines:[],isEmpty:!0}}return{lines:is(a),isEmpty:!1}}const s=rp(n,r);return{lines:is(s),isEmpty:!1}}const d3=22,ki=1e4;function f3(e){return e==="added"?"+":e==="removed"?"-":" "}function h3(e){return e==="added"?"bg-green-500/10 text-green-700 dark:text-green-300":e==="removed"?"bg-red-500/10 text-red-700 dark:text-red-300":"text-foreground/80"}function mc({result:e,emptyLabel:t}){const[n,r]=b.useState("unified"),o=b.useRef(null),i=Cu({count:e.lines.length,getScrollElement:()=>o.current,estimateSize:()=>d3,overscan:10});if(e.isEmpty)return c.jsx("div",{className:"rounded border border-dashed border-border bg-muted/30 px-4 py-6 text-center text-xs text-muted-foreground","data-testid":"diff-empty",children:t??"No transformation applied — raw and processed are identical."});const s=e.lines.length,a=s>ki,l=a?e.lines.slice(0,ki):e.lines;return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[c.jsxs("span",{children:[s.toLocaleString()," line",s===1?"":"s",a&&` (showing first ${ki.toLocaleString()})`]}),c.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[c.jsxs("button",{type:"button",onClick:()=>r("unified"),"aria-pressed":n==="unified",className:ge("flex items-center gap-1 px-2 py-1 transition-colors",n==="unified"?"bg-muted text-foreground":"hover:bg-muted/50"),title:"Unified diff (single column)",children:[c.jsx(Ou,{className:"size-3"}),"Unified"]}),c.jsxs("button",{type:"button",onClick:()=>r("split"),"aria-pressed":n==="split",className:ge("flex items-center gap-1 px-2 py-1 transition-colors border-l border-border",n==="split"?"bg-muted text-foreground":"hover:bg-muted/50"),title:"Split diff (side by side)",children:[c.jsx(ju,{className:"size-3"}),"Split"]})]})]}),c.jsx("div",{ref:o,className:"max-h-[60vh] overflow-auto rounded border border-border bg-background font-mono text-xs","data-testid":"diff-viewport",children:n==="unified"?c.jsx(p3,{virtualizer:i,lines:l}):c.jsx(x3,{lines:l})})]})}function p3({virtualizer:e,lines:t}){return c.jsx("div",{style:{height:`${e.getTotalSize()}px`,width:"100%",position:"relative"},children:e.getVirtualItems().map(n=>{const r=t[n.index];return r===void 0?null:c.jsxs("div",{"data-index":n.index,ref:e.measureElement,className:ge("flex items-start gap-3 px-2",h3(r.kind)),style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${n.start}px)`},children:[c.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.oldLineNumber??""}),c.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.newLineNumber??""}),c.jsx("span",{className:ge("select-none w-3 text-right font-bold",r.kind==="added"&&"text-green-600 dark:text-green-400",r.kind==="removed"&&"text-red-600 dark:text-red-400"),children:f3(r.kind)}),c.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:r.text})]},n.key)})})}function m3(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(r===void 0)break;if(r.kind==="context"){t.push({left:{text:r.text,lineNumber:r.oldLineNumber},right:{text:r.text,lineNumber:r.newLineNumber},kind:"equal"}),n+=1;continue}const o=[],i=[];for(;n<e.length&&e[n]?.kind==="removed";){const a=e[n];a!==void 0&&o.push(a),n+=1}for(;n<e.length&&e[n]?.kind==="added";){const a=e[n];a!==void 0&&i.push(a),n+=1}const s=Math.max(o.length,i.length);for(let a=0;a<s;a+=1){const l=o[a],u=i[a];l!==void 0&&u!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:{text:u.text,lineNumber:u.newLineNumber},kind:"changed"}):l!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:null,kind:"removed"}):u!==void 0&&t.push({left:null,right:{text:u.text,lineNumber:u.newLineNumber},kind:"added"})}}return t}function g3(e){switch(e){case"changed":return"bg-amber-500/10";case"removed":return"bg-red-500/10";case"added":return"bg-green-500/10";case"equal":return""}}function x3({lines:e}){const t=m3(e);return c.jsx("div",{"data-testid":"diff-split",children:t.map((n,r)=>c.jsxs("div",{className:ge("grid grid-cols-2 font-mono text-xs",g3(n.kind)),children:[c.jsxs("div",{className:"flex items-start gap-2 px-2 border-r border-border/50",children:[c.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.left?.lineNumber??""}),c.jsx("span",{className:ge("select-none w-3 text-right font-bold",(n.kind==="removed"||n.kind==="changed")&&"text-red-600 dark:text-red-400"),children:n.left!==null?"-":" "}),c.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.left?.text??""})]}),c.jsxs("div",{className:"flex items-start gap-2 px-2",children:[c.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.right?.lineNumber??""}),c.jsx("span",{className:ge("select-none w-3 text-right font-bold",(n.kind==="added"||n.kind==="changed")&&"text-green-600 dark:text-green-400"),children:n.right!==null?"+":" "}),c.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.right?.text??""})]})]},r))})}const y3="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",b3="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",k3="/assets/alibaba-TTwafVwX.svg",_3="/assets/qwen-CONDcHqt.png",S3="/assets/zhipuai-BPNAnxo-.svg",C3={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function E3(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(C3))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const gn={width:24,height:24,objectFit:"contain"},N3=rt.memo(({className:e})=>c.jsx("img",{src:y3,alt:"Anthropic",className:e,style:gn})),j3=rt.memo(({className:e})=>c.jsx("img",{src:b3,alt:"OpenAI",className:e,style:{...gn,background:"white",borderRadius:"4px"}})),T3=rt.memo(({className:e})=>c.jsx("img",{src:v3,alt:"DeepSeek",className:e,style:gn})),A3=rt.memo(({className:e})=>c.jsx("img",{src:w3,alt:"MiniMax",className:e,style:gn})),z3=rt.memo(({className:e})=>c.jsx("img",{src:k3,alt:"Alibaba",className:e,style:gn})),I3=rt.memo(({className:e})=>c.jsx("img",{src:_3,alt:"Qwen",className:e,style:gn})),R3=rt.memo(({className:e})=>c.jsx("img",{src:S3,alt:"ZhipuAI",className:e,style:gn}));function P3({provider:e,className:t}){switch(e){case"anthropic":return c.jsx(N3,{className:t});case"openai":return c.jsx(j3,{className:t});case"deepseek":return c.jsx(T3,{className:t});case"minimax":return c.jsx(A3,{className:t});case"alibaba":return c.jsx(z3,{className:t});case"qwen":return c.jsx(I3,{className:t});case"zhipuai":return c.jsx(R3,{className:t});case"unknown":return null}}function O3(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const gc={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"};function xc({trend:e}){if(e===null)return null;const t=e.direction==="up",n=t?db:cb,r=t?"+":"-";return c.jsxs("span",{className:"flex items-center gap-0.5 text-muted-foreground tabular-nums",children:[c.jsx(n,{className:t?"size-3 text-emerald-400":"size-3 text-rose-400"}),c.jsxs("span",{className:"font-mono",children:[r,qe(e.delta)]})]})}const D3=b.memo(function({log:e,parsedRequest:t,expanded:n,onToggle:r,suppressApiFormatBadge:o=!1,cacheTrend:i=null,isSelected:s=!1,onToggleSelect:a}){const l=Yu(e.responseStatus),u=e.inputTokens!==null||e.outputTokens!==null,d=t!==null?t.messages.length:null,h=t!==null&&t.tools!==void 0&&t.tools.length>0?t.tools.length:null;return c.jsxs("div",{role:"button",tabIndex:0,className:ge("flex items-center gap-2.5 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none"),onClick:r,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),r())},children:[a!==void 0&&c.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),a(e.id)},"aria-label":s?"Deselect for comparison":"Select for comparison","aria-pressed":s,className:ge("shrink-0 size-4 rounded-sm border flex items-center justify-center transition-colors cursor-pointer",s?"bg-amber-400 border-amber-400 text-amber-950":"border-muted-foreground/40 hover:border-amber-400 hover:bg-amber-400/10"),children:s&&c.jsx(Vt,{className:"size-3",strokeWidth:3})}),c.jsxs("span",{className:"text-blue-400/80 font-mono text-xs font-semibold tabular-nums shrink-0",children:["#",e.id]}),e.model!==null&&c.jsxs(c.Fragment,{children:[c.jsx(P3,{provider:E3(e.model),className:"size-4 shrink-0"}),c.jsx(et,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model})]}),!o&&c.jsx(et,{variant:"outline",className:ge("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",e.apiFormat==="openai"&&"border-blue-500/40 text-blue-400",e.apiFormat==="anthropic"&&"border-orange-500/40 text-orange-400",e.apiFormat==="unknown"&&"border-muted text-muted-foreground"),children:e.apiFormat==="anthropic"?"Anthropic":e.apiFormat==="openai"?"OpenAI":"Unknown"}),l==="server_error"?c.jsx(et,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:e.responseStatus}):l==="pending"?c.jsx(et,{variant:"outline",className:ge("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",gc[l]),children:c.jsx(zu,{className:"size-3 animate-spin"})}):c.jsx(et,{variant:"outline",className:ge("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",gc[l]),children:e.responseStatus}),e.elapsedMs!==null&&c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(wo,{className:"size-3"}),c.jsx("span",{className:"font-mono tabular-nums",children:O3(e.elapsedMs)})]}),u&&c.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[c.jsx(yr,{className:"size-3 text-muted-foreground"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[c.jsxs("span",{className:e.inputTokens!==null?"text-blue-400":"text-muted-foreground",children:["IN ",e.inputTokens!==null?qe(e.inputTokens):"—"]})," / ",c.jsxs("span",{className:e.outputTokens!==null?"text-amber-400":"text-muted-foreground",children:["OUT ",e.outputTokens!==null?qe(e.outputTokens):"—"]})]})]}),e.cacheCreationInputTokens!==null&&e.cacheCreationInputTokens>0&&c.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[c.jsx(xc,{trend:i?.creation??null}),c.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",qe(e.cacheCreationInputTokens)]})]}),e.cacheReadInputTokens!==null&&e.cacheReadInputTokens>0&&c.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[c.jsx(xc,{trend:i?.read??null}),c.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",qe(e.cacheReadInputTokens)]})]}),d!==null&&c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(Iu,{className:"size-3"}),c.jsx("span",{className:"font-mono tabular-nums",children:d})]}),h!==null&&c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(Ev,{className:"size-3"}),c.jsx("span",{className:"font-mono tabular-nums",children:h})]}),e.origin!==null&&c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`Origin: ${e.origin}`,children:[c.jsx(Wb,{className:"size-3"}),c.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",title:e.origin,children:e.origin})]}),e.userAgent!==null&&c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`User-Agent: ${e.userAgent}`,children:[c.jsx(vv,{className:"size-3"}),c.jsx("span",{className:"font-mono tabular-nums truncate max-w-[150px]",title:e.userAgent,children:e.userAgent})]}),(e.clientPid!==null||e.clientProjectFolder!==null)&&c.jsxs("span",{className:"flex items-center gap-1 text-purple-400/80 text-xs shrink-0",title:e.clientCwd!==null?`PID: ${e.clientPid??"?"} | CWD: ${e.clientCwd}`:`PID: ${e.clientPid??"?"}`,children:[c.jsx($b,{className:"size-3"}),e.clientProjectFolder!==null?c.jsx("span",{className:"font-mono tabular-nums",children:e.clientProjectFolder}):c.jsxs("span",{className:"font-mono tabular-nums",children:["PID ",e.clientPid]})]}),e.streaming&&c.jsx(ov,{className:"size-3 text-muted-foreground/60 shrink-0"}),c.jsx("span",{className:"flex-1 min-w-0"}),n?c.jsx(pt,{className:"size-4 text-muted-foreground shrink-0"}):c.jsx(kt,{className:"size-4 text-muted-foreground shrink-0"})]})});function ip({...e}){return c.jsx(s2,{"data-slot":"dialog",...e})}function M3({...e}){return c.jsx(a2,{"data-slot":"dialog-trigger",...e})}function L3({...e}){return c.jsx(l2,{"data-slot":"dialog-portal",...e})}function F3({className:e,...t}){return c.jsx(c2,{"data-slot":"dialog-overlay",className:ge("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 sp({className:e,children:t,...n}){return c.jsxs(L3,{children:[c.jsx(F3,{}),c.jsxs(u2,{"data-slot":"dialog-content",className:ge("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,c.jsxs(f2,{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:[c.jsx(Cs,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ap({className:e,...t}){return c.jsx("div",{"data-slot":"dialog-header",className:ge("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function lp({className:e,...t}){return c.jsx(d2,{"data-slot":"dialog-title",className:ge("text-lg font-semibold leading-none tracking-tight",e),...t})}function cp({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(V_,{"data-slot":"separator",decorative:n,orientation:t,className:ge("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 Wo({...e}){return c.jsx(q1,{"data-slot":"collapsible",...e})}function Ho({...e}){return c.jsx(id,{"data-slot":"collapsible-trigger",...e})}function qo({...e}){return c.jsx(sd,{"data-slot":"collapsible-content",...e})}function fa({className:e,children:t,...n}){return c.jsxs(r_,{"data-slot":"scroll-area",className:ge("relative",e),...n,children:[c.jsx(o_,{"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}),c.jsx($3,{}),c.jsx(i_,{})]})}function $3({className:e,orientation:t="vertical",...n}){return c.jsx(xf,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ge("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:c.jsx(wf,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function B3(e){return c.jsx(c.Fragment,{})}function U3({text:e}){const[t,n]=b.useState(!1);return c.jsxs(Wo,{open:t,onOpenChange:n,children:[c.jsxs(Ho,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?c.jsx(pt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"}),c.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),c.jsx(qo,{children:c.jsx("div",{className:"pl-4 pt-1",children:c.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:c.jsx(Un,{children:e})})})})]})}const Z3=/<think>([\s\S]*?)<\/think>/gi,V3=/<think>([\s\S]*?)<\/think>/i;function up(e){const t=V3.exec(e);if(!t||t[1]===void 0)return{thinking:null,remainingText:e};const n=t[1].trim(),r=e.replace(Z3,"").trim();return{thinking:n,remainingText:r}}function W3({text:e}){if(e.includes("<system-reminder>"))return c.jsx(U3,{text:e});const{thinking:t,remainingText:n}=up(e);return c.jsxs("div",{className:"space-y-2",children:[t!==null&&c.jsx(po,{thinking:t}),n.length>0&&c.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:c.jsx(Un,{children:n})}),t===null&&n.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty text block"})]})}function po({thinking:e}){const[t,n]=b.useState(!1);return c.jsx(Wo,{open:t,onOpenChange:n,children:c.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[c.jsxs(Ho,{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:[c.jsx(hb,{className:"size-3.5 text-purple-400 shrink-0"}),c.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),c.jsxs(et,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[e.length.toLocaleString()," chars"]}),c.jsx("span",{className:"flex-1"}),t?c.jsx(pt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(qo,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(fa,{className:"max-h-[60vh]",children:c.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function H3({name:e,input:t}){const[n,r]=b.useState(!1);return c.jsx(Wo,{open:n,onOpenChange:r,children:c.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[c.jsxs(Ho,{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:[c.jsx(Du,{className:"size-3.5 text-blue-400 shrink-0"}),c.jsx(et,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:e}),c.jsx("span",{className:"flex-1"}),n?c.jsx(pt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(qo,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(fa,{className:"max-h-[60vh]",children:c.jsx(Vo,{data:Zn(t),defaultExpandDepth:2})})})})]})})}function q3({block:e}){switch(e.type){case"text":return c.jsx(W3,{text:e.text});case"thinking":case"think":return c.jsx(po,{thinking:e.thinking});case"tool_use":return c.jsx(H3,{name:e.name,input:e.input});default:return B3()}}function K3({response:e}){return c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx(et,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&c.jsxs(et,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[c.jsx(Nu,{className:"size-2.5"}),e.stop_reason]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[c.jsx(yr,{className:"size-3"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[qe(e.usage.input_tokens??0)," in /"," ",qe(e.usage.output_tokens??0)," out"]}),e.usage.cache_creation_input_tokens!==void 0&&e.usage.cache_creation_input_tokens!==null&&e.usage.cache_creation_input_tokens>0&&c.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",qe(e.usage.cache_creation_input_tokens)]}),e.usage.cache_read_input_tokens!==void 0&&e.usage.cache_read_input_tokens!==null&&e.usage.cache_read_input_tokens>0&&c.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",qe(e.usage.cache_read_input_tokens)]})]})]}),c.jsx(cp,{className:"opacity-50"}),c.jsxs("div",{className:"space-y-2",children:[e.content.map((t,n)=>c.jsx(q3,{block:t},n)),e.content.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function G3(e){if(e===void 0||e==="")return{};try{return JSON.parse(e)}catch{return null}}function J3({call:e}){const[t,n]=b.useState(!1),r=e.function.name??"(unnamed tool)",o=G3(e.function.arguments);return c.jsx(Wo,{open:t,onOpenChange:n,children:c.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[c.jsxs(Ho,{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:[c.jsx(Du,{className:"size-3.5 text-blue-400 shrink-0"}),c.jsx(et,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:r}),e.id!==void 0&&e.id!==""&&c.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 truncate",children:e.id}),c.jsx("span",{className:"flex-1"}),t?c.jsx(pt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(qo,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(fa,{className:"max-h-[60vh]",children:o===null?c.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-words text-rose-300/90",children:e.function.arguments}):c.jsx(Vo,{data:Zn(o),defaultExpandDepth:2})})})})]})})}function Y3({response:e}){const t=e.choices[0],n=t?.message,r=n?.tool_calls??[];return c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx(et,{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&&c.jsxs(et,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[c.jsx(Nu,{className:"size-2.5"}),t.finish_reason]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[c.jsx(yr,{className:"size-3"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[qe(e.usage.prompt_tokens??0)," in /"," ",qe(e.usage.completion_tokens??0)," out"]})]})]}),c.jsx(cp,{className:"opacity-50"}),c.jsxs("div",{className:"space-y-2",children:[n?.reasoning_content!==null&&n?.reasoning_content!==void 0&&n.reasoning_content.length>0&&c.jsx(po,{thinking:n.reasoning_content}),n?.content!==null&&n?.content!==void 0&&n.content.length>0&&(()=>{const o=n.reasoning_content!==null&&n.reasoning_content!==void 0&&n.reasoning_content.length>0,{thinking:i,remainingText:s}=up(n.content);return c.jsxs("div",{className:"space-y-2",children:[i!==null&&!o&&c.jsx(po,{thinking:i}),s.length>0&&c.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:c.jsx(Un,{children:s})})]})})(),r.map((o,i)=>c.jsx(J3,{call:o},o.id??`tc-${i}`)),n?.function_call!==null&&n?.function_call!==void 0&&c.jsxs("div",{className:"border border-blue-500/30 rounded-md p-3 bg-blue-500/5",children:[c.jsx("div",{className:"text-xs text-blue-400 font-mono mb-1",children:"function_call"}),c.jsxs("div",{className:"font-mono text-xs",children:[c.jsx("span",{className:"text-blue-300",children:n.function_call.name}),c.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)&&r.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function X3(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function Q3(e,t){return X3(t)?c.jsx(Y3,{response:t}):c.jsx(K3,{response:t})}function e5(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 t5(e,t){try{let n=JSON.parse(e);if(typeof n=="string"&&(n=JSON.parse(n)),t==="openai"){const o=Ly(e);if(o)return o}const r=Iy.safeParse(n);return r.success?r.data:null}catch{return null}}function ir({status:e}){const t=Yu(e),n=e5(t);return e===null?c.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):c.jsxs("span",{className:ge("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&c.jsx(gv,{className:"size-3"}),e]})}function yc({text:e}){return c.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:c.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:e})})}function n5({text:e}){return c.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:c.jsx(Un,{children:e})})}function Kr({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 c.jsxs("div",{className:"flex items-center gap-2 py-3",children:[c.jsx(ir,{status:t}),c.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]});if(t!==null&&t>=400)return c.jsxs("div",{className:"space-y-2",children:[c.jsx(ir,{status:t}),c.jsx(yc,{text:e??""}),l!=null&&c.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[c.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),c.jsx("div",{className:"text-muted-foreground font-mono",children:l})]})]});if(l!=null)return c.jsxs("div",{className:"space-y-2",children:[c.jsx(ir,{status:t}),c.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[c.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),c.jsx("div",{className:"text-muted-foreground font-mono",children:l})]}),e!==null&&c.jsx("div",{className:"mt-2",children:c.jsx(yc,{text:e})})]});const d=e!==null?t5(e,a):null;return d!==null?c.jsxs("div",{className:"space-y-2",children:[c.jsx(ir,{status:t}),Q3(a,d)]}):c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ir,{status:t}),n&&(r!==null||o!==null)&&c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[c.jsx(yr,{className:"size-3"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?qe(r):"—"," in /"," ",o!==null?qe(o):"—"," out"]}),i!=null&&i>0&&c.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",qe(i)]}),s!=null&&s>0&&c.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",qe(s)]})]})]}),c.jsx(n5,{text:e??""})]})}const r5=se({success:tt(),error:J().optional(),responseStatus:ve().optional(),responseText:J().optional(),inputTokens:ve().optional(),outputTokens:ve().optional(),elapsedMs:ve().optional(),streaming:tt().optional()});function o5({log:e,open:t,onOpenChange:n}){const[r,o]=b.useState(()=>e.rawRequestBody??"{}"),[i,s]=b.useState(null),[a,l]=b.useState(!1),[u,d]=b.useState(null);async function h(){l(!0),d(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=r5.safeParse(x);if(!m.success){d("Invalid response from server"),l(!1);return}const y=m.data;s(y),y.success||d(y.error??"Replay failed")}catch(f){d(f instanceof Error?f.message:"Network error")}finally{l(!1)}}function p(){s(null),d(null),n(!1)}return c.jsx(ip,{open:t,onOpenChange:p,children:c.jsxs(sp,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[c.jsx(ap,{children:c.jsxs(lp,{className:"flex items-center gap-2",children:[c.jsx(Ru,{className:"size-4"}),"Replay Request #",e.id]})}),c.jsxs(Nn,{defaultValue:"modified",children:[c.jsxs(jn,{children:[c.jsx(Ge,{value:"modified",children:"Modified Request"}),c.jsx(Ge,{value:"original",children:"Original Response"}),i&&c.jsx(Ge,{value:"replay",children:"Replay Response"})]}),c.jsxs(Je,{value:"modified",className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Request Body (JSON)"}),c.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:f=>o(f.target.value),spellCheck:!1})]}),u!==null&&u!==""&&c.jsx("div",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:u}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ht,{onClick:()=>{h()},disabled:a,children:a?"Replaying...":"Replay"})}),i&&i.success&&c.jsxs(Nn,{defaultValue:"parsed",children:[c.jsxs(jn,{children:[c.jsx(Ge,{value:"parsed",children:"Response"}),c.jsx(Ge,{value:"raw",children:"Raw Response"})]}),c.jsx(Je,{value:"parsed",children:c.jsx(Kr,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),c.jsx(Je,{value:"raw",children:c.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"})})]})]}),c.jsx(Je,{value:"original",children:e.responseText!==null?c.jsxs(Nn,{defaultValue:"parsed",children:[c.jsxs(jn,{children:[c.jsx(Ge,{value:"parsed",children:"Response"}),c.jsx(Ge,{value:"raw",children:"Raw Response"})]}),c.jsx(Je,{value:"parsed",children:c.jsx(Kr,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat})}),c.jsx(Je,{value:"raw",children:c.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:e.responseText})})]}):c.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No original response"})}),i&&i.success&&c.jsx(Je,{value:"replay",children:i.responseText!==null?c.jsxs(Nn,{defaultValue:"parsed",children:[c.jsxs(jn,{children:[c.jsx(Ge,{value:"parsed",children:"Response"}),c.jsx(Ge,{value:"raw",children:"Raw Response"})]}),c.jsx(Je,{value:"parsed",children:c.jsx(Kr,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),c.jsx(Je,{value:"raw",children:c.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText})})]}):c.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No replay response"})})]})]})})}function i5({logId:e,truncated:t}){const[n,r]=b.useState(!1),[o,i]=b.useState({status:"idle"}),[s,a]=b.useState(new Set);b.useEffect(()=>{if(!n||o.status!=="idle")return;let h=!1;return i({status:"loading"}),fetch(`/api/logs/${e}/chunks`).then(p=>p.ok?p.json():Promise.reject(new Error("Chunks not found"))).then(p=>{h||i({status:"success",chunks:p.chunks})}).catch(()=>{h||i({status:"error",message:"Chunk data unavailable"})}),()=>{h=!0}},[n,e]);const l=b.useMemo(()=>{if(o.status!=="success")return[];const h=new Map;for(const p of o.chunks){const f=h.get(p.index);f?f.push(p):h.set(p.index,[p])}return Array.from(h.entries()).map(([p,f])=>({index:p,chunks:f})).sort((p,f)=>p.index-f.index)},[o]),u=h=>{a(p=>{const f=new Set(p);return f.has(h)?f.delete(h):f.add(h),f})};function d(){return o.status==="idle"||o.status==="loading"?c.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[c.jsx(zu,{className:"size-3 animate-spin"}),c.jsx("span",{children:"Loading chunks..."})]}):o.status==="error"?c.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:o.message}):c.jsxs("div",{className:"p-2 space-y-1",children:[c.jsxs("div",{className:"text-[10px] text-muted-foreground font-mono mb-2",children:[l.length," index group",l.length!==1?"s":""," available"]}),l.map(h=>{const p=s.has(h.index);return c.jsxs("div",{className:"rounded border border-border bg-background",children:[c.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:()=>u(h.index),children:[p?c.jsx(pt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"}),c.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",h.index,"] ",h.chunks[0]?.type??""]}),c.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[h.chunks.length," chunk",h.chunks.length!==1?"s":""]})]}),p&&c.jsx("div",{className:"px-2 pb-2 space-y-1",children:h.chunks.map(f=>c.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",f.timestamp,"ms"]}),c.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:f.type})]}),c.jsx(Vo,{data:f,defaultExpandDepth:1,showCopy:!0})]},f.index))})]},h.index)})]})}return c.jsxs("div",{className:"space-y-1",children:[c.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(h=>!h),children:[n?c.jsx(pt,{className:"size-3"}):c.jsx(kt,{className:"size-3"}),c.jsx("span",{children:"Raw SSE Events"}),c.jsxs(et,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[e,t===!0?"+":""]})]}),n===!0?c.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:d()}):null]})}function bc(e,t,n){return e==="anthropic"&&t==="full"&&n}function s5(e,t){return e==="full"&&t}function a5(e,t,n,r){return e==="anthropic"&&t==="full"&&n&&r}function _i({text:e,label:t,copied:n,onCopy:r}){return e===null?null:c.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?c.jsxs(c.Fragment,{children:[c.jsx(Vt,{className:"size-3 text-green-500"}),c.jsx("span",{className:"text-green-500",children:"Copied!"})]}):c.jsxs(c.Fragment,{children:[c.jsx(pn,{className:"size-3"}),c.jsx("span",{children:t})]})})}function vc({active:e,onClick:t}){return c.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:ge("flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors",e?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:e?"Hide diff with raw":"Diff this view against the raw version",children:[c.jsx(Au,{className:"size-3"}),e?"Showing diff":"Diff with Raw"]})}const dp=b.memo(function({log:e,viewMode:t="simple",suppressApiFormatBadge:n=!1,strip:r,cacheTrend:o=null,isSelected:i=!1,onToggleSelect:s}){const[a,l]=b.useState(!1),[u,d]=b.useState(!1),[h,p]=b.useState(!1),[f,x]=b.useState(!1),[m,y]=b.useState(!1),[g,w]=b.useState(!1),[_,S]=b.useState(!1),E=b.useMemo(()=>Ai(e.rawRequestBody),[e.rawRequestBody]),A=b.useMemo(()=>!r||e.apiFormat!=="anthropic"||e.rawRequestBody===null?null:jS(e.rawRequestBody).body,[e.rawRequestBody,e.apiFormat,r])??e.rawRequestBody,I=b.useMemo(()=>c3(e.rawHeaders,e.headers),[e.rawHeaders,e.headers]),P=b.useMemo(()=>u3(e.rawRequestBody,A),[e.rawRequestBody,A]);function M(D){D.stopPropagation(),A!==null&&window.navigator.clipboard.writeText(A).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})}function B(D){D.stopPropagation(),e.rawRequestBody!==null&&window.navigator.clipboard.writeText(e.rawRequestBody).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)})}function N(D){D.stopPropagation(),e.responseText!==null&&window.navigator.clipboard.writeText(e.responseText).then(()=>{x(!0),setTimeout(()=>x(!1),2e3)})}return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ge("border border-border rounded-lg mb-3 overflow-hidden",i&&"border-l-2 border-l-amber-400"),children:[c.jsx(D3,{log:e,parsedRequest:E,expanded:a,onToggle:()=>l(!a),suppressApiFormatBadge:n,cacheTrend:o,isSelected:i,onToggleSelect:s}),a&&c.jsx("div",{onClick:D=>D.stopPropagation(),onKeyDown:D=>D.stopPropagation(),children:c.jsxs(Nn,{defaultValue:"request",children:[c.jsxs(jn,{className:"mx-4 mt-2",children:[t==="full"&&c.jsx(Ge,{value:"raw-headers",children:"Raw Headers"}),t==="full"&&c.jsx(Ge,{value:"headers",children:"Headers"}),bc(e.apiFormat,t,r)&&c.jsx(Ge,{value:"raw-request",children:"Raw Request"}),c.jsx(Ge,{value:"request",children:"Request"}),t==="full"&&c.jsx(Ge,{value:"raw",children:"Raw Response"}),c.jsx(Ge,{value:"parsed",children:"Response"})]}),bc(e.apiFormat,t,r)&&c.jsx(Je,{value:"raw-request",children:c.jsxs("div",{className:"px-4 py-3",children:[c.jsx("div",{className:"flex justify-end mb-2",children:c.jsx(_i,{text:e.rawRequestBody,label:"Copy Raw Request",copied:h,onCopy:B})}),e.rawRequestBody!==null?c.jsx(sn,{text:e.rawRequestBody,defaultExpandDepth:1}):c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),c.jsx(Je,{value:"request",children:c.jsxs("div",{className:"px-4 py-3",children:[c.jsxs("div",{className:"flex justify-end gap-2 mb-2",children:[a5(e.apiFormat,t,r,e.rawRequestBody!==null)&&c.jsx(vc,{active:_,onClick:D=>{D.stopPropagation(),S(!_)}}),c.jsxs(ht,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:D=>{D.stopPropagation(),y(!0)},children:[c.jsx(Ru,{className:"size-3 mr-1"}),"Replay"]}),c.jsx(_i,{text:A,label:"Copy Request",copied:u,onCopy:M})]}),_?c.jsx(mc,{result:P,emptyLabel:"No transformation applied — raw and sent request bodies are identical."}):A!==null?c.jsx(sn,{text:A,defaultExpandDepth:1}):c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),t==="full"&&c.jsx(Je,{value:"headers",children:c.jsxs("div",{className:"px-4 py-3",children:[c.jsx("div",{className:"flex justify-end gap-2 mb-2",children:s5(t,e.rawHeaders!==void 0&&Object.keys(e.rawHeaders).length>0)&&c.jsx(vc,{active:g,onClick:D=>{D.stopPropagation(),w(!g)}})}),g?c.jsx(mc,{result:I,emptyLabel:"No transformation applied — raw and processed headers are identical."}):e.headers&&Object.keys(e.headers).length>0?c.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.headers).sort(([D],[k])=>D.localeCompare(k)).map(([D,k])=>c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[D,":"]}),c.jsx("span",{className:"text-muted-foreground truncate",title:k,children:k})]},D))}):c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No headers captured"})]})}),t==="full"&&c.jsx(Je,{value:"raw-headers",children:c.jsx("div",{className:"px-4 py-3",children:e.rawHeaders&&Object.keys(e.rawHeaders).length>0?c.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.rawHeaders).sort(([D],[k])=>D.localeCompare(k)).map(([D,k])=>c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[D,":"]}),c.jsx("span",{className:"text-muted-foreground truncate",title:k,children:k})]},D))}):c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No raw headers captured"})})}),c.jsx(Je,{value:"raw",children:c.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.error!==void 0&&e.error!==null&&c.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[c.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),c.jsx("div",{className:"text-muted-foreground font-mono",children:e.error})]}),c.jsx("div",{className:"flex justify-end",children:c.jsx(_i,{text:e.responseText,label:"Copy Response",copied:f,onCopy:N})}),e.responseText!==null?c.jsx(sn,{text:e.responseText,defaultExpandDepth:1}):c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No response"}),e.streaming===!0&&c.jsx(i5,{logId:e.id,truncated:e.streamingChunksPath!==null})]})}),c.jsx(Je,{value:"parsed",children:c.jsx("div",{className:"px-4 py-3",children:c.jsx(Kr,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat,error:e.error})})})]})})]}),c.jsx(o5,{log:e,open:m,onOpenChange:y})]})});function l5(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 c5=b.memo(function({group:e,viewMode:t="simple",strip:n,cacheTrends:r,selectedSet:o,onToggleSelect:i}){const[s,a]=b.useState(!1),l=l5(e.logs),u=e.logs[0]?.timestamp??new Date().toISOString(),d=e.logs[e.logs.length-1]?.timestamp??new Date().toISOString(),h=kS(e.logs),p=e.conversationId.startsWith("PID:")||e.conversationId.includes("|")?e.conversationId:e.conversationId.length>24?e.conversationId.slice(0,12)+"…"+e.conversationId.slice(-12):e.conversationId;return c.jsxs("div",{className:"mb-4",children:[c.jsx(vS,{conversationId:p,startTime:u,endTime:d,totalCalls:e.logs.length,totalInputTokens:l.totalInputTokens,totalOutputTokens:l.totalOutputTokens,apiFormat:wS(e.logs),expanded:s,onToggle:()=>a(!s),hideApiFormat:h}),s&&c.jsx("div",{className:"pl-4 border-l-2 border-muted ml-3",children:e.logs.map(f=>c.jsx(dp,{log:f,viewMode:t,suppressApiFormatBadge:!h,strip:n,cacheTrend:r?.get(f.id)??null,isSelected:o.has(f.id),onToggleSelect:i},f.id))})]})});function u5({className:e}){return c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:ge("inline-block size-5",e),children:[c.jsx("path",{d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z"}),c.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),c.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),c.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),c.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"}),c.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),c.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),c.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),c.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),c.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]})}function wc({...e}){return c.jsx(T_,{"data-slot":"select",...e})}function kc({...e}){return c.jsx(z_,{"data-slot":"select-value",...e})}function _c({className:e,size:t="default",children:n,...r}){return c.jsxs(A_,{"data-slot":"select-trigger","data-size":t,className:ge("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,c.jsx(I_,{asChild:!0,children:c.jsx(pt,{className:"size-4 opacity-50"})})]})}function Sc({className:e,children:t,position:n="popper",align:r="center",...o}){return c.jsx(R_,{children:c.jsxs(P_,{"data-slot":"select-content",className:ge("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:[c.jsx(d5,{}),c.jsx(O_,{className:ge("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),c.jsx(f5,{})]})})}function Br({className:e,children:t,...n}){return c.jsxs(D_,{"data-slot":"select-item",className:ge("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:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(L_,{children:c.jsx(Vt,{className:"size-4"})})}),c.jsx(M_,{children:t})]})}function d5({className:e,...t}){return c.jsx(F_,{"data-slot":"select-scroll-up-button",className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(yb,{className:"size-4"})})}function f5({className:e,...t}){return c.jsx($_,{"data-slot":"select-scroll-down-button",className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(pt,{className:"size-4"})})}function fp(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}const h5={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function p5(e){return Object.prototype.hasOwnProperty.call(e,"success")}function m5(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function g5(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return c.jsx(wo,{...t});case"network_unreachable":return c.jsx(kv,{...t});case"connection_refused":return c.jsx(Sv,{...t});case"auth_failed":return c.jsx(Xb,{...t});case"rate_limited":return c.jsx(Ub,{...t});case"server_error":return c.jsx(cv,{...t});case"invalid_response":return c.jsx(Nb,{...t});case"unknown":return c.jsx(Ii,{...t});default:return c.jsx(Ii,{...t})}}function Ur({result:e}){const[t,n]=b.useState(!1);if(!p5(e))return m5(e)?c.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[c.jsx(_s,{className:"size-3"}),c.jsx("span",{children:"Not configured"})]}):c.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[c.jsx(Pu,{className:"size-3 animate-spin"}),c.jsx("span",{children:"Testing..."})]});if(e.success){const l=[];e.inputTokens!==void 0&&l.push(c.jsxs("span",{children:[e.inputTokens," in"]},"in")),e.outputTokens!==void 0&&l.push(c.jsxs("span",{children:[e.outputTokens," out"]},"out")),e.cacheCreationInputTokens!==void 0&&e.cacheCreationInputTokens>0&&l.push(c.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["+",e.cacheCreationInputTokens," cache"]},"cache-create")),e.cacheReadInputTokens!==void 0&&e.cacheReadInputTokens>0&&l.push(c.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["~",e.cacheReadInputTokens," cached"]},"cache-read"));const u=[];for(let d=0;d<l.length;d++)d>0&&u.push(", "),u.push(l[d]);return c.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 shrink-0",children:[c.jsx(Cb,{className:"size-3"}),c.jsx("span",{children:"Connected"}),l.length>0&&c.jsxs("span",{className:"text-muted-foreground",children:["(",u,")"]})]})}const r=e.error,o=r?.message??"Connection failed",i=r?.hint,s=r?.details,a=r?.type??"unknown";return c.jsxs("div",{className:"flex flex-col gap-1 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600 max-w-[200px]",children:[g5(a),c.jsx("span",{className:"truncate",children:o}),s!==void 0&&c.jsx("button",{type:"button",onClick:()=>n(!t),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",title:t?"Hide details":"Show details",children:t?c.jsx(ws,{className:"size-3"}):c.jsx(ks,{className:"size-3"})})]}),t&&s!==void 0&&c.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded p-2 max-w-[300px]",children:[i!==void 0&&c.jsx("div",{className:"mb-1",children:i}),c.jsx("div",{className:"font-mono whitespace-pre-wrap break-all text-red-400/80",children:s})]})]})}function x5(e){const t=Date.now(),n=new Date(e).getTime(),r=t-n,o=Math.floor(r/1e3);if(o<60)return"just now";const i=Math.floor(o/60);if(i<60)return`${i}m ago`;const s=Math.floor(i/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function y5({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,isHighlighted:o,onEdit:i,onDelete:s,onTest:a}){const[l,u]=b.useState(!1),[d,h]=b.useState(!1),[p,f]=b.useState(!1),x=b.useRef(null),m=b.useRef(void 0);t?.testedAt!==void 0&&t.testedAt!==m.current&&(m.current=t.testedAt,x.current=null);const y=b.useCallback(()=>{f(_=>{const S=!_;return S&&x.current===null&&t?.models!==void 0&&(x.current=t.testedAt??"",fetch(`/api/providers/${e.id}/test/log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})),S})},[e.id,t]);function g(){navigator.clipboard.writeText(e.apiKey).catch(()=>{}),h(!0),setTimeout(()=>h(!1),2e3)}const w=e.apiDocsUrl??Object.entries(h5).find(([_])=>e.name.toLowerCase().includes(_))?.[1];return c.jsxs("div",{className:`border rounded-lg p-4 flex flex-col gap-3 bg-card transition-all duration-500 ${o===!0?"ring-2 ring-primary shadow-md":""}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:"font-medium truncate",children:e.name}),e.source==="company"&&c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400 shrink-0",children:"公司"}),e.source==="personal"&&c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400 shrink-0",children:"个人"})]}),w!==void 0&&c.jsxs("a",{href:w,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:[c.jsx(Db,{className:"size-3"}),c.jsx("span",{className:"sr-only",children:"Docs"})]})]}),e.models!==void 0&&e.models.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:e.models.map(_=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:_},_))}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded flex-1 truncate",children:l?e.apiKey:fp(e.apiKey)}),c.jsx("button",{type:"button",onClick:()=>u(_=>!_),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":l?"Hide API key":"Show API key",children:l?c.jsx(ws,{className:"size-4"}):c.jsx(ks,{className:"size-4"})}),c.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":"Copy API key",children:d?c.jsx(Vt,{className:"size-4 text-green-500"}):c.jsx(pn,{className:"size-4"})})]}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[c.jsx("span",{className:"font-medium",children:"Anthropic:"})," ",c.jsx("span",{className:"truncate",children:e.anthropicBaseUrl})]}),t&&c.jsx(Ur,{result:t.anthropic.nonStreaming})]}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[c.jsx("span",{className:"font-medium",children:"OpenAI:"})," ",c.jsx("span",{className:"truncate",children:e.openaiBaseUrl})]}),t&&c.jsx(Ur,{result:t.openai.nonStreaming})]}),t?.testedAt!==void 0&&c.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[c.jsx(wo,{className:"size-3"}),c.jsxs("span",{children:["Tested ",x5(t.testedAt)]})]}),t?.models!==void 0&&Object.keys(t.models).length>0&&c.jsxs("div",{className:"border-t pt-2",children:[c.jsxs("button",{type:"button",onClick:y,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[c.jsx("span",{className:"font-mono",children:p?"▾":"▸"}),"Model Test Results (",Object.keys(t.models).length,")"]}),p&&c.jsx("div",{className:"mt-2 overflow-x-auto",children:c.jsxs("table",{className:"w-full text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-border",children:[c.jsx("th",{className:"text-left py-1 px-2 font-medium text-muted-foreground",children:"Model"}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&c.jsx("th",{className:"text-left py-1 px-2 font-medium text-muted-foreground",children:"Anthropic"}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&c.jsx("th",{className:"text-left py-1 px-2 font-medium text-muted-foreground",children:"OpenAI"})]})}),c.jsx("tbody",{children:Object.entries(t.models).map(([_,S])=>c.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[c.jsx("td",{className:"py-1 px-2 font-medium",children:_}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&c.jsx("td",{className:"py-1 px-2",children:c.jsx(Ur,{result:S.anthropic.nonStreaming})}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&c.jsx("td",{className:"py-1 px-2",children:c.jsx(Ur,{result:S.openai.nonStreaming})})]},_))})]})})]}),c.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[a!==void 0&&c.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>a(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[c.jsx(Pu,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),c.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>i(e),className:"text-xs h-7 gap-1",children:[c.jsx(Ss,{className:"size-3"}),"Edit"]}),c.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",children:[c.jsx(pv,{className:"size-3"}),"Delete"]})]})]})}const b5={deepseek:{format:"openai",baseUrl:"https://api.deepseek.com"},minimax:{format:"anthropic",baseUrl:"https://api.minimaxi.com/anthropic",apiDocsUrl:"https://platform.minimaxi.com/docs/api-reference/api-overview"},alibaba:{format:"openai",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode"}},Cc=["MiniMax M3","MiniMax M2.7","MiniMax M2.7-highspeed","MiniMax M2.5","MiniMax M2.5-highspeed","MiniMax M2.1","MiniMax M2.1-highspeed","MiniMax M2"],Ec=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function v5({provider:e,onSubmit:t,onCancel:n}){const[r,o]=b.useState(e?.name??""),[i,s]=b.useState(e?.apiKey??""),[a,l]=b.useState(!1),[u,d]=b.useState(!1),h=e?.models,[p,f]=b.useState(h!==void 0&&h.length>0?h:[""]),[x,m]=b.useState("anthropic"),[y,g]=b.useState(e?.anthropicBaseUrl??""),[w,_]=b.useState(e?.openaiBaseUrl??""),[S,E]=b.useState(e?.apiDocsUrl??""),[C,A]=b.useState(e?.source),[I,P]=b.useState({}),[M,B]=b.useState(!1),[N,D]=b.useState(null),k=b.useRef([]);b.useEffect(()=>{if(N===null)return;const K=N;function ue(Q){if(!(Q.target instanceof Node))return;const ce=k.current[K];ce!=null&&!ce.contains(Q.target)&&D(null)}return document.addEventListener("mousedown",ue),()=>document.removeEventListener("mousedown",ue)},[N]);const[O,Y]=b.useState(!1),[Z,H]=b.useState(!1),G=r.toLowerCase().includes("minimax"),j=r.toLowerCase().includes("alibaba");function L(){navigator.clipboard.writeText(i).catch(()=>{}),d(!0),setTimeout(()=>d(!1),2e3)}b.useEffect(()=>{e&&(o(e.name),s(e.apiKey),f((e.models?.length??0)>0?e.models:[""]),g(e.anthropicBaseUrl??""),_(e.openaiBaseUrl??""),E(e.apiDocsUrl??""),A(e.source),Y(!1),H(!1))},[e]),b.useEffect(()=>{const K=r.toLowerCase();for(const[ue,Q]of Object.entries(b5))if(K.includes(ue)){Q.format==="anthropic"&&!O?g(Q.baseUrl):Q.format==="openai"&&!Z&&_(Q.baseUrl),Q.apiDocsUrl!==void 0&&!S&&E(Q.apiDocsUrl),ue==="minimax"&&p.length===1&&p[0]===""&&f([Cc[0]??""]),ue==="alibaba"&&p.length===1&&p[0]===""&&f([Ec[0]??""]);break}},[r]);function F(){const K={};return r.trim()||(K.name="Name is required"),i.trim()||(K.apiKey="API key is required"),(p.length===0||p.every(ue=>!ue.trim()))&&(K.models="At least one model is required"),y.trim()&&!T(y.trim())&&(K.anthropicBaseUrl="Invalid URL format"),w.trim()&&!T(w.trim())&&(K.openaiBaseUrl="Invalid URL format"),!y.trim()&&!w.trim()&&(K.format="At least one format URL (Anthropic or OpenAI) is required"),P(K),Object.keys(K).length===0}function T(K){try{return new URL(K),!0}catch{return!1}}function ee(K){if(K.preventDefault(),!!F()){B(!0);try{t({name:r.trim(),apiKey:i.trim(),models:p.map(ue=>ue.trim()).filter(ue=>ue!==""),anthropicBaseUrl:y.trim()||void 0,openaiBaseUrl:w.trim()||void 0,apiDocsUrl:S.trim()||void 0,source:C})}finally{B(!1)}}}return c.jsxs("form",{onSubmit:ee,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{htmlFor:"provider-name",className:"text-sm font-medium",children:["Name ",c.jsx("span",{className:"text-destructive",children:"*"})]}),c.jsx("input",{id:"provider-name",type:"text",value:r,onChange:K=>o(K.target.value),placeholder:"Provider 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"}),I.name!==void 0&&c.jsx("p",{className:"text-xs text-destructive",children:I.name})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"provider-source",className:"text-sm font-medium",children:"Token Source"}),c.jsxs("select",{id:"provider-source",value:C??"",onChange:K=>A(K.target.value==="company"||K.target.value==="personal"?K.target.value:void 0),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.jsx("option",{value:"",children:"—"}),c.jsx("option",{value:"personal",children:"个人 (Personal)"}),c.jsx("option",{value:"company",children:"公司 (Company)"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Label whether this API key is company-provided or personal."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{htmlFor:"provider-apikey",className:"text-sm font-medium",children:["API Key ",c.jsx("span",{className:"text-destructive",children:"*"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{id:"provider-apikey",type:"text",value:a||i.length===0?i:fp(i),onChange:K=>s(K.target.value),onFocus:()=>{!a&&i.length>0&&l(!0)},placeholder:"sk-ant-...",readOnly:!a&&i.length>0,className:"flex-1 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"}),c.jsx("button",{type:"button",onClick:()=>l(K=>!K),className:"text-muted-foreground hover:text-foreground transition-colors p-1 shrink-0","aria-label":a?"Hide API key":"Show API key",children:a?c.jsx(ws,{className:"size-4"}):c.jsx(ks,{className:"size-4"})}),c.jsx("button",{type:"button",onClick:L,className:"text-muted-foreground hover:text-foreground transition-colors p-1 shrink-0","aria-label":"Copy API key",children:u?c.jsx(Vt,{className:"size-4 text-green-500"}):c.jsx(pn,{className:"size-4"})})]}),I.apiKey!==void 0&&c.jsx("p",{className:"text-xs text-destructive",children:I.apiKey})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:"text-sm font-medium",children:["Models ",c.jsx("span",{className:"text-destructive",children:"*"})]}),p.map((K,ue)=>c.jsxs("div",{ref:Q=>{k.current[ue]=Q},className:"flex items-center gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{type:"text",value:K,onChange:Q=>{f(ce=>{const fe=[...ce];return fe[ue]=Q.target.value,fe})},placeholder:G||j?"Type or select a model...":"Model name",className:"w-full rounded-md border border-input bg-background px-4 py-3 pr-8 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"}),(G||j)&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>D(N===ue?null:ue),className:"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1 z-10","aria-label":"Show model suggestions",children:c.jsx(pt,{className:"size-4"})}),N===ue&&c.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-popover border border-border rounded-md shadow-md max-h-48 overflow-y-auto",children:(G?Cc:Ec).map(Q=>c.jsx("button",{type:"button",onClick:()=>{f(ce=>{const fe=[...ce];return fe[ue]=Q,fe}),D(null)},className:"w-full text-left px-3 py-2 text-sm hover:bg-muted transition-colors",children:Q},Q))})]})]}),p.length>1&&c.jsx("button",{type:"button",onClick:()=>f(Q=>Q.filter((ce,fe)=>fe!==ue)),className:"text-muted-foreground hover:text-destructive transition-colors p-1 shrink-0","aria-label":"Remove model",children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M3 6h18"}),c.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),c.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})})]},ue)),c.jsx("button",{type:"button",onClick:()=>f(K=>[...K,""]),className:"text-xs text-primary hover:underline flex items-center gap-1",children:"+ Add Model"}),I.models!==void 0&&c.jsx("p",{className:"text-xs text-destructive",children:I.models})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex gap-1 border-b border-border",children:[c.jsx("button",{type:"button",onClick:()=>m("anthropic"),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${x==="anthropic"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"Anthropic Format"}),c.jsx("button",{type:"button",onClick:()=>m("openai"),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${x==="openai"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"OpenAI Format"})]}),I.format!==void 0&&c.jsx("p",{className:"text-xs text-destructive",children:I.format})]}),x==="anthropic"&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"provider-anthropic-base-url",className:"text-sm font-medium",children:"Anthropic Base URL"}),c.jsx("input",{id:"provider-anthropic-base-url",type:"text",value:y,onChange:K=>{Y(!0),g(K.target.value)},placeholder:"https://api.anthropic.com",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"}),I.anthropicBaseUrl!==void 0&&c.jsx("p",{className:"text-xs text-destructive",children:I.anthropicBaseUrl}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Anthropic-compatible endpoint URL. Leave empty if this provider does not support Anthropic format."})]}),x==="openai"&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"provider-openai-base-url",className:"text-sm font-medium",children:"OpenAI Base URL"}),c.jsx("input",{id:"provider-openai-base-url",type:"text",value:w,onChange:K=>{H(!0),_(K.target.value)},placeholder:"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"}),I.openaiBaseUrl!==void 0&&c.jsx("p",{className:"text-xs text-destructive",children:I.openaiBaseUrl}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"OpenAI-compatible endpoint URL. Leave empty if this provider does not support OpenAI format."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"provider-api-docs-url",className:"text-sm font-medium",children:"API Docs URL"}),c.jsx("input",{id:"provider-api-docs-url",type:"text",value:S,onChange:K=>E(K.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"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional API documentation URL. If not set, uses known provider docs."})]}),c.jsxs("div",{className:"sticky bottom-0 bg-card border-t flex gap-2 justify-end pt-2 pb-2",children:[c.jsx(ht,{type:"button",variant:"outline",onClick:n,disabled:M,children:"Cancel"}),c.jsx(ht,{type:"submit",disabled:M,children:M?"Saving...":e?"Update Provider":"Add Provider"})]})]})}const ss=se({id:J(),name:J(),apiKey:J(),model:J().optional(),models:Oe(J()).min(1),format:wt(["anthropic","openai"]).optional(),baseUrl:J().optional(),anthropicBaseUrl:J().optional(),openaiBaseUrl:J().optional(),authHeader:wt(["bearer","x-api-key"]).optional().default("bearer"),apiDocsUrl:J().optional(),source:wt(["company","personal"]).optional(),createdAt:J(),updatedAt:J()}),w5=wt(["timeout","network_unreachable","connection_refused","auth_failed","rate_limited","server_error","invalid_response","unknown"]),k5=se({message:J(),type:w5,details:J().optional(),hint:J().optional()}),_5=se({type:wt(["text","thinking"]),text:J().optional(),thinking:J().optional()}),S5=se({success:tt(),error:k5.optional(),model:J().optional(),inputTokens:ve().optional(),outputTokens:ve().optional(),cacheCreationInputTokens:ve().optional(),cacheReadInputTokens:ve().optional(),latencyMs:ve().optional(),content:Oe(_5).optional(),rawResponse:J().optional(),streaming:tt().optional(),streamingChunks:se({chunks:Oe(wu),truncated:tt().default(!1)}).optional(),requestHeaders:$t(J(),J()).optional()}),Nc=Zt([S5,se({notConfigured:Ce(!0)}),se({testing:Ce(!0)})]),mo=se({nonStreaming:Nc,streaming:Nc}),C5=se({anthropic:mo,openai:mo}),E5=se({anthropic:mo,openai:mo,models:$t(J(),C5).optional(),testedAt:J().optional()});function N5(){return{anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}}}function jc(e,t){const n=()=>({nonStreaming:{success:!1,error:{message:e,type:t}},streaming:{notConfigured:!0}});return{anthropic:n(),openai:n()}}const j5=se({providerConfig:J()}),T5=se({success:tt().optional(),imported:ve().optional(),message:J().optional(),errors:Oe(J()).optional()}),A5=30,Si="Network error: could not reach the server. Is the proxy running?";function Tc(e){return{name:e.name,apiKey:e.apiKey,models:e.models,anthropicBaseUrl:(e.anthropicBaseUrl?.length??0)>0?e.anthropicBaseUrl:void 0,openaiBaseUrl:(e.openaiBaseUrl?.length??0)>0?e.openaiBaseUrl:void 0,apiDocsUrl:(e.apiDocsUrl?.length??0)>0?e.apiDocsUrl:void 0,source:e.source}}function z5({externalProviders:e,isLoading:t=!1,externalTestResults:n,externalTestingProviders:r,externalTestingTimeLeft:o,onProvidersMutate:i,onTestResultsChange:s,onTestingProvidersChange:a,onTestingTimeLeftChange:l}){const[u,d]=b.useState(!1),[h,p]=b.useState(),[f,x]=b.useState(null),[m,y]=b.useState({}),[g,w]=b.useState(new Set),[_,S]=b.useState({}),[E,C]=b.useState(null),[A,I]=b.useState(!1),[P,M]=b.useState(null),[B,N]=b.useState("all"),D=b.useRef(null),k=b.useRef(null),O=e??[],Y=b.useMemo(()=>{const le=B==="all"?O:O.filter(v=>v.source===B);return B==="all"?[...le].sort((v,q)=>{const V={personal:0,company:1};return(V[v.source??""]??2)-(V[q.source??""]??2)}):le},[O,B]),Z=n??m,H=r??g,G=o??_,j=l?(le,v)=>l(le,v):(le,v)=>{S(v===void 0?q=>{const V={...q};return delete V[le],V}:q=>({...q,[le]:v}))};b.useEffect(()=>{(async()=>{try{const le=await fetch("/api/config/paths");if(le.ok){const v=await Sn(le,j5);C(v.providerConfig)}}catch{}})()},[]);const L=b.useCallback(le=>{k.current!==null&&clearTimeout(k.current),M(le),D.current?.scrollTo({top:D.current.scrollHeight,behavior:"smooth"}),k.current=setTimeout(()=>{M(null),k.current=null},2e3)},[]);b.useEffect(()=>()=>{k.current!==null&&clearTimeout(k.current)},[]);const F=b.useCallback(()=>{i?.().catch(()=>{})},[i]),T=b.useCallback((le,v)=>{s?s(le,v):y(q=>({...q,[le]:v}))},[s]),ee=b.useCallback((le,v)=>{if(a){a(le,v);return}w(q=>{const V=new Set(q);return v?V.add(le):V.delete(le),V})},[a]),K=b.useCallback(async le=>{T(le,N5()),ee(le,!0);const v=new AbortController;let q=A5;j(le,q);const V=setInterval(()=>{q--,j(le,q),q<=0&&(clearInterval(V),v.abort())},1e3);try{const R=await fetch(`/api/providers/${le}/test`,{method:"POST",signal:v.signal});if(R.ok){const z=await Sn(R,E5);T(le,z)}else T(le,jc(`HTTP ${R.status}: ${R.statusText}`,"server_error"))}catch(R){R instanceof Error&&R.name==="AbortError"&&T(le,jc("Request timed out","timeout"))}finally{clearInterval(V),j(le,void 0),ee(le,!1)}},[j,T,ee]);function ue(le){(async()=>{try{const v=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Tc(le))});if(!v.ok){x(await Zr(v,"Failed to add provider"));return}const q=await Sn(v,ss);d(!1),L(q.id),F(),await K(q.id)}catch{x(Si)}})()}function Q(le){h&&(async()=>{try{const v=await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Tc(le))});if(!v.ok){x(await Zr(v,"Failed to update provider"));return}const q=await Sn(v,ss);p(void 0),L(q.id),F(),((le.apiKey??"")!==(h.apiKey??"")||JSON.stringify(le.models)!==JSON.stringify(h.models)||(le.anthropicBaseUrl??"")!==(h.anthropicBaseUrl??"")||(le.openaiBaseUrl??"")!==(h.openaiBaseUrl??""))&&await K(q.id)}catch{x(Si)}})()}function ce(le){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{let v;try{v=await fetch(`/api/providers/${le}`,{method:"DELETE"})}catch{x(Si);return}if(!v.ok){x(await Zr(v,"Failed to delete provider"));return}F()})()}const fe=b.useRef(null);function xe(le){const v="/api/providers/export";(async()=>{try{const q=await fetch(v);if(!q.ok){x("Failed to export providers");return}const V=await q.blob(),R=URL.createObjectURL(V),z=document.createElement("a");z.href=R,z.download=q.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(z),z.click(),document.body.removeChild(z),URL.revokeObjectURL(R)}catch{x("Failed to export providers")}})()}function be(){fe.current?.click()}function je(le){const v=le.target.files?.[0];v&&(async()=>{try{const q=await v.text(),V=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)}),R=await Sn(V,T5);V.ok&&R.imported!==void 0&&R.imported>0?(F(),x(null)):R.errors&&R.errors.length>0?x(R.errors.join("; ")):x(R.message??"Import failed")}catch{x("Failed to import providers")}le.target.value=""})()}return t?c.jsx("div",{className:"flex items-center justify-center py-8",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading providers..."})}):u||h?c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"flex items-center justify-between sticky top-0 bg-background z-10 pb-2",children:c.jsx("h3",{className:"text-lg font-medium",children:h?"Edit Provider":"Add New Provider"})}),c.jsx(v5,{provider:h,onSubmit:h?Q:ue,onCancel:()=>{d(!1),p(void 0)}})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-background pb-2",children:[c.jsx("h3",{className:"text-lg font-medium",children:"Providers"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>xe(),className:"gap-1 hover:bg-muted",children:[c.jsx(Tu,{className:"size-3"}),"Export"]}),c.jsxs(ht,{variant:"outline",size:"sm",onClick:be,className:"gap-1 hover:bg-muted",children:[c.jsx(yv,{className:"size-3"}),"Import"]}),c.jsx("input",{type:"file",ref:fe,accept:".json",onChange:je,style:{display:"none"}}),c.jsxs(ht,{onClick:()=>d(!0),size:"sm",className:"gap-1",children:[c.jsx(eo,{className:"size-4"}),"Add Provider"]})]})]}),E!==null&&c.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/30 rounded-md px-3 py-2",children:[c.jsx("span",{className:"shrink-0",children:"Config:"}),c.jsx("span",{className:"font-mono truncate",title:E,children:E}),c.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(E).then(()=>{I(!0),setTimeout(()=>I(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:A?c.jsx(Vt,{className:"size-3 text-green-500"}):c.jsx(pn,{className:"size-3"})})]}),f!==null&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive bg-destructive/10 rounded-md px-3 py-2",children:[c.jsx(Ii,{className:"size-4 shrink-0"}),f]}),O.length===0?c.jsxs("div",{className:"text-center py-12 space-y-3",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured yet."}),c.jsxs(ht,{onClick:()=>d(!0),variant:"outline",size:"sm",children:[c.jsx(eo,{className:"size-4"}),"Add Your First Provider"]})]}):c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"flex gap-1 border-b border-border",children:["all","personal","company"].map(le=>c.jsx("button",{type:"button",onClick:()=>N(le),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${B===le?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:le==="all"?"All":le==="personal"?"Personal":"Company"},le))}),c.jsx("div",{ref:D,className:"space-y-3",children:Y.map(le=>c.jsx(y5,{provider:le,testResults:Z[le.id],isTesting:H.has(le.id),testingTimeLeft:G[le.id],isHighlighted:le.id===P,onEdit:v=>p(v),onDelete:ce,onTest:v=>{K(v)}},le.id))})]})]})}async function I5(e){return vs(e,ss.array(),void 0,t=>`Failed to fetch ${e}: ${t.status}`)}function R5(){const e=Oc("/api/providers",I5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function P5(){const[e,t]=b.useState(!1),[n,r]=b.useState("providers"),{providers:o,isLoading:i,mutate:s}=R5(),[a,l]=b.useState({}),[u,d]=b.useState(new Set),[h,p]=b.useState({}),f=b.useCallback((y,g)=>{l(w=>({...w,[y]:g}))},[]),x=b.useCallback((y,g)=>{d(w=>{const _=new Set(w);return g?_.add(y):_.delete(y),_})},[]),m=b.useCallback((y,g)=>{p(w=>{if(g===void 0){const _={...w};return delete _[y],_}return{...w,[y]:g}})},[]);return c.jsxs(ip,{open:e,onOpenChange:t,children:[c.jsx(M3,{asChild:!0,children:c.jsxs(ht,{variant:"ghost",size:"icon",className:"size-8",children:[c.jsx(dv,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Settings"})]})}),c.jsxs(sp,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[c.jsx(ap,{children:c.jsx(lp,{children:"Settings"})}),c.jsxs(Nn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[c.jsxs(jn,{children:[c.jsx(Ge,{value:"providers",children:"Providers"}),c.jsx(Ge,{value:"proxy",children:"Proxy"})]}),c.jsxs("div",{className:"mt-4 overflow-y-auto flex-1 pr-3",children:[c.jsx(Je,{value:"providers",children:c.jsx(z5,{externalProviders:o,isLoading:i,externalTestResults:a,externalTestingProviders:u,externalTestingTimeLeft:h,onProvidersMutate:()=>s(),onTestResultsChange:f,onTestingProvidersChange:x,onTestingTimeLeftChange:m})}),c.jsx(Je,{value:"proxy",children:c.jsx(O5,{})})]})]})]})]})}function O5(){const{strip:e,isLoading:t,setStrip:n}=_u(),[r,o]=b.useState(null),[i,s]=b.useState(!1),a=b.useCallback(async l=>{o(null),s(!0);try{await n(l)}catch(u){o(u instanceof Error?u.message:String(u))}finally{s(!1)}},[n]);return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-sm font-semibold",children:"Claude Code billing header"}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["When enabled, the proxy strips the synthetic ",c.jsx("code",{children:"x-anthropic-billing-header"})," text block that Claude Code prepends to the system prompt before forwarding to upstream. Improves prefix-cache hit rates against third-party upstreams. The default at startup is controlled by the ",c.jsx("code",{children:"LLM_INSPECTOR_STRIP_CLAUDE_CODE_BILLING_HEADER"})," environment variable; your choice is persisted to ",c.jsx("code",{children:"config.json"})," and overrides the env var for subsequent requests."]})]}),c.jsxs("label",{className:"flex items-center gap-3",children:[c.jsx("input",{type:"checkbox",role:"switch",checked:e,disabled:t||i,onChange:l=>{a(l.currentTarget.checked)},className:"size-4 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"}),c.jsx("span",{className:"text-sm",children:t?"Loading…":e?"Stripping enabled":"Stripping disabled"})]}),r!==null&&c.jsxs("p",{className:"text-xs text-destructive",children:["Failed to save: ",r]})]})}function D5(e){const t=new Map;for(const n of e){const r=n.logs;for(let o=1;o<r.length;o++){const i=r[o-1],s=r[o];i===void 0||s===void 0||t.set(s.id,{creation:Ac(i.cacheCreationInputTokens,s.cacheCreationInputTokens),read:Ac(i.cacheReadInputTokens,s.cacheReadInputTokens)})}}return t}function Ac(e,t){return t===null||e===null?null:t>e?{direction:"up",delta:t-e}:t<e?{direction:"down",delta:e-t}:null}const M5="";function sr(e){if(e.length===0)return M5;let t="";for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(typeof r=="number"?t+=`[${r}]`:n===0?t+=r:t+=`.${r}`)}return t}function L5(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zc(e){if(typeof e=="string")try{return go(JSON.parse(e))}catch{return{kind:"primitive",value:e}}return go(e)}function go(e){if(e===null)return{kind:"primitive",value:null};if(typeof e=="string")return{kind:"primitive",value:e};if(typeof e=="number")return{kind:"primitive",value:e};if(typeof e=="boolean")return{kind:"primitive",value:e};if(Array.isArray(e))return{kind:"array",value:e.map(t=>go(t))};if(L5(e)){const t={};for(const n of Object.keys(e).sort())t[n]=go(e[n]);return{kind:"object",value:t}}return{kind:"primitive",value:null}}function F5(e,t){const n=[];return as([],e,t,n),n}function as(e,t,n,r){const o=sr(e);if(ls(t,n)){r.push({kind:"equal",path:o,value:t});return}if(t.kind!==n.kind){r.push({kind:"changed",path:o,left:t,right:n});return}if(t.kind==="primitive"&&n.kind==="primitive"){r.push({kind:"changed",path:o,left:t,right:n});return}if(t.kind==="object"&&n.kind==="object"){const i=Object.keys(t.value),s=Object.keys(n.value),a=new Set(s);for(const l of i){const u=t.value[l];if(u!==void 0)if(!a.has(l))r.push({kind:"removed",path:sr([...e,l]),value:u});else{const d=n.value[l];if(d===void 0)continue;as([...e,l],u,d,r)}}for(const l of s){if(i.includes(l))continue;const u=n.value[l];u!==void 0&&r.push({kind:"added",path:sr([...e,l]),value:u})}return}if(t.kind==="array"&&n.kind==="array"){const i=Math.min(t.value.length,n.value.length);for(let s=0;s<i;s++){const a=t.value[s],l=n.value[s];a===void 0||l===void 0||as([...e,s],a,l,r)}for(let s=i;s<n.value.length;s++){const a=n.value[s];a!==void 0&&r.push({kind:"added",path:sr([...e,s]),value:a})}for(let s=i;s<t.value.length;s++){const a=t.value[s];a!==void 0&&r.push({kind:"removed",path:sr([...e,s]),value:a})}}}function ls(e,t){if(e.kind!==t.kind)return!1;if(e.kind==="primitive"&&t.kind==="primitive")return e.value===t.value;if(e.kind==="array"&&t.kind==="array"){if(e.value.length!==t.value.length)return!1;for(let n=0;n<e.value.length;n++){const r=e.value[n],o=t.value[n];if(r===void 0||o===void 0||!ls(r,o))return!1}return!0}if(e.kind==="object"&&t.kind==="object"){const n=Object.keys(e.value),r=Object.keys(t.value);if(n.length!==r.length)return!1;for(const o of n){const i=e.value[o],s=t.value[o];if(i===void 0||s===void 0||!ls(i,s))return!1}return!0}return!1}function vt(e,t=80){let n;switch(e.kind){case"primitive":n=e.value===null?"null":JSON.stringify(e.value);break;case"array":n=`[… ${e.value.length} items]`;break;case"object":n=`{… ${Object.keys(e.value).length} keys}`;break}return n.length>t&&(n=`${n.slice(0,t-1)}…`),n}function Gr(e,t=2){return JSON.stringify(cs(e),null,t)}function cs(e){switch(e.kind){case"primitive":return e.value;case"array":return e.value.map(cs);case"object":{const t={};for(const[n,r]of Object.entries(e.value))t[n]=cs(r);return t}}}function Ic(e){if(e==="")return"";for(let t=e.length-1;t>=0;t--){const n=e[t];if(n==="."||n==="[")return e.substring(0,t)}return""}function Rc(e){return e.kind==="equal"&&(e.value.kind==="object"||e.value.kind==="array")}function $5(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(r!==void 0&&Rc(r)){const o=Ic(r.path);let i=n+1;for(;i<e.length;){const s=e[i];if(s===void 0||!Rc(s)||Ic(s.path)!==o)break;i++}if(i-n>1){const s=[];for(let a=n;a<i;a++){const l=e[a];l!==void 0&&l.kind==="equal"&&s.push(l)}t.push({kind:"equal-run",ops:s}),n=i;continue}}r!==void 0&&t.push({kind:"single",op:r}),n++}return t}const hp={added:{icon:eo,accent:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-500/5 hover:bg-emerald-500/10",border:"border-l-emerald-500",label:"ADDED"},removed:{icon:_s,accent:"text-rose-600 dark:text-rose-400",bg:"bg-rose-500/5 hover:bg-rose-500/10",border:"border-l-rose-500",label:"REMOVED"},changed:{icon:Ss,accent:"text-amber-600 dark:text-amber-400",bg:"bg-amber-500/5 hover:bg-amber-500/10",border:"border-l-amber-500",label:"CHANGED"},equal:{icon:Pb,accent:"text-muted-foreground/70",bg:"bg-muted/20 hover:bg-muted/30",border:"border-l-muted-foreground/20",label:"EQUAL"}};function B5({ops:e,expanded:t,onToggle:n}){const r=e[0],o=e[e.length-1];if(r===void 0||o===void 0)return c.jsx("div",{className:"text-muted-foreground/40 text-xs",children:"—"});const i=r.path,s=o.path,a=e.length===1?i:`${i} … ${s}`,l=r.value.kind==="array"?`${e.length} equal arrays`:r.value.kind==="object"?`${e.length} equal objects`:"equal",u=hp.equal;return c.jsxs("div",{className:ge("border-l-4 rounded-sm",u.border,u.bg),children:[c.jsxs("button",{type:"button",onClick:n,className:"w-full text-left flex items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground cursor-pointer",children:[c.jsx(kt,{className:ge("size-3 transition-transform shrink-0",t&&"rotate-90")}),c.jsx(u.icon,{className:ge("size-3 shrink-0",u.accent)}),c.jsx("span",{className:"font-mono truncate flex-1",title:`${i} … ${s}`,children:a}),c.jsx("span",{className:ge("text-[10px] uppercase tracking-wider shrink-0",u.accent),children:u.label}),c.jsxs("span",{className:"text-muted-foreground/60 shrink-0",children:["(",l,")"]})]}),t&&c.jsx("div",{className:"ml-5 mt-1 mb-2 space-y-2 pr-2",children:e.map(d=>c.jsxs("div",{className:"border border-border/50 rounded p-2 bg-muted/20",children:[c.jsx("div",{className:"font-mono text-xs text-muted-foreground mb-1",children:d.path}),c.jsx(sn,{text:Gr(d.value),defaultExpandDepth:2})]},d.path))})]})}function U5({op:e,idx:t,copiedPath:n,onCopyPath:r,expanded:o,onToggle:i}){const s=hp[e.kind],a=s.icon,l=e.kind==="added"||e.kind==="removed"?e.value.kind==="object"||e.value.kind==="array":e.kind==="changed"?e.left.kind==="object"||e.left.kind==="array"||e.right.kind==="object"||e.right.kind==="array":!1,u=e.kind==="changed"?[{text:vt(e.left,400),tone:"text-rose-700 dark:text-rose-300 line-through"},{text:vt(e.right,400),tone:"text-emerald-700 dark:text-emerald-300"}]:e.kind==="removed"?[{text:vt(e.value,400),tone:"text-rose-700 dark:text-rose-300 line-through"}]:e.kind==="added"?[{text:vt(e.value,400),tone:"text-emerald-700 dark:text-emerald-300"}]:[{text:vt(e.value,400),tone:"text-muted-foreground"}],d=n===e.path&&e.path!=="";return c.jsxs("div",{"data-diff-idx":t,"data-diff-kind":e.kind,className:ge("border-l-4 rounded-sm px-3 py-2 my-0.5 transition-colors",s.border,s.bg),children:[c.jsxs("button",{type:"button",onClick:i,disabled:!l,className:ge("w-full flex items-center gap-2 text-xs text-left rounded-sm",l?"cursor-pointer":"cursor-default"),"aria-expanded":l?o:void 0,"aria-label":l?o?`Collapse ${e.path||"root"}`:`Expand ${e.path||"root"}`:void 0,children:[l?c.jsx(kt,{className:ge("size-3 shrink-0 transition-transform",s.accent,o&&"rotate-90")}):c.jsx("span",{className:"size-3 shrink-0","aria-hidden":"true"}),c.jsx(a,{className:ge("size-3.5 shrink-0",s.accent),strokeWidth:2.5}),c.jsx("span",{className:"font-mono truncate flex-1 min-w-0",title:e.path||"(root)",children:e.path===""?"(root)":e.path}),c.jsx("span",{className:ge("text-[9px] font-bold uppercase tracking-wider shrink-0 px-1.5 py-0.5 rounded",s.accent,e.kind==="equal"?"bg-muted/40":"bg-background/60"),children:s.label}),e.path!==""&&c.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),r(e.path)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),h.preventDefault(),r(e.path))},className:ge("shrink-0 p-1 rounded transition-colors cursor-pointer inline-flex items-center justify-center",d?"text-emerald-500":"text-muted-foreground/50 hover:text-foreground hover:bg-muted"),"aria-label":d?"Copied":"Copy path",title:d?"Copied!":"Copy path",children:d?c.jsx(Vt,{className:"size-3"}):c.jsx(pn,{className:"size-3"})})]}),u.map((h,p)=>c.jsx("div",{className:ge("font-mono text-xs mt-1 break-all pl-5",h.tone),children:h.text},p)),c.jsx("div",{className:"overflow-hidden transition-all duration-200",style:{maxHeight:o&&l?"2000px":"0"},"aria-hidden":!o,children:o&&l&&e.kind!=="equal"?c.jsx(Z5,{op:e}):null})]})}function Z5({op:e}){if(e.kind==="added"||e.kind==="removed")return c.jsx("div",{className:"pl-5 mt-2 border border-border/50 rounded p-2 bg-muted/20",children:c.jsx(sn,{text:Gr(e.value),defaultExpandDepth:2})});const t=e.left.kind==="object"||e.left.kind==="array",n=e.right.kind==="object"||e.right.kind==="array";return!t&&!n?c.jsx("div",{className:"pl-5 mt-2 text-xs text-muted-foreground/70 italic",children:"Primitive values are shown inline above."}):c.jsxs("div",{className:"pl-5 mt-2 grid grid-cols-1 md:grid-cols-2 gap-2",children:[c.jsxs("div",{className:"border border-rose-500/30 rounded p-2 bg-rose-500/5",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-rose-500 mb-1",children:"Old"}),c.jsx(sn,{text:Gr(e.left),defaultExpandDepth:2})]}),c.jsxs("div",{className:"border border-emerald-500/30 rounded p-2 bg-emerald-500/5",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-500 mb-1",children:"New"}),c.jsx(sn,{text:Gr(e.right),defaultExpandDepth:2})]})]})}function V5({counts:e,onJumpTo:t}){const n=e.added+e.removed+e.changed;return c.jsxs("div",{className:"px-4 py-2 border-b border-border bg-muted/20 flex items-center gap-2 text-xs flex-wrap",children:[c.jsxs("span",{className:"text-muted-foreground font-medium",children:[n," ",n===1?"change":"changes"]}),c.jsxs("button",{type:"button",onClick:()=>t("removed"),disabled:e.removed===0,className:ge("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border cursor-pointer transition-colors",e.removed>0?"border-rose-500/40 text-rose-600 dark:text-rose-400 bg-rose-500/10 hover:bg-rose-500/20":"border-border text-muted-foreground/40 cursor-not-allowed"),title:e.removed>0?"Jump to first removed":"No removals",children:[c.jsx(_s,{className:"size-3"}),e.removed," removed"]}),c.jsxs("button",{type:"button",onClick:()=>t("added"),disabled:e.added===0,className:ge("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border cursor-pointer transition-colors",e.added>0?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 hover:bg-emerald-500/20":"border-border text-muted-foreground/40 cursor-not-allowed"),title:e.added>0?"Jump to first added":"No additions",children:[c.jsx(eo,{className:"size-3"}),e.added," added"]}),c.jsxs("button",{type:"button",onClick:()=>t("changed"),disabled:e.changed===0,className:ge("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border cursor-pointer transition-colors",e.changed>0?"border-amber-500/40 text-amber-600 dark:text-amber-400 bg-amber-500/10 hover:bg-amber-500/20":"border-border text-muted-foreground/40 cursor-not-allowed"),title:e.changed>0?"Jump to first changed":"No changes",children:[c.jsx(Ss,{className:"size-3"}),e.changed," changed"]})]})}function W5({mode:e,onChange:t}){return c.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[c.jsxs("button",{type:"button",onClick:()=>t("unified"),"aria-pressed":e==="unified",className:ge("flex items-center gap-1 px-2 py-1 text-xs transition-colors cursor-pointer",e==="unified"?"bg-muted text-foreground":"hover:bg-muted/50 text-muted-foreground"),title:"Unified view (single column, emphasized diffs)",children:[c.jsx(Ou,{className:"size-3"}),"Unified"]}),c.jsxs("button",{type:"button",onClick:()=>t("split"),"aria-pressed":e==="split",className:ge("flex items-center gap-1 px-2 py-1 text-xs transition-colors border-l border-border cursor-pointer",e==="split"?"bg-muted text-foreground":"hover:bg-muted/50 text-muted-foreground"),title:"Split view (path | left | right)",children:[c.jsx(ju,{className:"size-3"}),"Split"]})]})}function Pc({log:e,side:t}){const n=Bn(e);return c.jsxs("div",{className:"flex-1 min-w-0 space-y-1 text-xs",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(et,{variant:"outline",className:ge("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",t==="left"?"border-rose-500/40 text-rose-400":"border-emerald-500/40 text-emerald-400"),children:t==="left"?"← Left":"Right →"}),c.jsxs("span",{className:"font-mono text-blue-400/80",children:["#",e.id]}),e.model!==null&&c.jsx("span",{className:"font-mono text-muted-foreground truncate",children:e.model})]}),c.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground font-mono",children:[e.cacheCreationInputTokens!==null&&e.cacheCreationInputTokens>0&&c.jsxs("span",{className:"text-emerald-400",children:["Cache +",qe(e.cacheCreationInputTokens)]}),e.cacheReadInputTokens!==null&&e.cacheReadInputTokens>0&&c.jsxs("span",{className:"text-purple-400",children:["Cache ~",qe(e.cacheReadInputTokens)]}),c.jsx("span",{className:"truncate",title:e.timestamp,children:e.timestamp})]}),c.jsxs("div",{className:"text-muted-foreground/70 font-mono truncate",title:n,children:["session: ",n]})]})}function H5({left:e,right:t,onClose:n}){const r=b.useMemo(()=>{const C=zc(Ai(e.rawRequestBody)??e.rawRequestBody),A=zc(Ai(t.rawRequestBody)??t.rawRequestBody);return F5(C,A)},[e.rawRequestBody,t.rawRequestBody]),o=b.useMemo(()=>$5(r),[r]),i=b.useMemo(()=>{let C=0,A=0,I=0;for(const P of o)if(P.kind==="single")switch(P.op.kind){case"added":C++;break;case"removed":A++;break;case"changed":I++;break}return{added:C,removed:A,changed:I}},[o]),[s,a]=b.useState(new Set),l=C=>{a(A=>{const I=new Set(A);return I.has(C)?I.delete(C):I.add(C),I})},[u,d]=b.useState(new Set),h=C=>{d(A=>{const I=new Set(A);return I.has(C)?I.delete(C):I.add(C),I})};b.useEffect(()=>{d(new Set)},[e.id,t.id]);const[p,f]=b.useState("unified"),x=b.useRef(null),[m,y]=b.useState(null),g=b.useRef(null),w=C=>{window.navigator.clipboard.writeText(C).then(()=>{y(C),g.current!==null&&clearTimeout(g.current),g.current=setTimeout(()=>y(null),1500)})};b.useEffect(()=>()=>{g.current!==null&&clearTimeout(g.current)},[]);const _=C=>{const A=o.findIndex(M=>M.kind==="single"&&M.op.kind===C);if(A===-1)return;const I=x.current;if(I===null)return;const P=I.querySelector(`[data-diff-idx="${A}"]`);P!==null&&P.scrollIntoView({behavior:"smooth",block:"center"})};b.useEffect(()=>{const C=I=>{I.key==="Escape"&&n()};document.addEventListener("keydown",C);const A=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",C),document.body.style.overflow=A}},[n]);const S=Bn(e)===Bn(t),E=r.length===1&&r[0]?.kind==="equal";return c.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",role:"dialog","aria-modal":"true","aria-label":"Compare two log requests",children:[c.jsx("button",{type:"button",onClick:n,"aria-label":"Close compare drawer",className:"absolute inset-0 bg-black/40 cursor-default",tabIndex:-1}),c.jsxs("div",{className:ge("relative bg-background border-l border-border shadow-xl","w-full md:w-[70vw] max-w-[1100px] flex flex-col h-full"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),children:[c.jsxs("div",{className:"flex items-start gap-4 px-4 py-3 border-b border-border",children:[c.jsxs("div",{className:"flex-1 flex gap-4 min-w-0",children:[c.jsx(Pc,{log:e,side:"left"}),c.jsx(Pc,{log:t,side:"right"})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(W5,{mode:p,onChange:f}),c.jsx("button",{type:"button",onClick:n,"aria-label":"Close",className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer",children:c.jsx(Cs,{className:"size-4"})})]})]}),!S&&c.jsx("div",{className:"px-4 py-1.5 text-xs text-amber-400 bg-amber-500/10 border-b border-border",children:"Heads up: the two selected logs are from different sessions."}),E?c.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex items-center justify-center text-muted-foreground text-sm",children:"The two Request payloads are identical."}):c.jsxs(c.Fragment,{children:[c.jsx(V5,{counts:i,onJumpTo:_}),c.jsx("div",{ref:x,className:"flex-1 min-h-0 overflow-y-auto",children:p==="unified"?c.jsx("div",{className:"px-3 py-2 space-y-0.5",children:o.map((C,A)=>{if(C.kind==="equal-run")return c.jsx(B5,{ops:C.ops,expanded:s.has(A),onToggle:()=>l(A)},`r${A}`);const I=C.op;return c.jsx(U5,{op:I,idx:A,copiedPath:m,onCopyPath:w,expanded:u.has(A),onToggle:()=>h(A)},`o${A}`)})}):c.jsx(q5,{grouped:o,left:e,right:t})})]})]})]})}function q5({grouped:e,left:t,right:n}){return c.jsxs("div",{className:"grid grid-cols-[200px_1fr_1fr] gap-x-2 gap-y-0.5 px-3 py-2 text-xs",children:[c.jsxs("div",{className:"grid grid-cols-[200px_1fr_1fr] gap-x-2 col-span-3 pb-2 mb-2 border-b border-border text-[10px] uppercase tracking-wider text-muted-foreground",children:[c.jsx("span",{children:"Path"}),c.jsxs("span",{children:["Left (Log #",t.id,")"]}),c.jsxs("span",{children:["Right (Log #",n.id,")"]})]}),e.map((r,o)=>{if(r.kind==="equal-run")return c.jsxs("div",{className:"col-span-3 px-2 py-1 text-xs text-muted-foreground/60",children:[r.ops.length," equal siblings collapsed — switch to Unified to expand"]},o);const i=r.op;return i.kind==="equal"?c.jsxs("div",{className:"col-span-3 grid grid-cols-[200px_1fr_1fr] gap-x-2 px-2 py-0.5 text-muted-foreground",children:[c.jsx("span",{className:"font-mono text-xs truncate",title:i.path,children:i.path}),c.jsx("span",{className:"font-mono text-xs break-all opacity-60",children:vt(i.value,200)}),c.jsx("span",{className:"font-mono text-xs break-all opacity-60",children:vt(i.value,200)})]},o):i.kind==="added"?c.jsxs("div",{className:"col-span-3 px-2 py-1 rounded text-xs border-l-2 border-l-emerald-400/70 bg-emerald-500/5",children:[c.jsx("div",{className:"font-mono text-xs text-muted-foreground mb-0.5",children:i.path}),c.jsxs("div",{className:"font-mono break-all text-emerald-300/90",children:["+ ",vt(i.value,400)]})]},o):i.kind==="removed"?c.jsxs("div",{className:"col-span-3 px-2 py-1 rounded text-xs border-l-2 border-l-rose-400/70 bg-rose-500/5",children:[c.jsx("div",{className:"font-mono text-xs text-muted-foreground mb-0.5",children:i.path}),c.jsxs("div",{className:"font-mono break-all text-rose-300/90 line-through",children:["− ",vt(i.value,400)]})]},o):c.jsxs("div",{className:"col-span-3 px-2 py-1 rounded text-xs border-l-2 border-l-amber-400/70 bg-amber-500/5",children:[c.jsx("div",{className:"font-mono text-xs text-muted-foreground mb-1",children:i.path}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsx("div",{className:"font-mono text-rose-300/90 break-all line-through",children:vt(i.left,400)}),c.jsx("div",{className:"font-mono text-emerald-300/90 break-all",children:vt(i.right,400)})]})]},o)})]})}function K5(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function G5(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 J5({command:e}){const[t,n]=b.useState(!1),r=b.useCallback(()=>{window.navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},[e]);return c.jsxs("div",{className:"inline-flex items-center gap-2 bg-muted rounded-md px-3 py-2",children:[c.jsx("pre",{className:"text-blue-500 font-mono text-sm m-0",children:e}),c.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?c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M20 6 9 17l-5-5"})}):c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),c.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 Y5({logs:e,sessions:t,models:n,selectedSession:r,selectedModel:o,onSessionChange:i,onModelChange:s,onClearAll:a,viewMode:l,onViewModeChange:u,strip:d}){const{totalIn:h,totalOut:p}=G5(e),[f,x]=b.useState(!0),[m,y]=b.useState(!1),[g,w]=b.useState([]),[_,S]=b.useState(!1),[E,C]=b.useState(null),A=b.useCallback(async()=>{y(!0);try{await Rv(e)}finally{y(!1)}},[e]),I=b.useRef(null),P=b.useCallback(j=>{w(L=>{if(L.includes(j))return L.filter(T=>T!==j);if(L.length<2)return[...L,j];const F=L[1];return F===void 0?L:[F,j]})},[]);b.useEffect(()=>{w([]),S(!1)},[r,o]);const M=b.useMemo(()=>new Set(g),[g]),B=b.useCallback(()=>{if(g.length!==2)return;const[j,L]=g;if(j===void 0||L===void 0)return;const F=e.find(ee=>ee.id===j),T=e.find(ee=>ee.id===L);F===void 0||T===void 0||(C([F,T]),S(!0))},[g,e]),N=b.useCallback(()=>{S(!1)},[]),D=b.useCallback(()=>{w([])},[]),k=b.useMemo(()=>{if(g.length!==2)return null;const[j,L]=g;if(j===void 0||L===void 0)return null;const F=e.find(ue=>ue.id===j),T=e.find(ue=>ue.id===L);if(F===void 0||T===void 0)return null;const ee=Bn(F)===Bn(T);let K="";if(F.timestamp!==null&&T.timestamp!==null){const ue=Date.parse(F.timestamp),Q=Date.parse(T.timestamp);if(!Number.isNaN(ue)&&!Number.isNaN(Q)){const ce=Math.abs(Q-ue);K=O(ce)}}return{logA:F,logB:T,sameSession:ee,elapsed:K}},[g,e]);function O(j){if(j<1e3)return`${j}ms`;const L=Math.floor(j/1e3);if(L<60)return`${L}s`;const F=Math.floor(L/60);return F<60?`${F}m`:`${Math.floor(F/60)}h${F%60}m`}const Y=b.useMemo(()=>_S(e),[e]),Z=b.useMemo(()=>D5(Y),[Y]),H=e.length>0&&f&&!(Y.length===1&&Y[0]?.logs.length===e.length),G=Cu({count:H?Y.length:e.length,getScrollElement:()=>I.current,estimateSize:()=>150,measureElement:typeof window<"u"?j=>j.getBoundingClientRect().height:void 0,overscan:5});return c.jsxs("div",{className:"max-w-[1200px] mx-auto flex flex-col h-screen",style:{maxHeight:"100vh"},children:[c.jsxs("div",{className:"flex items-center gap-4 mb-4 px-6 pt-6",children:[c.jsxs("h1",{className:"text-lg font-bold flex-1 flex items-center gap-2",children:[c.jsx(u5,{className:"size-10 text-amber-500 self-center"}),c.jsxs("span",{className:"flex items-baseline gap-2",children:["LLM Inspector",c.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["v",Ov.version]})]})]}),c.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[c.jsx("button",{type:"button",onClick:()=>u("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"}),c.jsx("button",{type:"button",onClick:()=>u("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"})]}),c.jsx(P5,{}),c.jsxs("span",{className:"text-muted-foreground text-xs font-mono",children:[e.length," request",e.length!==1?"s":"",h>0||p>0?` · ${h.toLocaleString()} in / ${p.toLocaleString()} out`:""]}),e.length>0&&c.jsx("button",{type:"button",onClick:()=>{A()},disabled:m,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:m?c.jsx("span",{children:"Exporting..."}):c.jsxs(c.Fragment,{children:[c.jsx(Tu,{className:"size-3"}),c.jsx("span",{children:"Export All"})]})}),c.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"})]}),c.jsxs("div",{className:"flex gap-3 px-6 mb-4",children:[c.jsxs(wc,{value:r,onValueChange:i,children:[c.jsx(_c,{className:"flex-1 max-w-[400px] text-xs",children:c.jsx(kc,{placeholder:"All sessions"})}),c.jsxs(Sc,{children:[c.jsx(Br,{value:"__all__",children:"All sessions"}),t.map(j=>c.jsx(Br,{value:j,children:K5(j)},j))]})]}),c.jsxs(wc,{value:o,onValueChange:s,children:[c.jsx(_c,{className:"text-xs",children:c.jsx(kc,{placeholder:"All models"})}),c.jsxs(Sc,{children:[c.jsx(Br,{value:"__all__",children:"All models"}),n.map(j=>c.jsx(Br,{value:j,children:j},j))]})]}),c.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[c.jsx("button",{type:"button",onClick:()=>x(!0),className:`px-2 py-1.5 cursor-pointer transition-colors ${f?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grouped view",children:c.jsx(qb,{className:"size-4"})}),c.jsx("button",{type:"button",onClick:()=>x(!1),className:`px-2 py-1.5 cursor-pointer transition-colors ${f?"text-muted-foreground hover:bg-muted/50":"bg-muted text-foreground"}`,title:"Flat view",children:c.jsx(Gb,{className:"size-4"})})]})]}),c.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.length===0?c.jsxs("div",{className:"text-center text-muted-foreground py-16 space-y-4",children:[c.jsx("p",{className:"text-sm",children:"No requests captured yet."}),c.jsx("p",{className:"text-xs",children:"Route AI coding tools through the proxy:"}),c.jsx(J5,{command:"LLM_BASE_URL=http://localhost:25947/proxy <your-tool>"})]}):c.jsx("div",{ref:I,className:"overflow-y-auto h-full",children:c.jsx("div",{style:{height:`${G.getTotalSize()}px`,width:"100%",position:"relative"},children:G.getVirtualItems().map(j=>{if(H){const L=Y[j.index];return L===void 0?null:c.jsx("div",{"data-index":j.index,ref:G.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${j.start}px)`},children:c.jsx(c5,{group:L,viewMode:l,strip:d,cacheTrends:Z,selectedSet:M,onToggleSelect:P})},L.id)}else{const L=e[j.index];return L===void 0?null:c.jsx("div",{"data-index":j.index,ref:G.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${j.start}px)`},children:c.jsx(dp,{log:L,viewMode:l,strip:d,cacheTrend:Z.get(L.id)??null,isSelected:M.has(L.id),onToggleSelect:P})},L.id)}})})})}),k!==null&&c.jsxs("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-40 flex items-center gap-3 bg-background border border-border rounded-lg shadow-lg px-4 py-2 text-xs",children:[c.jsx(Au,{className:"size-4 text-amber-400 shrink-0"}),c.jsxs("span",{className:"text-muted-foreground font-mono",children:["#",k.logA.id," ↔ #",k.logB.id," · ",k.sameSession?"same session":"different sessions",k.elapsed!==""&&` · ${k.elapsed} apart`]}),c.jsxs("button",{type:"button",onClick:D,className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer inline-flex items-center gap-1",children:[c.jsx(Cs,{className:"size-3"}),"Clear"]}),c.jsx("button",{type:"button",onClick:B,className:"bg-amber-400 text-amber-950 hover:bg-amber-300 transition-colors px-3 py-1 rounded font-medium cursor-pointer",children:"Compare 2 logs"})]}),_&&E!==null&&c.jsx(H5,{left:E[0],right:E[1],onClose:N})]})}se({logs:Oe(Ti),total:ve(),offset:ve(),limit:ve()});const X5=Zt([se({type:Ce("init"),logs:Oe(Ti)}),se({type:Ce("update"),log:Ti})]);function Q5(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function eT(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function tT(){const[e,t]=b.useState([]),[n,r]=b.useState([]),[o,i]=b.useState([]),[s,a]=b.useState("__all__"),[l,u]=b.useState("__all__"),[d,h]=b.useState("simple"),[p,f]=b.useState(null),x=b.useRef(null),m=b.useRef(null),y=b.useCallback(async()=>{try{const[S,E]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(S.ok&&E.ok){const C=await S.json(),A=await E.json(),I=Oe(J()).safeParse(C),P=Oe(J()).safeParse(A);I.success&&r(I.data),P.success&&i(P.data)}}catch{}},[]),g=b.useCallback(()=>{x.current&&x.current.close();const S=new URLSearchParams;s!=="__all__"&&S.set("sessionId",s),l!=="__all__"&&S.set("model",l);const E=new EventSource(`/api/logs/stream?${S}`);x.current=E,E.onmessage=C=>{try{const A=String(C.data),I=JSON.parse(A),P=X5.safeParse(I);if(!P.success){f("Failed to parse SSE data");return}const M=P.data;M.type==="init"?(t(M.logs),r(Q5(M.logs)),i(eT(M.logs)),f(null)):M.type==="update"&&(t(B=>{const N=s==="__all__"||M.log.sessionId===s,D=l==="__all__"||M.log.model===l;return!N||!D?B:B.findIndex(O=>O.id===M.log.id)>=0?B.map(O=>O.id===M.log.id?M.log:O):[...B,M.log]}),r(B=>{const N=M.log.sessionId;return N!=null&&N!==""?B.includes(N)?B:[...B,N]:B}),i(B=>{const N=M.log.model;return N!=null&&N!==""?B.includes(N)?B:[...B,N]:B}))}catch{f("Failed to parse SSE data")}},E.onerror=()=>{f("SSE connection lost, reconnecting..."),E.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(g,3e3)},y()},[s,l,y]);b.useEffect(()=>(g(),()=>{x.current&&(x.current.close(),x.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[g]);const w=b.useCallback(()=>{(async()=>{try{if(!(await fetch("/api/logs",{method:"DELETE"})).ok){f("Failed to clear logs");return}t([]),r([]),i([]),f(null)}catch(S){f(S instanceof Error?S.message:"Unknown error clearing logs")}})()},[]),{strip:_}=_u();return c.jsxs(c.Fragment,{children:[p!==null&&c.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}),c.jsx(Y5,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:u,onClearAll:w,viewMode:d,onViewModeChange:h,strip:_})]})}const oT=tT;export{oT as component};